dont recheck paletterendering state multiple times during opengl lighting calc

This commit is contained in:
Alug committed 2025-08-26 19:33:31 +02:00
1 parent 18bdbfdb07
commit fdba6a253a
1 file changed
+4 -1
+4 -1
View File
@@ -413,8 +413,11 @@ void HWR_Lighting(FSurfaceInfo *Surface, INT32 light_level, extracolormap_t *col
tint_color.rgba = (colormap != NULL) ? (UINT32)colormap->rgba : GL_DEFAULTMIX;
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);
// Clamp the light level, since it can sometimes go out of the 0-255 range from animations
light_level = CLAMP(SOFTLIGHT(light_level), cv_secbright.value, 255);
light_level = CLAMP(light_level, cv_secbright.value, 255);
// Crappy backup coloring if you can't do shaders
if (!HWR_UseShader())