diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-04-08 23:18:34 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-04-08 23:18:34 +0300 |
commit | d472a3cf2a40169ffb4eca900e9cc53e6bcc4cc7 (patch) | |
tree | bedcffde98ff439af310c6d2d06430a2de6b5670 /src/being | |
parent | 877bfe276efcf663de5a8af8fa9464aaf935ca2d (diff) | |
download | manaplus-d472a3cf2a40169ffb4eca900e9cc53e6bcc4cc7.tar.gz manaplus-d472a3cf2a40169ffb4eca900e9cc53e6bcc4cc7.tar.bz2 manaplus-d472a3cf2a40169ffb4eca900e9cc53e6bcc4cc7.tar.xz manaplus-d472a3cf2a40169ffb4eca900e9cc53e6bcc4cc7.zip |
Use enum SpriteDirection form sprite direction in being.
Diffstat (limited to 'src/being')
-rw-r--r-- | src/being/being.cpp | 5 | ||||
-rw-r--r-- | src/being/being.h | 4 |
2 files changed, 4 insertions, 5 deletions
diff --git a/src/being/being.cpp b/src/being/being.cpp index 93dd6abc5..fbdd6fc79 100644 --- a/src/being/being.cpp +++ b/src/being/being.cpp @@ -1355,7 +1355,7 @@ void Being::setDirection(const uint8_t direction) { dir = SpriteDirection::LEFT; } - mSpriteDirection = static_cast<uint8_t>(dir); + mSpriteDirection = dir; CompoundSprite::setSpriteDirection(dir); if (mEmotionSprite) @@ -3109,8 +3109,7 @@ void Being::setEmote(const uint8_t emotion, const int emote_time) if (mEmotionSprite) { mEmotionSprite->play(mSpriteAction); - mEmotionSprite->setSpriteDirection( - static_cast<SpriteDirection::Type>(mSpriteDirection)); + mEmotionSprite->setSpriteDirection(mSpriteDirection); } else { diff --git a/src/being/being.h b/src/being/being.h index 9c7ef3404..23afd549f 100644 --- a/src/being/being.h +++ b/src/being/being.h @@ -485,7 +485,7 @@ class Being notfinal : public ActorSprite, * Returns the direction the being is facing. */ SpriteDirection::Type getSpriteDirection() const A_WARN_UNUSED - { return static_cast<SpriteDirection::Type>(mSpriteDirection); } + { return mSpriteDirection; } void setPosition(const Vector &pos) override; @@ -1003,7 +1003,7 @@ class Being notfinal : public ActorSprite, uint16_t mSubType; /**< Subtype (graphical view, basically) */ uint8_t mDirection; /**< Facing direction */ uint8_t mDirectionDelayed; /**< Facing direction */ - uint8_t mSpriteDirection; /**< Facing direction */ + SpriteDirection::Type mSpriteDirection; /**< Facing direction */ bool mShowName; bool mIsGM; |