diff options
author | Colin Snover | 2017-11-04 20:10:54 -0500 |
---|---|---|
committer | Filippos Karapetis | 2018-08-26 15:33:44 +0300 |
commit | 81f78d4ddf2bee6164dd9cb90657d0666688603d (patch) | |
tree | dc5cf1a6e3454941013a5140b2342e2404bd7def /engines/bladerunner/script | |
parent | 6af0c77b5a8fb9176870b287e0eb18c99c82c102 (diff) | |
download | scummvm-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/bladerunner/script')
-rw-r--r-- | engines/bladerunner/script/ai/leon.cpp | 2 | ||||
-rw-r--r-- | engines/bladerunner/script/ai/maggie.cpp | 2 | ||||
-rw-r--r-- | engines/bladerunner/script/script.cpp | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/engines/bladerunner/script/ai/leon.cpp b/engines/bladerunner/script/ai/leon.cpp index fdcb538f0a..1a421239ee 100644 --- a/engines/bladerunner/script/ai/leon.cpp +++ b/engines/bladerunner/script/ai/leon.cpp @@ -455,7 +455,7 @@ void AIScriptLeon::FledCombat() {} float AIScriptLeon::sub_446700(int actorId, float x, float y, float z) { float actorX, actorY, actorZ; Actor_Query_XYZ(actorId, &actorX, &actorY, &actorZ); - return sqrtf((z - actorZ) * (z - actorZ) + (y - actorY) * (y - actorY) + (x - actorX) * (x - actorX)); + return sqrt(static_cast<float>((z - actorZ) * (z - actorZ) + (y - actorY) * (y - actorY) + (x - actorX) * (x - actorX))); } } // End of namespace BladeRunner diff --git a/engines/bladerunner/script/ai/maggie.cpp b/engines/bladerunner/script/ai/maggie.cpp index 09631d4507..7d56e12a2e 100644 --- a/engines/bladerunner/script/ai/maggie.cpp +++ b/engines/bladerunner/script/ai/maggie.cpp @@ -658,7 +658,7 @@ int AIScriptMaggie::sub_44B260() { float AIScriptMaggie::sub_44B200(int actorId, float x, float y, float z) { float actorX, actorY, actorZ; Actor_Query_XYZ(actorId, &actorX, &actorY, &actorZ); - return sqrtf((z - actorZ) * (z - actorZ) + (y - actorY) * (y - actorY) + (x - actorX) * (x - actorX)); + return sqrt(static_cast<float>((z - actorZ) * (z - actorZ) + (y - actorY) * (y - actorY) + (x - actorX) * (x - actorX))); } } // End of namespace BladeRunner diff --git a/engines/bladerunner/script/script.cpp b/engines/bladerunner/script/script.cpp index 3c68717116..92fbc2b4a0 100644 --- a/engines/bladerunner/script/script.cpp +++ b/engines/bladerunner/script/script.cpp @@ -358,7 +358,7 @@ int ScriptBase::Actor_Query_Inch_Distance_From_Waypoint(int actorId, int waypoin float distX = actorX - waypointX; float distZ = actorZ - waypointZ; - return sqrtf(distX * distX + distZ * distZ); + return sqrt(distX * distX + distZ * distZ); } bool ScriptBase::Actor_Query_In_Between_Two_Actors(int actorId, int otherActor1Id, int otherActor2Id) { |