summaryrefslogtreecommitdiff
path: root/src/animation.h
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/animation.h
parentc3a3b608b3f9a7b2edb3a7132af5dffde1a9e3c2 (diff)
downloadmana-client-ef82a7df8aafb569f6db5e77ff2dd67fde860148.tar.gz
mana-client-ef82a7df8aafb569f6db5e77ff2dd67fde860148.tar.bz2
mana-client-ef82a7df8aafb569f6db5e77ff2dd67fde860148.tar.xz
mana-client-ef82a7df8aafb569f6db5e77ff2dd67fde860148.zip
Applied patch by Bahamut81 which implements resetting of Animation, Action and
AnimatedSprite. This fixes the animation synchronization issues.
Diffstat (limited to 'src/animation.h')
-rw-r--r--src/animation.h16
1 files changed, 14 insertions, 2 deletions
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;