From d2b8f1aaff534b7e07c218b25d0cce2f11b2d956 Mon Sep 17 00:00:00 2001 From: nashmuhandes Date: Sat, 25 Sep 2021 12:00:25 +0800 Subject: [PATCH] Add light probe actor --- src/CMakeLists.txt | 1 + src/common/engine/namedef.h | 1 + src/r_data/a_lightprobe.cpp | 31 ++++++++++++++++ src/r_data/a_lightprobe.h | 35 ++++++++++++++++++ wadsrc/static/mapinfo/common.txt | 1 + wadsrc/static/sprites/LPROA0.png | Bin 0 -> 1611 bytes wadsrc/static/zscript.txt | 1 + .../zscript/actors/shared/lightprobe.zs | 9 +++++ 8 files changed, 79 insertions(+) create mode 100644 src/r_data/a_lightprobe.cpp create mode 100644 src/r_data/a_lightprobe.h create mode 100644 wadsrc/static/sprites/LPROA0.png create mode 100644 wadsrc/static/zscript/actors/shared/lightprobe.zs diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 178a5934e..db36362e9 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -976,6 +976,7 @@ set (PCH_SOURCES r_data/colormaps.cpp r_data/gldefs.cpp r_data/a_dynlightdata.cpp + r_data/a_lightprobe.cpp r_data/r_translate.cpp r_data/sprites.cpp r_data/portalgroups.cpp diff --git a/src/common/engine/namedef.h b/src/common/engine/namedef.h index 489507061..b836dd6fb 100644 --- a/src/common/engine/namedef.h +++ b/src/common/engine/namedef.h @@ -1078,6 +1078,7 @@ xx(SpotOuterAngle) xx(lightflags) xx(lighttype) xx(InternalDynamicLight) +xx(LightProbe) xx(_a_chase_default) xx(MapMarker) xx(Spawn2) diff --git a/src/r_data/a_lightprobe.cpp b/src/r_data/a_lightprobe.cpp new file mode 100644 index 000000000..4057041cc --- /dev/null +++ b/src/r_data/a_lightprobe.cpp @@ -0,0 +1,31 @@ +/* +** Light Probe Actor +** Copyright (c) 2021 Nash Muhandes, Magnus Norddahl +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +*/ + + +#include "actor.h" +#include "a_lightprobe.h" + +IMPLEMENT_CLASS(ALightProbe, false, false) + +void ALightProbe::Tick() +{ + Super::Tick(); +} diff --git a/src/r_data/a_lightprobe.h b/src/r_data/a_lightprobe.h new file mode 100644 index 000000000..051b6d82f --- /dev/null +++ b/src/r_data/a_lightprobe.h @@ -0,0 +1,35 @@ +/* +** Light Probe Actor +** Copyright (c) 2021 Nash Muhandes, Magnus Norddahl +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef __A_LIGHTPROBE_H__ +#define __A_LIGHTPROBE_H__ + +class AActor; + +class ALightProbe : public AActor +{ + DECLARE_CLASS(ALightProbe, AActor) + +public: + void Tick(); +}; + +#endif //__A_LIGHTPROBE_H__ diff --git a/wadsrc/static/mapinfo/common.txt b/wadsrc/static/mapinfo/common.txt index 6a31743b4..6a4b230d4 100644 --- a/wadsrc/static/mapinfo/common.txt +++ b/wadsrc/static/mapinfo/common.txt @@ -136,6 +136,7 @@ DoomEdNums 9872 = SpotLightFlickerAttenuated 9873 = SectorSpotLightAttenuated 9874 = SpotLightFlickerRandomAttenuated + 9875 = LightProbe 9982 = SecActEyesAboveC 9983 = SecActEyesBelowC 9988 = CustomSprite diff --git a/wadsrc/static/sprites/LPROA0.png b/wadsrc/static/sprites/LPROA0.png new file mode 100644 index 0000000000000000000000000000000000000000..b325a44fbd2f7cc6e8da3fe1ead87f0eb73952b9 GIT binary patch literal 1611 zcmeAS@N?(olHy`uVBq!ia0y~yV31^BV36ftW?*2*SZ40dz`($fUgVg>z`(!*l2Gw_ zvyXv+K`6i{#I=Lr|NsC0@7}$;eED()1`x+(?yd#~1_rj0AirRc+<%76`~aDsl@LK)}Ynq98FjJGDe1 zDK$Ma&sORE?)^#%nJKnP;ikR@z6H*y8JQkcMXAA6ej&+K*~ykEO7?aNHWgMCxdpkY zC5Z|ZxjA{oRu#5NU~{eVimgDx`br95B_-LmN{%246(W2C6rA&mQWZ?~%yg3tO^g)G zE%gk|3@nXIbQFvX49)co%=Hb8bqx%y49u*IEft_Z$xgwhC?(A*$i)q6S5Zoutx`rw zNr9EVetCJhUb(Seeo?xGK4GRy>*)Z*l#%z~24 z{5%DaiHS-1r6smXN>F1fatq+b<`qMODLFq^zap_f-%!s0Z z>!;?V=BDPA6zd!68N$_8nI6H$P#zH|OJTosP zzr0uzWD!(Ps!L)?s;!cdfsvuEfu*jIX^5erm8qeXv8A?wg_VH;M5%9TNn%Q3Ng{EI z^HVa@DhVo0Nw!MMFUn0Uu~o{gi&uRFPYtmzkMj zm1u5il$e~HrfX-5pIi!xM40{*67~BR zWu|B5CFYQC4m^^qobz+?i+uA_K%uOpfDrd|b`B`YPs_|nwN)w(a(7bjbagf}v@|o* zHPSN#rFC$cv+~F+F3B&dgyx>$)IumLCsP5O%&ZcVK{>%zDH)UmQd5+m!kJ_TA;j47 zjMO~5=>npxI6tkVJh3R%F+DY}gqWnKZ>M0R56ZR>ujr%u5-f+5#bL^WT--oRaA^c8 znd}r0MP6!Nimg(SlD%D0?mSlp28M~AE{-7@=SwGDlxkJrX*y|q|NqqJS%)mPXcP^jGg7=5Eg4Te*DN}A%OmL7n(|xulcyBj+1yyf`{%ZUk;$oVUdnnK z&8KfVmFsq-)9Xm5aHiXpDa?WDS~Hh1$p1HKT97|AW7!X8?cgb!Rf2mNW@-9XUXGi2 rNhIQa1pjK~J#ta)#xFj+dbg9&UV~fi_tpOUprYE-)z4*}Q$iB}goq2O literal 0 HcmV?d00001 diff --git a/wadsrc/static/zscript.txt b/wadsrc/static/zscript.txt index a447a9b73..bd709f1bf 100644 --- a/wadsrc/static/zscript.txt +++ b/wadsrc/static/zscript.txt @@ -90,6 +90,7 @@ version "4.6" #include "zscript/actors/shared/fastprojectile.zs" #include "zscript/actors/shared/randomspawner.zs" #include "zscript/actors/shared/dynlights.zs" +#include "zscript/actors/shared/lightprobe.zs" #include "zscript/actors/doom/doomplayer.zs" #include "zscript/actors/doom/possessed.zs" diff --git a/wadsrc/static/zscript/actors/shared/lightprobe.zs b/wadsrc/static/zscript/actors/shared/lightprobe.zs new file mode 100644 index 000000000..032e2e779 --- /dev/null +++ b/wadsrc/static/zscript/actors/shared/lightprobe.zs @@ -0,0 +1,9 @@ +class LightProbe : Actor native +{ + States + { + Spawn: + LPRO A -1 Bright; + Stop; + } +}