diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-05-19 15:21:11 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-05-19 15:21:11 +0300 |
commit | ad3ee95f90bfd368a511407c13718b900e44be0f (patch) | |
tree | f3f41b9802d684d784b7cef05e0d6ae2383b5e5b /src/resources/spritedef.cpp | |
parent | fba4289e53447a09dcf82211e2dab3563e2581f1 (diff) | |
download | manaverse-ad3ee95f90bfd368a511407c13718b900e44be0f.tar.gz manaverse-ad3ee95f90bfd368a511407c13718b900e44be0f.tar.bz2 manaverse-ad3ee95f90bfd368a511407c13718b900e44be0f.tar.xz manaverse-ad3ee95f90bfd368a511407c13718b900e44be0f.zip |
Move spritedirection into separate file.
Diffstat (limited to 'src/resources/spritedef.cpp')
-rw-r--r-- | src/resources/spritedef.cpp | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/src/resources/spritedef.cpp b/src/resources/spritedef.cpp index 10617b248..e7a751feb 100644 --- a/src/resources/spritedef.cpp +++ b/src/resources/spritedef.cpp @@ -281,9 +281,9 @@ void SpriteDef::loadAnimation(const XmlNodePtr animationNode, const std::string directionName = XML::getProperty(animationNode, "direction", ""); - const SpriteDirection directionType = makeSpriteDirection(directionName); + const SpriteDirection::Type directionType = makeSpriteDirection(directionName); - if (directionType == DIRECTION_INVALID) + if (directionType == SpriteDirection::INVALID) { logger->log("Warning: Unknown direction \"%s\" used in %s", directionName.c_str(), getIdPath().c_str()); @@ -462,28 +462,29 @@ SpriteDef::~SpriteDef() mImageSets.clear(); } -SpriteDirection SpriteDef::makeSpriteDirection(const std::string &direction) +SpriteDirection::Type SpriteDef::makeSpriteDirection(const std::string + &direction) { if (direction.empty() || direction == "default") - return DIRECTION_DEFAULT; + return SpriteDirection::DEFAULT; else if (direction == "up") - return DIRECTION_UP; + return SpriteDirection::UP; else if (direction == "left") - return DIRECTION_LEFT; + return SpriteDirection::LEFT; else if (direction == "right") - return DIRECTION_RIGHT; + return SpriteDirection::RIGHT; else if (direction == "down") - return DIRECTION_DOWN; + return SpriteDirection::DOWN; else if (direction == "upleft") - return DIRECTION_UPLEFT; + return SpriteDirection::UPLEFT; else if (direction == "upright") - return DIRECTION_UPRIGHT; + return SpriteDirection::UPRIGHT; else if (direction == "downleft") - return DIRECTION_DOWNLEFT; + return SpriteDirection::DOWNLEFT; else if (direction == "downright") - return DIRECTION_DOWNRIGHT; + return SpriteDirection::DOWNRIGHT; else - return DIRECTION_INVALID; + return SpriteDirection::INVALID; } void SpriteDef::addAction(const unsigned hp, const std::string &name, |