From 7cbe8669b687b1c560bab4f69d2fd1d832b4286f Mon Sep 17 00:00:00 2001 From: Magnus Norddahl Date: Sat, 10 Feb 2018 00:06:47 +0100 Subject: [PATCH] - fix decals not getting lit by lights not having a target while still having the LF_DONTLIGHTSELF flag - fix decal light not being calculated from the center of the decal --- src/gl/scene/gl_decal.cpp | 2 +- src/gl/scene/gl_spritelight.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gl/scene/gl_decal.cpp b/src/gl/scene/gl_decal.cpp index cf23102094..0f3bc7ffb4 100644 --- a/src/gl/scene/gl_decal.cpp +++ b/src/gl/scene/gl_decal.cpp @@ -289,7 +289,7 @@ void GLWall::DrawDecal(DBaseDecal *decal) // Note: This should be replaced with proper shader based lighting. double x, y; decal->GetXY(seg->sidedef, x, y); - gl_SetDynSpriteLight(NULL, x, y, zpos, sub); + gl_SetDynSpriteLight(nullptr, x, y, zpos - decalheight * 0.5f, sub); } // alpha color only has an effect when using an alpha texture. diff --git a/src/gl/scene/gl_spritelight.cpp b/src/gl/scene/gl_spritelight.cpp index ac7e6971e5..1415ce16c9 100644 --- a/src/gl/scene/gl_spritelight.cpp +++ b/src/gl/scene/gl_spritelight.cpp @@ -74,7 +74,7 @@ void gl_SetDynSpriteLight(AActor *self, float x, float y, float z, subsector_t * while (node) { light=node->lightsource; - if (light->visibletoplayer && !(light->flags2&MF2_DORMANT) && (!(light->lightflags&LF_DONTLIGHTSELF) || light->target != self) && !(light->lightflags&LF_DONTLIGHTACTORS)) + if (light->visibletoplayer && !(light->flags2&MF2_DORMANT) && (!(light->lightflags&LF_DONTLIGHTSELF) || light->target != self || !self) && !(light->lightflags&LF_DONTLIGHTACTORS)) { float dist; FVector3 L;