diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-10-22 18:01:10 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-10-22 18:01:10 +0300 |
commit | fa148213572d8c48428d55ed05f984fc19445885 (patch) | |
tree | 1f534127c1b7e5d943a97f0753f4fd65ad995697 /src/resources | |
parent | 9e7d90f2c93e0158e4c6312f8cf77fe9dd1583fd (diff) | |
download | plus-fa148213572d8c48428d55ed05f984fc19445885.tar.gz plus-fa148213572d8c48428d55ed05f984fc19445885.tar.bz2 plus-fa148213572d8c48428d55ed05f984fc19445885.tar.xz plus-fa148213572d8c48428d55ed05f984fc19445885.zip |
Add support for layer property ConditionLayer for future usage.
Diffstat (limited to 'src/resources')
-rw-r--r-- | src/resources/mapreader.cpp | 10 |
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, |