From f98d003e354a1792117b7cbc771d1dd91475a156 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 18 Mar 2011 17:48:29 +0200 Subject: Fix most old style cast except manaserv and libxml2 defines. --- src/imageparticle.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'src/imageparticle.cpp') diff --git a/src/imageparticle.cpp b/src/imageparticle.cpp index ec1a62fd0..2d4f21337 100644 --- a/src/imageparticle.cpp +++ b/src/imageparticle.cpp @@ -66,8 +66,8 @@ bool ImageParticle::draw(Graphics *graphics, int offsetX, int offsetY) const if (!isAlive() || !mImage) return false; - int screenX = (int) mPos.x + offsetX - mImage->getWidth() / 2; - int screenY = (int) mPos.y - (int)mPos.z + int screenX = static_cast(mPos.x) + offsetX - mImage->getWidth() / 2; + int screenY = static_cast(mPos.y) - static_cast(mPos.z) + offsetY - mImage->getHeight() / 2; // Check if on screen @@ -82,10 +82,16 @@ bool ImageParticle::draw(Graphics *graphics, int offsetX, int offsetY) const float alphafactor = mAlpha; if (mFadeOut && mLifetimeLeft > -1 && mLifetimeLeft < mFadeOut) - alphafactor *= (float) mLifetimeLeft / (float) mFadeOut; + { + alphafactor *= static_cast(mLifetimeLeft) + / static_cast(mFadeOut); + } if (mFadeIn && mLifetimePast < mFadeIn) - alphafactor *= (float) mLifetimePast / (float) mFadeIn; + { + alphafactor *= static_cast(mLifetimePast) + / static_cast(mFadeIn); + } mImage->setAlpha(alphafactor); return graphics->drawImage(mImage, screenX, screenY); -- cgit v1.2.3-70-g09d2