diff options
author | Yohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer> | 2010-07-30 00:30:40 +0200 |
---|---|---|
committer | Yohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer> | 2010-07-30 00:30:40 +0200 |
commit | 4cd89f7fc9a3846e9d42b1d401453b8b55a2990f (patch) | |
tree | 1e1519f02b10b8a3c584fff93063d42b0d8a55d4 | |
parent | ae898aa1a5175b2b08f7248e4cd89bf61bc8e4be (diff) | |
download | mana-client-4cd89f7fc9a3846e9d42b1d401453b8b55a2990f.tar.gz mana-client-4cd89f7fc9a3846e9d42b1d401453b8b55a2990f.tar.bz2 mana-client-4cd89f7fc9a3846e9d42b1d401453b8b55a2990f.tar.xz mana-client-4cd89f7fc9a3846e9d42b1d401453b8b55a2990f.zip |
Changed the FloatData class to store double instead of single floats.
Also fixed a few compile warnings.
-rw-r--r-- | src/being.cpp | 5 | ||||
-rw-r--r-- | src/defaults.cpp | 5 | ||||
-rw-r--r-- | src/listener.h | 2 | ||||
-rw-r--r-- | 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 |