From 9a73a883df6209e37d3ffb81cb1a29e374694569 Mon Sep 17 00:00:00 2001 From: Kai Blaschke Date: Wed, 8 Nov 2023 00:14:27 +0100 Subject: [PATCH] Use our own Pi constant, as the Windows cmath header doesn't have the definition. --- src/libprojectM/Renderer/PresetTransition.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/libprojectM/Renderer/PresetTransition.cpp b/src/libprojectM/Renderer/PresetTransition.cpp index 141a90079..8fa903f3f 100644 --- a/src/libprojectM/Renderer/PresetTransition.cpp +++ b/src/libprojectM/Renderer/PresetTransition.cpp @@ -6,6 +6,8 @@ #include #include +constexpr double PI = 3.14159265358979323846; + PresetTransition::PresetTransition(const std::shared_ptr& transitionShader, double durationSeconds) : m_transitionShader(transitionShader) , m_durationSeconds(durationSeconds) @@ -59,7 +61,7 @@ void PresetTransition::Draw(const Preset& oldPreset, if (m_durationSeconds > 0.0) { linearProgress = secondsSinceStart / m_durationSeconds; - cosineProgress = (-std::cos(linearProgress * M_PI) + 1.0) * 0.5; + cosineProgress = (-std::cos(linearProgress * PI) + 1.0) * 0.5; bicubicProgress = linearProgress < 0.5 ? 4.0 * linearProgress * linearProgress * linearProgress : 1.0 - pow(-2.0 * linearProgress + 2.0, 3.0) / 2.0; }