summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-02-28 12:55:04 +0300
committerAndrei Karas <akaras@inbox.ru>2016-02-28 12:55:04 +0300
commit3d944b6d5ee981464f6eea4e9034d5aeb7b9423a (patch)
treecb03b9a55f0fb26853243292a05c3ddbcb4071fb
parentedfc1181738ac3cb0228006952361cd8cf3a35fb (diff)
downloadplus-3d944b6d5ee981464f6eea4e9034d5aeb7b9423a.tar.gz
plus-3d944b6d5ee981464f6eea4e9034d5aeb7b9423a.tar.bz2
plus-3d944b6d5ee981464f6eea4e9034d5aeb7b9423a.tar.xz
plus-3d944b6d5ee981464f6eea4e9034d5aeb7b9423a.zip
Ignore map layer with name "Actions" for future usage.
-rw-r--r--src/resources/map/maplayer.h3
-rw-r--r--src/resources/mapreader.cpp36
2 files changed, 26 insertions, 13 deletions
diff --git a/src/resources/map/maplayer.h b/src/resources/map/maplayer.h
index 59276a378..1fd3552e1 100644
--- a/src/resources/map/maplayer.h
+++ b/src/resources/map/maplayer.h
@@ -50,7 +50,8 @@ class MapLayer final: public ConfigListener
{
TILES = 0,
COLLISION,
- HEIGHTS
+ HEIGHTS,
+ ACTIONS
};
friend class Map;
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 =