diff options
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(); - } } |