summaryrefslogtreecommitdiff
path: root/src/simpleanimation.h
diff options
context:
space:
mode:
authorIra Rice <irarice@gmail.com>2009-02-10 12:26:57 -0700
committerIra Rice <irarice@gmail.com>2009-02-10 12:26:57 -0700
commit02e60b55b359002ae1f26f36b40f8fa78ea1a708 (patch)
tree0264392528cf174e2275bb79a84472b77c5245d2 /src/simpleanimation.h
parenta8a992ade40c9d68c9faec1cc3a54e7f064fb9d5 (diff)
downloadmana-client-02e60b55b359002ae1f26f36b40f8fa78ea1a708.tar.gz
mana-client-02e60b55b359002ae1f26f36b40f8fa78ea1a708.tar.bz2
mana-client-02e60b55b359002ae1f26f36b40f8fa78ea1a708.tar.xz
mana-client-02e60b55b359002ae1f26f36b40f8fa78ea1a708.zip
Simplified target drawing so that it actually uses the SimpleAnimation
that it creates when initializing the target cursors in the first place. This behavior was carried over in the first place from the Viewport class. Also moved target drawing responsibility from the map to the being being targeted in the first place. This allows for assuring that targets are always drawn below the sprite being targeted (which the previous solution was designed to do, but didn't do correctly). Signed-off-by: Ira Rice <irarice@gmail.com>
Diffstat (limited to 'src/simpleanimation.h')
-rw-r--r--src/simpleanimation.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/simpleanimation.h b/src/simpleanimation.h
index 16ac2906..a639cf14 100644
--- a/src/simpleanimation.h
+++ b/src/simpleanimation.h
@@ -50,12 +50,22 @@ class SimpleAnimation
void update(unsigned int timePassed);
+ bool draw(Graphics* graphics, int posX, int posY) const;
+
+ /**
+ * Resets the animation.
+ */
+ void reset();
+
Image *getCurrentImage() const;
private:
/** The hosted animation. */
Animation *mAnimation;
+ /**< The last time update was called. */
+ unsigned int mLastTime;
+
/** Time in game ticks the current frame is shown. */
unsigned int mAnimationTime;