From 9ab9548723e1c258cfa713799b9c6cf12ccc927d Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Sun, 7 Aug 2016 14:50:48 +0300 Subject: [PATCH] Additional fix for splitting of complex wall in compatibility renderer warp 2720 -200 -32 on Extreme Terror https://www.doomworld.com/idgames/levels/doom2/Ports/d-f/exterror --- src/gl/scene/gl_wall.h | 2 +- src/gl/scene/gl_walls.cpp | 22 ++++++++++++---------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/src/gl/scene/gl_wall.h b/src/gl/scene/gl_wall.h index fdeb99ed0..674d7fffd 100644 --- a/src/gl/scene/gl_wall.h +++ b/src/gl/scene/gl_wall.h @@ -187,7 +187,7 @@ private: void RenderLightsCompat(int pass); void Put3DWall(lightlist_t * lightlist, bool translucent); - void SplitWallComplex(sector_t * frontsector, bool translucent, float maplightbottomleft, float maplightbottomright); + bool SplitWallComplex(sector_t * frontsector, bool translucent, float& maplightbottomleft, float& maplightbottomright); void SplitWall(sector_t * frontsector, bool translucent); void SetupLights(); diff --git a/src/gl/scene/gl_walls.cpp b/src/gl/scene/gl_walls.cpp index a688a036b..6f1f02d86 100644 --- a/src/gl/scene/gl_walls.cpp +++ b/src/gl/scene/gl_walls.cpp @@ -264,7 +264,7 @@ void GLWall::Put3DWall(lightlist_t * lightlist, bool translucent) // //========================================================================== -void GLWall::SplitWallComplex(sector_t * frontsector, bool translucent, float maplightbottomleft, float maplightbottomright) +bool GLWall::SplitWallComplex(sector_t * frontsector, bool translucent, float& maplightbottomleft, float& maplightbottomright) { GLWall copyWall1, copyWall2; @@ -304,7 +304,7 @@ void GLWall::SplitWallComplex(sector_t * frontsector, bool translucent, float ma copyWall1.SplitWall(frontsector, translucent); copyWall2.SplitWall(frontsector, translucent); - return; + return true; } } @@ -345,9 +345,11 @@ void GLWall::SplitWallComplex(sector_t * frontsector, bool translucent, float ma copyWall1.SplitWall(frontsector, translucent); copyWall2.SplitWall(frontsector, translucent); - return; + return true; } } + + return false; } void GLWall::SplitWall(sector_t * frontsector, bool translucent) @@ -406,14 +408,14 @@ void GLWall::SplitWall(sector_t * frontsector, bool translucent) // Use hardware clipping if this cannot be done cleanly. this->lightlist = &lightlist; PutWall(translucent); - } - else - { - // crappy fallback if no clip planes available - SplitWallComplex(frontsector, translucent, maplightbottomleft, maplightbottomright); - } - goto out; + goto out; + } + // crappy fallback if no clip planes available + else if (SplitWallComplex(frontsector, translucent, maplightbottomleft, maplightbottomright)) + { + goto out; + } } // 3D floor is completely within this light