Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doom/Heretic: A11y Flickering - Correct Lightlevel in case of competing Strobe Thinkers #1253

Merged
merged 4 commits into from
Jan 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading