diff options
author | Andrei Karas <akaras@inbox.ru> | 2013-12-19 21:01:14 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2013-12-19 21:01:14 +0300 |
commit | 41b8151a3f04bc1cb0127bdf5c10e0dd8275bad5 (patch) | |
tree | c316fc4d0466b6e9a8e0c3f65e274c9d717e03d0 | |
parent | f0315000bcf20685471966d2f25cd8e9f35e8230 (diff) | |
download | manaverse-41b8151a3f04bc1cb0127bdf5c10e0dd8275bad5.tar.gz manaverse-41b8151a3f04bc1cb0127bdf5c10e0dd8275bad5.tar.bz2 manaverse-41b8151a3f04bc1cb0127bdf5c10e0dd8275bad5.tar.xz manaverse-41b8151a3f04bc1cb0127bdf5c10e0dd8275bad5.zip |
improve a bit ambientlayer.
-rw-r--r-- | src/resources/ambientlayer.cpp | 7 | ||||
-rw-r--r-- | src/resources/ambientlayer.h | 2 |
2 files changed, 5 insertions, 4 deletions
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) diff --git a/src/resources/ambientlayer.h b/src/resources/ambientlayer.h index 3403c0455..4ce13179e 100644 --- a/src/resources/ambientlayer.h +++ b/src/resources/ambientlayer.h @@ -45,7 +45,7 @@ class AmbientLayer final */ AmbientLayer(Image *const img, const float parallax, const float speedX, const float speedY, - const bool keepRatio, int mask); + const bool keepRatio, const int mask); A_DELETE_COPY(AmbientLayer) |