Merge pull request #216 from tkoeppe/abs

[renderergl2/tr_main.c] Use floating-point fabsf() for floating-point values
This commit is contained in:
Tim Angus 2016-09-13 10:34:48 +01:00 committed by GitHub
commit bd062f713a

View file

@ -2055,7 +2055,7 @@ void R_RenderPshadowMaps(const refdef_t *fd)
VectorScale(lightDir, -1.0f, shadow->lightViewAxis[0]); VectorScale(lightDir, -1.0f, shadow->lightViewAxis[0]);
VectorSet(up, 0, 0, -1); VectorSet(up, 0, 0, -1);
if ( abs(DotProduct(up, shadow->lightViewAxis[0])) > 0.9f ) if ( fabsf(DotProduct(up, shadow->lightViewAxis[0])) > 0.9f )
{ {
VectorSet(up, -1, 0, 0); VectorSet(up, -1, 0, 0);
} }
@ -2298,7 +2298,7 @@ void R_RenderSunShadowMaps(const refdef_t *fd, int level)
} }
// Check if too close to parallel to light direction // Check if too close to parallel to light direction
if (abs(DotProduct(lightViewAxis[2], lightViewAxis[0])) > 0.9f) if (fabsf(DotProduct(lightViewAxis[2], lightViewAxis[0])) > 0.9f)
{ {
if (level == 3 || lightViewIndependentOfCameraView) if (level == 3 || lightViewIndependentOfCameraView)
{ {