From a3e5eadaa503e16a4e02af40f1d36a2bb0b5c243 Mon Sep 17 00:00:00 2001 From: Yohann Ferreira Date: Wed, 22 Jun 2011 18:18:39 +0200 Subject: Made the being death sequence better handled. Now the death animation is set to the minimum of 1.5 seconds just as in the older versions, but permit longer sequences as well. I didn't put a maximum hard cap on it as it may be a burden for the maintainers whatever the hard cap would be, and as it isn't vital to set one anyway. Resolves: Mana-Mantis #364. Reviewed-by: bjorn, Jaxad0127. --- src/resources/animation.h | 2 +- src/resources/spritedef.cpp | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'src/resources') diff --git a/src/resources/animation.h b/src/resources/animation.h index 1629aebf..14ba2b27 100644 --- a/src/resources/animation.h +++ b/src/resources/animation.h @@ -70,7 +70,7 @@ class Animation int getLength() const { return mFrames.size(); } /** - * Returns the duration of this animation. + * Returns the duration of this animation in milliseconds. */ int getDuration() const { return mDuration; } diff --git a/src/resources/spritedef.cpp b/src/resources/spritedef.cpp index 22312107..4375fb89 100644 --- a/src/resources/spritedef.cpp +++ b/src/resources/spritedef.cpp @@ -22,6 +22,7 @@ #include "resources/spritedef.h" #include "log.h" +#include "sprite.h" #include "resources/action.h" #include "resources/animation.h" @@ -224,7 +225,8 @@ void SpriteDef::loadAnimation(xmlNodePtr animationNode, // Get animation frames for_each_xml_child_node(frameNode, animationNode) { - const int delay = XML::getProperty(frameNode, "delay", 0); + const int delay = XML::getProperty(frameNode, "delay", + DEFAULT_FRAME_DELAY); int offsetX = XML::getProperty(frameNode, "offsetX", 0); int offsetY = XML::getProperty(frameNode, "offsetY", 0); -- cgit v1.2.3-70-g09d2