diff --git a/src/gl/scene/gl_portal.cpp b/src/gl/scene/gl_portal.cpp index 4737f518d..a186d4ff0 100644 --- a/src/gl/scene/gl_portal.cpp +++ b/src/gl/scene/gl_portal.cpp @@ -83,6 +83,8 @@ EXTERN_CVAR(Bool, gl_portals) EXTERN_CVAR(Bool, gl_noquery) EXTERN_CVAR(Int, r_mirror_recursions) +extern bool r_showviewer; + TArray GLPortal::portals; TArray GLPortal::planestack; int GLPortal::recursion; @@ -311,6 +313,7 @@ bool GLPortal::Start(bool usestencil, bool doquery) savedviewactor=GLRenderer->mViewActor; savedviewangle=viewangle; savedviewarea=in_area; + savedshowviewer = r_showviewer; NextPortal = GLRenderer->mCurrentPortal; GLRenderer->mCurrentPortal = NULL; // Portals which need this have to set it themselves @@ -382,6 +385,7 @@ void GLPortal::End(bool usestencil) viewangle=savedviewangle; GLRenderer->mViewActor=savedviewactor; in_area=savedviewarea; + r_showviewer = savedshowviewer; GLRenderer->SetupView(viewx, viewy, viewz, viewangle, !!(MirrorFlag & 1), !!(PlaneMirrorFlag & 1)); { @@ -440,6 +444,7 @@ void GLPortal::End(bool usestencil) viewangle=savedviewangle; GLRenderer->mViewActor=savedviewactor; in_area=savedviewarea; + r_showviewer = savedshowviewer; GLRenderer->SetupView(viewx, viewy, viewz, viewangle, !!(MirrorFlag&1), !!(PlaneMirrorFlag&1)); // This draws a valid z-buffer into the stencil's contents to ensure it @@ -806,6 +811,7 @@ void GLPlaneMirrorPortal::DrawContents() viewz = 2*planez - viewz; GLRenderer->mViewActor = NULL; PlaneMirrorMode = ksgn(origin->c); + r_showviewer = true; validcount++; @@ -922,6 +928,7 @@ void GLMirrorPortal::DrawContents() linedef->v2->x, linedef->v2->y) - startang; GLRenderer->mViewActor = NULL; + r_showviewer = true; validcount++; diff --git a/src/gl/scene/gl_portal.h b/src/gl/scene/gl_portal.h index 5a2af3807..177c2230e 100644 --- a/src/gl/scene/gl_portal.h +++ b/src/gl/scene/gl_portal.h @@ -117,6 +117,7 @@ private: angle_t savedviewangle; AActor * savedviewactor; area_t savedviewarea; + bool savedshowviewer; GLPortal *NextPortal; TArray savedmapsection; TArray mPrimIndices;