diff --git a/src/modules/math/Math.cpp b/src/modules/math/ModMath.cpp similarity index 94% rename from src/modules/math/Math.cpp rename to src/modules/math/ModMath.cpp index 5bbe05006..6e873d7d6 100644 --- a/src/modules/math/Math.cpp +++ b/src/modules/math/ModMath.cpp @@ -18,7 +18,7 @@ * 3. This notice may not be removed or altered from any source distribution. **/ -#include "Math.h" +#include "ModMath.h" #include "common/math.h" #include @@ -30,13 +30,13 @@ namespace math // 64 bit Xorshift implementation taken from the end of Sec. 3 (page 4) in // George Marsaglia, "Xorshift RNGs", Journal of Statistical Software, Vol.8 (Issue 14), 2003 -Math::Math() +ModMath::ModMath() { RNGState.seed = 0x0139408DCBBF7A44; RNGState.last_randnormal = std::numeric_limits::infinity(); } -uint32_t Math::rand() +uint32_t ModMath::rand() { uint64_t &x = RNGState.seed; x ^= (x << 13); @@ -46,7 +46,7 @@ uint32_t Math::rand() } // Box–Muller transform -double Math::randnormal(double stddev) +double ModMath::randnormal(double stddev) { if (RNGState.last_randnormal != std::numeric_limits::infinity()) { diff --git a/src/modules/math/Math.h b/src/modules/math/ModMath.h similarity index 94% rename from src/modules/math/Math.h rename to src/modules/math/ModMath.h index 97a0be6bf..f5486ccf0 100644 --- a/src/modules/math/Math.h +++ b/src/modules/math/ModMath.h @@ -18,8 +18,8 @@ * 3. This notice may not be removed or altered from any source distribution. **/ -#ifndef LOVE_MATH_MATH_H -#define LOVE_MATH_MATH_H +#ifndef LOVE_MATH_MODMATH_H +#define LOVE_MATH_MODMATH_H // LOVE #include "common/Module.h" @@ -33,11 +33,11 @@ namespace love namespace math { -class Math : public Module +class ModMath : public Module { public: - Math(); - virtual ~Math() {} + ModMath(); + virtual ~ModMath() {} /** Set pseudo random seed. * diff --git a/src/modules/math/wrap_Math.cpp b/src/modules/math/wrap_Math.cpp index 706ff208f..0959f2910 100644 --- a/src/modules/math/wrap_Math.cpp +++ b/src/modules/math/wrap_Math.cpp @@ -19,7 +19,7 @@ **/ #include "wrap_Math.h" -#include "Math.h" +#include "ModMath.h" #include #include @@ -40,7 +40,7 @@ namespace love namespace math { -static Math *instance = 0; +static ModMath *instance = 0; int w_randomseed(lua_State *L) { @@ -112,7 +112,7 @@ static const lua_CFunction types[] = extern "C" int luaopen_love_math(lua_State *L) { if (instance == 0) - instance = new love::math::Math(); + instance = new love::math::ModMath(); else instance->retain();