summaryrefslogtreecommitdiff
path: root/src/resources/ambientlayer.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-07-02 04:36:59 +0300
committerAndrei Karas <akaras@inbox.ru>2011-07-02 04:37:42 +0300
commitca58a3cced99fc2a8989da0155c1927bc0f08b6f (patch)
treec8fc16ac2c5c0a9184c17c2920266b96934ed28f /src/resources/ambientlayer.cpp
parentd4dd89e72f8b1e2c0517981f7e3ffac4a040f9fa (diff)
downloadmv-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/resources/ambientlayer.cpp')
-rw-r--r--src/resources/ambientlayer.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/resources/ambientlayer.cpp b/src/resources/ambientlayer.cpp
index caa4d46bf..09a235e59 100644
--- a/src/resources/ambientlayer.cpp
+++ b/src/resources/ambientlayer.cpp
@@ -47,9 +47,9 @@ AmbientLayer::AmbientLayer(Image *img, float parallax,
// Rescale the overlay to keep the ratio as if we were on
// the default resolution...
Image *rescaledOverlay = ResourceManager::getInstance()->
- getRescaled(mImage, static_cast<int>(mImage->getWidth())
+ getRescaled(mImage, static_cast<int>(mImage->mBounds.w)
/ defaultScreenWidth * graphics->getWidth(),
- static_cast<int>(mImage->getHeight())
+ static_cast<int>(mImage->mBounds.h)
/ defaultScreenHeight * graphics->getHeight());
if (rescaledOverlay)
@@ -85,8 +85,8 @@ void AmbientLayer::update(int timePassed, float dx, float dy)
mPosX += dx * mParallax;
mPosY += dy * mParallax;
- int imgW = mImage->getWidth();
- int imgH = mImage->getHeight();
+ int imgW = mImage->mBounds.w;
+ int imgH = mImage->mBounds.h;
// Wrap values
while (mPosX > imgW)
@@ -116,9 +116,9 @@ void AmbientLayer::draw(Graphics *graphics, int x, int y)
graphics->drawRescaledImagePattern(mImage, static_cast<int>(-mPosX),
static_cast<int>(-mPosY), x + static_cast<int>(mPosX),
y + static_cast<int>(mPosY),
- static_cast<int>(mImage->getWidth())
+ static_cast<int>(mImage->mBounds.w)
/ defaultScreenWidth * graphics->getWidth(),
- static_cast<int>(mImage->getHeight()) / defaultScreenHeight
+ static_cast<int>(mImage->mBounds.h) / defaultScreenHeight
* graphics->getHeight());
}
}