aboutsummaryrefslogtreecommitdiff
path: root/engines/sword25/math
diff options
context:
space:
mode:
authorColin Snover2017-11-04 20:10:54 -0500
committerFilippos Karapetis2018-08-26 15:33:44 +0300
commit81f78d4ddf2bee6164dd9cb90657d0666688603d (patch)
treedc5cf1a6e3454941013a5140b2342e2404bd7def /engines/sword25/math
parent6af0c77b5a8fb9176870b287e0eb18c99c82c102 (diff)
downloadscummvm-rg350-81f78d4ddf2bee6164dd9cb90657d0666688603d.tar.gz
scummvm-rg350-81f78d4ddf2bee6164dd9cb90657d0666688603d.tar.bz2
scummvm-rg350-81f78d4ddf2bee6164dd9cb90657d0666688603d.zip
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.
Diffstat (limited to 'engines/sword25/math')
-rw-r--r--engines/sword25/math/region.cpp4
1 files changed, 2 insertions, 2 deletions
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<float>(point.y - lineStart.y);
float vector2X = static_cast<float>(lineEnd.x - lineStart.x);
float vector2Y = static_cast<float>(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<float>((lineStart.x - lineEnd.x) * (lineStart.x - lineEnd.x) +
+ float distance = sqrt(static_cast<float>((lineStart.x - lineEnd.x) * (lineStart.x - lineEnd.x) +
(lineStart.y - lineEnd.y) * (lineStart.y - lineEnd.y)));
float dot = vector1X * vector2X + vector1Y * vector2Y;