From d797415745ba2344d5e1964dfbe6b797cbf2211d Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 2 Feb 2016 11:58:00 +0100 Subject: [PATCH] - fixed: dynamic lights did not relink themselves when their position changed. --- src/actor.h | 2 +- src/gl/dynlights/a_dynlight.cpp | 13 +++++++++++++ src/gl/dynlights/gl_dynlight.h | 3 ++- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/actor.h b/src/actor.h index 700999b51..4cc4e2de4 100644 --- a/src/actor.h +++ b/src/actor.h @@ -1186,7 +1186,7 @@ public: void LinkToWorld (sector_t *sector); void UnlinkFromWorld (); void AdjustFloorClip (); - void SetOrigin (fixed_t x, fixed_t y, fixed_t z, bool moving = false); + virtual void SetOrigin (fixed_t x, fixed_t y, fixed_t z, bool moving = false); bool InStateSequence(FState * newstate, FState * basestate); int GetTics(FState * newstate); bool SetState (FState *newstate, bool nofunction=false); diff --git a/src/gl/dynlights/a_dynlight.cpp b/src/gl/dynlights/a_dynlight.cpp index 9a13d9e09..3e1cace46 100644 --- a/src/gl/dynlights/a_dynlight.cpp +++ b/src/gl/dynlights/a_dynlight.cpp @@ -384,6 +384,19 @@ void ADynamicLight::UpdateLocation() // // //========================================================================== + +void ADynamicLight::SetOrigin(fixed_t x, fixed_t y, fixed_t z, bool moving) +{ + Super::SetOrigin(x, y, z, moving); + LinkLight(); +} + +//========================================================================== +// +// +// +//========================================================================== + void ADynamicLight::SetOffset(fixed_t x, fixed_t y, fixed_t z) { m_offX = x; diff --git a/src/gl/dynlights/gl_dynlight.h b/src/gl/dynlights/gl_dynlight.h index 568630898..c78a0c927 100644 --- a/src/gl/dynlights/gl_dynlight.h +++ b/src/gl/dynlights/gl_dynlight.h @@ -81,7 +81,8 @@ public: void UnlinkLight(); size_t PointerSubstitution (DObject *old, DObject *notOld); - virtual void BeginPlay(); + void BeginPlay(); + void SetOrigin (fixed_t x, fixed_t y, fixed_t z, bool moving = false); void PostBeginPlay(); void Destroy(); void Activate(AActor *activator);