From b4e751de478ed8819b123cb9977fbdd1895acc96 Mon Sep 17 00:00:00 2001 From: NepDisk Date: Sat, 6 Dec 2025 13:04:13 -0500 Subject: [PATCH] =?UTF-8?q?Shift=20the=20lightlevel=20for=20Palette=20rend?= =?UTF-8?q?ering=20mode=20to=20replicate=20software=C2=B4s=20limited=2032?= =?UTF-8?q?=20lightlevels?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Thanks Alug for the suggestion --- src/hardware/hw_main.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/hardware/hw_main.c b/src/hardware/hw_main.c index 4c8db626f..64d546481 100644 --- a/src/hardware/hw_main.c +++ b/src/hardware/hw_main.c @@ -300,6 +300,10 @@ void HWR_Lighting(FSurfaceInfo *Surface, INT32 light_level, extracolormap_t *col poly_color.s.blue = (UINT8)blue; } + // Shift the lightlevel for Palette rendering mode to replicate software´s limited 32 lightlevels + 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 = min(max(light_level, cv_secbright.value), 255);