summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-12-14 17:18:04 +0300
committerAndrei Karas <akaras@inbox.ru>2013-12-14 17:18:04 +0300
commit36de2c64d6bba077775360c9c0d681f0a096ffc3 (patch)
treee505ba9337b4eabb73d4d37cdc15d6e7c1f91727
parentd9a77eb8ac5d507665cbf8b20f5d8187148ebfd1 (diff)
downloadplus-36de2c64d6bba077775360c9c0d681f0a096ffc3.tar.gz
plus-36de2c64d6bba077775360c9c0d681f0a096ffc3.tar.bz2
plus-36de2c64d6bba077775360c9c0d681f0a096ffc3.tar.xz
plus-36de2c64d6bba077775360c9c0d681f0a096ffc3.zip
chnage return values for draw functions from bool to void.
-rw-r--r--src/animatedsprite.cpp5
-rw-r--r--src/animatedsprite.h2
-rw-r--r--src/being/actor.h2
-rw-r--r--src/being/being.cpp14
-rw-r--r--src/being/being.h4
-rw-r--r--src/being/compoundsprite.cpp7
-rw-r--r--src/being/compoundsprite.h2
-rw-r--r--src/flooritem.cpp7
-rw-r--r--src/flooritem.h2
-rw-r--r--src/imagesprite.cpp5
-rw-r--r--src/imagesprite.h2
-rw-r--r--src/particle/imageparticle.cpp8
-rw-r--r--src/particle/imageparticle.h2
-rw-r--r--src/particle/particle.cpp3
-rw-r--r--src/particle/particle.h2
-rw-r--r--src/particle/textparticle.cpp8
-rw-r--r--src/particle/textparticle.h2
-rw-r--r--src/simpleanimation.cpp5
-rw-r--r--src/simpleanimation.h2
-rw-r--r--src/sprite.h2
20 files changed, 37 insertions, 49 deletions
diff --git a/src/animatedsprite.cpp b/src/animatedsprite.cpp
index 2f167e794..0d3755617 100644
--- a/src/animatedsprite.cpp
+++ b/src/animatedsprite.cpp
@@ -283,12 +283,12 @@ bool AnimatedSprite::updateCurrentAnimation(const unsigned int time)
return true;
}
-bool AnimatedSprite::draw(Graphics *const graphics,
+void AnimatedSprite::draw(Graphics *const graphics,
const int posX, const int posY) const
{
FUNC_BLOCK("AnimatedSprite::draw", 1)
if (!mFrame || !mFrame->image)
- return false;
+ return;
Image *const image = mFrame->image;
if (image->getAlpha() != mAlpha)
@@ -296,7 +296,6 @@ bool AnimatedSprite::draw(Graphics *const graphics,
DRAW_IMAGE(graphics, image,
posX + mFrame->offsetX, posY + mFrame->offsetY);
- return true;
}
bool AnimatedSprite::setSpriteDirection(const SpriteDirection direction)
diff --git a/src/animatedsprite.h b/src/animatedsprite.h
index 7b92d5d0e..45af4eea2 100644
--- a/src/animatedsprite.h
+++ b/src/animatedsprite.h
@@ -69,7 +69,7 @@ class AnimatedSprite final : public Sprite
bool update(const int time) override final;
- bool draw(Graphics *const graphics,
+ void draw(Graphics *const graphics,
const int posX, const int posY) const override final;
int getWidth() const A_WARN_UNUSED;
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;
/**
diff --git a/src/flooritem.cpp b/src/flooritem.cpp
index 3019dca02..bd97f0ff8 100644
--- a/src/flooritem.cpp
+++ b/src/flooritem.cpp
@@ -100,11 +100,11 @@ std::string FloorItem::getName() const
return info.getName();
}
-bool FloorItem::draw(Graphics *const graphics,
+void FloorItem::draw(Graphics *const graphics,
const int offsetX, const int offsetY) const
{
if (!mMap)
- return false;
+ return;
BLOCK_START("FloorItem::draw")
const int x = mX * mMap->getTileWidth() + offsetX;
@@ -147,7 +147,7 @@ bool FloorItem::draw(Graphics *const graphics,
const int px = getActorX() + offsetX;
const int py = getActorY() + offsetY;
ActorSprite::draw1(graphics, px, py);
- const bool res = CompoundSprite::draw(graphics, px, py);
+ CompoundSprite::draw(graphics, px, py);
if (mHighlight)
{
@@ -160,5 +160,4 @@ bool FloorItem::draw(Graphics *const graphics,
}
}
BLOCK_END("FloorItem::draw")
- return res;
}
diff --git a/src/flooritem.h b/src/flooritem.h
index 2d825b310..4078fbaff 100644
--- a/src/flooritem.h
+++ b/src/flooritem.h
@@ -55,7 +55,7 @@ class FloorItem final : public ActorSprite
Type getType() const override final A_WARN_UNUSED
{ return FLOOR_ITEM; }
- bool draw(Graphics *const graphics,
+ void draw(Graphics *const graphics,
const int offsetX, const int offsetY) const override final;
/**
diff --git a/src/imagesprite.cpp b/src/imagesprite.cpp
index 5e9cc9463..71592566c 100644
--- a/src/imagesprite.cpp
+++ b/src/imagesprite.cpp
@@ -48,14 +48,13 @@ ImageSprite::~ImageSprite()
}
}
-bool ImageSprite::draw(Graphics *const graphics,
+void ImageSprite::draw(Graphics *const graphics,
const int posX, const int posY) const
{
FUNC_BLOCK("ImageSprite::draw", 1)
if (!mImage)
- return false;
+ return;
mImage->setAlpha(mAlpha);
DRAW_IMAGE(graphics, mImage, posX, posY);
- return true;
}
diff --git a/src/imagesprite.h b/src/imagesprite.h
index e51878e31..24df11aab 100644
--- a/src/imagesprite.h
+++ b/src/imagesprite.h
@@ -46,7 +46,7 @@ public:
bool update(const int time A_UNUSED) override final
{ return false; }
- bool draw(Graphics *const graphics,
+ void draw(Graphics *const graphics,
const int posX, const int posY) const override final;
int getWidth() const override final A_WARN_UNUSED
diff --git a/src/particle/imageparticle.cpp b/src/particle/imageparticle.cpp
index 0654b3c6f..fa96f5962 100644
--- a/src/particle/imageparticle.cpp
+++ b/src/particle/imageparticle.cpp
@@ -67,12 +67,12 @@ ImageParticle::~ImageParticle()
}
}
-bool ImageParticle::draw(Graphics *const graphics,
+void ImageParticle::draw(Graphics *const graphics,
const int offsetX, const int offsetY) const
{
FUNC_BLOCK("ImageParticle::draw", 1)
if (mAlive != ALIVE || !mImage)
- return false;
+ return;
const int screenX = static_cast<int>(mPos.x)
+ offsetX - mImage->mBounds.w / 2;
@@ -85,7 +85,7 @@ bool ImageParticle::draw(Graphics *const graphics,
screenY + mImage->mBounds.h < 0 ||
screenY > graphics->mHeight)
{
- return false;
+ return;
}
float alphafactor = mAlpha;
@@ -104,5 +104,5 @@ bool ImageParticle::draw(Graphics *const graphics,
mImage->setAlpha(alphafactor);
DRAW_IMAGE(graphics, mImage, screenX, screenY);
- return true;
+ return;
}
diff --git a/src/particle/imageparticle.h b/src/particle/imageparticle.h
index daae640ce..91a11bfc2 100644
--- a/src/particle/imageparticle.h
+++ b/src/particle/imageparticle.h
@@ -53,7 +53,7 @@ class ImageParticle : public Particle
/**
* Draws the particle image
*/
- virtual bool draw(Graphics *const graphics,
+ virtual void draw(Graphics *const graphics,
const int offsetX,
const int offsetY) const override final;
diff --git a/src/particle/particle.cpp b/src/particle/particle.cpp
index 7bdc24345..99e4117ae 100644
--- a/src/particle/particle.cpp
+++ b/src/particle/particle.cpp
@@ -98,9 +98,8 @@ void Particle::setupEngine()
logger->log1("Particle engine set up");
}
-bool Particle::draw(Graphics *const, const int, const int) const
+void Particle::draw(Graphics *const, const int, const int) const
{
- return false;
}
bool Particle::update()
diff --git a/src/particle/particle.h b/src/particle/particle.h
index f677ee01b..d14db0572 100644
--- a/src/particle/particle.h
+++ b/src/particle/particle.h
@@ -100,7 +100,7 @@ class Particle : public Actor
/**
* Draws the particle image.
*/
- virtual bool draw(Graphics *const graphics,
+ virtual void draw(Graphics *const graphics,
const int offsetX,
const int offsetY) const override;
diff --git a/src/particle/textparticle.cpp b/src/particle/textparticle.cpp
index 0a1798c21..355102531 100644
--- a/src/particle/textparticle.cpp
+++ b/src/particle/textparticle.cpp
@@ -43,17 +43,17 @@ TextParticle::TextParticle(const std::string &text,
{
}
-bool TextParticle::draw(Graphics *const graphics,
+void TextParticle::draw(Graphics *const graphics,
const int offsetX, const int offsetY) const
{
if (!mColor || !mTextFont)
- return false;
+ return;
BLOCK_START("TextParticle::draw")
if (!isAlive())
{
BLOCK_END("TextParticle::draw")
- return false;
+ return;
}
const int screenX = static_cast<int>(mPos.x) + offsetX;
@@ -85,5 +85,5 @@ bool TextParticle::draw(Graphics *const graphics,
}
mTextFont->drawString(graphics, mText, screenX - mTextWidth, screenY);
BLOCK_END("TextParticle::draw")
- return true;
+ return;
}
diff --git a/src/particle/textparticle.h b/src/particle/textparticle.h
index 7b63ff259..47cf14d62 100644
--- a/src/particle/textparticle.h
+++ b/src/particle/textparticle.h
@@ -40,7 +40,7 @@ class TextParticle final : public Particle
/**
* Draws the particle image.
*/
- bool draw(Graphics *const graphics,
+ void draw(Graphics *const graphics,
const int offsetX, const int offsetY) const override final;
// hack to improve text visibility
diff --git a/src/simpleanimation.cpp b/src/simpleanimation.cpp
index b1efc16e5..77e84d835 100644
--- a/src/simpleanimation.cpp
+++ b/src/simpleanimation.cpp
@@ -72,16 +72,15 @@ SimpleAnimation::~SimpleAnimation()
}
}
-bool SimpleAnimation::draw(Graphics *const graphics,
+void SimpleAnimation::draw(Graphics *const graphics,
const int posX, const int posY) const
{
FUNC_BLOCK("SimpleAnimation::draw", 1)
if (!mCurrentFrame || !mCurrentFrame->image)
- return false;
+ return;
DRAW_IMAGE(graphics, mCurrentFrame->image,
posX + mCurrentFrame->offsetX, posY + mCurrentFrame->offsetY);
- return true;
}
void SimpleAnimation::reset()
diff --git a/src/simpleanimation.h b/src/simpleanimation.h
index 3e382c9f6..c78b5009c 100644
--- a/src/simpleanimation.h
+++ b/src/simpleanimation.h
@@ -63,7 +63,7 @@ class SimpleAnimation final
bool update(const int timePassed);
- bool draw(Graphics *const graphics,
+ void draw(Graphics *const graphics,
const int posX, const int posY) const;
/**
diff --git a/src/sprite.h b/src/sprite.h
index c31accdd4..75c81b29b 100644
--- a/src/sprite.h
+++ b/src/sprite.h
@@ -61,7 +61,7 @@ class Sprite
* Draw the current animation frame at the coordinates given in screen
* pixels.
*/
- virtual bool draw(Graphics *const graphics,
+ virtual void draw(Graphics *const graphics,
const int posX, const int posY) const = 0;
/**