Module: wine Branch: master Commit: aa344fc88d2fa3c39647e68be113dcb6c0ac43dc URL: http://source.winehq.org/git/wine.git/?a=commit;h=aa344fc88d2fa3c39647e68be1...
Author: Rico Schüller kgbricola@web.de Date: Fri Sep 28 08:43:14 2012 +0200
d3dx9: Use float function in D3DXFresnelTerm().
---
dlls/d3dx9_36/math.c | 9 +++++---- 1 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/dlls/d3dx9_36/math.c b/dlls/d3dx9_36/math.c index 24303d2..a3aa07e 100644 --- a/dlls/d3dx9_36/math.c +++ b/dlls/d3dx9_36/math.c @@ -81,13 +81,14 @@ FLOAT WINAPI D3DXFresnelTerm(FLOAT costheta, FLOAT refractionindex) { FLOAT a, d, g, result;
- TRACE("(%f, %f)\n", costheta, refractionindex); + TRACE("costheta %f, refractionindex %f)\n", costheta, refractionindex);
- g = sqrt(refractionindex * refractionindex + costheta * costheta - 1.0f); + g = sqrtf(refractionindex * refractionindex + costheta * costheta - 1.0f); a = g + costheta; d = g - costheta; - result = ( costheta * a - 1.0f ) * ( costheta * a - 1.0f ) / ( ( costheta * d + 1.0f ) * ( costheta * d + 1.0f ) ) + 1.0f; - result = result * 0.5f * d * d / ( a * a ); + result = (costheta * a - 1.0f) * (costheta * a - 1.0f) / ((costheta * d + 1.0f) * (costheta * d + 1.0f)) + 1.0f; + result *= 0.5f * d * d / (a * a); + return result; }