From 07649fd31a145921bdfde3bdac8c9bfa0d4b7cb6 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Mon, 13 Aug 2018 23:46:55 +0200 Subject: [PATCH] - removed some leftover code for handling dynamic lights in the render pass. # Conflicts: # src/gl/scene/gl_flats.cpp --- src/gl/scene/gl_drawinfo.h | 4 ++-- src/gl/scene/gl_flats.cpp | 29 +++++++++++++---------------- 2 files changed, 15 insertions(+), 18 deletions(-) diff --git a/src/gl/scene/gl_drawinfo.h b/src/gl/scene/gl_drawinfo.h index 8f0e0dea4..7f0c8371d 100644 --- a/src/gl/scene/gl_drawinfo.h +++ b/src/gl/scene/gl_drawinfo.h @@ -73,8 +73,8 @@ struct FDrawInfo : public HWDrawInfo // Flat drawer void DrawFlat(GLFlat *flat, int pass, bool trans) override; // trans only has meaning for GLPASS_LIGHTSONLY - void DrawSkyboxSector(GLFlat *flat, int pass, bool processlights); - void DrawSubsectors(GLFlat *flat, int pass, bool processlights, bool istrans); + void DrawSkyboxSector(GLFlat *flat, int pass); + void DrawSubsectors(GLFlat *flat, int pass, bool istrans); void DrawSubsector(GLFlat *flat, subsector_t * sub); // Sprite drawer diff --git a/src/gl/scene/gl_flats.cpp b/src/gl/scene/gl_flats.cpp index 1d878bc64..98314af8a 100644 --- a/src/gl/scene/gl_flats.cpp +++ b/src/gl/scene/gl_flats.cpp @@ -104,7 +104,7 @@ void FDrawInfo::DrawSubsector(GLFlat *flat, subsector_t * sub) // //========================================================================== -void FDrawInfo::DrawSubsectors(GLFlat *flat, int pass, bool processlights, bool istrans) +void FDrawInfo::DrawSubsectors(GLFlat *flat, int pass, bool istrans) { int dli = flat->dynlightindex; auto vcount = flat->sector->ibocount; @@ -112,15 +112,12 @@ void FDrawInfo::DrawSubsectors(GLFlat *flat, int pass, bool processlights, bool gl_RenderState.Apply(); auto iboindex = flat->iboindex; - if (processlights) - { - if (screen->hwcaps & RFL_BUFFER_STORAGE) - { - flat->SetupLights(this, flat->sector->lighthead, lightdata, flat->sector->PortalGroup); - } - gl_RenderState.ApplyLightIndex(flat->dynlightindex); - } + if (screen->hwcaps & RFL_BUFFER_STORAGE) + { + flat->SetupLights(this, flat->sector->lighthead, lightdata, flat->sector->PortalGroup); + } + gl_RenderState.ApplyLightIndex(flat->dynlightindex); if (iboindex >= 0) { if (vcount > 0 && !ClipLineShouldBeActive()) @@ -173,7 +170,7 @@ void FDrawInfo::DrawSubsectors(GLFlat *flat, int pass, bool processlights, bool while (node) { - if (processlights) gl_RenderState.ApplyLightIndex(node->lightindex); + gl_RenderState.ApplyLightIndex(node->lightindex); DrawSubsector(flat, node->sub); node = node->next; } @@ -187,10 +184,11 @@ void FDrawInfo::DrawSubsectors(GLFlat *flat, int pass, bool processlights, bool // //========================================================================== -void FDrawInfo::DrawSkyboxSector(GLFlat *flat, int pass, bool processlights) +void FDrawInfo::DrawSkyboxSector(GLFlat *flat, int pass) { FQuadDrawer qd; flat->CreateSkyboxVertices(qd.Pointer()); + gl_RenderState.ApplyLightIndex(flat->dynlightindex); qd.Render(GL_TRIANGLE_FAN); flatvertices += 4; @@ -208,7 +206,6 @@ void FDrawInfo::DrawFlat(GLFlat *flat, int pass, bool trans) // trans only has m int rel = getExtraLight(); auto &plane = flat->plane; - auto processLights = level.HasDynamicLights && !isFullbrightScene(); gl_RenderState.SetNormal(plane.plane.Normal().X, plane.plane.Normal().Z, plane.plane.Normal().Y); switch (pass) @@ -222,13 +219,13 @@ void FDrawInfo::DrawFlat(GLFlat *flat, int pass, bool trans) // trans only has m { gl_RenderState.SetMaterial(flat->gltexture, CLAMP_NONE, 0, -1, false); gl_RenderState.SetPlaneTextureRotation(&plane, flat->gltexture); - DrawSubsectors(flat, pass, processLights, false); + DrawSubsectors(flat, pass, false); gl_RenderState.EnableTextureMatrix(false); } else { gl_RenderState.SetMaterial(flat->gltexture, CLAMP_XY, 0, -1, false); - DrawSkyboxSector(flat, pass, processLights); + DrawSkyboxSector(flat, pass); } gl_RenderState.SetObjectColor(0xffffffff); break; @@ -243,7 +240,7 @@ void FDrawInfo::DrawFlat(GLFlat *flat, int pass, bool trans) // trans only has m { gl_RenderState.AlphaFunc(GL_GEQUAL, 0.f); gl_RenderState.EnableTexture(false); - DrawSubsectors(flat, pass, false, true); + DrawSubsectors(flat, pass, true); gl_RenderState.EnableTexture(true); } else @@ -252,7 +249,7 @@ void FDrawInfo::DrawFlat(GLFlat *flat, int pass, bool trans) // trans only has m else gl_RenderState.AlphaFunc(GL_GEQUAL, 0.f); gl_RenderState.SetMaterial(flat->gltexture, CLAMP_NONE, 0, -1, false); gl_RenderState.SetPlaneTextureRotation(&plane, flat->gltexture); - DrawSubsectors(flat, pass, processLights && (gl.lightmethod == LM_DIRECT || flat->dynlightindex > -1), true); + DrawSubsectors(flat, pass, true); gl_RenderState.EnableTextureMatrix(false); } if (flat->renderstyle==STYLE_Add) gl_RenderState.BlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);