From e0562a44e534b2dc7bd3fb2d537dd44c5b45d3e2 Mon Sep 17 00:00:00 2001 From: James R Date: Fri, 11 Aug 2023 01:42:48 -0700 Subject: [PATCH] Add MSF_DIRECTIONLIGHTING, forces directional lighting on, even indoors UDMF flag: forcedirectionallighting --- src/deh_tables.c | 1 + src/p_setup.c | 8 ++++++++ src/r_defs.h | 2 ++ 3 files changed, 11 insertions(+) diff --git a/src/deh_tables.c b/src/deh_tables.c index a7a0ada1e..9e69a9599 100644 --- a/src/deh_tables.c +++ b/src/deh_tables.c @@ -6040,6 +6040,7 @@ const char *const MSF_LIST[] = { "RIPPLE_CEILING", "INVERTENCORE", "FLATLIGHTING", + "DIRECTIONLIGHTING", NULL }; diff --git a/src/p_setup.c b/src/p_setup.c index 8f7111e0c..cf233ee2d 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -1708,6 +1708,8 @@ static void ParseTextmapSectorParameter(UINT32 i, const char *param, const char sectors[i].flags |= MSF_INVERTENCORE; else if (fastcmp(param, "flatlighting") && fastcmp("true", val)) sectors[i].flags |= MSF_FLATLIGHTING; + else if (fastcmp(param, "forcedirectionallighting") && fastcmp("true", val)) + sectors[i].flags |= MSF_DIRECTIONLIGHTING; else if (fastcmp(param, "nostepup") && fastcmp("true", val)) sectors[i].specialflags |= SSF_NOSTEPUP; else if (fastcmp(param, "doublestepup") && fastcmp("true", val)) @@ -3485,6 +3487,12 @@ void P_UpdateSegLightOffset(seg_t *li) boolean P_SectorUsesDirectionalLighting(const sector_t *sector) { + // explicitly turned on + if (sector->flags & MSF_DIRECTIONLIGHTING) + { + return true; + } + // explicitly turned off if (sector->flags & MSF_FLATLIGHTING) { diff --git a/src/r_defs.h b/src/r_defs.h index a33162ac6..26d0aaaaf 100644 --- a/src/r_defs.h +++ b/src/r_defs.h @@ -352,6 +352,8 @@ typedef enum MSF_INVERTENCORE = 1<<12, // turn off directional lighting MSF_FLATLIGHTING = 1<<13, + // force it on (even if it was disabled) + MSF_DIRECTIONLIGHTING = 1<<14, } sectorflags_t; typedef enum