mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2024-11-27 14:37:16 +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);
|
dynamicval<bool> di(inHighQual, true);
|
||||||
|
|
||||||
renderbuffer glbuf(bandfull, bandfull, vid.usingGL);
|
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;
|
vid.xres = vid.yres = bandfull;
|
||||||
glbuf.enable(); current_display->radius = bandhalf;
|
glbuf.enable(); current_display->radius = bandhalf;
|
||||||
calcparam();
|
calcparam();
|
||||||
@ -480,7 +485,8 @@ EX namespace history {
|
|||||||
};
|
};
|
||||||
|
|
||||||
if(!band) {
|
if(!band) {
|
||||||
addMessage("Could not create an image of that size.");
|
addMessage(XLAT("Could not create an image of that size."));
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
||||||
@ -528,6 +534,10 @@ EX namespace history {
|
|||||||
len -= bandsegment; xpos -= bandsegment;
|
len -= bandsegment; xpos -= bandsegment;
|
||||||
seglen = min(int(len), bandsegment);
|
seglen = min(int(len), bandsegment);
|
||||||
band = SDL_CreateRGBSurface(SDL_SWSURFACE, seglen, bandfull,32,0,0,0,0);
|
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;
|
goto drawsegment;
|
||||||
}
|
}
|
||||||
xpos += bwidth;
|
xpos += bwidth;
|
||||||
|
Loading…
Reference in New Issue
Block a user