diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-02-28 12:55:04 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-02-28 12:55:04 +0300 |
commit | 3d944b6d5ee981464f6eea4e9034d5aeb7b9423a (patch) | |
tree | cb03b9a55f0fb26853243292a05c3ddbcb4071fb /src/resources/mapreader.cpp | |
parent | edfc1181738ac3cb0228006952361cd8cf3a35fb (diff) | |
download | manaplus-3d944b6d5ee981464f6eea4e9034d5aeb7b9423a.tar.gz manaplus-3d944b6d5ee981464f6eea4e9034d5aeb7b9423a.tar.bz2 manaplus-3d944b6d5ee981464f6eea4e9034d5aeb7b9423a.tar.xz manaplus-3d944b6d5ee981464f6eea4e9034d5aeb7b9423a.zip |
Ignore map layer with name "Actions" for future usage.
Diffstat (limited to 'src/resources/mapreader.cpp')
-rw-r--r-- | src/resources/mapreader.cpp | 36 |
1 files changed, 24 insertions, 12 deletions
diff --git a/src/resources/mapreader.cpp b/src/resources/mapreader.cpp index ff0fa6a7d..d9e068d7c 100644 --- a/src/resources/mapreader.cpp +++ b/src/resources/mapreader.cpp @@ -577,6 +577,7 @@ inline static void setTile(Map *const map, } default: + case MapLayer::ACTIONS: break; } } @@ -764,6 +765,7 @@ void MapReader::readLayer(const XmlNodePtr node, Map *const map) const bool isFringeLayer = (name.substr(0, 6) == "fringe"); const bool isCollisionLayer = (name.substr(0, 9) == "collision"); const bool isHeightLayer = (name.substr(0, 7) == "heights"); + const bool isActionsLayer = (name.substr(0, 7) == "actions"); int mask = 1; int tileCondition = -1; int conditionLayer = 0; @@ -773,6 +775,8 @@ void MapReader::readLayer(const XmlNodePtr node, Map *const map) layerType = MapLayer::COLLISION; else if (isHeightLayer) layerType = MapLayer::HEIGHTS; + else if (isActionsLayer) + layerType = MapLayer::ACTIONS; map->indexTilesets(); @@ -833,19 +837,27 @@ void MapReader::readLayer(const XmlNodePtr node, Map *const map) if (conditionLayer != 0) tileCondition = -1; - if (layerType == MapLayer::TILES) + switch (layerType) { - layer = new MapLayer(offsetX, offsetY, - w, h, - isFringeLayer, - mask, - tileCondition); - map->addLayer(layer); - } - else if (layerType == MapLayer::HEIGHTS) - { - heights = new MapHeights(w, h); - map->addHeights(heights); + case MapLayer::TILES: + { + layer = new MapLayer(offsetX, offsetY, + w, h, + isFringeLayer, + mask, + tileCondition); + map->addLayer(layer); + break; + } + case MapLayer::HEIGHTS: + { + heights = new MapHeights(w, h); + map->addHeights(heights); + break; + } + default: + case MapLayer::ACTIONS: + break; } const std::string encoding = |