From ca58a3cced99fc2a8989da0155c1927bc0f08b6f Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 2 Jul 2011 04:36:59 +0300 Subject: Replace some getters to direct member access in Image class. --- src/resources/ambientlayer.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/resources/ambientlayer.cpp') 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(mImage->getWidth()) + getRescaled(mImage, static_cast(mImage->mBounds.w) / defaultScreenWidth * graphics->getWidth(), - static_cast(mImage->getHeight()) + static_cast(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(-mPosX), static_cast(-mPosY), x + static_cast(mPosX), y + static_cast(mPosY), - static_cast(mImage->getWidth()) + static_cast(mImage->mBounds.w) / defaultScreenWidth * graphics->getWidth(), - static_cast(mImage->getHeight()) / defaultScreenHeight + static_cast(mImage->mBounds.h) / defaultScreenHeight * graphics->getHeight()); } } -- cgit v1.2.3-60-g2f50