diff options
author | Chris Robinson <[email protected]> | 2011-09-23 22:44:34 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2011-09-23 22:44:34 -0700 |
commit | da62f5052890054daa11603eb9bd2522cae8a3df (patch) | |
tree | b1cae1c1d141a05974aef7d7de971fc619e91b20 | |
parent | e84e38cc193be0678f98cf8b5deba1471c77e225 (diff) |
Check for asinf and use it
-rw-r--r-- | Alc/ALu.c | 2 | ||||
-rw-r--r-- | CMakeLists.txt | 3 | ||||
-rw-r--r-- | OpenAL32/Include/alu.h | 6 | ||||
-rw-r--r-- | config.h.in | 3 |
4 files changed, 12 insertions, 2 deletions
@@ -716,7 +716,7 @@ ALvoid CalcSourceParams(ALsource *ALSource, const ALCcontext *ALContext) // Calculate elevation and azimuth only when the source is not at // the listener. This prevents +0 and -0 Z from producing // inconsistent panning. - ev = asin(Position[1]); + ev = aluAsin(Position[1]); az = atan2(Position[0], -Position[2]*ZScale); } diff --git a/CMakeLists.txt b/CMakeLists.txt index 21e9189d..4909a985 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -228,12 +228,13 @@ CHECK_LIBRARY_EXISTS(m sqrtf "" HAVE_SQRTF) CHECK_LIBRARY_EXISTS(m cosf "" HAVE_COSF) CHECK_LIBRARY_EXISTS(m sinf "" HAVE_SINF) CHECK_LIBRARY_EXISTS(m acosf "" HAVE_ACOSF) +CHECK_LIBRARY_EXISTS(m asinf "" HAVE_ASINF) CHECK_LIBRARY_EXISTS(m atanf "" HAVE_ATANF) CHECK_LIBRARY_EXISTS(m fabsf "" HAVE_FABSF) IF(HAVE_FENV_H) CHECK_LIBRARY_EXISTS(m fesetround "" HAVE_FESETROUND) ENDIF() -IF(HAVE_SQRTF OR HAVE_COSF OR HAVE_SINF OR HAVE_ACOSF OR HAVE_ATANF OR HAVE_FABSF OR HAVE_FESETROUND) +IF(HAVE_SQRTF OR HAVE_COSF OR HAVE_SINF OR HAVE_ACOSF OR HAVE_ASINF OR HAVE_ATANF OR HAVE_FABSF OR HAVE_FESETROUND) SET(EXTRA_LIBS m ${EXTRA_LIBS}) ENDIF() CHECK_FUNCTION_EXISTS(strtof HAVE_STRTOF) diff --git a/OpenAL32/Include/alu.h b/OpenAL32/Include/alu.h index a62ca1c5..f041ffc5 100644 --- a/OpenAL32/Include/alu.h +++ b/OpenAL32/Include/alu.h @@ -52,6 +52,12 @@ #define aluAcos(x) ((ALfloat)acos((double)(x))) #endif +#ifdef HAVE_ASINF +#define aluAsin(x) (asinf((x))) +#else +#define aluAsin(x) ((ALfloat)asin((double)(x))) +#endif + #ifdef HAVE_ATANF #define aluAtan(x) (atanf((x))) #else diff --git a/config.h.in b/config.h.in index b6c945a5..645e4208 100644 --- a/config.h.in +++ b/config.h.in @@ -62,6 +62,9 @@ /* Define if we have the acosf function */ #cmakedefine HAVE_ACOSF +/* Define if we have the asinf function */ +#cmakedefine HAVE_ASINF + /* Define if we have the atanf function */ #cmakedefine HAVE_ATANF |