Fix crash in Mapster32 when switching from GL 3d mode to 2d mode.

git-svn-id: https://svn.eduke32.com/eduke32@6929 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
terminx 2018-06-24 00:55:23 +00:00
parent cbf6dc3c42
commit bcb7815118

View file

@ -9890,7 +9890,7 @@ int32_t videoSetGameMode(char davidoption, int32_t daxdim, int32_t daydim, int32
#ifdef USE_OPENGL
if (dabpp > 8) rendmode = glrendmode; // GL renderer
else if (dabpp == 8 && j > 8) rendmode = REND_CLASSIC;
else rendmode = REND_CLASSIC;
#endif
xdim = daxdim;
@ -12759,19 +12759,21 @@ void videoSet2dMode(int32_t daxdim, int32_t daydim)
ydim = yres;
#ifdef USE_OPENGL
extern char nogl;
fxdim = (float) xres;
fydim = (float) yres;
#endif
if (!nogl)
glsurface_initialize({ xres, yres });
#endif
videoAllocateBuffers();
ydim16 = yres - STATUS2DSIZ2;
halfxdim16 = xres >> 1;
midydim16 = ydim16 >> 1; // scale(200,yres,480);
videoBeginDrawing(); //{{{
Bmemset((char *)frameplace, 0, yres*bytesperline);
videoEndDrawing(); //}}}
videoClearScreen(0L);
}
qsetmode = ((daxdim<<16)|(daydim&0xffff));