diff options
author | Thorbjørn Lindeijer <thorbjorn@lindeijer.nl> | 2010-02-07 19:07:04 +0100 |
---|---|---|
committer | Thorbjørn Lindeijer <thorbjorn@lindeijer.nl> | 2010-02-07 19:07:04 +0100 |
commit | a3157908d23fd711ea96797dffce064953cb8fb6 (patch) | |
tree | 2f237b21118461a9948f3ccb829f62038564dedf /src/being.cpp | |
parent | 1208d5383a9bfd03f338ccf71fb9764790b2e1a9 (diff) | |
download | mana-a3157908d23fd711ea96797dffce064953cb8fb6.tar.gz mana-a3157908d23fd711ea96797dffce064953cb8fb6.tar.bz2 mana-a3157908d23fd711ea96797dffce064953cb8fb6.tar.xz mana-a3157908d23fd711ea96797dffce064953cb8fb6.zip |
Nicer way of indicating that we're waiting on the server
No longer a dialog with an annoying progress bar (due to going back and
forth), but rather a progress indicator that integrates better with the
background.
Diffstat (limited to 'src/being.cpp')
-rw-r--r-- | src/being.cpp | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/src/being.cpp b/src/being.cpp index 9331e8de..20d7319a 100644 --- a/src/being.cpp +++ b/src/being.cpp @@ -638,12 +638,14 @@ void Being::draw(Graphics *graphics, int offsetX, int offsetY) const mUsedTargetCursor->draw(graphics, px, py); 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::drawSpriteAt(Graphics *graphics, int x, int y) const @@ -652,12 +654,14 @@ void Being::drawSpriteAt(Graphics *graphics, int x, int y) const const int py = y - 32; 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) @@ -819,8 +823,8 @@ int Being::getWidth() const if (base) return std::max(base->getWidth(), DEFAULT_BEING_WIDTH); - else - return DEFAULT_BEING_WIDTH; + + return DEFAULT_BEING_WIDTH; } int Being::getHeight() const @@ -833,11 +837,11 @@ int Being::getHeight() const if (base) return std::max(base->getHeight(), DEFAULT_BEING_HEIGHT); - else - return DEFAULT_BEING_HEIGHT; + + return DEFAULT_BEING_HEIGHT; } -void Being::setTargetAnimation(SimpleAnimation* animation) +void Being::setTargetAnimation(SimpleAnimation *animation) { mUsedTargetCursor = animation; mUsedTargetCursor->reset(); @@ -889,13 +893,13 @@ static EffectDescription *getEffectDescription(int effectId) } else if (xmlStrEqual(node->name, BAD_CAST "default")) { - EffectDescription *EffectDescription = + EffectDescription *effectDescription = getEffectDescription(node, &id); if (default_effect) delete default_effect; - default_effect = EffectDescription; + default_effect = effectDescription; } } @@ -904,10 +908,7 @@ static EffectDescription *getEffectDescription(int effectId) EffectDescription *ed = effects[effectId]; - if (!ed) - return default_effect; - else - return ed; + return ed ? ed : default_effect; } void Being::internalTriggerEffect(int effectId, bool sfx, bool gfx) @@ -965,7 +966,6 @@ void Being::showName() mDispName = new FlashText(mDisplayName, getPixelX(), getPixelY(), gcn::Graphics::CENTER, mNameColor); - } int Being::getNumberOfLayers() const @@ -988,7 +988,5 @@ void Being::load() void Being::updateName() { if (mShowName) - { showName(); - } } |