diff options
author | Jared Adams <jaxad0127@gmail.com> | 2009-06-08 09:28:50 -0600 |
---|---|---|
committer | Jared Adams <jaxad0127@gmail.com> | 2009-06-08 09:28:50 -0600 |
commit | 8596b1a8102726de0d7b3df12dff86f5c974e6fe (patch) | |
tree | e4403af689615f6fe8625beb679538780ecfba67 | |
parent | c9f52e60ea7eadca0d11fc0bbf7eb8a6ad465925 (diff) | |
download | mana-8596b1a8102726de0d7b3df12dff86f5c974e6fe.tar.gz mana-8596b1a8102726de0d7b3df12dff86f5c974e6fe.tar.bz2 mana-8596b1a8102726de0d7b3df12dff86f5c974e6fe.tar.xz mana-8596b1a8102726de0d7b3df12dff86f5c974e6fe.zip |
Merge being direction handling code
-rw-r--r-- | src/being.cpp | 26 | ||||
-rw-r--r-- | src/being.h | 6 |
2 files changed, 2 insertions, 30 deletions
diff --git a/src/being.cpp b/src/being.cpp index 3c77cd2a..657e2236 100644 --- a/src/being.cpp +++ b/src/being.cpp @@ -76,9 +76,7 @@ Being::Being(int id, int job, Map *map): mJob(job), mId(id), mDirection(DOWN), -#ifdef TMWSERV_SUPPORT mSpriteDirection(DIRECTION_DOWN), -#endif mMap(NULL), mParticleEffects(config.getValue("particleeffects", 1)), mEquippedWeapon(NULL), @@ -461,12 +459,12 @@ void Being::setDirection(Uint8 direction) if (mDirection == direction) return; -#ifdef TMWSERV_SUPPORT + mDirection = direction; + // if the direction does not change much, keep the common component int mFaceDirection = mDirection & direction; if (!mFaceDirection) mFaceDirection = direction; - mDirection = direction; SpriteDirection dir; if (mFaceDirection & UP) @@ -478,10 +476,6 @@ void Being::setDirection(Uint8 direction) else dir = DIRECTION_LEFT; mSpriteDirection = dir; -#else - mDirection = direction; - SpriteDirection dir = getSpriteDirection(); -#endif for (int i = 0; i < VECTOREND_SPRITE; i++) { @@ -491,22 +485,6 @@ void Being::setDirection(Uint8 direction) } #ifdef EATHENA_SUPPORT -SpriteDirection Being::getSpriteDirection() const -{ - SpriteDirection dir; - - if (mDirection & UP) - dir = DIRECTION_UP; - else if (mDirection & DOWN) - dir = DIRECTION_DOWN; - else if (mDirection & RIGHT) - dir = DIRECTION_RIGHT; - else - dir = DIRECTION_LEFT; - - return dir; -} - void Being::nextStep() { if (mPath.empty()) diff --git a/src/being.h b/src/being.h index d451bb52..e5068952 100644 --- a/src/being.h +++ b/src/being.h @@ -358,12 +358,8 @@ class Being : public Sprite, public ConfigListener /** * Returns the direction the being is facing. */ -#ifdef TMWSERV_SUPPORT SpriteDirection getSpriteDirection() const { return SpriteDirection(mSpriteDirection); } -#else - SpriteDirection getSpriteDirection() const; -#endif /** * Draws this being to the given graphics context. @@ -558,9 +554,7 @@ class Being : public Sprite, public ConfigListener int mId; /**< Unique sprite id */ Uint8 mDirection; /**< Facing direction */ -#ifdef TMWSERV_SUPPORT Uint8 mSpriteDirection; /**< Facing direction */ -#endif Map *mMap; /**< Map on which this being resides */ std::string mName; /**< Name of character */ SpriteIterator mSpriteIterator; |