Skip to content

Commit

Permalink
Do not check if gamma levels was generated previously
Browse files Browse the repository at this point in the history
  • Loading branch information
JNechaevsky committed Dec 11, 2023
1 parent 5e6d006 commit c51afc8
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 14 deletions.
7 changes: 4 additions & 3 deletions src/doom/r_data.c
Original file line number Diff line number Diff line change
Expand Up @@ -1173,9 +1173,6 @@ void R_InitColormaps (void)
int c, i, j = 0;
byte r, g, b;

// [crispy] intermediate gamma levels
I_SetGammaTable();

playpal = W_CacheLumpName("PLAYPAL", PU_STATIC);

if (!colormaps)
Expand Down Expand Up @@ -1298,6 +1295,10 @@ void R_InitData (void)
printf (".");
R_InitSpriteLumps ();
printf (".");
#ifdef CRISPY_TRUECOLOR
// [crispy] Initialize and generate gamma-correction levels for true color render.
I_SetGammaTable ();
#endif
R_InitColormaps ();
#ifndef CRISPY_TRUECOLOR
R_InitTranMap(); // [crispy] prints a mark itself
Expand Down
7 changes: 4 additions & 3 deletions src/heretic/r_data.c
Original file line number Diff line number Diff line change
Expand Up @@ -535,9 +535,6 @@ void R_InitColormaps(void)
int c, i, j = 0;
byte r, g, b;

// [crispy] intermediate gamma levels
I_SetGammaTable();

playpal = W_CacheLumpName("PLAYPAL", PU_STATIC);

if (!colormaps)
Expand Down Expand Up @@ -665,6 +662,10 @@ void R_InitData(void)
R_InitSpriteLumps();
IncThermo();
printf (".");
#ifdef CRISPY_TRUECOLOR
// [crispy] Initialize and generate gamma-correction levels for true color render.
I_SetGammaTable();
#endif
R_InitColormaps();
}

Expand Down
12 changes: 4 additions & 8 deletions src/i_video.c
Original file line number Diff line number Diff line change
Expand Up @@ -986,14 +986,6 @@ void I_SetGammaTable (void)
void I_SetPalette (byte *doompalette)
{
int i;
static boolean gamma2table_set = false;

// [crispy] intermediate gamma levels
if (!gamma2table_set)
{
I_SetGammaTable();
gamma2table_set = true;
}

for (i=0; i<256; ++i)
{
Expand Down Expand Up @@ -1756,6 +1748,10 @@ void I_InitGraphics(void)

SDL_FillRect(screenbuffer, NULL, 0);

// [crispy] Initialize and generate gamma-correction levels for palletted render.

I_SetGammaTable();

// Set the palette

doompal = W_CacheLumpName(DEH_String("PLAYPAL"), PU_CACHE);
Expand Down

0 comments on commit c51afc8

Please sign in to comment.