summaryrefslogtreecommitdiff
path: root/src/resources
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-10-22 18:01:10 +0300
committerAndrei Karas <akaras@inbox.ru>2015-10-22 18:01:10 +0300
commitfa148213572d8c48428d55ed05f984fc19445885 (patch)
tree1f534127c1b7e5d943a97f0753f4fd65ad995697 /src/resources
parent9e7d90f2c93e0158e4c6312f8cf77fe9dd1583fd (diff)
downloadmv-fa148213572d8c48428d55ed05f984fc19445885.tar.gz
mv-fa148213572d8c48428d55ed05f984fc19445885.tar.bz2
mv-fa148213572d8c48428d55ed05f984fc19445885.tar.xz
mv-fa148213572d8c48428d55ed05f984fc19445885.zip
Add support for layer property ConditionLayer for future usage.
Diffstat (limited to 'src/resources')
-rw-r--r--src/resources/mapreader.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/resources/mapreader.cpp b/src/resources/mapreader.cpp
index 9c0a9648f..4c5776e6d 100644
--- a/src/resources/mapreader.cpp
+++ b/src/resources/mapreader.cpp
@@ -766,6 +766,7 @@ void MapReader::readLayer(const XmlNodePtr node, Map *const map)
const bool isHeightLayer = (name.substr(0, 7) == "heights");
int mask = 1;
int tileCondition = -1;
+ int conditionLayer = 0;
MapLayer::Type layerType = MapLayer::TILES;
if (isCollisionLayer)
@@ -817,12 +818,21 @@ void MapReader::readLayer(const XmlNodePtr node, Map *const map)
{
tileCondition = atoi(value.c_str());
}
+ else if (pname == "ConditionLayer")
+ {
+ conditionLayer = atoi(value.c_str());
+ }
}
}
if (!xmlNameEqual(childNode, "data"))
continue;
+ // Disable for future usage "TileCondition" attribute
+ // if already set ConditionLayer to non zero
+ if (conditionLayer != 0)
+ tileCondition = -1;
+
if (layerType == MapLayer::TILES)
{
layer = new MapLayer(offsetX, offsetY,