From 1648fc6a07d0e021b05d9489994ebefd053eff99 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Wed, 25 Apr 2018 09:14:01 +0200 Subject: [PATCH] Fixed initialization issues with dynamic lights. Actors get initialized from their defaults so anything done in the constructor or some explicit member initialization will be overwritten. They must use their properties for setting up configurable fields and do the rest in BeginPlay. --- src/g_shared/a_dynlight.cpp | 1 + src/g_shared/a_dynlight.h | 6 +++--- wadsrc/static/zscript/shared/dynlights.txt | 2 ++ 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/g_shared/a_dynlight.cpp b/src/g_shared/a_dynlight.cpp index aab54d24b..65fae7176 100644 --- a/src/g_shared/a_dynlight.cpp +++ b/src/g_shared/a_dynlight.cpp @@ -167,6 +167,7 @@ void ADynamicLight::BeginPlay() specialf1 = DAngle(double(SpawnAngle)).Normalized360().Degrees; visibletoplayer = true; + mShadowmapIndex = 1024; } //========================================================================== diff --git a/src/g_shared/a_dynlight.h b/src/g_shared/a_dynlight.h index a0aede192..ae2493ca2 100644 --- a/src/g_shared/a_dynlight.h +++ b/src/g_shared/a_dynlight.h @@ -230,9 +230,9 @@ public: bool shadowmapped; int bufferindex; LightFlags lightflags; - DAngle SpotInnerAngle = 10.0; - DAngle SpotOuterAngle = 25.0; + DAngle SpotInnerAngle; + DAngle SpotOuterAngle; - int mShadowmapIndex = 1024; + int mShadowmapIndex; }; diff --git a/wadsrc/static/zscript/shared/dynlights.txt b/wadsrc/static/zscript/shared/dynlights.txt index c2c005bd8..7310dc18d 100644 --- a/wadsrc/static/zscript/shared/dynlights.txt +++ b/wadsrc/static/zscript/shared/dynlights.txt @@ -35,6 +35,8 @@ class DynamicLight : Actor native Radius 0.1; FloatBobPhase 0; RenderRadius -1; + DynamicLight.SpotInnerAngle 10; + DynamicLight.SpotOuterAngle 25; +NOBLOCKMAP +NOGRAVITY +FIXMAPTHINGPOS