- removed some leftover code for handling dynamic lights in the render pass.

# Conflicts:
#	src/gl/scene/gl_flats.cpp
This commit is contained in:
Christoph Oelckers 2018-08-13 23:46:55 +02:00
parent acb9505606
commit 07649fd31a
2 changed files with 15 additions and 18 deletions

View file

@ -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

View file

@ -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);