From ef82a7df8aafb569f6db5e77ff2dd67fde860148 Mon Sep 17 00:00:00 2001 From: Bjørn Lindeijer Date: Sat, 26 Aug 2006 18:50:34 +0000 Subject: Applied patch by Bahamut81 which implements resetting of Animation, Action and AnimatedSprite. This fixes the animation synchronization issues. --- src/animation.h | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'src/animation.h') diff --git a/src/animation.h b/src/animation.h index c5b277b7..60dcd287 100644 --- a/src/animation.h +++ b/src/animation.h @@ -55,6 +55,12 @@ class Animation */ Animation(); + /** + * Restarts the animation from the first frame. + */ + void + reset(); + void addPhase(int image, unsigned int delay, int offsetX, int offsetY); @@ -68,13 +74,13 @@ class Animation * Returns the x offset of the current frame. */ int - getOffsetX() const { return (*iCurrentPhase).offsetX; }; + getOffsetX() const { return iCurrentPhase->offsetX; }; /** * Returns the y offset of the current frame. */ int - getOffsetY() const { return (*iCurrentPhase).offsetY; }; + getOffsetY() const { return iCurrentPhase->offsetY; }; /** * Returns the length of this animation. @@ -119,6 +125,12 @@ class Action void setAnimation(int direction, Animation *animation); + /** + * Resets all animations associated with this action. + */ + void + reset(); + Animation* getAnimation(int direction) const; -- cgit v1.2.3-70-g09d2