diff options
| author | Max Roncace <me@caseif.net> | 2026-01-11 22:25:26 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-01-11 19:25:26 -0800 |
| commit | 6a59c5231fb6807c05532267927c023f6475bed9 (patch) | |
| tree | 78e9a40a15679ccab8de4d3b8d1e870e37f3891a /src/JSystem/JMath/JMATrigonometric.cpp | |
| parent | 47daf0b4ed411be7ee63661bc3c64cff321c8edf (diff) | |
Fix errors when building with -ipa program (#3035)
Diffstat (limited to 'src/JSystem/JMath/JMATrigonometric.cpp')
| -rw-r--r-- | src/JSystem/JMath/JMATrigonometric.cpp | 67 |
1 files changed, 1 insertions, 66 deletions
diff --git a/src/JSystem/JMath/JMATrigonometric.cpp b/src/JSystem/JMath/JMATrigonometric.cpp index 530602b8cd..2fc14cb13e 100644 --- a/src/JSystem/JMath/JMATrigonometric.cpp +++ b/src/JSystem/JMath/JMATrigonometric.cpp @@ -1,7 +1,6 @@ #include "JSystem/JSystem.h" // IWYU pragma: keep -// don't include header until this "zero" mess is figured out -// #include "JSystem/JMath/JMATrigonometric.h" +#include "JSystem/JMath/JMATrigonometric.h" #include <math> #include "global.h" @@ -9,78 +8,14 @@ static f32 dummy() { return 0.0f; } -namespace std { -template <typename A1, typename B1> -struct pair { - A1 a1; - B1 b1; - pair() { - a1 = A1(); - b1 = B1(); - } -}; -} // namespace std - namespace JMath { template<typename T> struct TAngleConstant_; -template<> -struct TAngleConstant_<f32> { - static f32 RADIAN_DEG180() { return M_PI;} - static f32 RADIAN_DEG360() { return M_PI * 2; } -}; - -template<int N, typename T> -struct TSinCosTable { - std::pair<T, T> table[1 << N]; - TSinCosTable() { - init(); - } - void init() { - for (int i = 0; i < 1 << N; i++) { - table[i].a1 = sin((i * f64(TAngleConstant_<f32>::RADIAN_DEG360())) / (1 << N)); - table[i].b1 = cos((i * f64(TAngleConstant_<f32>::RADIAN_DEG360())) / (1 << N)); - } - } -}; - inline f64 getConst2() { return 9.765625E-4; } -template<int N, typename T> -struct TAtanTable { - T table[N + 1]; - u8 pad[0x1C]; - TAtanTable() { - init(); - } - void init() { - for (int i = 0; i < u32(N); i++) { - table[i] = atan(getConst2() * i); - } - table[0] = 0.0f; - table[N] = TAngleConstant_<f32>::RADIAN_DEG180() * 0.25f; // 0.25 * PI - } -}; - -template<int N, typename T> -struct TAsinAcosTable { - T table[N + 1]; - u8 pad[0x1C]; - TAsinAcosTable() { - init(); - } - void init() { - for (int i = 0; i < N; i++) { - table[i] = asin(getConst2() * i); - } - table[0] = 0.0f; - table[N] = TAngleConstant_<f32>::RADIAN_DEG180() * 0.25f; // 0.25 * PI - } -}; - TSinCosTable<13, f32> sincosTable_ ATTRIBUTE_ALIGN(32); TAtanTable<1024, f32> atanTable_ ATTRIBUTE_ALIGN(32); |
