summaryrefslogtreecommitdiff
path: root/src/particle.h
diff options
context:
space:
mode:
authorJared Adams <jaxad0127@gmail.com>2010-05-02 14:43:40 -0600
committerJared Adams <jaxad0127@gmail.com>2010-05-06 22:21:57 -0600
commit9baedc27191c82bbf1fedee2a7e738bc5b267c0e (patch)
treef0986c6839d1e79b402d5d4ec36e4994741955ea /src/particle.h
parent844e9a7a72faca6a212e788a3adc45e17f41dca6 (diff)
downloadmana-client-9baedc27191c82bbf1fedee2a7e738bc5b267c0e.tar.gz
mana-client-9baedc27191c82bbf1fedee2a7e738bc5b267c0e.tar.bz2
mana-client-9baedc27191c82bbf1fedee2a7e738bc5b267c0e.tar.xz
mana-client-9baedc27191c82bbf1fedee2a7e738bc5b267c0e.zip
Add support for floor item sprites
This commit adds a sprite hierarchy (Sprite->ImageSprite,AnimatedSprite,CompundSprite; CompoundSprite,Actor->ActorSprite;ActorSprite->Being,FloorItem) to collect common functionailty into new base classes which will make other Mantis tickets easier to do. Also allows monsters to use particle effects. Reviewed-by: Bertram
Diffstat (limited to 'src/particle.h')
-rw-r--r--src/particle.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/particle.h b/src/particle.h
index 64221514..2be169c1 100644
--- a/src/particle.h
+++ b/src/particle.h
@@ -83,7 +83,7 @@ class Particle : public Actor
/**
* Draws the particle image.
*/
- virtual void draw(Graphics *graphics, int offsetX, int offsetY) const;
+ virtual bool draw(Graphics *graphics, int offsetX, int offsetY) const;
/**
* Necessary for sorting with the other sprites.
@@ -247,12 +247,18 @@ class Particle : public Actor
virtual int getNumberOfLayers() const
{ return 1; }
+ virtual float getAlpha() const
+ { return 1.0f; }
+
+ virtual void setAlpha(float alpha) {}
+
protected:
bool mAlive; /**< Is the particle supposed to be drawn and updated?*/
int mLifetimeLeft; /**< Lifetime left in game ticks*/
int mLifetimePast; /**< Age of the particle in game ticks*/
int mFadeOut; /**< Lifetime in game ticks left where fading out begins*/
int mFadeIn; /**< Age in game ticks where fading in is finished*/
+ float mAlpha; /**< Opacity of the graphical representation of the particle */
// generic properties
bool mAutoDelete; /**< May the particle request its deletion by the parent particle? */