diff --git a/src/doomdata.h b/src/doomdata.h index 5f681fa76..d11a45ce7 100644 --- a/src/doomdata.h +++ b/src/doomdata.h @@ -371,6 +371,8 @@ struct FMapThing int16_t roll; uint32_t RenderStyle; int FloatbobPhase; + double SpotInnerAngle; + double SpotOuterAngle; }; diff --git a/src/p_mobj.cpp b/src/p_mobj.cpp index d5c5e93ea..78b41facc 100644 --- a/src/p_mobj.cpp +++ b/src/p_mobj.cpp @@ -108,6 +108,7 @@ #include "a_morph.h" #include "events.h" #include "actorinlines.h" +#include "a_dynlight.h" // MACROS ------------------------------------------------------------------ @@ -6001,6 +6002,8 @@ AActor *P_SpawnMapThing (FMapThing *mthing, int position) } } + + // spawn it double sz; @@ -6087,6 +6090,14 @@ AActor *P_SpawnMapThing (FMapThing *mthing, int position) mobj->fillcolor = (mthing->fillcolor & 0xffffff) | (ColorMatcher.Pick((mthing->fillcolor & 0xff0000) >> 16, (mthing->fillcolor & 0xff00) >> 8, (mthing->fillcolor & 0xff)) << 24); + if (i->IsDescendantOf(RUNTIME_CLASS(ADynamicLight))) + { + if (mthing->SpotInnerAngle != 0) + ((ADynamicLight*)mobj)->SpotInnerAngle = mthing->SpotInnerAngle; + if (mthing->SpotOuterAngle != 0) + ((ADynamicLight*)mobj)->SpotOuterAngle = mthing->SpotOuterAngle; + } + mobj->CallBeginPlay (); if (!(mobj->ObjectFlags & OF_EuthanizeMe)) { diff --git a/wadsrc/static/mapinfo/common.txt b/wadsrc/static/mapinfo/common.txt index 5782f8808..d183675c0 100644 --- a/wadsrc/static/mapinfo/common.txt +++ b/wadsrc/static/mapinfo/common.txt @@ -109,6 +109,11 @@ DoomEdNums 9832 = PointLightFlickerAttenuated 9833 = SectorPointLightAttenuated 9834 = PointLightFlickerRandomAttenuated + 9840 = SpotLight + 9841 = SpotLightPulse + 9842 = SpotLightFlicker + 9843 = SectorSpotLight + 9844 = SpotLightFlickerRandom 9982 = SecActEyesAboveC 9983 = SecActEyesBelowC 9988 = CustomSprite diff --git a/wadsrc/static/zscript/shared/dynlights.txt b/wadsrc/static/zscript/shared/dynlights.txt index 8cdd3b267..362389b8a 100644 --- a/wadsrc/static/zscript/shared/dynlights.txt +++ b/wadsrc/static/zscript/shared/dynlights.txt @@ -205,6 +205,46 @@ class PointLightFlickerRandomAttenuated :PointLightFlickerRandom } } +class SpotLight : DynamicLight +{ + Default + { + DynamicLight.Type "Point"; + +DYNAMICLIGHT.SPOT + } +} + +class SpotLightPulse : SpotLight +{ + Default + { + DynamicLight.Type "Pulse"; + } +} + +class SpotLightFlicker : SpotLight +{ + Default + { + DynamicLight.Type "Flicker"; + } +} + +class SectorSpotLight : SpotLight +{ + Default + { + DynamicLight.Type "Sector"; + } +} + +class SpotLightFlickerRandom : SpotLight +{ + Default + { + DynamicLight.Type "RandomFlicker"; + } +} class VavoomLight : DynamicLight {