summaryrefslogtreecommitdiff
path: root/src/resources/mapreader.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-06-22 20:58:13 +0300
committerAndrei Karas <akaras@inbox.ru>2014-06-22 20:58:13 +0300
commit8ad99cc3f4dd98f0b73a2ece9323f01099a81e80 (patch)
tree33115940e6efabec34efb71e0be6b6d7dfd7e4df /src/resources/mapreader.cpp
parent04f47f060f94ec0e2dfc3cccf62cff167e0ecd68 (diff)
downloadmv-8ad99cc3f4dd98f0b73a2ece9323f01099a81e80.tar.gz
mv-8ad99cc3f4dd98f0b73a2ece9323f01099a81e80.tar.bz2
mv-8ad99cc3f4dd98f0b73a2ece9323f01099a81e80.tar.xz
mv-8ad99cc3f4dd98f0b73a2ece9323f01099a81e80.zip
Add profiler lines into some functions.
Diffstat (limited to 'src/resources/mapreader.cpp')
-rw-r--r--src/resources/mapreader.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/resources/mapreader.cpp b/src/resources/mapreader.cpp
index f8515d021..95321fc0f 100644
--- a/src/resources/mapreader.cpp
+++ b/src/resources/mapreader.cpp
@@ -273,7 +273,9 @@ Map *MapReader::readMap(const std::string &restrict filename,
void MapReader::loadLayers(const std::string &path)
{
+ BLOCK_START("MapReader::loadLayers")
loadXmlDir2(path, addLayerToList, ".tmx");
+ BLOCK_END("MapReader::loadLayers")
}
void MapReader::unloadTempLayers()
@@ -326,6 +328,7 @@ Map *MapReader::readMap(XmlNodePtrConst node, const std::string &path)
ResourceManager *const resman = ResourceManager::getInstance();
#ifdef USE_OPENGL
+ BLOCK_START("MapReader::readMap load atlas")
if (graphicsManager.getUseAtlases())
{
const MapInfo *const info = MapDB::getMapAtlas(fileName);
@@ -335,6 +338,7 @@ Map *MapReader::readMap(XmlNodePtrConst node, const std::string &path)
info->atlas, *info->files));
}
}
+ BLOCK_END("MapReader::readMap load atlas")
#endif
for_each_xml_child_node(childNode, node)
@@ -460,8 +464,12 @@ Map *MapReader::readMap(XmlNodePtrConst node, const std::string &path)
void MapReader::readProperties(const XmlNodePtrConst node,
Properties *const props)
{
+ BLOCK_START("MapReader::readProperties")
if (!node || !props)
+ {
+ BLOCK_END("MapReader::readProperties")
return;
+ }
for_each_xml_child_node(childNode, node)
{
@@ -475,6 +483,7 @@ void MapReader::readProperties(const XmlNodePtrConst node,
if (!name.empty() && !value.empty())
props->setProperty(name, value);
}
+ BLOCK_END("MapReader::readProperties")
}
inline static void setTile(Map *const map, MapLayer *const layer,
@@ -863,8 +872,12 @@ Tileset *MapReader::readTileset(XmlNodePtr node,
const std::string &path,
Map *const map)
{
+ BLOCK_START("MapReader::readTileset")
if (!map)
+ {
+ BLOCK_END("MapReader::readTileset")
return nullptr;
+ }
const int firstGid = XML::getProperty(node, "firstgid", 0);
const int margin = XML::getProperty(node, "margin", 0);
@@ -884,6 +897,7 @@ Tileset *MapReader::readTileset(XmlNodePtr node,
if (!node)
{
delete doc;
+ BLOCK_END("MapReader::readTileset")
return nullptr;
}
@@ -1029,6 +1043,7 @@ Tileset *MapReader::readTileset(XmlNodePtr node,
if (set)
set->setProperties(props);
+ BLOCK_END("MapReader::readTileset")
return set;
}