summaryrefslogtreecommitdiff
path: root/src/simpleanimation.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/simpleanimation.h')
-rw-r--r--src/simpleanimation.h15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/simpleanimation.h b/src/simpleanimation.h
index a56c31da..561c540d 100644
--- a/src/simpleanimation.h
+++ b/src/simpleanimation.h
@@ -26,7 +26,10 @@
#include "resources/animation.h"
+#include "utils/xml.h"
+
class Frame;
+class Graphics;
/**
* This class is a leightweight alternative to the AnimatedSprite class.
@@ -35,6 +38,9 @@ class Frame;
class SimpleAnimation
{
public:
+ /**
+ * Creates a simple animation with an already created animation.
+ */
SimpleAnimation(Animation *animation):
mAnimation(animation),
mAnimationTime(0),
@@ -42,6 +48,11 @@ class SimpleAnimation
mCurrentFrame(mAnimation->getFrame(0))
{};
+ /**
+ * Creates a simple animation that creates its animation from XML Data.
+ */
+ SimpleAnimation(xmlNodePtr animationNode);
+
~SimpleAnimation();
void update(unsigned int timePassed);
@@ -55,10 +66,10 @@ class SimpleAnimation
/** Time in game ticks the current frame is shown. */
unsigned int mAnimationTime;
- /** Index of current animation frame. */
+ /** Index of current animation phase. */
unsigned int mAnimationPhase;
- /** Current animation frame. */
+ /** Current animation phase. */
Frame *mCurrentFrame;
};