aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/ALu.c
diff options
context:
space:
mode:
authorChris Robinson <chris.kcat@gmail.com>2008-01-15 21:23:14 -0800
committerChris Robinson <chris.kcat@gmail.com>2008-01-15 21:23:14 -0800
commitabc69dd3d044fb5370b0a9afee05c3f2b9e79c21 (patch)
tree4eddf62618a2cc6dc88cb0d30987cdb9a64a78eb /Alc/ALu.c
parentbf87aed459a2546bcc8762dd8a849485690ffd89 (diff)
Use acosf when available
Diffstat (limited to 'Alc/ALu.c')
-rw-r--r--Alc/ALu.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/Alc/ALu.c b/Alc/ALu.c
index 3e9387bb..22f3ad12 100644
--- a/Alc/ALu.c
+++ b/Alc/ALu.c
@@ -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);