mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-13 07:57:58 +00:00
- do not render lights from uninitialized data.
This commit is contained in:
parent
3046a7dd81
commit
e13d1e4d0d
2 changed files with 3 additions and 1 deletions
|
@ -57,6 +57,7 @@ void FDrawInfo::SetupSubsectorLights(GLFlat *flat, int pass, subsector_t * sub,
|
||||||
{
|
{
|
||||||
if (dli != NULL && *dli != -1)
|
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));
|
gl_RenderState.ApplyLightIndex(GLRenderer->mLights->GetIndex(*dli));
|
||||||
(*dli)++;
|
(*dli)++;
|
||||||
return;
|
return;
|
||||||
|
@ -85,6 +86,7 @@ void FDrawInfo::SetupSectorLights(GLFlat *flat, int pass, int *dli)
|
||||||
{
|
{
|
||||||
if (dli != NULL && *dli != -1)
|
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));
|
gl_RenderState.ApplyLightIndex(GLRenderer->mLights->GetIndex(*dli));
|
||||||
(*dli)++;
|
(*dli)++;
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -139,9 +139,9 @@ bool GLFlat::SetupLights(int pass, FLightNode * node, FDynLightData &lightdata,
|
||||||
{
|
{
|
||||||
Plane p;
|
Plane p;
|
||||||
|
|
||||||
|
lightdata.Clear();
|
||||||
if (renderstyle == STYLE_Add && !level.lightadditivesurfaces) return false; // no lights on additively blended surfaces.
|
if (renderstyle == STYLE_Add && !level.lightadditivesurfaces) return false; // no lights on additively blended surfaces.
|
||||||
|
|
||||||
lightdata.Clear();
|
|
||||||
while (node)
|
while (node)
|
||||||
{
|
{
|
||||||
ADynamicLight * light = node->lightsource;
|
ADynamicLight * light = node->lightsource;
|
||||||
|
|
Loading…
Reference in a new issue