summaryrefslogtreecommitdiff
path: root/src/animatedsprite.cpp
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2006-08-26 18:50:34 +0000
committerBjørn Lindeijer <bjorn@lindeijer.nl>2006-08-26 18:50:34 +0000
commitef82a7df8aafb569f6db5e77ff2dd67fde860148 (patch)
tree202a461e6d9d426ef1d080ec554334a195fa709a /src/animatedsprite.cpp
parentc3a3b608b3f9a7b2edb3a7132af5dffde1a9e3c2 (diff)
downloadmana-ef82a7df8aafb569f6db5e77ff2dd67fde860148.tar.gz
mana-ef82a7df8aafb569f6db5e77ff2dd67fde860148.tar.bz2
mana-ef82a7df8aafb569f6db5e77ff2dd67fde860148.tar.xz
mana-ef82a7df8aafb569f6db5e77ff2dd67fde860148.zip
Applied patch by Bahamut81 which implements resetting of Animation, Action and
AnimatedSprite. This fixes the animation synchronization issues.
Diffstat (limited to 'src/animatedsprite.cpp')
-rw-r--r--src/animatedsprite.cpp17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/animatedsprite.cpp b/src/animatedsprite.cpp
index d1201042..a7a4453c 100644
--- a/src/animatedsprite.cpp
+++ b/src/animatedsprite.cpp
@@ -48,12 +48,14 @@ AnimatedSprite::AnimatedSprite(const std::string& animationFile, int variant):
free(data);
if (!doc) {
- logger->error("Animation: Error while parsing animation definition file!");
+ logger->error(
+ "Animation: Error while parsing animation definition file!");
}
xmlNodePtr node = xmlDocGetRootElement(doc);
if (!node || !xmlStrEqual(node->name, BAD_CAST "sprite")) {
- logger->error("Animation: this is not a valid animation definition file!");
+ logger->error(
+ "Animation: this is not a valid animation definition file!");
}
// Get the variant
@@ -232,13 +234,14 @@ AnimatedSprite::~AnimatedSprite()
void
AnimatedSprite::reset()
{
- // Reset all defined actions (because of aliases, some will be resetted
- // multiple times)
+ // Reset all defined actions (because of aliases some will be resetted
+ // multiple times, but this doesn't matter)
for (ActionIterator i = mActions.begin(); i != mActions.end(); ++i)
{
- //TODO: If resetting everything is really a nice way of fixing the
- // synchronization issues, finish implementing this.
- //i->second->reset();
+ if (i->second)
+ {
+ i->second->reset();
+ }
}
}