From 8f4566408923e8fb952c46fe06725b0c704e6061 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Thu, 8 Dec 2016 17:00:15 +0100 Subject: [PATCH] - fixed: Fog boundaries were not drawn on line portals. There's two restrictions, though: * on one-sided-line portals fog boundaries will not be drawn. * the filler sector behind the portal may not have a sky ceiling texture. This is because the drawing code contains several sky checks which get in the way here. --- src/gl/scene/gl_walls.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/gl/scene/gl_walls.cpp b/src/gl/scene/gl_walls.cpp index db16a941a..30e10b73f 100644 --- a/src/gl/scene/gl_walls.cpp +++ b/src/gl/scene/gl_walls.cpp @@ -1654,7 +1654,10 @@ void GLWall::Process(seg_t *seg, sector_t * frontsector, sector_t * backsector) /* mid texture */ - bool drawfogboundary = gl_CheckFog(frontsector, backsector); + bool isportal = seg->linedef->isVisualPortal() && seg->sidedef == seg->linedef->sidedef[0]; + sector_t *backsec = isportal? seg->linedef->getPortalDestination()->frontsector : backsector; + + bool drawfogboundary = gl_CheckFog(frontsector, backsec); FTexture *tex = TexMan(seg->sidedef->GetTexture(side_t::mid)); if (tex != NULL) { @@ -1672,7 +1675,7 @@ void GLWall::Process(seg_t *seg, sector_t * frontsector, sector_t * backsector) fch1, fch2, ffh1, ffh2, bch1, bch2, bfh1, bfh2); } - if (seg->linedef->isVisualPortal() && seg->sidedef == seg->linedef->sidedef[0]) + if (isportal) { lineportal = linePortalToGL[seg->linedef->portalindex]; ztop[0] = bch1;