From 107570e6288d266825724010a6f0149eaaac40db Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Wed, 21 Sep 2016 12:01:43 +0200 Subject: many: remove compat/pi-constant.hpp With -D_USE_MATH_DEFINES MSVC defines the standard M_PI and friends. Since this preprocessor definition is now always passed as part of the build system for MSVC. We can use M_PI as if on a mission. --- tracker-test/test.cpp | 7 +++---- tracker-test/test.h | 8 ++++---- 2 files changed, 7 insertions(+), 8 deletions(-) (limited to 'tracker-test') diff --git a/tracker-test/test.cpp b/tracker-test/test.cpp index 3e0db547..9ffdd366 100644 --- a/tracker-test/test.cpp +++ b/tracker-test/test.cpp @@ -56,17 +56,16 @@ void FTNoIR_Tracker::data(double *data) #endif for (int i = 0; i < 6; i++) { - double x = fmod(last_x[i] + incr[i] * d2r * dt, - 2 * pi); + double x = fmod(last_x[i] + incr[i] * d2r * dt, 2 * M_PI); last_x[i] = x; if (i >= 3) { #ifdef DISCONTINUITY if (x > pi + pi/2) - x -= pi; + x -= M_PI; else if (x > pi/2 && x < pi) - x += pi; + x += M_PI; #endif data[i] = sin(x) * 180; diff --git a/tracker-test/test.h b/tracker-test/test.h index 786d7705..acaee67d 100644 --- a/tracker-test/test.h +++ b/tracker-test/test.h @@ -2,7 +2,8 @@ #include "ui_test.h" #include "api/plugin-api.hpp" #include "compat/timer.hpp" -#include "compat/pi-constant.hpp" + +#include class FTNoIR_Tracker : public ITracker { @@ -13,9 +14,8 @@ public: void data(double *data) override; private: - static constexpr double pi = OPENTRACK_PI; - static constexpr double r2d = 180 / pi; - static constexpr double d2r = pi / 180; + static constexpr double r2d = 180 / M_PI; + static constexpr double d2r = M_PI / 180; static const double incr[6]; double last_x[6]; -- cgit v1.2.3