mirror of
https://github.com/ZDoom/qzdoom.git
synced 2025-01-31 04:50:48 +00:00
- fixed light level calculation for low light levels.
This commit is contained in:
parent
78737f9bc7
commit
ad2993950a
1 changed files with 19 additions and 3 deletions
|
@ -196,14 +196,30 @@ int gl_CalcLightLevel(int lightlevel, int rellight, bool weapon)
|
||||||
|
|
||||||
if ((glset.lightmode & 2) && lightlevel < 192 && !weapon)
|
if ((glset.lightmode & 2) && lightlevel < 192 && !weapon)
|
||||||
{
|
{
|
||||||
light = xs_CRoundToInt(192.f - (192-lightlevel)* 1.95f);
|
if (lightlevel > 100)
|
||||||
|
{
|
||||||
|
light = xs_CRoundToInt(192.f - (192 - lightlevel)* 1.87f);
|
||||||
|
if (light + rellight < 20)
|
||||||
|
{
|
||||||
|
light = 20 + (light + rellight - 20) / 5;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
light += rellight;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
light = (lightlevel + rellight) / 5;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
light=lightlevel;
|
light=lightlevel+rellight;
|
||||||
}
|
}
|
||||||
|
|
||||||
return clamp(light+rellight, 0, 255);
|
return clamp(light, 0, 255);
|
||||||
}
|
}
|
||||||
|
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
|
|
Loading…
Reference in a new issue