- force model light to be attenuated

This commit is contained in:
Magnus Norddahl 2018-05-25 19:23:47 +02:00
parent 1634b78280
commit 31f29bbe8a
3 changed files with 5 additions and 5 deletions

View file

@ -63,7 +63,7 @@ bool FDynLightData::GetLight(int group, Plane & p, ADynamicLight * light, bool c
return false;
}
AddLightToList(group, light);
AddLightToList(group, light, false);
return true;
}
@ -72,7 +72,7 @@ bool FDynLightData::GetLight(int group, Plane & p, ADynamicLight * light, bool c
// Add one dynamic light to the light data list
//
//==========================================================================
void FDynLightData::AddLightToList(int group, ADynamicLight * light)
void FDynLightData::AddLightToList(int group, ADynamicLight * light, bool forceAttenuate)
{
int i = 0;
@ -109,7 +109,7 @@ void FDynLightData::AddLightToList(int group, ADynamicLight * light)
bool attenuate;
// Store attenuate flag in the sign bit of the float.
if (gl_attenuate == -1) attenuate = !!(light->lightflags & LF_ATTENUATE);
if (gl_attenuate == -1) attenuate = !!(light->lightflags & LF_ATTENUATE) || forceAttenuate;
else attenuate = !!gl_attenuate;
if (attenuate) shadowIndex = -shadowIndex;

View file

@ -54,7 +54,7 @@ struct FDynLightData
}
bool GetLight(int group, Plane & p, ADynamicLight * light, bool checkside);
void AddLightToList(int group, ADynamicLight * light);
void AddLightToList(int group, ADynamicLight * light, bool forceAttenuate);
};

View file

@ -219,7 +219,7 @@ void hw_GetDynModelLight(AActor *self, FDynLightData &modellightdata)
{
if (std::find(addedLights.begin(), addedLights.end(), light) == addedLights.end()) // Check if we already added this light from a different subsector
{
modellightdata.AddLightToList(group, light);
modellightdata.AddLightToList(group, light, true);
addedLights.Push(light);
}
}