Skip to content

Commit

Permalink
fix status bar chain shading
Browse files Browse the repository at this point in the history
  • Loading branch information
fabiangreffrath committed Nov 27, 2023
1 parent f7ad2c1 commit 07b42b3
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions src/heretic/sb_bar.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
#include "s_sound.h"
#include "v_video.h"
#include "am_map.h"
#ifdef CRISPY_TRUECOLOR
#include "v_trans.h" // [crispy] I_BlendDark()
#endif

// Types

Expand Down Expand Up @@ -434,26 +437,33 @@ static void DrSmallNumber(int val, int x, int y)

static void ShadeLine(int x, int y, int height, int shade)
{
pixel_t *dest;
#ifndef CRISPY_TRUECOLOR
byte *dest;
byte *shades;
#endif

x <<= crispy->hires;
y <<= crispy->hires;
height <<= crispy->hires;

#ifndef CRISPY_TRUECOLOR
shades = colormaps + 9 * 256 + shade * 2 * 256;
#else
shade = 0xFF - (((9 + shade * 2) << 8) / NUMCOLORMAPS);
#endif
dest = I_VideoBuffer + y * SCREENWIDTH + x + (WIDESCREENDELTA << crispy->hires);
while (height--)
{
if (crispy->hires)
#ifndef CRISPY_TRUECOLOR
*(dest + 1) = *(shades + *dest);
*(dest) = *(shades + *dest);
dest += SCREENWIDTH;
}
#else
// [JN] TODO - chain shading
*(dest + 1) = I_BlendDark(*dest, shade);
*(dest) = I_BlendDark(*dest, shade);
#endif
dest += SCREENWIDTH;
}
}

//---------------------------------------------------------------------------
Expand Down

0 comments on commit 07b42b3

Please sign in to comment.