Browse Source

Make non-gcc compilers happy...

vrld 12 years ago
parent
commit
1a407a6af3

+ 1 - 1
src/modules/graphics/opengl/ParticleSystem.cpp

@@ -21,7 +21,7 @@
 #include "ParticleSystem.h"
 
 #include "common/math.h"
-#include "modules/math/Math.h"
+#include "modules/math/MathModule.h"
 
 #include "OpenGL.h"
 #include <cmath>

+ 5 - 5
src/modules/math/Math.cpp → src/modules/math/MathModule.cpp

@@ -18,7 +18,7 @@
  * 3. This notice may not be removed or altered from any source distribution.
  **/
 
-#include "modules/math/Math.h"
+#include "modules/math/MathModule.h"
 #include "common/math.h"
 
 #include <cmath>
@@ -90,11 +90,11 @@ Math::Math()
 	// i mean
 	union
 	{
-		uint64_t b64;
+		uint64 b64;
 		struct
 		{
-			uint32_t a;
-			uint32_t b;
+			uint32 a;
+			uint32 b;
 		} b32;
 	} converter;
 
@@ -111,7 +111,7 @@ Math::Math()
 	retain();
 }
 
-uint32_t Math::rand()
+uint64 Math::rand()
 {
 	rng_state ^= (rng_state << 13);
 	rng_state ^= (rng_state >> 7);

+ 5 - 4
src/modules/math/Math.h → src/modules/math/MathModule.h

@@ -24,6 +24,7 @@
 // LOVE
 #include "common/Module.h"
 #include "common/math.h"
+#include "common/int.h"
 
 // STL
 #include <limits>
@@ -54,9 +55,9 @@ public:
 
 	/** Return uniformly distributed pseudo random integer.
 	 *
-	 * @returns Pseudo random integer in [0,2^32).
+	 * @returns Pseudo random integer in [0,2^64).
 	 */
-	uint32_t rand();
+	uint64 rand();
 
 	/** Get uniformly distributed pseudo random number in [0,1).
 	 *
@@ -64,7 +65,7 @@ public:
 	 */
 	inline double random()
 	{
-		return double(rand()) / (double(std::numeric_limits<uint32_t>::max()) + 1.0);
+		return double(rand()) / (double(std::numeric_limits<uint64>::max()) + 1.0);
 	}
 
 	/** Get uniformly distributed pseudo random number in [0,max).
@@ -108,7 +109,7 @@ public:
 private:
 	Math();
 
-	uint64_t rng_state;
+	uint64 rng_state;
 	double last_randnormal;
 };
 

+ 1 - 1
src/modules/math/wrap_Math.cpp

@@ -19,7 +19,7 @@
  **/
 
 #include "wrap_Math.h"
-#include "modules/math/Math.h"
+#include "modules/math/MathModule.h"
 
 #include <cmath>
 #include <iostream>