From bf18eab54b9bcc0258605ce3b88a63ad6858f6b1 Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Thu, 23 Jan 2020 17:20:20 +0200 Subject: [PATCH] - 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 --- src/rendering/hwrenderer/scene/hw_sprites.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rendering/hwrenderer/scene/hw_sprites.cpp b/src/rendering/hwrenderer/scene/hw_sprites.cpp index f215e1ef4..d2104c7d1 100644 --- a/src/rendering/hwrenderer/scene/hw_sprites.cpp +++ b/src/rendering/hwrenderer/scene/hw_sprites.cpp @@ -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]); }