diff options
author | Chris Robinson <[email protected]> | 2008-01-15 21:23:14 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2008-01-15 21:23:14 -0800 |
commit | abc69dd3d044fb5370b0a9afee05c3f2b9e79c21 (patch) | |
tree | 4eddf62618a2cc6dc88cb0d30987cdb9a64a78eb /Alc/ALu.c | |
parent | bf87aed459a2546bcc8762dd8a849485690ffd89 (diff) |
Use acosf when available
Diffstat (limited to 'Alc/ALu.c')
-rw-r--r-- | Alc/ALu.c | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -49,6 +49,12 @@ typedef long long ALint64; #define aluSqrt(x) ((ALfloat)sqrt((double)(x))) #endif +#ifdef HAVE_ACOSF +#define aluAcos(x) ((ALfloat)acosf((float)(x))) +#else +#define aluAcos(x) ((ALfloat)acos((double)(x))) +#endif + // fixes for mingw32. #if defined(max) && !defined(__max) #define __max max @@ -390,7 +396,8 @@ static ALvoid CalcSourceParams(ALCcontext *ALContext, ALsource *ALSource, SourceToListener[2] = -Position[2]; aluNormalize(Direction); aluNormalize(SourceToListener); - Angle = (ALfloat)(180.0*acos(aluDotproduct(Direction,SourceToListener))/3.141592654f); + Angle = aluAcos(aluDotproduct(Direction,SourceToListener)) * 180.0f / + 3.141592654f; if(Angle >= InnerAngle && Angle <= OuterAngle) { ALfloat scale = (Angle-InnerAngle) / (OuterAngle-InnerAngle); |