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/resources/ambientlayer.cpp | |
parent | d4dd89e72f8b1e2c0517981f7e3ffac4a040f9fa (diff) | |
download | manaplus-ca58a3cced99fc2a8989da0155c1927bc0f08b6f.tar.gz manaplus-ca58a3cced99fc2a8989da0155c1927bc0f08b6f.tar.bz2 manaplus-ca58a3cced99fc2a8989da0155c1927bc0f08b6f.tar.xz manaplus-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.cpp | 12 |
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()); } } |