diff options
author | Andrei Karas <akaras@inbox.ru> | 2013-12-14 17:18:04 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2013-12-14 17:18:04 +0300 |
commit | 36de2c64d6bba077775360c9c0d681f0a096ffc3 (patch) | |
tree | e505ba9337b4eabb73d4d37cdc15d6e7c1f91727 /src/being | |
parent | d9a77eb8ac5d507665cbf8b20f5d8187148ebfd1 (diff) | |
download | mv-36de2c64d6bba077775360c9c0d681f0a096ffc3.tar.gz mv-36de2c64d6bba077775360c9c0d681f0a096ffc3.tar.bz2 mv-36de2c64d6bba077775360c9c0d681f0a096ffc3.tar.xz mv-36de2c64d6bba077775360c9c0d681f0a096ffc3.zip |
chnage return values for draw functions from bool to void.
Diffstat (limited to 'src/being')
-rw-r--r-- | src/being/actor.h | 2 | ||||
-rw-r--r-- | src/being/being.cpp | 14 | ||||
-rw-r--r-- | src/being/being.h | 4 | ||||
-rw-r--r-- | src/being/compoundsprite.cpp | 7 | ||||
-rw-r--r-- | src/being/compoundsprite.h | 2 |
5 files changed, 11 insertions, 18 deletions
diff --git a/src/being/actor.h b/src/being/actor.h index 03f301a78..5f508dfa6 100644 --- a/src/being/actor.h +++ b/src/being/actor.h @@ -49,7 +49,7 @@ public: * would support setting a translation offset. It already does this * partly with the clipping rectangle support. */ - virtual bool draw(Graphics *const graphics, + virtual void draw(Graphics *const graphics, const int offsetX, const int offsetY) const = 0; /** diff --git a/src/being/being.cpp b/src/being/being.cpp index 75a7b0bb9..8990ec339 100644 --- a/src/being/being.cpp +++ b/src/being/being.cpp @@ -2248,19 +2248,16 @@ void Being::talkTo() const Net::getNpcHandler()->talk(mId); } -bool Being::draw(Graphics *const graphics, +void Being::draw(Graphics *const graphics, const int offsetX, const int offsetY) const { - bool res = true; if (!mErased) { const int px = getActorX() + offsetX; const int py = getActorY() + offsetY; ActorSprite::draw1(graphics, px, py); - res = drawSpriteAt(graphics, px, py); + drawSpriteAt(graphics, px, py); } - - return res; } void Being::drawSprites(Graphics *const graphics, @@ -2298,13 +2295,13 @@ void Being::drawSpritesSDL(Graphics *const graphics, } } -bool Being::drawSpriteAt(Graphics *const graphics, +void Being::drawSpriteAt(Graphics *const graphics, const int x, const int y) const { - bool res = CompoundSprite::draw(graphics, x, y); + CompoundSprite::draw(graphics, x, y); if (!userPalette) - return res; + return; if (mHighlightMapPortals && mMap && mSubType == 45 && !mMap->getHasWarps()) { @@ -2365,7 +2362,6 @@ bool Being::drawSpriteAt(Graphics *const graphics, y + mapTileSize - 6 + mInfo->getHpBarOffsetY(), 2 * 50, 4); } - return res; } void Being::drawHpBar(Graphics *const graphics, const int maxHP, const int hp, diff --git a/src/being/being.h b/src/being/being.h index d2314e9ee..9d595fa6f 100644 --- a/src/being/being.h +++ b/src/being/being.h @@ -683,10 +683,10 @@ class Being : public ActorSprite, public ConfigListener void talkTo() const; - bool draw(Graphics *const graphics, + void draw(Graphics *const graphics, const int offsetX, const int offsetY) const override final; - bool drawSpriteAt(Graphics *const graphics, + void drawSpriteAt(Graphics *const graphics, const int x, const int y) const; void setMoveTime() diff --git a/src/being/compoundsprite.cpp b/src/being/compoundsprite.cpp index b0442d055..ef489c166 100644 --- a/src/being/compoundsprite.cpp +++ b/src/being/compoundsprite.cpp @@ -111,7 +111,7 @@ bool CompoundSprite::update(const int time) return ret; } -bool CompoundSprite::draw(Graphics *const graphics, +void CompoundSprite::draw(Graphics *const graphics, const int posX, const int posY) const { FUNC_BLOCK("CompoundSprite::draw", 1) @@ -119,25 +119,22 @@ bool CompoundSprite::draw(Graphics *const graphics, updateImages(); if (mSprites.empty()) // Nothing to draw - return false; + return; if (mAlpha == 1.0F && mImage) { DRAW_IMAGE(graphics, mImage, posX + mOffsetX, posY + mOffsetY); - return true; } else if (mAlpha && mAlphaImage) { mAlphaImage->setAlpha(mAlpha); DRAW_IMAGE(graphics, mAlphaImage, posX + mOffsetX, posY + mOffsetY); - return true; } else { drawSprites(graphics, posX, posY); } - return false; } void CompoundSprite::drawSprites(Graphics *const graphics, diff --git a/src/being/compoundsprite.h b/src/being/compoundsprite.h index 1ffa0edd4..0ac2c90fc 100644 --- a/src/being/compoundsprite.h +++ b/src/being/compoundsprite.h @@ -65,7 +65,7 @@ public: virtual bool update(const int time) override final; - virtual bool draw(Graphics *const graphics, + virtual void draw(Graphics *const graphics, const int posX, const int posY) const override; /** |