diff options
author | Andrei Karas <akaras@inbox.ru> | 2011-04-03 20:44:04 +0300 |
---|---|---|
committer | Erik Schilling <ablu.erikschilling@googlemail.com> | 2012-01-30 20:42:05 +0100 |
commit | 7de429cbcd838326dd455e7d182cb5ef19a611c9 (patch) | |
tree | 9695d146f660a9751691dacbb0e8c4becb273f4b /src/resources/spritedef.cpp | |
parent | d8a119d8b2c65ac362b40f6ad33122ba8be76edc (diff) | |
download | mana-client-7de429cbcd838326dd455e7d182cb5ef19a611c9.tar.gz mana-client-7de429cbcd838326dd455e7d182cb5ef19a611c9.tar.bz2 mana-client-7de429cbcd838326dd455e7d182cb5ef19a611c9.tar.xz mana-client-7de429cbcd838326dd455e7d182cb5ef19a611c9.zip |
Add default offsets in imageset tag for all animations.
Reviewed-by: Bjorn.
Diffstat (limited to 'src/resources/spritedef.cpp')
-rw-r--r-- | src/resources/spritedef.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/resources/spritedef.cpp b/src/resources/spritedef.cpp index 405d147c..c1f74ec8 100644 --- a/src/resources/spritedef.cpp +++ b/src/resources/spritedef.cpp @@ -164,6 +164,8 @@ void SpriteDef::loadImageSet(xmlNodePtr node, const std::string &palettes) logger->error("Couldn't load imageset!"); } + imageSet->setOffsetX(XML::getProperty(node, "offsetX", 0)); + imageSet->setOffsetY(XML::getProperty(node, "offsetY", 0)); mImageSets[name] = imageSet; } @@ -229,8 +231,10 @@ void SpriteDef::loadAnimation(xmlNodePtr animationNode, { const int delay = XML::getProperty(frameNode, "delay", DEFAULT_FRAME_DELAY); - int offsetX = XML::getProperty(frameNode, "offsetX", 0); - int offsetY = XML::getProperty(frameNode, "offsetY", 0); + int offsetX = XML::getProperty(frameNode, "offsetX", 0) + + imageSet->getOffsetX(); + int offsetY = XML::getProperty(frameNode, "offsetY", 0) + + imageSet->getOffsetY(); if (xmlStrEqual(frameNode->name, BAD_CAST "frame")) { |