- do not render lights from uninitialized data.

This commit is contained in:
Christoph Oelckers 2018-09-16 13:52:02 +02:00
parent 3046a7dd81
commit e13d1e4d0d
2 changed files with 3 additions and 1 deletions

View file

@ -57,6 +57,7 @@ void FDrawInfo::SetupSubsectorLights(GLFlat *flat, int pass, subsector_t * sub,
{
if (dli != NULL && *dli != -1)
{
if (flat->renderstyle == STYLE_Add && !level.lightadditivesurfaces) return; // no lights on additively blended surfaces.
gl_RenderState.ApplyLightIndex(GLRenderer->mLights->GetIndex(*dli));
(*dli)++;
return;
@ -85,6 +86,7 @@ void FDrawInfo::SetupSectorLights(GLFlat *flat, int pass, int *dli)
{
if (dli != NULL && *dli != -1)
{
if (flat->renderstyle == STYLE_Add && !level.lightadditivesurfaces) return; // no lights on additively blended surfaces.
gl_RenderState.ApplyLightIndex(GLRenderer->mLights->GetIndex(*dli));
(*dli)++;
return;

View file

@ -139,9 +139,9 @@ bool GLFlat::SetupLights(int pass, FLightNode * node, FDynLightData &lightdata,
{
Plane p;
lightdata.Clear();
if (renderstyle == STYLE_Add && !level.lightadditivesurfaces) return false; // no lights on additively blended surfaces.
lightdata.Clear();
while (node)
{
ADynamicLight * light = node->lightsource;