From 07b42b3bda87a0d3eff7b244a35916ff733ad8a7 Mon Sep 17 00:00:00 2001 From: Fabian Greffrath Date: Mon, 27 Nov 2023 17:37:21 +0100 Subject: [PATCH] fix status bar chain shading --- src/heretic/sb_bar.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/heretic/sb_bar.c b/src/heretic/sb_bar.c index f5f7161bf5..dee7b1be57 100644 --- a/src/heretic/sb_bar.c +++ b/src/heretic/sb_bar.c @@ -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 @@ -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; + } } //---------------------------------------------------------------------------