From b9ffb51d0c7d61693982fdfe7e7d5803d29c853f Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Mon, 4 Aug 2014 23:00:40 +0200 Subject: [PATCH] - small but important optimization: Two-sided lines with both sides in the same sector don't really require vertex splitting for precise rendering. --- src/gl/scene/gl_wall.h | 1 + src/gl/scene/gl_walls.cpp | 1 + src/gl/scene/gl_walls_draw.cpp | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gl/scene/gl_wall.h b/src/gl/scene/gl_wall.h index 37501c607..a317ac267 100644 --- a/src/gl/scene/gl_wall.h +++ b/src/gl/scene/gl_wall.h @@ -99,6 +99,7 @@ public: GLWF_GLOW=8, // illuminated by glowing flats GLWF_NOSPLITUPPER=16, GLWF_NOSPLITLOWER=32, + GLWF_NOSPLIT=64, }; enum diff --git a/src/gl/scene/gl_walls.cpp b/src/gl/scene/gl_walls.cpp index cd179a265..ab6d710d4 100644 --- a/src/gl/scene/gl_walls.cpp +++ b/src/gl/scene/gl_walls.cpp @@ -984,6 +984,7 @@ void GLWall::DoMidTexture(seg_t * seg, bool drawfogboundary, // FloatRect *splitrect; int v = gltexture->GetAreas(&splitrect); + if (seg->frontsector == seg->backsector) flags |= GLWF_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)) { // split the poly! diff --git a/src/gl/scene/gl_walls_draw.cpp b/src/gl/scene/gl_walls_draw.cpp index 98bc9f661..c4576acc8 100644 --- a/src/gl/scene/gl_walls_draw.cpp +++ b/src/gl/scene/gl_walls_draw.cpp @@ -166,7 +166,7 @@ void GLWall::SetupLights() void GLWall::RenderWall(int textured, unsigned int *store) { static texcoord tcs[4]; // making this variable static saves us a relatively costly stack integrity check. - bool split = (gl_seamless && !(textured&RWF_NOSPLIT) && seg->sidedef != NULL && !(seg->sidedef->Flags & WALLF_POLYOBJ)); + bool split = (gl_seamless && !(textured&RWF_NOSPLIT) && seg->sidedef != NULL && !(seg->sidedef->Flags & WALLF_POLYOBJ) && !(flags & GLWF_NOSPLIT)); tcs[0]=lolft; tcs[1]=uplft;