diff options
Diffstat (limited to 'src/being.cpp')
-rw-r--r-- | src/being.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/being.cpp b/src/being.cpp index 37ae2200..32a3b5c3 100644 --- a/src/being.cpp +++ b/src/being.cpp @@ -82,6 +82,8 @@ Being::Being(int id, int job, Map *map): mEquippedWeapon(NULL), mText(0), mStunMode(0), + mAlpha(1.0f), + mNumberOfLayers(0), mStatusParticleEffects(&mStunParticleEffects, false), mChildParticleEffects(&mStatusParticleEffects, false), mMustResetParticles(false), @@ -605,7 +607,11 @@ void Being::draw(Graphics *graphics, int offsetX, int offsetY) const for (SpriteConstIterator it = mSprites.begin(); it != mSprites.end(); it++) if (*it) + { + if ((*it)->getAlpha() != mAlpha) + (*it)->setAlpha(mAlpha); (*it)->draw(graphics, px, py); + } } void Being::drawEmotion(Graphics *graphics, int offsetX, int offsetY) @@ -910,3 +916,15 @@ void Being::load() mNumberOfHairstyles = hairstyles; } + +void Being::_updateNumberOfLayers() +{ + SpriteConstIterator si = mSprites.begin(); + mNumberOfLayers = 0; + while (si != mSprites.end()) + { + if (*si) + mNumberOfLayers++; + si++; + } +} |