- fixed sprite and particle colors when not affected by dynlights

When gl_light_sprites and/or gl_light_particles CVARs were unset, random values could be used their colors

https://forum.zdoom.org/viewtopic.php?t=67066
This commit is contained in:
alexey.lysiuk 2020-01-23 17:20:20 +02:00
parent 729ff8fa8f
commit bf18eab54b

View file

@ -146,7 +146,7 @@ void HWSprite::DrawSprite(HWDrawInfo *di, FRenderState &state, bool translucent)
{
if (dynlightindex == -1) // only set if we got no light buffer index. This covers all cases where sprite lighting is used.
{
float out[3];
float out[3] = {};
di->GetDynSpriteLight(gl_light_sprites ? actor : nullptr, gl_light_particles ? particle : nullptr, out);
state.SetDynLight(out[0], out[1], out[2]);
}