From a36e85d9b70800ee1f5594ba0af5e15ac80bfd43 Mon Sep 17 00:00:00 2001 From: Sandu Liviu Catalin Date: Wed, 18 Aug 2021 21:55:01 +0300 Subject: [PATCH] Update Circle.cpp --- module/Base/Circle.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/module/Base/Circle.cpp b/module/Base/Circle.cpp index 802b1478..258f9fa0 100644 --- a/module/Base/Circle.cpp +++ b/module/Base/Circle.cpp @@ -476,16 +476,16 @@ Array Circle::ToPointsArray(SQInteger num_segments) const if (i >= num_segments) return false; // Get the current angle #ifdef SQUSEDOUBLE - SQFloat theta = 2.0d * SQMOD_PI64 * static_cast< SQFloat >(i) / static_cast< SQFloat >(num_segments); + SQFloat theta = 2.0 * SQMOD_PI64 * static_cast< SQFloat >(i) / static_cast< SQFloat >(num_segments); #else SQFloat theta = 2.0f * SQMOD_PI * static_cast< SQFloat >(i) / static_cast< SQFloat >(num_segments); #endif // SQUSEDOUBLE // Calculate the x component - SQFloat x = (rad * cosf(theta)) + pos.x; + SQFloat x = (rad * SQMOD_DOUBLE_OR(cos, cosf)(theta)) + pos.x; // Calculate the y component - SQFloat y = (rad * sinf(theta)) + pos.y; + SQFloat y = (rad * SQMOD_DOUBLE_OR(sin, sinf)(theta)) + pos.y; // Push the Vector2 instance on the stack - Var< Vector2 >::push(vm, Vector2{x, y}); + Var< Vector2 >::push(vm, Vector2{static_cast< Vector2::Value >(x), static_cast< Vector2::Value >(y)}); // Insert the element on the stack into the array return true; }, num_segments);