diff options
author | Andrei Karas <akaras@inbox.ru> | 2013-12-19 22:18:58 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2013-12-19 22:18:58 +0300 |
commit | da73354d0c3d9cf8507fe9d88a5e778fdbb7fa44 (patch) | |
tree | d05a33c0a234c4a9386639bf742239f3cedd50d6 /src/map.cpp | |
parent | 41b8151a3f04bc1cb0127bdf5c10e0dd8275bad5 (diff) | |
download | manaplus-da73354d0c3d9cf8507fe9d88a5e778fdbb7fa44.tar.gz manaplus-da73354d0c3d9cf8507fe9d88a5e778fdbb7fa44.tar.bz2 manaplus-da73354d0c3d9cf8507fe9d88a5e778fdbb7fa44.tar.xz manaplus-da73354d0c3d9cf8507fe9d88a5e778fdbb7fa44.zip |
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.
Diffstat (limited to 'src/map.cpp')
-rw-r--r-- | src/map.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
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"), |