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);