diff options
author | Filippos Karapetis | 2009-04-02 19:37:56 +0000 |
---|---|---|
committer | Filippos Karapetis | 2009-04-02 19:37:56 +0000 |
commit | 8ae0ed17061a98233a26c4efe70d4bf2f27d89d8 (patch) | |
tree | bce75f715b82cd0c721b12bba55cf6674557820c | |
parent | 44443badc5cf5d1f6f869754092500391ac4628c (diff) | |
download | scummvm-rg350-8ae0ed17061a98233a26c4efe70d4bf2f27d89d8.tar.gz scummvm-rg350-8ae0ed17061a98233a26c4efe70d4bf2f27d89d8.tar.bz2 scummvm-rg350-8ae0ed17061a98233a26c4efe70d4bf2f27d89d8.zip |
Applied fingolfin's suggestion to remove the roundf() implementation and make the code in that bit simpler and more readable (since points are always positive)
svn-id: r39802
-rw-r--r-- | engines/sci/engine/kpathing.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/engines/sci/engine/kpathing.cpp b/engines/sci/engine/kpathing.cpp index 9d8fc565f9..2fdcbd475f 100644 --- a/engines/sci/engine/kpathing.cpp +++ b/engines/sci/engine/kpathing.cpp @@ -77,15 +77,13 @@ enum { PF_FATAL = -2 }; -#define scummvm_roundf(a) ((fmod(a, 1) < 0.5) ? floor(a) : ceil(a)) - // Floating point struct struct FloatPoint { FloatPoint() : x(0), y(0) {} FloatPoint(float x_, float y_) : x(x_), y(y_) {} Common::Point toPoint() { - return Common::Point((int16)scummvm_roundf(x), (int16)scummvm_roundf(y)); + return Common::Point(x + 0.5, y + 0.5); } float x, y; |