summaryrefslogtreecommitdiff
path: root/src/being.h
diff options
context:
space:
mode:
authorBertram <bertram@cegetel.net>2009-09-17 02:14:12 +0200
committerBertram <bertram@cegetel.net>2009-09-17 02:14:12 +0200
commitfde41392cde408af9ea269e00336e503294dfdd2 (patch)
treefbdda716c1d441b7d85e686e054e3346396a144d /src/being.h
parent78134dc88b0b39b0d051392fa937418bcd384404 (diff)
downloadmana-fde41392cde408af9ea269e00336e503294dfdd2.tar.gz
mana-fde41392cde408af9ea269e00336e503294dfdd2.tar.bz2
mana-fde41392cde408af9ea269e00336e503294dfdd2.tar.xz
mana-fde41392cde408af9ea269e00336e503294dfdd2.zip
Partially (but mainly) resolved Mantis #753 by making monsters, NPC, and Floor Items visible even covered.
Next Step would be to add a caching system for multi-layered sprites + copy functions for SDL and OpenGL. Then, I'll be able to finish this, by making also players visible when covered... But Kage asked me (each and every hour) to do something else first ;)
Diffstat (limited to 'src/being.h')
-rw-r--r--src/being.h45
1 files changed, 41 insertions, 4 deletions
diff --git a/src/being.h b/src/being.h
index ad7f3459..1f9ada92 100644
--- a/src/being.h
+++ b/src/being.h
@@ -215,14 +215,29 @@ class Being : public Sprite, public ConfigListener
*/
virtual void setName(const std::string &name);
- const bool getShowName() const { return mShowName; }
+ const bool getShowName() const
+ { return mShowName; }
virtual void setShowName(bool doShowName);
/**
* Get the number of hairstyles implemented
*/
- static int getNumOfHairstyles() { return mNumberOfHairstyles; }
+ static int getNumOfHairstyles()
+ { return mNumberOfHairstyles; }
+
+ /**
+ * Get the number of layers used to draw the being
+ */
+ int getNumberOfLayers() const
+ { return mNumberOfLayers; }
+
+ /**
+ * Set the number of layers used to draw the being
+ */
+ void setNumberOfLayers(int numberOfLayers)
+ { mNumberOfLayers = numberOfLayers; }
+
#ifdef EATHENA_SUPPORT
/**
@@ -311,16 +326,30 @@ class Being : public Sprite, public ConfigListener
virtual void draw(Graphics *graphics, int offsetX, int offsetY) const;
/**
+ * Set the alpha opacity used to draw the being.
+ */
+ virtual void setAlpha(float alpha)
+ { mAlpha = alpha; }
+
+ /**
+ * Returns the current alpha opacity of the Being.
+ */
+ virtual float getAlpha() const
+ { return mAlpha; }
+
+ /**
* Returns the X coordinate in pixels.
*/
- int getPixelX() const { return mPx; }
+ int getPixelX() const
+ { return mPx; }
/**
* Returns the Y coordinate in pixels.
*
* @see Sprite::getPixelY()
*/
- int getPixelY() const { return mPy; }
+ int getPixelY() const
+ { return mPy; }
#ifdef EATHENA_SUPPORT
/**
@@ -526,6 +555,14 @@ class Being : public Sprite, public ConfigListener
typedef Sprites::iterator SpriteIterator;
typedef Sprites::const_iterator SpriteConstIterator;
Sprites mSprites;
+ float mAlpha; /**< Alpha opacity to draw the sprite */
+
+ /** Stores the number of layers used to draw the being */
+ int mNumberOfLayers;
+
+ /** This method counts reliably the sprite layers currently used */
+ void _updateNumberOfLayers();
+
ParticleList mStunParticleEffects;
ParticleVector mStatusParticleEffects;
ParticleList mChildParticleEffects;