Skip to content

Commit

Permalink
Doom/Heretic: A11y Flickering - Correct Lightlevel in case of competi…
Browse files Browse the repository at this point in the history
…ng Strobe Thinkers (#1253)

* Heretic: a11y Flickering - aligning restoring maxlight from saves with Doom.

* 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).

* 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.
  • Loading branch information
Noseey authored Jan 3, 2025
1 parent ccdea7c commit 793aaab
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 15 deletions.
8 changes: 0 additions & 8 deletions src/doom/p_lights.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}


Expand Down Expand Up @@ -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;
}


Expand Down Expand Up @@ -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;
}


Expand Down Expand Up @@ -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;
}


Expand Down
3 changes: 2 additions & 1 deletion src/doom/p_saveg.c
Original file line number Diff line number Diff line change
Expand Up @@ -1343,7 +1343,8 @@ 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) // [crispy] Ensure maxlight among competing thinkers.
str->sector->rlightlevel = str->maxlight;
}

Expand Down
6 changes: 0 additions & 6 deletions src/heretic/p_lights.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}


Expand Down Expand Up @@ -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;
}

//==================================================================
Expand Down Expand Up @@ -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)
Expand Down
11 changes: 11 additions & 0 deletions src/heretic/p_saveg.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include "m_misc.h"
#include "p_local.h"
#include "v_video.h"
#include "a11y.h"

static FILE *SaveGameFP;

Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -1474,6 +1478,10 @@ static void saveg_read_strobe_t(strobe_t *str)

// int brighttime;
str->brighttime = SV_ReadLong();

if (!a11y_sector_lighting &&
str->sector->rlightlevel < str->maxlight) // [crispy] Ensure maxlight among competing thinkers.
str->sector->rlightlevel = str->maxlight;
}

static void saveg_write_strobe_t(strobe_t *str)
Expand Down Expand Up @@ -1524,6 +1532,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)
Expand Down

0 comments on commit 793aaab

Please sign in to comment.