summaryrefslogtreecommitdiff
path: root/src/resources/ambientlayer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/resources/ambientlayer.cpp')
-rw-r--r--src/resources/ambientlayer.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/resources/ambientlayer.cpp b/src/resources/ambientlayer.cpp
index 361b2e391..b74ba96db 100644
--- a/src/resources/ambientlayer.cpp
+++ b/src/resources/ambientlayer.cpp
@@ -31,11 +31,13 @@
#include "debug.h"
-AmbientLayer::AmbientLayer(Image *const img, const float parallax,
+AmbientLayer::AmbientLayer(Image *const img,
+ const float parallaxX, const float parallaxY,
const float speedX, const float speedY,
const bool keepRatio, const int mask) :
mImage(img),
- mParallax(parallax),
+ mParallaxX(parallaxX),
+ mParallaxY(parallaxY),
mPosX(0),
mPosY(0),
mSpeedX(speedX),
@@ -90,8 +92,8 @@ void AmbientLayer::update(const int timePassed, const float dx, const float dy)
mPosY -= mSpeedY * time;
// Parallax scrolling
- mPosX += dx * mParallax;
- mPosY += dy * mParallax;
+ mPosX += dx * mParallaxX;
+ mPosY += dy * mParallaxY;
const SDL_Rect &rect = mImage->mBounds;
const float imgW = rect.w;