From a4ea9c23b3eedf5e333676cf64236cd5ba7e0b49 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 19 Jan 2019 10:29:28 +0100 Subject: [PATCH] - fixed: application of fake contrast should never result in a light level of 0 unless the sector's own light level is 0. --- src/hwrenderer/utility/hw_lighting.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/hwrenderer/utility/hw_lighting.cpp b/src/hwrenderer/utility/hw_lighting.cpp index 8d7298b9fd..69624dc10d 100644 --- a/src/hwrenderer/utility/hw_lighting.cpp +++ b/src/hwrenderer/utility/hw_lighting.cpp @@ -86,7 +86,7 @@ int hw_CalcLightLevel(int lightlevel, int rellight, bool weapon, int blendfactor { int light; - if (lightlevel == 0) return 0; + if (lightlevel <= 0) return 0; bool darklightmode = (level.isDarkLightMode()) || (level.isSoftwareLighting() && blendfactor > 0); @@ -115,7 +115,8 @@ int hw_CalcLightLevel(int lightlevel, int rellight, bool weapon, int blendfactor light=lightlevel+rellight; } - return clamp(light, 0, 255); + // Fake contrast should never turn a positive value into 0. + return clamp(light, 1, 255); } //==========================================================================