From d310d0e252ef9b86eb16d3925444218fff05e7f7 Mon Sep 17 00:00:00 2001 From: William Reading Date: Fri, 4 Jul 2003 18:03:20 +0000 Subject: [PATCH] Fix darwin math problems --- stepmania/autogen.sh | 8 ++++---- stepmania/src/ArrowEffects.cpp | 2 +- stepmania/src/GrooveRadar.cpp | 2 +- stepmania/src/LifeMeterBar.cpp | 1 + stepmania/src/MusicWheel.cpp | 1 + stepmania/src/NoteField.cpp | 1 + stepmania/src/RageMath.h | 33 +++++++++++++++++++++++++++++++++ stepmania/src/RageUtil.cpp | 2 +- stepmania/src/global.h | 2 +- 9 files changed, 44 insertions(+), 8 deletions(-) diff --git a/stepmania/autogen.sh b/stepmania/autogen.sh index c4b9295fdc..3d2f7ababc 100755 --- a/stepmania/autogen.sh +++ b/stepmania/autogen.sh @@ -15,13 +15,13 @@ PKG_NAME="stepmania" # Actually, there's a chance we'll work with later versions, too, but it's # not worth bending over backward to try to detect it right now. -ACLOCAL=aclocal-1.7 -AUTOHEADER=autoheader -AUTOMAKE=automake-1.7 +ACLOCAL=/sw/bin/aclocal-1.7 +AUTOHEADER=/sw/bin/autoheader +AUTOMAKE=/sw/bin/automake-1.7 ACLOCAL_OPTIONS="-I autoconf/m4/" AUTOMAKE_OPTIONS=-a -AUTOCONF=autoconf +AUTOCONF=/sw/bin/autoconf (test -f $srcdir/configure.ac \ && test -d $srcdir/src) || { diff --git a/stepmania/src/ArrowEffects.cpp b/stepmania/src/ArrowEffects.cpp index 617768034f..61abbe5d53 100644 --- a/stepmania/src/ArrowEffects.cpp +++ b/stepmania/src/ArrowEffects.cpp @@ -20,7 +20,7 @@ #include "NoteDisplay.h" #include "song.h" #include - +#include "RageMath.h" float g_fExpandSeconds = 0; diff --git a/stepmania/src/GrooveRadar.cpp b/stepmania/src/GrooveRadar.cpp index 81dcef7dbe..655b3aaf80 100644 --- a/stepmania/src/GrooveRadar.cpp +++ b/stepmania/src/GrooveRadar.cpp @@ -18,7 +18,7 @@ #include "ThemeManager.h" #include "Notes.h" #include "RageDisplay.h" - +#include "RageMath.h" #include diff --git a/stepmania/src/LifeMeterBar.cpp b/stepmania/src/LifeMeterBar.cpp index fbc68a356d..74b8e1ee8a 100644 --- a/stepmania/src/LifeMeterBar.cpp +++ b/stepmania/src/LifeMeterBar.cpp @@ -16,6 +16,7 @@ #include "RageTimer.h" #include "GameState.h" #include +#include "RageMath.h" #include "ThemeManager.h" diff --git a/stepmania/src/MusicWheel.cpp b/stepmania/src/MusicWheel.cpp index 1eb2465251..f21ad4ec3e 100644 --- a/stepmania/src/MusicWheel.cpp +++ b/stepmania/src/MusicWheel.cpp @@ -22,6 +22,7 @@ #include "RageLog.h" #include "GameConstantsAndTypes.h" #include "GameState.h" +#include "RageMath.h" #include #include "ThemeManager.h" #include "song.h" diff --git a/stepmania/src/NoteField.cpp b/stepmania/src/NoteField.cpp index 34ded3be3c..137e0e1fae 100644 --- a/stepmania/src/NoteField.cpp +++ b/stepmania/src/NoteField.cpp @@ -21,6 +21,7 @@ #include "RageException.h" #include "RageTimer.h" #include "RageLog.h" +#include "RageMath.h" #include #include "ThemeManager.h" #include "NoteFieldPositioning.h" diff --git a/stepmania/src/RageMath.h b/stepmania/src/RageMath.h index abd8c22119..8108e376f5 100644 --- a/stepmania/src/RageMath.h +++ b/stepmania/src/RageMath.h @@ -46,3 +46,36 @@ RageMatrix RageLookAt( float upx, float upy, float upz ); #endif + +// Fix for platforms that don't have these in math.h +#ifndef HAVE_POWF +#define powf(x,y) (float)pow((float)(x), (float)(y)) +#endif + +#ifndef HAVE_SQRTF +#define sqrtf(x) (float)sqrt((float)(x)) +#endif + +#ifndef HAVE_COSF +#define cosf(x) (float)cos((float)(x)) +#endif + +#ifndef HAVE_SINF +#define sinf(x) (float)sin((float)(x)) +#endif + +#ifndef HAVE_TANF +#define tanf(x) (float)tan((float)(x)) +#endif + +#ifndef HAVE_ACOSF +#define acosf(x) (float)acosh((float)(x)) +#endif + +#ifndef HAVE_ASINF +#define asinf(x) (float)acosh((float)(x)) +#endif + +#ifndef HAVE_ATANF +#define atanf(x) (float)atanh((float)(x)) +#endif \ No newline at end of file diff --git a/stepmania/src/RageUtil.cpp b/stepmania/src/RageUtil.cpp index 750cd0c2fb..c789316f63 100644 --- a/stepmania/src/RageUtil.cpp +++ b/stepmania/src/RageUtil.cpp @@ -9,7 +9,7 @@ Chris Danford ----------------------------------------------------------------------------- */ - +#include "RageMath.h" #include "RageUtil.h" #include "RageUtil_FileDB.h" #include "RageTimer.h" diff --git a/stepmania/src/global.h b/stepmania/src/global.h index edfe23890c..c31205d522 100644 --- a/stepmania/src/global.h +++ b/stepmania/src/global.h @@ -14,7 +14,7 @@ #define STDAFX_H #ifdef HAVE_CONFIG_H -#include +//#include #endif #if _MSC_VER >= 1000