From c3c9025b27e2a03f1641e5e9ea66dd38258f0ab6 Mon Sep 17 00:00:00 2001 From: Sally Coolatta Date: Wed, 10 Feb 2021 17:20:16 -0500 Subject: [PATCH] Minor cleanup --- src/r_data.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/r_data.c b/src/r_data.c index fafc60006..38f2b51ff 100644 --- a/src/r_data.c +++ b/src/r_data.c @@ -690,8 +690,8 @@ lighttable_t *R_CreateLightTable(extracolormap_t *extra_colormap) // Initialise the map and delta arrays // map[i] stores an RGB color (as double) for index i, // which is then converted to SRB2's palette later - // deltas[i] stores a corresponding fade delta between the RGB color and the final fade color; - // map[i]'s values are decremented by after each use + // brightChange[i] is the value added/subtracted every step for the fade; + // map[i]'s values are in/decremented by it after each use for (i = 0; i < 256; i++) { r = pMasterPalette[i].s.red; @@ -723,6 +723,7 @@ lighttable_t *R_CreateLightTable(extracolormap_t *extra_colormap) cbest = max(r, max(g, b)); } + // Add/subtract this value during fading. brightChange[i] = abs(cbest - cdestbright) / (double)fadedist; } @@ -753,7 +754,6 @@ lighttable_t *R_CreateLightTable(extracolormap_t *extra_colormap) else map[i][0] += brightChange[i]; - if (abs(map[i][1] - cdestg) <= brightChange[i]) map[i][1] = cdestg; else if (map[i][1] > cdestg)