From 41b8151a3f04bc1cb0127bdf5c10e0dd8275bad5 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 19 Dec 2013 21:01:14 +0300 Subject: improve a bit ambientlayer. --- src/resources/ambientlayer.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/resources/ambientlayer.cpp') diff --git a/src/resources/ambientlayer.cpp b/src/resources/ambientlayer.cpp index cc9ebdaec..361b2e391 100644 --- a/src/resources/ambientlayer.cpp +++ b/src/resources/ambientlayer.cpp @@ -33,7 +33,7 @@ AmbientLayer::AmbientLayer(Image *const img, const float parallax, const float speedX, const float speedY, - const bool keepRatio, int mask) : + const bool keepRatio, const int mask) : mImage(img), mParallax(parallax), mPosX(0), @@ -93,8 +93,9 @@ void AmbientLayer::update(const int timePassed, const float dx, const float dy) mPosX += dx * mParallax; mPosY += dy * mParallax; - const float imgW = mImage->mBounds.w; - const float imgH = mImage->mBounds.h; + const SDL_Rect &rect = mImage->mBounds; + const float imgW = rect.w; + const float imgH = rect.h; // Wrap values while (mPosX > imgW) -- cgit v1.2.3-70-g09d2