From 81f78d4ddf2bee6164dd9cb90657d0666688603d Mon Sep 17 00:00:00 2001 From: Colin Snover Date: Sat, 4 Nov 2017 20:10:54 -0500 Subject: BLADERUNNER: Remove use of C99 math C++ math functions are overloaded so operate using single-precision when receiving a float input. The C standard library on FreeMiNT does not fully support C99 math so use of sqrtf, sinf, etc. instead of the C++ API does not work. --- engines/sword25/math/region.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'engines/sword25') diff --git a/engines/sword25/math/region.cpp b/engines/sword25/math/region.cpp index cf422af774..788b584f4a 100644 --- a/engines/sword25/math/region.cpp +++ b/engines/sword25/math/region.cpp @@ -266,10 +266,10 @@ Vertex Region::findClosestPointOnLine(const Vertex &lineStart, const Vertex &lin float vector1Y = static_cast(point.y - lineStart.y); float vector2X = static_cast(lineEnd.x - lineStart.x); float vector2Y = static_cast(lineEnd.y - lineStart.y); - float vector2Length = sqrtf(vector2X * vector2X + vector2Y * vector2Y); + float vector2Length = sqrt(vector2X * vector2X + vector2Y * vector2Y); vector2X /= vector2Length; vector2Y /= vector2Length; - float distance = sqrtf(static_cast((lineStart.x - lineEnd.x) * (lineStart.x - lineEnd.x) + + float distance = sqrt(static_cast((lineStart.x - lineEnd.x) * (lineStart.x - lineEnd.x) + (lineStart.y - lineEnd.y) * (lineStart.y - lineEnd.y))); float dot = vector1X * vector2X + vector1Y * vector2Y; -- cgit v1.2.3