diff options
author | Andrei Karas <akaras@inbox.ru> | 2011-07-02 04:36:59 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2011-07-02 04:37:42 +0300 |
commit | ca58a3cced99fc2a8989da0155c1927bc0f08b6f (patch) | |
tree | c8fc16ac2c5c0a9184c17c2920266b96934ed28f /src/imageparticle.cpp | |
parent | d4dd89e72f8b1e2c0517981f7e3ffac4a040f9fa (diff) | |
download | mv-ca58a3cced99fc2a8989da0155c1927bc0f08b6f.tar.gz mv-ca58a3cced99fc2a8989da0155c1927bc0f08b6f.tar.bz2 mv-ca58a3cced99fc2a8989da0155c1927bc0f08b6f.tar.xz mv-ca58a3cced99fc2a8989da0155c1927bc0f08b6f.zip |
Replace some getters to direct member access in Image class.
Diffstat (limited to 'src/imageparticle.cpp')
-rw-r--r-- | src/imageparticle.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/imageparticle.cpp b/src/imageparticle.cpp index ca220bcc4..e38dc8cb5 100644 --- a/src/imageparticle.cpp +++ b/src/imageparticle.cpp @@ -70,14 +70,14 @@ bool ImageParticle::draw(Graphics *graphics, int offsetX, int offsetY) const if (!isAlive() || !mImage) return false; - int screenX = static_cast<int>(mPos.x) + offsetX - mImage->getWidth() / 2; + int screenX = static_cast<int>(mPos.x) + offsetX - mImage->mBounds.w / 2; int screenY = static_cast<int>(mPos.y) - static_cast<int>(mPos.z) - + offsetY - mImage->getHeight() / 2; + + offsetY - mImage->mBounds.h / 2; // Check if on screen - if (screenX + mImage->getWidth() < 0 || + if (screenX + mImage->mBounds.w < 0 || screenX > graphics->getWidth() || - screenY + mImage->getHeight() < 0 || + screenY + mImage->mBounds.h < 0 || screenY > graphics->getHeight()) { return false; |