- fixed: application of fake contrast should never result in a light level of 0 unless the sector's own light level is 0.

This commit is contained in:
Christoph Oelckers 2019-01-19 10:29:28 +01:00
parent 476a140c5c
commit a4ea9c23b3

View file

@ -86,7 +86,7 @@ int hw_CalcLightLevel(int lightlevel, int rellight, bool weapon, int blendfactor
{ {
int light; int light;
if (lightlevel == 0) return 0; if (lightlevel <= 0) return 0;
bool darklightmode = (level.isDarkLightMode()) || (level.isSoftwareLighting() && blendfactor > 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; light=lightlevel+rellight;
} }
return clamp(light, 0, 255); // Fake contrast should never turn a positive value into 0.
return clamp(light, 1, 255);
} }
//========================================================================== //==========================================================================