From 9398d602f8a0ee5a0088933c30dc0af597a63d92 Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Thu, 19 Apr 2018 12:50:07 +0300 Subject: [PATCH] Fixed applying of dymanic lights to models https://forum.zdoom.org/viewtopic.php?t=60301 --- src/gl/scene/gl_sprite.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gl/scene/gl_sprite.cpp b/src/gl/scene/gl_sprite.cpp index d4188f3a0..cc3e5be60 100644 --- a/src/gl/scene/gl_sprite.cpp +++ b/src/gl/scene/gl_sprite.cpp @@ -351,7 +351,7 @@ void GLSprite::Draw(int pass) if (gl_lights && GLRenderer->mLightCount && mDrawer->FixedColormap == CM_DEFAULT && !fullbright) { if (modelframe && !particle) - gl_SetDynModelLight(gl_light_sprites ? actor : NULL, dynlightindex); + dynlightindex = gl_SetDynModelLight(gl_light_sprites ? actor : NULL, dynlightindex); else gl_SetDynSpriteLight(gl_light_sprites ? actor : NULL, gl_light_particles ? particle : NULL); } @@ -523,6 +523,7 @@ inline void GLSprite::PutSprite(bool translucent) { list = GLDL_MODELS; } + dynlightindex = -1; auto newsprt = gl_drawinfo->drawlists[list].NewSprite(); *newsprt = *this; }