From da73354d0c3d9cf8507fe9d88a5e778fdbb7fa44 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 19 Dec 2013 22:18:58 +0300 Subject: add new parallax attributes. Old attribute: parallax New attributes: parallaxX, parallaxY Before parallax was used for x and y. If parallaxX or parallaxY missing can be used parallax. --- src/map.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/map.cpp') diff --git a/src/map.cpp b/src/map.cpp index 9d5eafc7b..d080406c6 100644 --- a/src/map.cpp +++ b/src/map.cpp @@ -286,8 +286,10 @@ void Map::initializeAmbientLayers() int mask = atoi(getProperty(name + "mask").c_str()); if (!mask) mask = 1; + const float parallax = getFloatProperty(name + "parallax"); mForegrounds.push_back(new AmbientLayer(img, - getFloatProperty(name + "parallax"), + getFloatProperty(name + "parallaxX", parallax), + getFloatProperty(name + "parallaxY", parallax), getFloatProperty(name + "scrollX"), getFloatProperty(name + "scrollY"), getBoolProperty(name + "keepratio"), @@ -310,8 +312,11 @@ void Map::initializeAmbientLayers() int mask = atoi(getProperty(name + "mask").c_str()); if (!mask) mask = 1; - mBackgrounds.push_back(new AmbientLayer(img, - getFloatProperty(name + "parallax"), + + const float parallax = getFloatProperty(name + "parallax"); + mForegrounds.push_back(new AmbientLayer(img, + getFloatProperty(name + "parallaxX", parallax), + getFloatProperty(name + "parallaxY", parallax), getFloatProperty(name + "scrollX"), getFloatProperty(name + "scrollY"), getBoolProperty(name + "keepratio"), -- cgit v1.2.3-70-g09d2