From f52744e8a4edcda1fa55699ad0d3651291956ddd Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Thu, 29 Dec 2016 19:54:38 +0100 Subject: [PATCH] - fixed: When looking through a plane mirror the portal plane exclusion logic needs to be flipped, because the mirror inverts the vertical view direction. --- src/gl/scene/gl_portal.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/gl/scene/gl_portal.cpp b/src/gl/scene/gl_portal.cpp index 02fd9b452..86ea68b39 100644 --- a/src/gl/scene/gl_portal.cpp +++ b/src/gl/scene/gl_portal.cpp @@ -777,6 +777,8 @@ void GLPlaneMirrorPortal::DrawContents() ClearScreen(); return; } + // A plane mirror needs to flip the portal exclusion logic because inside the mirror, up is down and down is up. + std::swap(instack[sector_t::floor], instack[sector_t::ceiling]); int old_pm=PlaneMirrorMode; @@ -794,6 +796,7 @@ void GLPlaneMirrorPortal::DrawContents() gl_RenderState.SetClipHeight(0.f, 0.f); PlaneMirrorFlag--; PlaneMirrorMode=old_pm; + std::swap(instack[sector_t::floor], instack[sector_t::ceiling]); } void GLPlaneMirrorPortal::PushState()