diff options
Diffstat (limited to 'src/resources/spritedef.cpp')
-rw-r--r-- | src/resources/spritedef.cpp | 31 |
1 files changed, 12 insertions, 19 deletions
diff --git a/src/resources/spritedef.cpp b/src/resources/spritedef.cpp index 5aea55fa..f5b763ea 100644 --- a/src/resources/spritedef.cpp +++ b/src/resources/spritedef.cpp @@ -33,8 +33,7 @@ #include "../log.h" #include "../utils/xml.h" -Action* -SpriteDef::getAction(SpriteAction action) const +Action *SpriteDef::getAction(SpriteAction action) const { Actions::const_iterator i = mActions.find(action); @@ -47,7 +46,7 @@ SpriteDef::getAction(SpriteAction action) const return i->second; } -SpriteDef *SpriteDef::load(std::string const &animationFile, int variant) +SpriteDef *SpriteDef::load(const std::string &animationFile, int variant) { std::string::size_type pos = animationFile.find('|'); std::string palettes; @@ -122,7 +121,7 @@ void SpriteDef::loadSprite(xmlNodePtr spriteNode, int variant, } } -void SpriteDef::loadImageSet(xmlNodePtr node, std::string const &palettes) +void SpriteDef::loadImageSet(xmlNodePtr node, const std::string &palettes) { const std::string name = XML::getProperty(node, "name", ""); @@ -147,8 +146,7 @@ void SpriteDef::loadImageSet(xmlNodePtr node, std::string const &palettes) mImageSets[name] = imageSet; } -void -SpriteDef::loadAction(xmlNodePtr node, int variant_offset) +void SpriteDef::loadAction(xmlNodePtr node, int variant_offset) { const std::string actionName = XML::getProperty(node, "name", ""); const std::string imageSetName = XML::getProperty(node, "imageset", ""); @@ -188,10 +186,9 @@ SpriteDef::loadAction(xmlNodePtr node, int variant_offset) } } -void -SpriteDef::loadAnimation(xmlNodePtr animationNode, - Action *action, ImageSet *imageSet, - int variant_offset) +void SpriteDef::loadAnimation(xmlNodePtr animationNode, + Action *action, ImageSet *imageSet, + int variant_offset) { const std::string directionName = XML::getProperty(animationNode, "direction", ""); @@ -268,8 +265,7 @@ SpriteDef::loadAnimation(xmlNodePtr animationNode, } // for frameNode } -void -SpriteDef::includeSprite(xmlNodePtr includeNode) +void SpriteDef::includeSprite(xmlNodePtr includeNode) { // TODO: Perform circular dependency check, since it's easy to crash the // client this way. @@ -290,8 +286,7 @@ SpriteDef::includeSprite(xmlNodePtr includeNode) loadSprite(rootNode, 0); } -void -SpriteDef::substituteAction(SpriteAction complete, SpriteAction with) +void SpriteDef::substituteAction(SpriteAction complete, SpriteAction with) { if (mActions.find(complete) == mActions.end()) { @@ -325,8 +320,7 @@ SpriteDef::~SpriteDef() } } -SpriteAction -SpriteDef::makeSpriteAction(const std::string& action) +SpriteAction SpriteDef::makeSpriteAction(const std::string &action) { if (action == "" || action == "default") { return ACTION_DEFAULT; @@ -408,8 +402,7 @@ SpriteDef::makeSpriteAction(const std::string& action) } } -SpriteDirection -SpriteDef::makeSpriteDirection(const std::string& direction) +SpriteDirection SpriteDef::makeSpriteDirection(const std::string& direction) { if (direction == "" || direction == "default") { return DIRECTION_DEFAULT; @@ -428,5 +421,5 @@ SpriteDef::makeSpriteDirection(const std::string& direction) } else { return DIRECTION_INVALID; - }; + } } |