From 8676da1517a86105e4cb4970fd3a7886f7d0c214 Mon Sep 17 00:00:00 2001 From: Bjørn Lindeijer Date: Wed, 2 Aug 2006 23:05:46 +0000 Subject: Some cleanups, fixes and a small start on a solution for the animated sprite synchronization problem (resetting all animations). --- src/animation.h | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) (limited to 'src/animation.h') diff --git a/src/animation.h b/src/animation.h index f2c40194..c5b277b7 100644 --- a/src/animation.h +++ b/src/animation.h @@ -55,16 +55,32 @@ class Animation */ Animation(); - void addPhase(int image, unsigned int delay, int offsetX, int offsetY); + void + addPhase(int image, unsigned int delay, int offsetX, int offsetY); - void update(unsigned int time); + void + update(unsigned int time); - int getCurrentPhase() const; + int + getCurrentPhase() const; - int getOffsetX() const { return (*iCurrentPhase).offsetX; }; - int getOffsetY() const { return (*iCurrentPhase).offsetY; }; + /** + * Returns the x offset of the current frame. + */ + int + getOffsetX() const { return (*iCurrentPhase).offsetX; }; - int getLength(); + /** + * Returns the y offset of the current frame. + */ + int + getOffsetY() const { return (*iCurrentPhase).offsetY; }; + + /** + * Returns the length of this animation. + */ + int + getLength(); protected: std::list mAnimationPhases; -- cgit v1.2.3-70-g09d2