From 0c0ef4f938f9a6276f095fdcfeb457ffd129c728 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Fri, 5 Mar 2021 12:25:41 +0100 Subject: [PATCH] - reinstated rendering of mid textures over two-sided wall portals. This was removed in the last PR due to z-fighting problems which now have also been addressed --- src/rendering/hwrenderer/scene/hw_drawlistadd.cpp | 2 +- src/rendering/hwrenderer/scene/hw_walls.cpp | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/rendering/hwrenderer/scene/hw_drawlistadd.cpp b/src/rendering/hwrenderer/scene/hw_drawlistadd.cpp index 9b2e9d57c3..8a862e29aa 100644 --- a/src/rendering/hwrenderer/scene/hw_drawlistadd.cpp +++ b/src/rendering/hwrenderer/scene/hw_drawlistadd.cpp @@ -49,7 +49,7 @@ void HWDrawInfo::AddWall(HWWall *wall) bool masked = HWWall::passflag[wall->type] == 1 ? false : (wall->texture && wall->texture->isMasked()); int list; - if ((wall->flags & HWWall::HWF_SKYHACK && wall->type == RENDERWALL_M2S)) + if (wall->flags & HWWall::HWF_SKYHACK && wall->type == RENDERWALL_M2S) { list = GLDL_MASKEDWALLSOFS; } diff --git a/src/rendering/hwrenderer/scene/hw_walls.cpp b/src/rendering/hwrenderer/scene/hw_walls.cpp index 94901093bc..6ae94fc966 100644 --- a/src/rendering/hwrenderer/scene/hw_walls.cpp +++ b/src/rendering/hwrenderer/scene/hw_walls.cpp @@ -1443,6 +1443,11 @@ void HWWall::DoMidTexture(HWDrawInfo *di, seg_t * seg, bool drawfogboundary, tci.mScale.Y = -tci.mScale.Y; flags |= HWF_NOSLICE; } + if (seg->linedef->isVisualPortal()) + { + // mid textures on portal lines need the same offsetting as mid textures on sky lines + flags |= HWF_SKYHACK; + } SetWallCoordinates(seg, &tci, texturetop, topleft, topright, bottomleft, bottomright, t_ofs); // @@ -2165,6 +2170,12 @@ void HWWall::Process(HWDrawInfo *di, seg_t *seg, sector_t * frontsector, sector_ zbottom[0] = bfh1; zbottom[1] = bfh2; PutPortal(di, PORTALTYPE_LINETOLINE, -1); + + if (texture && seg->backsector != nullptr) + { + DoMidTexture(di, seg, drawfogboundary, frontsector, backsector, realfront, realback, + fch1, fch2, ffh1, ffh2, bch1, bch2, bfh1, bfh2); + } } else {