diff options
author | Yohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer> | 2011-06-22 18:58:47 +0200 |
---|---|---|
committer | Yohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer> | 2011-06-22 18:58:47 +0200 |
commit | 852ff45c35c422b5264487669934b392a8657465 (patch) | |
tree | 380751fae34a7dcd7b31bd84e303b9086eb17485 /src/simpleanimation.cpp | |
parent | 2a11c6c5d874d661dcb7f016183c3c3e64e65f3c (diff) | |
parent | ec3c689c64922baf4a9f99bc6e9345e0a80403e8 (diff) | |
download | mana-client-852ff45c35c422b5264487669934b392a8657465.tar.gz mana-client-852ff45c35c422b5264487669934b392a8657465.tar.bz2 mana-client-852ff45c35c422b5264487669934b392a8657465.tar.xz mana-client-852ff45c35c422b5264487669934b392a8657465.zip |
Merge branch 'master' of gitorious.org:~bertram/mana/mana-any-square-tile-size
Diffstat (limited to 'src/simpleanimation.cpp')
-rw-r--r-- | src/simpleanimation.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/simpleanimation.cpp b/src/simpleanimation.cpp index 7ef433ea..24a17ce7 100644 --- a/src/simpleanimation.cpp +++ b/src/simpleanimation.cpp @@ -21,6 +21,7 @@ #include "simpleanimation.h" +#include "game.h" #include "graphics.h" #include "log.h" @@ -132,15 +133,19 @@ void SimpleAnimation::initializeAnimation(xmlNodePtr animationNode) return; // Get animation frames - for ( xmlNodePtr frameNode = animationNode->xmlChildrenNode; - frameNode; + for (xmlNodePtr frameNode = animationNode->xmlChildrenNode; frameNode; frameNode = frameNode->next) { int delay = XML::getProperty(frameNode, "delay", 0); int offsetX = XML::getProperty(frameNode, "offsetX", 0); int offsetY = XML::getProperty(frameNode, "offsetY", 0); - offsetY -= imageset->getHeight() - 32; - offsetX -= imageset->getWidth() / 2 - 16; + Game *game = Game::instance(); + if (game) + { + offsetX -= imageset->getWidth() / 2 + - game->getCurrentTileWidth() / 2; + offsetY -= imageset->getHeight() - game->getCurrentTileHeight(); + } if (xmlStrEqual(frameNode->name, BAD_CAST "frame")) { |