Skip to content

Commit

Permalink
R_InitColormaps: make pal/channel arrays static
Browse files Browse the repository at this point in the history
Co-Authored-By: pvictress <[email protected]>
  • Loading branch information
JNechaevsky and pvictress committed Nov 16, 2024
1 parent ff04a93 commit 951b6fb
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 22 deletions.
16 changes: 8 additions & 8 deletions src/doom/r_data.c
Original file line number Diff line number Diff line change
Expand Up @@ -1174,8 +1174,8 @@ void R_InitColormaps (void)
{
const byte k = colormap[i];
// [PN] Apply intensity and saturation corrections
byte pal[3];
byte channels[3];
static byte pal[3];
static byte channels[3];

CALC_INTENSITY(pal, playpal, k);
CALC_SATURATION(channels, pal, a_hi, a_lo);
Expand Down Expand Up @@ -1210,8 +1210,8 @@ void R_InitColormaps (void)
// but barely will be notable, since no light levels are used.

// [PN] Apply intensity and saturation corrections
byte pal[3];
byte channels[3];
static byte pal[3];
static byte channels[3];

CALC_INTENSITY(pal, playpal, colormap[32 * 256 + i]);
CALC_SATURATION(channels, pal, a_hi, a_lo);
Expand All @@ -1231,8 +1231,8 @@ void R_InitColormaps (void)
for (i = 0; i < 256; i++)
{
// [PN] Apply intensity and saturation corrections
byte pal[3];
byte channels[3];
static byte pal[3];
static byte channels[3];

CALC_INTENSITY(pal, playpal, colormap[c * 256 + i]);
CALC_SATURATION(channels, pal, a_hi, a_lo);
Expand All @@ -1256,8 +1256,8 @@ void R_InitColormaps (void)
for (i = 0, j = 0; i < 256; i++)
{
// [PN] Apply intensity and saturation corrections
byte pal[3];
byte channels[3];
static byte pal[3];
static byte channels[3];

CALC_INTENSITY(pal, playpal, i);
CALC_SATURATION(channels, pal, a_hi, a_lo);
Expand Down
16 changes: 8 additions & 8 deletions src/heretic/r_data.c
Original file line number Diff line number Diff line change
Expand Up @@ -826,8 +826,8 @@ void R_InitColormaps(void)
const byte k = colormap[i];

// [PN] Apply intensity and saturation corrections
byte pal[3];
byte channels[3];
static byte pal[3];
static byte channels[3];

CALC_INTENSITY(pal, playpal, k);
CALC_SATURATION(channels, pal, a_hi, a_lo);
Expand All @@ -847,8 +847,8 @@ void R_InitColormaps(void)
for (i = 0; i < 256; i++)
{
// [PN] Apply intensity and saturation corrections
byte pal[3];
byte channels[3];
static byte pal[3];
static byte channels[3];

CALC_INTENSITY(pal, playpal, colormap[c * 256 + i]);
CALC_SATURATION(channels, pal, a_hi, a_lo);
Expand All @@ -866,8 +866,8 @@ void R_InitColormaps(void)
for (i = 0; i < 256; i++)
{
// [PN] Apply intensity and saturation corrections
byte pal[3];
byte channels[3];
static byte pal[3];
static byte channels[3];

CALC_INTENSITY(pal, playpal, colormap[32 * 256 + i]);
CALC_SATURATION(channels, pal, a_hi, a_lo);
Expand All @@ -889,8 +889,8 @@ void R_InitColormaps(void)
for (i = 0, j = 0; i < 256; i++)
{
// [PN] Apply intensity and saturation corrections
byte pal[3];
byte channels[3];
static byte pal[3];
static byte channels[3];

CALC_INTENSITY(pal, playpal, i);
CALC_SATURATION(channels, pal, a_hi, a_lo);
Expand Down
12 changes: 6 additions & 6 deletions src/hexen/r_data.c
Original file line number Diff line number Diff line change
Expand Up @@ -741,8 +741,8 @@ void R_InitTrueColormaps(char *current_colormap)
const byte k = colormap[i];

// [PN] Apply intensity and saturation corrections
byte pal[3];
byte channels[3];
static byte pal[3];
static byte channels[3];

CALC_INTENSITY(pal, playpal, k);
CALC_SATURATION(channels, pal, a_hi, a_lo);
Expand All @@ -762,8 +762,8 @@ void R_InitTrueColormaps(char *current_colormap)
for (i = 0; i < 256; i++)
{
// [PN] Apply intensity and saturation corrections
byte pal[3];
byte channels[3];
static byte pal[3];
static byte channels[3];

CALC_INTENSITY(pal, playpal, colormap[c * 256 + i]);
CALC_SATURATION(channels, pal, a_hi, a_lo);
Expand All @@ -787,8 +787,8 @@ void R_InitTrueColormaps(char *current_colormap)
for (i = 0, j = 0; i < 256; i++)
{
// [PN] Apply intensity and saturation corrections
byte pal[3];
byte channels[3];
static byte pal[3];
static byte channels[3];

CALC_INTENSITY(pal, playpal, i);
CALC_SATURATION(channels, pal, a_hi, a_lo);
Expand Down

0 comments on commit 951b6fb

Please sign in to comment.