summaryrefslogtreecommitdiff
path: root/src/animation.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/animation.h')
-rw-r--r--src/animation.h11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/animation.h b/src/animation.h
index 8f62b9c4..0230e820 100644
--- a/src/animation.h
+++ b/src/animation.h
@@ -37,7 +37,7 @@ class Spriteset;
*/
struct AnimationPhase
{
- int image;
+ Image *image;
unsigned int delay;
int offsetX;
int offsetY;
@@ -65,7 +65,7 @@ class Animation
* Appends a new animation at the end of the sequence
*/
void
- addPhase(int image, unsigned int delay, int offsetX, int offsetY);
+ addPhase(Image *image, unsigned int delay, int offsetX, int offsetY);
/**
* Appends an animation terminator that states that the animation
@@ -82,7 +82,7 @@ class Animation
bool
update(unsigned int time);
- int
+ const AnimationPhase*
getCurrentPhase() const;
/**
@@ -101,13 +101,14 @@ class Animation
* Returns the length of this animation.
*/
int
- getLength();
+ getLength() const { return mLength; }
protected:
- static bool isTerminator(AnimationPhase);
+ static bool isTerminator(AnimationPhase phase);
std::list<AnimationPhase> mAnimationPhases;
std::list<AnimationPhase>::iterator iCurrentPhase;
unsigned int mTime;
+ int mLength;
};
#endif