- use symbolic constants for the light modes.

This commit is contained in:
Christoph Oelckers 2018-12-15 09:40:39 +01:00
commit 1187906a61
10 changed files with 62 additions and 34 deletions

View file

@ -127,7 +127,7 @@ void FRenderState::SetFog(int lightlevel, int rellight, bool fullbright, const F
}
else
{
if ((level.lightmode == 2 || (level.lightmode >= 8 && cmap->BlendFactor > 0)) && fogcolor == 0)
if ((level.lightmode == ELightMode::Doom || (level.isSoftwareLighting() && cmap->BlendFactor > 0)) && fogcolor == 0)
{
float light = (float)hw_CalcLightLevel(lightlevel, rellight, false, cmap->BlendFactor);
SetShaderLight(light, lightlevel);
@ -148,7 +148,7 @@ void FRenderState::SetFog(int lightlevel, int rellight, bool fullbright, const F
SetFog(fogcolor, fogdensity);
// Korshun: fullbright fog like in software renderer.
if (level.lightmode >= 8 && cmap->BlendFactor == 0 && level.brightfog && fogdensity != 0 && fogcolor != 0)
if (level.isSoftwareLighting() && cmap->BlendFactor == 0 && level.brightfog && fogdensity != 0 && fogcolor != 0)
{
SetSoftLightLevel(255);
}