mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2024-11-23 21:07:17 +00:00
fixed a crash with too large band
This commit is contained in:
parent
e33f26d51f
commit
8af2a43f5e
12
history.cpp
12
history.cpp
@ -457,6 +457,11 @@ EX namespace history {
|
||||
dynamicval<bool> di(inHighQual, true);
|
||||
|
||||
renderbuffer glbuf(bandfull, bandfull, vid.usingGL);
|
||||
glbuf.make_surface(); if(!glbuf.srf) {
|
||||
addMessage(XLAT("Could not create an image of that size."));
|
||||
return;
|
||||
}
|
||||
|
||||
vid.xres = vid.yres = bandfull;
|
||||
glbuf.enable(); current_display->radius = bandhalf;
|
||||
calcparam();
|
||||
@ -480,7 +485,8 @@ EX namespace history {
|
||||
};
|
||||
|
||||
if(!band) {
|
||||
addMessage("Could not create an image of that size.");
|
||||
addMessage(XLAT("Could not create an image of that size."));
|
||||
return;
|
||||
}
|
||||
else {
|
||||
|
||||
@ -528,6 +534,10 @@ EX namespace history {
|
||||
len -= bandsegment; xpos -= bandsegment;
|
||||
seglen = min(int(len), bandsegment);
|
||||
band = SDL_CreateRGBSurface(SDL_SWSURFACE, seglen, bandfull,32,0,0,0,0);
|
||||
if(!band) {
|
||||
addMessage(XLAT("Could not create an image of that size."));
|
||||
return;
|
||||
}
|
||||
goto drawsegment;
|
||||
}
|
||||
xpos += bwidth;
|
||||
|
Loading…
Reference in New Issue
Block a user