From a241cd4ac163e5e4f62f103b7717921826fbaeeb Mon Sep 17 00:00:00 2001 From: Alug Date: Wed, 27 Aug 2025 10:11:16 +0200 Subject: [PATCH] make paletterender lightlevel shift less ambigous that macro was from the older approach, but is uneeded now this better shows whats going on here --- src/hardware/hw_main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hardware/hw_main.cpp b/src/hardware/hw_main.cpp index 0534cd2fd..1b54251ea 100644 --- a/src/hardware/hw_main.cpp +++ b/src/hardware/hw_main.cpp @@ -66,7 +66,6 @@ // ========================================================================== #define ABS(x) ((x) < 0 ? -(x) : (x)) -#define SOFTLIGHT(llevel) HWR_ShouldUsePaletteRendering() ? ((llevel) >> LIGHTSEGSHIFT) << LIGHTSEGSHIFT : (llevel) // false if shaders have not been initialized yet, or if shaders are not available boolean gl_shadersavailable = false; @@ -417,7 +416,8 @@ void HWR_Lighting(FSurfaceInfo *Surface, INT32 light_level, extracolormap_t *col fade_color.rgba = (colormap != NULL) ? (UINT32)colormap->fadergba : GL_DEFAULTFOG; // Shift the lightlevel for Palette rendering mode to replicate software´s limited 32 lightlevels - light_level = SOFTLIGHT(light_level); + if (HWR_ShouldUsePaletteRendering()) + light_level = (light_level >> LIGHTSEGSHIFT) << LIGHTSEGSHIFT; // Clamp the light level, since it can sometimes go out of the 0-255 range from animations light_level = CLAMP(light_level, cv_secbright.value, 255);