- fixed: FDrawInfo must be kept around until DrawEndScene2D finishes.

Otherwise some code crashes on invalid data.
This commit is contained in:
Christoph Oelckers 2018-05-01 19:01:01 +02:00
parent 9bdb0f2e49
commit 14410ae526

View file

@ -722,7 +722,6 @@ sector_t * GLSceneDrawer::RenderViewpoint (AActor * camera, GL_IRECT * bounds, f
FDrawInfo::StartDrawInfo(this); FDrawInfo::StartDrawInfo(this);
ProcessScene(toscreen); ProcessScene(toscreen);
if (mainview && toscreen) EndDrawScene(lviewsector); // do not call this for camera textures. if (mainview && toscreen) EndDrawScene(lviewsector); // do not call this for camera textures.
FDrawInfo::EndDrawInfo();
if (mainview && FGLRenderBuffers::IsEnabled()) if (mainview && FGLRenderBuffers::IsEnabled())
{ {
@ -741,6 +740,7 @@ sector_t * GLSceneDrawer::RenderViewpoint (AActor * camera, GL_IRECT * bounds, f
DrawBlend(lviewsector); DrawBlend(lviewsector);
} }
FDrawInfo::EndDrawInfo();
GLRenderer->mDrawingScene2D = false; GLRenderer->mDrawingScene2D = false;
if (!stereo3dMode.IsMono() && FGLRenderBuffers::IsEnabled()) if (!stereo3dMode.IsMono() && FGLRenderBuffers::IsEnabled())
GLRenderer->mBuffers->BlitToEyeTexture(eye_ix); GLRenderer->mBuffers->BlitToEyeTexture(eye_ix);