@@ -14,7 +14,7 @@ liblol_a_SOURCES = \ | |||||
\ | \ | ||||
lol/unit.h lol/debug.h \ | lol/unit.h lol/debug.h \ | ||||
lol/math/vector.h lol/math/half.h lol/math/real.h lol/math/remez.h \ | lol/math/vector.h lol/math/half.h lol/math/real.h lol/math/remez.h \ | ||||
lol/math/trig.h \ | |||||
lol/math/math.h \ | |||||
\ | \ | ||||
generated/location.hh generated/position.hh generated/stack.hh \ | generated/location.hh generated/position.hh generated/stack.hh \ | ||||
\ | \ | ||||
@@ -12,8 +12,6 @@ | |||||
# include "config.h" | # include "config.h" | ||||
#endif | #endif | ||||
#include <cmath> | |||||
#if defined USE_SDL_MIXER | #if defined USE_SDL_MIXER | ||||
# include <SDL.h> | # include <SDL.h> | ||||
# include <SDL_mixer.h> | # include <SDL_mixer.h> | ||||
@@ -68,10 +68,10 @@ static inline int isnan(float f) | |||||
// Base types | // Base types | ||||
#include "lol/debug.h" | #include "lol/debug.h" | ||||
#include "lol/math/math.h" | |||||
#include "lol/math/half.h" | #include "lol/math/half.h" | ||||
#include "lol/math/real.h" | #include "lol/math/real.h" | ||||
#include "lol/math/vector.h" | #include "lol/math/vector.h" | ||||
#include "lol/math/trig.h" | |||||
#include "numeric.h" | #include "numeric.h" | ||||
#include "timer.h" | #include "timer.h" | ||||
#include "thread/thread.h" | #include "thread/thread.h" | ||||
@@ -20,7 +20,6 @@ | |||||
# include <windows.h> | # include <windows.h> | ||||
#endif | #endif | ||||
#include <cmath> | |||||
#include <cstdio> | #include <cstdio> | ||||
#include <cstring> | #include <cstring> | ||||
@@ -20,8 +20,6 @@ | |||||
# include <windows.h> | # include <windows.h> | ||||
#endif | #endif | ||||
#include <cmath> | |||||
#include "core.h" | #include "core.h" | ||||
#include "lolgl.h" | #include "lolgl.h" | ||||
#include "loldebug.h" | #include "loldebug.h" | ||||
@@ -12,8 +12,6 @@ | |||||
# include "config.h" | # include "config.h" | ||||
#endif | #endif | ||||
#include <cmath> | |||||
#include "core.h" | #include "core.h" | ||||
namespace lol | namespace lol | ||||
@@ -12,7 +12,6 @@ | |||||
# include "config.h" | # include "config.h" | ||||
#endif | #endif | ||||
#include <cmath> | |||||
#include <cstring> | #include <cstring> | ||||
#include <cstdio> | #include <cstdio> | ||||
@@ -12,8 +12,6 @@ | |||||
# include "config.h" | # include "config.h" | ||||
#endif | #endif | ||||
#include <cmath> | |||||
#include "core.h" | #include "core.h" | ||||
#include "lolgl.h" | #include "lolgl.h" | ||||
@@ -14,8 +14,6 @@ | |||||
#if defined __ANDROID__ | #if defined __ANDROID__ | ||||
#include <cmath> | |||||
#include <jni.h> | #include <jni.h> | ||||
#include <android/log.h> | #include <android/log.h> | ||||
@@ -12,8 +12,6 @@ | |||||
# include "config.h" | # include "config.h" | ||||
#endif | #endif | ||||
#include <cmath> | |||||
#include "core.h" | #include "core.h" | ||||
#include "../../image/image-private.h" | #include "../../image/image-private.h" | ||||
@@ -14,8 +14,6 @@ | |||||
#if defined USE_GDIPLUS | #if defined USE_GDIPLUS | ||||
#include <cmath> | |||||
#include <algorithm> | #include <algorithm> | ||||
using namespace std; | using namespace std; | ||||
@@ -14,7 +14,6 @@ | |||||
#if defined __APPLE__ && defined __MACH__ && defined __arm__ | #if defined __APPLE__ && defined __MACH__ && defined __arm__ | ||||
#include <cmath> | |||||
#import <UIKit/UIKit.h> | #import <UIKit/UIKit.h> | ||||
#include "core.h" | #include "core.h" | ||||
@@ -14,8 +14,6 @@ | |||||
#if defined __CELLOS_LV2__ | #if defined __CELLOS_LV2__ | ||||
#include <cmath> | |||||
#include <cell/sysmodule.h> | #include <cell/sysmodule.h> | ||||
#include <cell/codec/pngdec.h> | #include <cell/codec/pngdec.h> | ||||
@@ -14,8 +14,6 @@ | |||||
#if defined USE_SDL_IMAGE | #if defined USE_SDL_IMAGE | ||||
#include <cmath> | |||||
#include <SDL.h> | #include <SDL.h> | ||||
#include <SDL_image.h> | #include <SDL_image.h> | ||||
@@ -12,8 +12,6 @@ | |||||
# include "config.h" | # include "config.h" | ||||
#endif | #endif | ||||
#include <cmath> | |||||
#include "core.h" | #include "core.h" | ||||
#include "image-private.h" | #include "image-private.h" | ||||
@@ -13,7 +13,6 @@ | |||||
#endif | #endif | ||||
#include <cstdlib> | #include <cstdlib> | ||||
#include <cmath> | |||||
#if defined USE_SDL | #if defined USE_SDL | ||||
# include <SDL.h> | # include <SDL.h> | ||||
@@ -13,7 +13,6 @@ | |||||
#endif | #endif | ||||
#include <cstdlib> | #include <cstdlib> | ||||
#include <cmath> | |||||
#include "core.h" | #include "core.h" | ||||
@@ -12,7 +12,6 @@ | |||||
# include "config.h" | # include "config.h" | ||||
#endif | #endif | ||||
#include <cmath> | |||||
#include <cstdio> | #include <cstdio> | ||||
#if defined __ANDROID__ | #if defined __ANDROID__ | ||||
@@ -9,13 +9,14 @@ | |||||
// | // | ||||
// | // | ||||
// Trigonometry functions | |||||
// ---------------------- | |||||
// Various maths functions | |||||
// ----------------------- | |||||
// | // | ||||
#if !defined __LOL_MATH_TRIG_H__ | |||||
#define __LOL_MATH_TRIG_H__ | |||||
#if !defined __LOL_MATH_MATH_H__ | |||||
#define __LOL_MATH_MATH_H__ | |||||
#include <cmath> | |||||
#include <cstdio> | #include <cstdio> | ||||
#include <stdint.h> | #include <stdint.h> | ||||
@@ -23,16 +24,19 @@ namespace lol | |||||
{ | { | ||||
/* Standard cmath functions */ | /* Standard cmath functions */ | ||||
static inline double sqrt(double const &x) { return std::sqrt(x); } | |||||
static inline float sqrt(float const &x) { return std::sqrt(x); } | |||||
static inline double sin(double const &x) { return std::sin(x); } | static inline double sin(double const &x) { return std::sin(x); } | ||||
static inline double cos(double const &x) { return std::cos(x); } | static inline double cos(double const &x) { return std::cos(x); } | ||||
static inline double tan(double const &x) { return std::tan(x); } | static inline double tan(double const &x) { return std::tan(x); } | ||||
static inline double asin(double const &x) { return std::asin(x); } | |||||
static inline double acos(double const &x) { return std::acos(x); } | |||||
static inline double atan(double const &x) { return std::atan(x); } | |||||
static inline float sin(float const &x) { return std::sin(x); } | static inline float sin(float const &x) { return std::sin(x); } | ||||
static inline float cos(float const &x) { return std::cos(x); } | static inline float cos(float const &x) { return std::cos(x); } | ||||
static inline float tan(float const &x) { return std::tan(x); } | static inline float tan(float const &x) { return std::tan(x); } | ||||
static inline double asin(double const &x) { return std::asin(x); } | |||||
static inline double acos(double const &x) { return std::acos(x); } | |||||
static inline double atan(double const &x) { return std::atan(x); } | |||||
static inline float asin(float const &x) { return std::asin(x); } | static inline float asin(float const &x) { return std::asin(x); } | ||||
static inline float acos(float const &x) { return std::acos(x); } | static inline float acos(float const &x) { return std::acos(x); } | ||||
static inline float atan(float const &x) { return std::atan(x); } | static inline float atan(float const &x) { return std::atan(x); } | ||||
@@ -73,5 +77,5 @@ double lol_atan2(double, double); | |||||
} /* namespace lol */ | } /* namespace lol */ | ||||
#endif // __LOL_MATH_TRIG_H__ | |||||
#endif // __LOL_MATH_MATH_H__ | |||||
@@ -17,10 +17,10 @@ | |||||
#define __LOL_MATH_VECTOR_H__ | #define __LOL_MATH_VECTOR_H__ | ||||
#include <stdint.h> | #include <stdint.h> | ||||
#include <cmath> | |||||
#include <ostream> | #include <ostream> | ||||
#include <algorithm> | #include <algorithm> | ||||
#include "lol/math/math.h" | |||||
#include "lol/math/half.h" | #include "lol/math/half.h" | ||||
#include "lol/math/real.h" | #include "lol/math/real.h" | ||||
@@ -1198,7 +1198,6 @@ static inline Quat<T> operator /(Quat<T> x, Quat<T> const &y) | |||||
tprefix \ | tprefix \ | ||||
inline double length(tname<type> const &a) \ | inline double length(tname<type> const &a) \ | ||||
{ \ | { \ | ||||
using std::sqrt; \ | |||||
return sqrt((double)sqlength(a)); \ | return sqrt((double)sqlength(a)); \ | ||||
} \ | } \ | ||||
\ | \ | ||||
@@ -20,7 +20,6 @@ | |||||
#include <iomanip> | #include <iomanip> | ||||
#include <sstream> | #include <sstream> | ||||
#include <cstdio> | #include <cstdio> | ||||
#include <cmath> | |||||
namespace lol | namespace lol | ||||
{ | { | ||||
@@ -15,7 +15,6 @@ | |||||
#include <cstdio> | #include <cstdio> | ||||
#include <cstring> | #include <cstring> | ||||
#include <cstdlib> | #include <cstdlib> | ||||
#include <cmath> | |||||
#include <ctype.h> | #include <ctype.h> | ||||
#include "core.h" | #include "core.h" | ||||
@@ -29,7 +29,6 @@ | |||||
#include <cstring> | #include <cstring> | ||||
#include <cstdio> | #include <cstdio> | ||||
#include <cstdlib> | #include <cstdlib> | ||||
#include <cmath> | |||||
#include "core.h" | #include "core.h" | ||||
@@ -16,8 +16,6 @@ | |||||
# include <fastmath.h> | # include <fastmath.h> | ||||
#endif | #endif | ||||
#include <cmath> | |||||
#include "core.h" | #include "core.h" | ||||
using namespace std; | using namespace std; | ||||
@@ -25,7 +25,6 @@ | |||||
# undef far /* Fuck Microsoft again */ | # undef far /* Fuck Microsoft again */ | ||||
#endif | #endif | ||||
#include <cmath> /* for M_PI */ | |||||
#include <cstdlib> /* free() */ | #include <cstdlib> /* free() */ | ||||
#include <cstring> /* strdup() */ | #include <cstring> /* strdup() */ | ||||
@@ -16,7 +16,6 @@ | |||||
#if !defined __LOL_NUMERIC_H__ | #if !defined __LOL_NUMERIC_H__ | ||||
#define __LOL_NUMERIC_H__ | #define __LOL_NUMERIC_H__ | ||||
#include <cmath> | |||||
#include <cstdlib> | #include <cstdlib> | ||||
#include <stdint.h> | #include <stdint.h> | ||||
@@ -12,8 +12,6 @@ | |||||
# include "config.h" | # include "config.h" | ||||
#endif | #endif | ||||
#include <cmath> | |||||
#include "core.h" | #include "core.h" | ||||
namespace lol | namespace lol | ||||
@@ -14,7 +14,6 @@ | |||||
#include <cstdlib> | #include <cstdlib> | ||||
#include <cstdio> | #include <cstdio> | ||||
#include <cmath> | |||||
#include <cstring> | #include <cstring> | ||||
#if defined USE_SDL_MIXER | #if defined USE_SDL_MIXER | ||||
@@ -13,7 +13,6 @@ | |||||
#endif | #endif | ||||
#include <cstdlib> | #include <cstdlib> | ||||
#include <cmath> | |||||
#ifdef WIN32 | #ifdef WIN32 | ||||
# define WIN32_LEAN_AND_MEAN | # define WIN32_LEAN_AND_MEAN | ||||
@@ -14,7 +14,6 @@ | |||||
#include <cstdlib> | #include <cstdlib> | ||||
#include <cstdio> | #include <cstdio> | ||||
#include <cmath> | |||||
#include <cstring> | #include <cstring> | ||||
#if defined WIN32 && !defined _XBOX | #if defined WIN32 && !defined _XBOX | ||||
@@ -12,8 +12,6 @@ | |||||
# include "config.h" | # include "config.h" | ||||
#endif | #endif | ||||
#include <cmath> | |||||
#if defined _XBOX | #if defined _XBOX | ||||
# include <xtl.h> | # include <xtl.h> | ||||
# undef near /* Fuck Microsoft */ | # undef near /* Fuck Microsoft */ | ||||
@@ -13,7 +13,6 @@ | |||||
#endif | #endif | ||||
#include <cstring> | #include <cstring> | ||||
#include <cmath> | |||||
#include "core.h" | #include "core.h" | ||||
#include "lolgl.h" | #include "lolgl.h" | ||||
@@ -116,9 +115,9 @@ public: | |||||
{ | { | ||||
double f = (double)i / PALETTE_STEP; | double f = (double)i / PALETTE_STEP; | ||||
double r = 0.5 * sin(f * 0.27 + 2.0) + 0.5; | |||||
double g = 0.5 * sin(f * 0.17 - 1.8) + 0.5; | |||||
double b = 0.5 * sin(f * 0.21 - 2.6) + 0.5; | |||||
double r = 0.5 * lol::sin(f * 0.27 + 2.0) + 0.5; | |||||
double g = 0.5 * lol::sin(f * 0.17 - 1.8) + 0.5; | |||||
double b = 0.5 * lol::sin(f * 0.21 - 2.6) + 0.5; | |||||
if (f < 7.0) | if (f < 7.0) | ||||
{ | { | ||||
@@ -37,7 +37,7 @@ public: | |||||
for(int i = 0; i < 2000; i++) { | for(int i = 0; i < 2000; i++) { | ||||
float x = (i - 1000.0) / 100.0; | float x = (i - 1000.0) / 100.0; | ||||
graph[i].x = x; | graph[i].x = x; | ||||
graph[i].y = sin(x * 10.0) / (1.0 + x * x); | |||||
graph[i].y = lol::sin(x * 10.0) / (1.0 + x * x); | |||||
} | } | ||||
} | } | ||||
@@ -172,9 +172,9 @@ | |||||
<ClInclude Include="..\src\lolgl.h" /> | <ClInclude Include="..\src\lolgl.h" /> | ||||
<ClInclude Include="..\src\lol\debug.h" /> | <ClInclude Include="..\src\lol\debug.h" /> | ||||
<ClInclude Include="..\src\lol\math\half.h" /> | <ClInclude Include="..\src\lol\math\half.h" /> | ||||
<ClInclude Include="..\src\lol\math\math.h" /> | |||||
<ClInclude Include="..\src\lol\math\real.h" /> | <ClInclude Include="..\src\lol\math\real.h" /> | ||||
<ClInclude Include="..\src\lol\math\remez.h" /> | <ClInclude Include="..\src\lol\math\remez.h" /> | ||||
<ClInclude Include="..\src\lol\math\trig.h" /> | |||||
<ClInclude Include="..\src\lol\math\vector.h" /> | <ClInclude Include="..\src\lol\math\vector.h" /> | ||||
<ClInclude Include="..\src\lol\unit.h" /> | <ClInclude Include="..\src\lol\unit.h" /> | ||||
<ClInclude Include="..\src\map.h" /> | <ClInclude Include="..\src\map.h" /> | ||||
@@ -264,13 +264,13 @@ | |||||
<ClInclude Include="..\src\lol\math\half.h"> | <ClInclude Include="..\src\lol\math\half.h"> | ||||
<Filter>src\lol\math</Filter> | <Filter>src\lol\math</Filter> | ||||
</ClInclude> | </ClInclude> | ||||
<ClInclude Include="..\src\lol\math\real.h"> | |||||
<ClInclude Include="..\src\lol\math\math.h"> | |||||
<Filter>src\lol\math</Filter> | <Filter>src\lol\math</Filter> | ||||
</ClInclude> | </ClInclude> | ||||
<ClInclude Include="..\src\lol\math\remez.h"> | |||||
<ClInclude Include="..\src\lol\math\real.h"> | |||||
<Filter>src\lol\math</Filter> | <Filter>src\lol\math</Filter> | ||||
</ClInclude> | </ClInclude> | ||||
<ClInclude Include="..\src\lol\math\trig.h"> | |||||
<ClInclude Include="..\src\lol\math\remez.h"> | |||||
<Filter>src\lol\math</Filter> | <Filter>src\lol\math</Filter> | ||||
</ClInclude> | </ClInclude> | ||||
<ClInclude Include="..\src\lol\math\vector.h"> | <ClInclude Include="..\src\lol\math\vector.h"> | ||||