Fix tints with negative shades in r_usenewshading 4.

Patch from Fox.

git-svn-id: https://svn.eduke32.com/eduke32@6561 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
hendricks266 2017-12-12 05:14:12 +00:00
parent 583dc0f47a
commit 4c095c954d

View file

@ -81,9 +81,7 @@ static inline float getshadefactor(int32_t const shade)
return 1.f; return 1.f;
if (r_usenewshading == 4) if (r_usenewshading == 4)
{ return max(min(1.f - (shade * shadescale / frealmaxshade), 1.f), 0.f);
return 1.f - (shade * shadescale / frealmaxshade);
}
float const shadebound = (float)((shadescale_unbounded || shade>=numshades) ? numshades : numshades-1); float const shadebound = (float)((shadescale_unbounded || shade>=numshades) ? numshades : numshades-1);
float const scaled_shade = (float)shade*shadescale; float const scaled_shade = (float)shade*shadescale;