summaryrefslogtreecommitdiff
path: root/src/imageparticle.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/imageparticle.cpp')
-rw-r--r--src/imageparticle.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/imageparticle.cpp b/src/imageparticle.cpp
index feb9548d..76c05d64 100644
--- a/src/imageparticle.cpp
+++ b/src/imageparticle.cpp
@@ -39,10 +39,10 @@ ImageParticle::~ImageParticle()
mImage->decRef();
}
-void ImageParticle::draw(Graphics *graphics, int offsetX, int offsetY) const
+bool ImageParticle::draw(Graphics *graphics, int offsetX, int offsetY) const
{
if (!mAlive || !mImage)
- return;
+ return false;
int screenX = (int) mPos.x + offsetX - mImage->getWidth() / 2;
int screenY = (int) mPos.y - (int)mPos.z + offsetY - mImage->getHeight()/2;
@@ -52,9 +52,7 @@ void ImageParticle::draw(Graphics *graphics, int offsetX, int offsetY) const
screenX > graphics->getWidth() ||
screenY + mImage->getHeight() < 0 ||
screenY > graphics->getHeight())
- {
- return;
- }
+ return false;
float alphafactor = mAlpha;
@@ -65,5 +63,5 @@ void ImageParticle::draw(Graphics *graphics, int offsetX, int offsetY) const
alphafactor *= (float) mLifetimePast / (float) mFadeIn;
mImage->setAlpha(alphafactor);
- graphics->drawImage(mImage, screenX, screenY);
+ return graphics->drawImage(mImage, screenX, screenY);
}