- fixed: r_showviewer must always be true when rendering a mirror portal.

This commit is contained in:
Christoph Oelckers 2016-02-26 12:09:59 +01:00
parent bb4bd76257
commit 213d7a75c2
2 changed files with 8 additions and 0 deletions

View file

@ -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 *> GLPortal::portals;
TArray<float> 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++;

View file

@ -117,6 +117,7 @@ private:
angle_t savedviewangle;
AActor * savedviewactor;
area_t savedviewarea;
bool savedshowviewer;
GLPortal *NextPortal;
TArray<BYTE> savedmapsection;
TArray<unsigned int> mPrimIndices;