Minor cleanup

This commit is contained in:
Sally Coolatta 2021-02-10 17:20:16 -05:00
parent c95684198d
commit c3c9025b27

View file

@ -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)