From 4cd89f7fc9a3846e9d42b1d401453b8b55a2990f Mon Sep 17 00:00:00 2001 From: Yohann Ferreira Date: Fri, 30 Jul 2010 00:30:40 +0200 Subject: Changed the FloatData class to store double instead of single floats. Also fixed a few compile warnings. --- src/being.cpp | 5 +++-- src/defaults.cpp | 5 +++++ src/listener.h | 2 +- src/variabledata.h | 6 +++--- 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/being.cpp b/src/being.cpp index e8007948..1061cf36 100644 --- a/src/being.cpp +++ b/src/being.cpp @@ -215,8 +215,9 @@ void Being::setDestination(int dstX, int dstY) Position dest = mMap->checkNodeOffsets(getCollisionRadius(), getWalkMask(), dstX, dstY); - Path thisPath = mMap->findPixelPath(mPos.x, mPos.y, dest.x, dest.y, - getCollisionRadius(), getWalkMask()); + Path thisPath = mMap->findPixelPath((int) mPos.x, (int) mPos.y, + dest.x, dest.y, + getCollisionRadius(), getWalkMask()); if (thisPath.empty()) { diff --git a/src/defaults.cpp b/src/defaults.cpp index 9be5971d..c08fb357 100644 --- a/src/defaults.cpp +++ b/src/defaults.cpp @@ -35,6 +35,11 @@ VariableData* createData(int defData) return new IntData(defData); } +VariableData* createData(double defData) +{ + return new FloatData(defData); +} + VariableData* createData(float defData) { return new FloatData(defData); diff --git a/src/listener.h b/src/listener.h index 25b388a0..db7b3221 100644 --- a/src/listener.h +++ b/src/listener.h @@ -31,7 +31,7 @@ namespace Mana class Listener { public: - ~Listener(); + virtual ~Listener(); void listen(const std::string &channel); diff --git a/src/variabledata.h b/src/variabledata.h index 4f58c1fd..f73ebab2 100644 --- a/src/variabledata.h +++ b/src/variabledata.h @@ -72,14 +72,14 @@ private: class FloatData : public VariableData { public: - FloatData(float value) { mData = value; } + FloatData(double value) { mData = value; } - float getData() const { return mData; } + double getData() const { return mData; } int getType() const { return DATA_FLOAT; } private: - float mData; + double mData; }; class BoolData : public VariableData -- cgit v1.2.3-70-g09d2