summaryrefslogtreecommitdiff
path: root/src/sprite.h
diff options
context:
space:
mode:
authorYohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer>2011-06-22 18:18:39 +0200
committerYohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer>2011-06-23 04:17:28 +0200
commita3e5eadaa503e16a4e02af40f1d36a2bb0b5c243 (patch)
tree49d94fee1286d5c8c5dc01fdf22e7b3dda4338a9 /src/sprite.h
parentba5b70974c5dfa0be3105e72a0a012455b28e7a9 (diff)
downloadmana-a3e5eadaa503e16a4e02af40f1d36a2bb0b5c243.tar.gz
mana-a3e5eadaa503e16a4e02af40f1d36a2bb0b5c243.tar.bz2
mana-a3e5eadaa503e16a4e02af40f1d36a2bb0b5c243.tar.xz
mana-a3e5eadaa503e16a4e02af40f1d36a2bb0b5c243.zip
Made the being death sequence better handled.
Now the death animation is set to the minimum of 1.5 seconds just as in the older versions, but permit longer sequences as well. I didn't put a maximum hard cap on it as it may be a burden for the maintainers whatever the hard cap would be, and as it isn't vital to set one anyway. Resolves: Mana-Mantis #364. Reviewed-by: bjorn, Jaxad0127.
Diffstat (limited to 'src/sprite.h')
-rw-r--r--src/sprite.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/sprite.h b/src/sprite.h
index 797b1b20..096dcf8a 100644
--- a/src/sprite.h
+++ b/src/sprite.h
@@ -26,6 +26,9 @@
class Graphics;
class Image;
+// Default frame display delay in milliseconds
+const int DEFAULT_FRAME_DELAY = 75;
+
class Sprite
{
public:
@@ -60,7 +63,7 @@ class Sprite
virtual bool draw(Graphics* graphics, int posX, int posY) const = 0;
/**
- * Gets the width in pixels of the image
+ * Gets the width in pixels of the image
*/
virtual int getWidth() const = 0;
@@ -115,6 +118,11 @@ class Sprite
*/
virtual size_t getFrameCount() const = 0;
+ /**
+ * Returns the duration of the current sprite animation in milliseconds.
+ */
+ virtual int getDuration() const = 0;
+
protected:
float mAlpha; /**< The alpha opacity used to draw */
};