diff options
author | Philipp Sehmisch <mana@crushnet.org> | 2011-06-18 20:16:47 +0200 |
---|---|---|
committer | Philipp Sehmisch <mana@crushnet.org> | 2011-06-18 20:16:47 +0200 |
commit | 98a6003999eb198d9b953c11cca43aad181788c9 (patch) | |
tree | 0892bdfbf23989a1355d36a928b2a5c03a69dd65 | |
parent | faf0a45d6b8b85acd2836cf5e8e7f7c5b161931d (diff) | |
download | mana-98a6003999eb198d9b953c11cca43aad181788c9.tar.gz mana-98a6003999eb198d9b953c11cca43aad181788c9.tar.bz2 mana-98a6003999eb198d9b953c11cca43aad181788c9.tar.xz mana-98a6003999eb198d9b953c11cca43aad181788c9.zip |
Fixed compilation problems on windows caused by the switch to C++0x.
The M_PI constant from <cmath> is not standard anymore, so I replaced it
with an own PI constant.
WIN32 isn't defined anymore which caused the enet UNIX header to be
included, so I had to define it in the project compilation settings.
Reviewed-by: Thorbjorn
-rw-r--r-- | mana.cbp | 41 | ||||
-rw-r--r-- | src/particleemitterprop.h | 4 |
2 files changed, 33 insertions, 12 deletions
@@ -14,14 +14,15 @@ <Option compiler="gcc" /> <Option projectResourceIncludeDirsRelation="0" /> <Compiler> - <Add option="-g" /> <Add option="-O3" /> + <Add option="-std=c++0x" /> <Add option="-Wall" /> + <Add option="-g" /> <Add option="-Wno-switch" /> <Add option="-Wno-unknown-pragmas" /> <Add option="-DUSE_OPENGL" /> <Add option="-DENABLE_NLS" /> - <Add option="-std=c++0x" /> + <Add option="-DWIN32" /> </Compiler> <Linker> <Add option="-enable-auto-import" /> @@ -62,24 +63,42 @@ <Linker> <Add directory="lib" /> </Linker> + <Unit filename="libs\enet\callbacks.c"> + <Option compilerVar="CC" /> + </Unit> + <Unit filename="libs\enet\compress.c"> + <Option compilerVar="CC" /> + </Unit> + <Unit filename="libs\enet\host.c"> + <Option compilerVar="CC" /> + </Unit> <Unit filename="libs\enet\include\enet\callbacks.h" /> - <Unit filename="libs\enet\callbacks.c" /> - <Unit filename="libs\enet\compress.c" /> <Unit filename="libs\enet\include\enet\enet.h" /> - <Unit filename="libs\enet\host.c" /> <Unit filename="libs\enet\include\enet\list.h" /> - <Unit filename="libs\enet\list.c" /> - <Unit filename="libs\enet\packet.c" /> - <Unit filename="libs\enet\peer.c" /> <Unit filename="libs\enet\include\enet\protocol.h" /> - <Unit filename="libs\enet\protocol.c" /> <Unit filename="libs\enet\include\enet\time.h" /> <Unit filename="libs\enet\include\enet\types.h" /> <Unit filename="libs\enet\include\enet\unix.h" /> - <Unit filename="libs\enet\unix.c" /> <Unit filename="libs\enet\include\enet\utility.h" /> <Unit filename="libs\enet\include\enet\win32.h" /> - <Unit filename="libs\enet\win32.c" /> + <Unit filename="libs\enet\list.c"> + <Option compilerVar="CC" /> + </Unit> + <Unit filename="libs\enet\packet.c"> + <Option compilerVar="CC" /> + </Unit> + <Unit filename="libs\enet\peer.c"> + <Option compilerVar="CC" /> + </Unit> + <Unit filename="libs\enet\protocol.c"> + <Option compilerVar="CC" /> + </Unit> + <Unit filename="libs\enet\unix.c"> + <Option compilerVar="CC" /> + </Unit> + <Unit filename="libs\enet\win32.c"> + <Option compilerVar="CC" /> + </Unit> <Unit filename="src\SDLMain.h" /> <Unit filename="src\SDLMain.m" /> <Unit filename="src\actor.cpp" /> diff --git a/src/particleemitterprop.h b/src/particleemitterprop.h index c73d044c..b1268e8d 100644 --- a/src/particleemitterprop.h +++ b/src/particleemitterprop.h @@ -21,6 +21,8 @@ #include <cmath> +static const double PI = 3.14159265; + enum ChangeFunc { @@ -64,7 +66,7 @@ template <typename T> struct ParticleEmitterProp switch (changeFunc) { case FUNC_SINE: - val += (T) std::sin(M_PI * 2 * ((double)(tick%changePeriod) / (double)changePeriod)) * changeAmplitude; + val += (T) std::sin(PI * 2 * ((double)(tick%changePeriod) / (double)changePeriod)) * changeAmplitude; break; case FUNC_SAW: val += (T) (changeAmplitude * ((double)(tick%changePeriod) / (double)changePeriod)) * 2 - changeAmplitude; |