Fix r_usenewshading 3 visibility/fog for shades >= Numshades-1 (usually 31).

BUILD_LUNATIC.

git-svn-id: https://svn.eduke32.com/eduke32@4452 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
helixhorned 2014-04-19 22:42:23 +00:00
parent b4a050b0cf
commit 8d9282bc24

View file

@ -560,8 +560,16 @@ static inline void fogcalc(int32_t tile, int32_t shade, int32_t vis, int32_t pal
return;
}
fogresult = (r_usenewshading == 3 && shade > 0) ? 0 : -(FOGDISTCONST * shade)/combvis;
fogresult2 = (FOGDISTCONST * (numshades-1-shade))/combvis;
if (r_usenewshading == 3 && shade >= numshades-1)
{
fogresult = -1;
fogresult2 = 0;
}
else
{
fogresult = (r_usenewshading == 3 && shade > 0) ? 0 : -(FOGDISTCONST * shade)/combvis;
fogresult2 = (FOGDISTCONST * (numshades-1-shade))/combvis;
}
}
}