From fd3845ce0973546a2b1db683ee7eccc9de2e218b Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Wed, 3 Jun 2020 22:30:44 +0200 Subject: [PATCH] - fixed: vertically mirrored textures should not be subjected to empty space optimizations because the algorithm cannot deal with the inverted case. --- src/rendering/hwrenderer/scene/hw_drawstructs.h | 7 ++++--- src/rendering/hwrenderer/scene/hw_walls.cpp | 3 ++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/rendering/hwrenderer/scene/hw_drawstructs.h b/src/rendering/hwrenderer/scene/hw_drawstructs.h index 8c0d29173..1d20ced4a 100644 --- a/src/rendering/hwrenderer/scene/hw_drawstructs.h +++ b/src/rendering/hwrenderer/scene/hw_drawstructs.h @@ -128,7 +128,8 @@ public: HWF_NOSPLITUPPER=16, HWF_NOSPLITLOWER=32, HWF_NOSPLIT=64, - HWF_TRANSLUCENT = 128 + HWF_TRANSLUCENT = 128, + HWF_NOSLICE = 256 }; enum @@ -164,9 +165,9 @@ public: float ViewDistance; - int lightlevel; + short lightlevel; + uint16_t flags; uint8_t type; - uint8_t flags; short rellight; float topglowcolor[4]; diff --git a/src/rendering/hwrenderer/scene/hw_walls.cpp b/src/rendering/hwrenderer/scene/hw_walls.cpp index 78c532333..37ccd66bb 100644 --- a/src/rendering/hwrenderer/scene/hw_walls.cpp +++ b/src/rendering/hwrenderer/scene/hw_walls.cpp @@ -1404,6 +1404,7 @@ void HWWall::DoMidTexture(HWDrawInfo *di, seg_t * seg, bool drawfogboundary, { tci.mRenderHeight = -tci.mRenderHeight; tci.mScale.Y = -tci.mScale.Y; + flags |= HWF_NOSLICE; } SetWallCoordinates(seg, &tci, texturetop, topleft, topright, bottomleft, bottomright, t_ofs); @@ -1464,7 +1465,7 @@ void HWWall::DoMidTexture(HWDrawInfo *di, seg_t * seg, bool drawfogboundary, FloatRect *splitrect; int v = texture->GetAreas(&splitrect); if (seg->frontsector == seg->backsector) flags |= HWF_NOSPLIT; // we don't need to do vertex splits if a line has both sides in the same sector - if (v>0 && !drawfogboundary && !(seg->linedef->flags&ML_WRAP_MIDTEX)) + if (v>0 && !drawfogboundary && !(seg->linedef->flags&ML_WRAP_MIDTEX) && !(flags & HWF_NOSLICE)) { // split the poly! int i,t=0;