mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-11 07:12:16 +00:00
- force model light to be attenuated
This commit is contained in:
parent
1634b78280
commit
31f29bbe8a
3 changed files with 5 additions and 5 deletions
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
||||
};
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue