From 479e0c301ebddf7c83e3bb30936f11c0c115ac81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ricardo=20Lu=C3=ADs=20Vaz=20Silva?= Date: Tue, 8 Oct 2024 20:48:42 -0300 Subject: [PATCH] add light_noshadowmap/light_dontlightactors/light_dontlightmap to UDMF --- specs/udmf_zdoom.txt | 3 +++ src/doomdata.h | 3 +++ src/maploader/udmf.cpp | 12 ++++++++++++ src/namedef_custom.h | 3 +++ src/playsim/p_mobj.cpp | 15 +++++++++++++++ 5 files changed, 36 insertions(+) diff --git a/specs/udmf_zdoom.txt b/specs/udmf_zdoom.txt index acf3a36da..b703de5df 100644 --- a/specs/udmf_zdoom.txt +++ b/specs/udmf_zdoom.txt @@ -432,6 +432,9 @@ Note: All fields default to false unless mentioned otherwise. light_strength = ; // Light strenght for Inverse-square falloff lights. Default = 0.0 (auto) + light_noshadowmap = ; // Disable shadows for light + light_dontlightactors = ; // Don't light actors + light_dontlightmap = ; // Don't light map geometry friendlyseeblocks = ; // How far (in block units) a friendly monster can see other monsters. Default 10 diff --git a/src/doomdata.h b/src/doomdata.h index 8ef88effa..a9f118a73 100644 --- a/src/doomdata.h +++ b/src/doomdata.h @@ -385,6 +385,9 @@ struct FMapThing FName arg0str; double SoftShadowRadius; double LightStrength; + bool LightNoShadowMap; + bool LightDontLightActors; + bool LightDontLightMap; }; diff --git a/src/maploader/udmf.cpp b/src/maploader/udmf.cpp index 84ac00981..15f6227ca 100644 --- a/src/maploader/udmf.cpp +++ b/src/maploader/udmf.cpp @@ -800,6 +800,18 @@ public: th->LightStrength = CheckFloat(key); break; + case NAME_light_noshadowmap: + th->LightNoShadowMap = CheckBool(key); + break; + + case NAME_light_dontlightactors: + th->LightDontLightActors = CheckBool(key); + break; + + case NAME_light_dontlightmap: + th->LightDontLightMap = CheckBool(key); + break; + case NAME_lm_suncolor: CHECK_N(Zd | Zdt) if (CheckInt(key) < 0 || CheckInt(key) > 0xFFFFFF) diff --git a/src/namedef_custom.h b/src/namedef_custom.h index 363c62add..a9af0a077 100644 --- a/src/namedef_custom.h +++ b/src/namedef_custom.h @@ -872,6 +872,9 @@ xx(lm_suncolor) // Light keywords xx(light_softshadowradius) xx(light_strength) +xx(light_noshadowmap) +xx(light_dontlightactors) +xx(light_dontlightmap) xx(skew_bottom_type) xx(skew_middle_type) diff --git a/src/playsim/p_mobj.cpp b/src/playsim/p_mobj.cpp index eca50a742..a6bee6c84 100644 --- a/src/playsim/p_mobj.cpp +++ b/src/playsim/p_mobj.cpp @@ -6218,6 +6218,21 @@ AActor *FLevelLocals::SpawnMapThing (FMapThing *mthing, int position) { mobj->FloatVar(NAME_LightStrength) = mthing->LightStrength; } + + if (mthing->LightNoShadowMap) + { + mobj->IntVar(NAME_lightflags) |= LF_NOSHADOWMAP; + } + + if (mthing->LightDontLightActors) + { + mobj->IntVar(NAME_lightflags) |= LF_DONTLIGHTACTORS; + } + + if (mthing->LightDontLightMap) + { + mobj->IntVar(NAME_lightflags) |= LF_DONTLIGHTMAP; + } } mobj->CallBeginPlay ();