summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/map.cpp4
-rw-r--r--src/resources/ambientlayer.cpp15
-rw-r--r--src/resources/ambientlayer.h11
3 files changed, 22 insertions, 8 deletions
diff --git a/src/map.cpp b/src/map.cpp
index b17e9ebdb..5dc1bfc0f 100644
--- a/src/map.cpp
+++ b/src/map.cpp
@@ -290,6 +290,8 @@ void Map::initializeAmbientLayers()
mForegrounds.push_back(new AmbientLayer(img,
getFloatProperty(name + "parallaxX", parallax),
getFloatProperty(name + "parallaxY", parallax),
+ getFloatProperty(name + "posX"),
+ getFloatProperty(name + "posY"),
getFloatProperty(name + "scrollX"),
getFloatProperty(name + "scrollY"),
getBoolProperty(name + "keepratio"),
@@ -317,6 +319,8 @@ void Map::initializeAmbientLayers()
mForegrounds.push_back(new AmbientLayer(img,
getFloatProperty(name + "parallaxX", parallax),
getFloatProperty(name + "parallaxY", parallax),
+ getFloatProperty(name + "posX"),
+ getFloatProperty(name + "posY"),
getFloatProperty(name + "scrollX"),
getFloatProperty(name + "scrollY"),
getBoolProperty(name + "keepratio"),
diff --git a/src/resources/ambientlayer.cpp b/src/resources/ambientlayer.cpp
index c9574c589..b839064be 100644
--- a/src/resources/ambientlayer.cpp
+++ b/src/resources/ambientlayer.cpp
@@ -32,14 +32,19 @@
#include "debug.h"
AmbientLayer::AmbientLayer(Image *const img,
- const float parallaxX, const float parallaxY,
- const float speedX, const float speedY,
- const bool keepRatio, const int mask) :
+ const float parallaxX,
+ const float parallaxY,
+ const float posX,
+ const float posY,
+ const float speedX,
+ const float speedY,
+ const bool keepRatio,
+ const int mask) :
mImage(img),
mParallaxX(parallaxX),
mParallaxY(parallaxY),
- mPosX(0),
- mPosY(0),
+ mPosX(posX),
+ mPosY(posY),
mSpeedX(speedX),
mSpeedY(speedY),
mMask(mask),
diff --git a/src/resources/ambientlayer.h b/src/resources/ambientlayer.h
index 9a694bb2f..f6dd6d120 100644
--- a/src/resources/ambientlayer.h
+++ b/src/resources/ambientlayer.h
@@ -44,9 +44,14 @@ class AmbientLayer final
* the same ratio than in 800x600 resolution mode.
*/
AmbientLayer(Image *const img,
- const float parallax, const float parallaxY,
- const float speedX, const float speedY,
- const bool keepRatio, const int mask);
+ const float parallax,
+ const float parallaxY,
+ const float posX,
+ const float posY,
+ const float speedX,
+ const float speedY,
+ const bool keepRatio,
+ const int mask);
A_DELETE_COPY(AmbientLayer)