summaryrefslogtreecommitdiff
path: root/src/animatedsprite.h
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2006-11-14 22:51:09 +0000
committerBjørn Lindeijer <bjorn@lindeijer.nl>2006-11-14 22:51:09 +0000
commit29bedd4da7e21b6dc644c8aa69d096db1516ea7b (patch)
treec33d35513bbf069e4e39c604bc2200ce100856e1 /src/animatedsprite.h
parent82f587f2f3795898ed4fb7b125bf34b7e13de7cd (diff)
downloadmana-client-29bedd4da7e21b6dc644c8aa69d096db1516ea7b.tar.gz
mana-client-29bedd4da7e21b6dc644c8aa69d096db1516ea7b.tar.bz2
mana-client-29bedd4da7e21b6dc644c8aa69d096db1516ea7b.tar.xz
mana-client-29bedd4da7e21b6dc644c8aa69d096db1516ea7b.zip
Resolve Image* of animation phase at load time instead of storing just the
spriteset index and looking it up later (checking validity should still be added). Also calculate animation length during loading instead of summing it up each time it is requested.
Diffstat (limited to 'src/animatedsprite.h')
-rw-r--r--src/animatedsprite.h14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/animatedsprite.h b/src/animatedsprite.h
index e87a9885..73dfa529 100644
--- a/src/animatedsprite.h
+++ b/src/animatedsprite.h
@@ -33,6 +33,7 @@
class Action;
class Graphics;
class Spriteset;
+struct AnimationPhase;
enum SpriteAction
{
@@ -97,7 +98,8 @@ class AnimatedSprite
* Inform the animation of the passed time so that it can output the
* correct animation phase.
*/
- void update(int time);
+ void
+ update(int time);
/**
* Draw the current animation phase at the coordinates given in screen
@@ -107,13 +109,13 @@ class AnimatedSprite
draw(Graphics* graphics, Sint32 posX, Sint32 posY) const;
/**
- * gets the width in pixels of the current animation phase.
+ * Returns the width in pixels of the current animation phase.
*/
int
getWidth() const;
/**
- * gets the height in pixels of the current animation phase.
+ * Returns the height in pixels of the current animation phase.
*/
int
getHeight() const;
@@ -136,6 +138,12 @@ class AnimatedSprite
substituteAction(SpriteAction complete, SpriteAction with);
/**
+ * Returns the current animation frame.
+ */
+ const AnimationPhase*
+ getCurrentPhase() const;
+
+ /**
* Gets an integer property from an xmlNodePtr.
*
* TODO: Same function is present in MapReader. Should probably be