From b968433ddf16da6c1d8f36730d61992cba7a162e Mon Sep 17 00:00:00 2001 From: Noseey Date: Mon, 30 Dec 2024 14:05:19 +0100 Subject: [PATCH 1/3] Heretic: a11y Flickering - aligning restoring maxlight from saves with Doom. --- src/heretic/p_saveg.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/heretic/p_saveg.c b/src/heretic/p_saveg.c index 2dfb09120..ace77129a 100644 --- a/src/heretic/p_saveg.c +++ b/src/heretic/p_saveg.c @@ -24,6 +24,7 @@ #include "m_misc.h" #include "p_local.h" #include "v_video.h" +#include "a11y.h" static FILE *SaveGameFP; @@ -1418,6 +1419,9 @@ static void saveg_read_lightflash_t(lightflash_t *str) // int mintime; str->mintime = SV_ReadLong(); + + if (!a11y_sector_lighting) + str->sector->rlightlevel = str->maxlight; } static void saveg_write_lightflash_t(lightflash_t *str) @@ -1474,6 +1478,9 @@ static void saveg_read_strobe_t(strobe_t *str) // int brighttime; str->brighttime = SV_ReadLong(); + + if (!a11y_sector_lighting) + str->sector->rlightlevel = str->maxlight; } static void saveg_write_strobe_t(strobe_t *str) @@ -1524,6 +1531,9 @@ static void saveg_read_glow_t(glow_t *str) // int direction; str->direction = SV_ReadLong(); + + if (!a11y_sector_lighting) + str->sector->rlightlevel = str->maxlight; } static void saveg_write_glow_t(glow_t *str) From 44bbfb367fbd037324d651b6f8bf84ac3918ca57 Mon Sep 17 00:00:00 2001 From: Noseey Date: Mon, 30 Dec 2024 16:37:46 +0100 Subject: [PATCH 2/3] Doom/Heretic: Fix for competing Strobe-Thinkers and removing unrequired code. - Fixing flickering glitch when multiple strobe thinkers compete with the same sector-light. (see Heretic E1M6). - Removal of unrequired code in p_lights (reconstruction of maxlight in p_saveg). --- src/doom/p_extsaveg.c | 2 +- src/doom/p_lights.c | 8 -------- src/doom/p_saveg.c | 6 +++--- src/heretic/p_lights.c | 6 ------ src/heretic/p_saveg.c | 6 +++--- 5 files changed, 7 insertions(+), 21 deletions(-) diff --git a/src/doom/p_extsaveg.c b/src/doom/p_extsaveg.c index be5009778..b27eb5c4d 100644 --- a/src/doom/p_extsaveg.c +++ b/src/doom/p_extsaveg.c @@ -165,7 +165,7 @@ static void P_ReadFireFlicker (const char *key) flick->thinker.function.acp1 = (actionf_p1)T_FireFlicker; - if (!a11y_sector_lighting) + if (!a11y_sector_lighting && flick->sector->rlightlevel < flick->maxlight) flick->sector->rlightlevel = flick->maxlight; P_AddThinker(&flick->thinker); diff --git a/src/doom/p_lights.c b/src/doom/p_lights.c index ff50ac892..96ddacc8d 100644 --- a/src/doom/p_lights.c +++ b/src/doom/p_lights.c @@ -56,8 +56,6 @@ void T_FireFlicker (fireflicker_t* flick) // [crispy] A11Y if (a11y_sector_lighting) flick->sector->rlightlevel = flick->sector->lightlevel; - else - flick->sector->rlightlevel = flick->maxlight; } @@ -114,8 +112,6 @@ void T_LightFlash (lightflash_t* flash) // [crispy] A11Y if (a11y_sector_lighting) flash->sector->rlightlevel = flash->sector->lightlevel; - else - flash->sector->rlightlevel = flash->maxlight; } @@ -176,8 +172,6 @@ void T_StrobeFlash (strobe_t* flash) // [crispy] A11Y if (a11y_sector_lighting) flash->sector->rlightlevel = flash->sector->lightlevel; - else - flash->sector->rlightlevel = flash->maxlight; } @@ -353,8 +347,6 @@ void T_Glow(glow_t* g) // [crispy] A11Y if (a11y_sector_lighting) g->sector->rlightlevel = g->sector->lightlevel; - else - g->sector->rlightlevel = g->maxlight; } diff --git a/src/doom/p_saveg.c b/src/doom/p_saveg.c index d6813bde3..c09375e6a 100644 --- a/src/doom/p_saveg.c +++ b/src/doom/p_saveg.c @@ -1285,7 +1285,7 @@ static void saveg_read_lightflash_t(lightflash_t *str) // int mintime; str->mintime = saveg_read32(); - if (!a11y_sector_lighting) + if (!a11y_sector_lighting && str->sector->rlightlevel < str->maxlight) str->sector->rlightlevel = str->maxlight; } @@ -1343,7 +1343,7 @@ static void saveg_read_strobe_t(strobe_t *str) // int brighttime; str->brighttime = saveg_read32(); - if (!a11y_sector_lighting) + if (!a11y_sector_lighting && str->sector->rlightlevel < str->maxlight) str->sector->rlightlevel = str->maxlight; } @@ -1395,7 +1395,7 @@ static void saveg_read_glow_t(glow_t *str) // int direction; str->direction = saveg_read32(); - if (!a11y_sector_lighting) + if (!a11y_sector_lighting && str->sector->rlightlevel < str->maxlight) str->sector->rlightlevel = str->maxlight; } diff --git a/src/heretic/p_lights.c b/src/heretic/p_lights.c index 32dda406a..b89e9e7e0 100644 --- a/src/heretic/p_lights.c +++ b/src/heretic/p_lights.c @@ -56,8 +56,6 @@ void T_LightFlash(thinker_t *thinker) // [crispy] A11Y if (a11y_sector_lighting) flash->sector->rlightlevel = flash->sector->lightlevel; - else - flash->sector->rlightlevel = flash->maxlight; } @@ -120,8 +118,6 @@ void T_StrobeFlash(thinker_t *thinker) // [crispy] A11Y if (a11y_sector_lighting) flash->sector->rlightlevel = flash->sector->lightlevel; - else - flash->sector->rlightlevel = flash->maxlight; } //================================================================== @@ -281,8 +277,6 @@ void T_Glow(thinker_t *thinker) // [crispy] A11Y if (a11y_sector_lighting) g->sector->rlightlevel = g->sector->lightlevel; - else - g->sector->rlightlevel = g->maxlight; } void P_SpawnGlowingLight(sector_t * sector) diff --git a/src/heretic/p_saveg.c b/src/heretic/p_saveg.c index ace77129a..69fd95f86 100644 --- a/src/heretic/p_saveg.c +++ b/src/heretic/p_saveg.c @@ -1420,7 +1420,7 @@ static void saveg_read_lightflash_t(lightflash_t *str) // int mintime; str->mintime = SV_ReadLong(); - if (!a11y_sector_lighting) + if (!a11y_sector_lighting && str->sector->rlightlevel < str->maxlight) str->sector->rlightlevel = str->maxlight; } @@ -1479,7 +1479,7 @@ static void saveg_read_strobe_t(strobe_t *str) // int brighttime; str->brighttime = SV_ReadLong(); - if (!a11y_sector_lighting) + if (!a11y_sector_lighting && str->sector->rlightlevel < str->maxlight) str->sector->rlightlevel = str->maxlight; } @@ -1532,7 +1532,7 @@ static void saveg_read_glow_t(glow_t *str) // int direction; str->direction = SV_ReadLong(); - if (!a11y_sector_lighting) + if (!a11y_sector_lighting && str->sector->rlightlevel < str->maxlight) str->sector->rlightlevel = str->maxlight; } From afb7c686ad2f5c3454178164bc6b74a686de0bd8 Mon Sep 17 00:00:00 2001 From: Noseey Date: Tue, 31 Dec 2024 11:28:19 +0100 Subject: [PATCH 3/3] Doom/Heretic: Limit extra Condition for maxlight to strobeflash .. other flashers are only spawned on setup-level and thus refer to the same sector-lightlevel. --- src/doom/p_extsaveg.c | 2 +- src/doom/p_saveg.c | 7 ++++--- src/heretic/p_saveg.c | 7 ++++--- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/doom/p_extsaveg.c b/src/doom/p_extsaveg.c index b27eb5c4d..be5009778 100644 --- a/src/doom/p_extsaveg.c +++ b/src/doom/p_extsaveg.c @@ -165,7 +165,7 @@ static void P_ReadFireFlicker (const char *key) flick->thinker.function.acp1 = (actionf_p1)T_FireFlicker; - if (!a11y_sector_lighting && flick->sector->rlightlevel < flick->maxlight) + if (!a11y_sector_lighting) flick->sector->rlightlevel = flick->maxlight; P_AddThinker(&flick->thinker); diff --git a/src/doom/p_saveg.c b/src/doom/p_saveg.c index c09375e6a..6f775094e 100644 --- a/src/doom/p_saveg.c +++ b/src/doom/p_saveg.c @@ -1285,7 +1285,7 @@ static void saveg_read_lightflash_t(lightflash_t *str) // int mintime; str->mintime = saveg_read32(); - if (!a11y_sector_lighting && str->sector->rlightlevel < str->maxlight) + if (!a11y_sector_lighting) str->sector->rlightlevel = str->maxlight; } @@ -1343,7 +1343,8 @@ static void saveg_read_strobe_t(strobe_t *str) // int brighttime; str->brighttime = saveg_read32(); - if (!a11y_sector_lighting && str->sector->rlightlevel < str->maxlight) + if (!a11y_sector_lighting && + str->sector->rlightlevel < str->maxlight) // [crispy] Ensure maxlight among competing thinkers. str->sector->rlightlevel = str->maxlight; } @@ -1395,7 +1396,7 @@ static void saveg_read_glow_t(glow_t *str) // int direction; str->direction = saveg_read32(); - if (!a11y_sector_lighting && str->sector->rlightlevel < str->maxlight) + if (!a11y_sector_lighting) str->sector->rlightlevel = str->maxlight; } diff --git a/src/heretic/p_saveg.c b/src/heretic/p_saveg.c index 69fd95f86..a9615c7f6 100644 --- a/src/heretic/p_saveg.c +++ b/src/heretic/p_saveg.c @@ -1420,7 +1420,7 @@ static void saveg_read_lightflash_t(lightflash_t *str) // int mintime; str->mintime = SV_ReadLong(); - if (!a11y_sector_lighting && str->sector->rlightlevel < str->maxlight) + if (!a11y_sector_lighting) str->sector->rlightlevel = str->maxlight; } @@ -1479,7 +1479,8 @@ static void saveg_read_strobe_t(strobe_t *str) // int brighttime; str->brighttime = SV_ReadLong(); - if (!a11y_sector_lighting && str->sector->rlightlevel < str->maxlight) + if (!a11y_sector_lighting && + str->sector->rlightlevel < str->maxlight) // [crispy] Ensure maxlight among competing thinkers. str->sector->rlightlevel = str->maxlight; } @@ -1532,7 +1533,7 @@ static void saveg_read_glow_t(glow_t *str) // int direction; str->direction = SV_ReadLong(); - if (!a11y_sector_lighting && str->sector->rlightlevel < str->maxlight) + if (!a11y_sector_lighting) str->sector->rlightlevel = str->maxlight; }