Revert a number of changes from r6929 and r6930 that are no longer necessary.

Fix root causes of issues causing crash and black screen in Mapster32 when switching back and forth between 3D & 2D modes

git-svn-id: https://svn.eduke32.com/eduke32@6931 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
pogokeen 2018-06-25 14:53:42 +00:00
parent d0e73aa85e
commit a0faeaf8f6
3 changed files with 15 additions and 11 deletions

View File

@ -769,7 +769,7 @@ int app_main(int argc, char const * const * argv)
g_videoBrightness = 0.0; g_videoBrightness = 0.0;
videoSetPalette(0,0,0); videoSetPalette(0,0,0);
if (videoSetGameMode(fullscreen, xdim2d, ydim2d, bppgame) < 0) if (videoSetGameMode(fullscreen, xdim2d, ydim2d, 8) < 0)
{ {
CallExtUnInit(); CallExtUnInit();
engineUnInit(); engineUnInit();

View File

@ -9825,6 +9825,14 @@ static void videoAllocateBuffers(void)
ysavecnt = YSAVES; ysavecnt = YSAVES;
nodesperline = tabledivide32_noinline(YSAVES, ydim); nodesperline = tabledivide32_noinline(YSAVES, ydim);
#ifdef USE_OPENGL
extern char nogl;
if (videoGetRenderMode() == REND_CLASSIC && !nogl)
{
glsurface_initialize({xdim, ydim});
}
#endif
} }
#ifdef USE_OPENGL #ifdef USE_OPENGL
@ -9899,11 +9907,6 @@ int32_t videoSetGameMode(char davidoption, int32_t daxdim, int32_t daydim, int32
#ifdef USE_OPENGL #ifdef USE_OPENGL
fxdim = (float) daxdim; fxdim = (float) daxdim;
fydim = (float) daydim; fydim = (float) daydim;
if (videoGetRenderMode() == REND_CLASSIC && !nogl)
{
glsurface_initialize({xdim, ydim});
}
#endif #endif
videoAllocateBuffers(); videoAllocateBuffers();
@ -12759,21 +12762,21 @@ void videoSet2dMode(int32_t daxdim, int32_t daydim)
ydim = yres; ydim = yres;
#ifdef USE_OPENGL #ifdef USE_OPENGL
extern char nogl;
fxdim = (float) xres; fxdim = (float) xres;
fydim = (float) yres; fydim = (float) yres;
if (!nogl) rendmode = REND_CLASSIC;
glsurface_initialize({ xres, yres });
#endif #endif
videoAllocateBuffers(); videoAllocateBuffers();
ydim16 = yres - STATUS2DSIZ2; ydim16 = yres - STATUS2DSIZ2;
halfxdim16 = xres >> 1; halfxdim16 = xres >> 1;
midydim16 = ydim16 >> 1; // scale(200,yres,480); midydim16 = ydim16 >> 1; // scale(200,yres,480);
videoClearScreen(0L); videoBeginDrawing(); //{{{
Bmemset((char *)frameplace, 0, yres*bytesperline);
videoEndDrawing(); //}}}
} }
qsetmode = ((daxdim<<16)|(daydim&0xffff)); qsetmode = ((daxdim<<16)|(daydim&0xffff));

View File

@ -85,6 +85,7 @@ bool glsurface_initialize(vec2_t inputBufferResolution)
glEnableVertexAttribArray(0); glEnableVertexAttribArray(0);
glEnableVertexAttribArray(1); glEnableVertexAttribArray(1);
glActiveTexture(GL_TEXTURE0);
glGenTextures(1, &bufferTexID); glGenTextures(1, &bufferTexID);
glBindTexture(GL_TEXTURE_2D, bufferTexID); glBindTexture(GL_TEXTURE_2D, bufferTexID);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_BASE_LEVEL, 0); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_BASE_LEVEL, 0);