From 0a35027f67e94c9237fc83eef9c030db33d39088 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 17 Apr 2016 10:39:29 +0200 Subject: [PATCH] - fixed use of validcount for the GL renderer. This needs to be incremented more locally to the place where it is used, so that it is guaranteed that each viewpoint that needs to be rendered increases it. As a result the uses in the portal code could be removed. --- src/gl/scene/gl_portal.cpp | 9 --------- src/gl/scene/gl_scene.cpp | 1 + 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/src/gl/scene/gl_portal.cpp b/src/gl/scene/gl_portal.cpp index 74af305c3..50b7fc9bb 100644 --- a/src/gl/scene/gl_portal.cpp +++ b/src/gl/scene/gl_portal.cpp @@ -661,7 +661,6 @@ void GLSkyboxPortal::DrawContents() GLRenderer->mViewActor = origin; - validcount++; inskybox = true; GLRenderer->SetupView(ViewPos.X, ViewPos.Y, ViewPos.Z, ViewAngle, !!(MirrorFlag & 1), !!(PlaneMirrorFlag & 1)); GLRenderer->SetViewArea(); @@ -755,9 +754,6 @@ void GLSectorStackPortal::DrawContents() ViewPos += origin->mDisplacement; GLRenderer->mViewActor = NULL; - - validcount++; - // avoid recursions! if (origin->plane != -1) instack[origin->plane]++; @@ -803,8 +799,6 @@ void GLPlaneMirrorPortal::DrawContents() PlaneMirrorMode = origin->fC() < 0 ? -1 : 1; r_showviewer = true; - validcount++; - PlaneMirrorFlag++; GLRenderer->SetupView(ViewPos.X, ViewPos.Y, ViewPos.Z, ViewAngle, !!(MirrorFlag&1), !!(PlaneMirrorFlag&1)); ClearClipper(); @@ -916,8 +910,6 @@ void GLMirrorPortal::DrawContents() GLRenderer->mViewActor = NULL; r_showviewer = true; - validcount++; - MirrorFlag++; GLRenderer->SetupView(ViewPos.X, ViewPos.Y, ViewPos.Z, ViewAngle, !!(MirrorFlag&1), !!(PlaneMirrorFlag&1)); @@ -1028,7 +1020,6 @@ void GLLineToLinePortal::DrawContents() } GLRenderer->mViewActor = NULL; - validcount++; GLRenderer->SetupView(ViewPos.X, ViewPos.Y, ViewPos.Z, ViewAngle, !!(MirrorFlag&1), !!(PlaneMirrorFlag&1)); ClearClipper(); diff --git a/src/gl/scene/gl_scene.cpp b/src/gl/scene/gl_scene.cpp index acb8416a4..9c2f6505c 100644 --- a/src/gl/scene/gl_scene.cpp +++ b/src/gl/scene/gl_scene.cpp @@ -306,6 +306,7 @@ void FGLRenderer::CreateScene() gl_spriteindex=0; Bsp.Clock(); R_SetView(); + validcount++; // used for processing sidedefs only once by the renderer. gl_RenderBSPNode (nodes + numnodes - 1); Bsp.Unclock();