diff options
author | Johannes Schickel | 2014-06-02 01:00:14 +0200 |
---|---|---|
committer | Johannes Schickel | 2014-06-02 01:00:14 +0200 |
commit | 3630c588c65e55d83f11c46980d6df500d18d2c4 (patch) | |
tree | 3e28f03483c503a72edcd8623ffecb20392aa058 | |
parent | 2aab673251dbc5ced98c71b4a0ca6f2afbc0a04d (diff) | |
download | scummvm-rg350-3630c588c65e55d83f11c46980d6df500d18d2c4.tar.gz scummvm-rg350-3630c588c65e55d83f11c46980d6df500d18d2c4.tar.bz2 scummvm-rg350-3630c588c65e55d83f11c46980d6df500d18d2c4.zip |
BBVS: Silence double->float conversion warning.
This might not be obvious to a C++ developer, but we use C's sin which is
*always* double. Thus, sin will return a double and therefore some compilers
might warn about this conversion.
-rw-r--r-- | engines/bbvs/walk.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/engines/bbvs/walk.cpp b/engines/bbvs/walk.cpp index 4d71d95fc0..f3023b97c2 100644 --- a/engines/bbvs/walk.cpp +++ b/engines/bbvs/walk.cpp @@ -109,7 +109,7 @@ void BbvsEngine::updateWalkObject(SceneObject *sceneObject) { void BbvsEngine::walkObject(SceneObject *sceneObject, const Common::Point &destPt, int walkSpeed) { int deltaX = destPt.x - (sceneObject->x >> 16); int deltaY = destPt.y - (sceneObject->y >> 16); - float distance = sqrt((double)(deltaX * deltaX + deltaY * deltaY)); + float distance = (float)sqrt((double)(deltaX * deltaX + deltaY * deltaY)); // NOTE The original doesn't have this check but without it the whole pathfinding breaks if (distance > 0.0) { sceneObject->walkCount = (int)(distance / ((((float)ABS(deltaX) / distance) + 1.0) * ((float)walkSpeed / 120))); |