summaryrefslogtreecommitdiff
path: root/src/resources/action.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-05-19 15:21:11 +0300
committerAndrei Karas <akaras@inbox.ru>2014-05-19 15:21:11 +0300
commitad3ee95f90bfd368a511407c13718b900e44be0f (patch)
treef3f41b9802d684d784b7cef05e0d6ae2383b5e5b /src/resources/action.cpp
parentfba4289e53447a09dcf82211e2dab3563e2581f1 (diff)
downloadmanaverse-ad3ee95f90bfd368a511407c13718b900e44be0f.tar.gz
manaverse-ad3ee95f90bfd368a511407c13718b900e44be0f.tar.bz2
manaverse-ad3ee95f90bfd368a511407c13718b900e44be0f.tar.xz
manaverse-ad3ee95f90bfd368a511407c13718b900e44be0f.zip
Move spritedirection into separate file.
Diffstat (limited to 'src/resources/action.cpp')
-rw-r--r--src/resources/action.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/resources/action.cpp b/src/resources/action.cpp
index cbcf4f72b..8576ffab8 100644
--- a/src/resources/action.cpp
+++ b/src/resources/action.cpp
@@ -39,20 +39,21 @@ Action::~Action()
delete_all(mAnimations);
}
-const Animation *Action::getAnimation(SpriteDirection direction) const noexcept
+const Animation *Action::getAnimation(SpriteDirection::Type direction)
+ const noexcept
{
Animations::const_iterator i = mAnimations.find(direction);
if (i == mAnimations.end())
{
- if (direction == DIRECTION_UPLEFT || direction == DIRECTION_UPRIGHT)
+ if (direction == SpriteDirection::UPLEFT || direction == SpriteDirection::UPRIGHT)
{
- direction = DIRECTION_UP;
+ direction = SpriteDirection::UP;
}
- else if (direction == DIRECTION_DOWNLEFT
- || direction == DIRECTION_DOWNRIGHT)
+ else if (direction == SpriteDirection::DOWNLEFT
+ || direction == SpriteDirection::DOWNRIGHT)
{
- direction = DIRECTION_DOWN;
+ direction = SpriteDirection::DOWN;
}
i = mAnimations.find(direction);
@@ -65,7 +66,7 @@ const Animation *Action::getAnimation(SpriteDirection direction) const noexcept
return (i == mAnimations.end()) ? nullptr : i->second;
}
-void Action::setAnimation(const SpriteDirection direction,
+void Action::setAnimation(const SpriteDirection::Type direction,
Animation *const animation) noexcept
{
mAnimations[direction] = animation;