summaryrefslogtreecommitdiff
path: root/src/resources/mapreader.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-01-10 21:06:33 +0300
committerAndrei Karas <akaras@inbox.ru>2012-01-10 21:06:33 +0300
commit5edddb1313ed0dc275e6ae70b8a1780ded3a590d (patch)
treefffa478013e8f3622c4e7f85eeb71609cb352322 /src/resources/mapreader.cpp
parenta057817a0983b3a3190f6773101f788f2c6278ba (diff)
downloadmanaplus-5edddb1313ed0dc275e6ae70b8a1780ded3a590d.tar.gz
manaplus-5edddb1313ed0dc275e6ae70b8a1780ded3a590d.tar.bz2
manaplus-5edddb1313ed0dc275e6ae70b8a1780ded3a590d.tar.xz
manaplus-5edddb1313ed0dc275e6ae70b8a1780ded3a590d.zip
Replace xmlStrEqual to xmlNameEqual.
Diffstat (limited to 'src/resources/mapreader.cpp')
-rw-r--r--src/resources/mapreader.cpp26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/resources/mapreader.cpp b/src/resources/mapreader.cpp
index aa7bce59d..8d71779f2 100644
--- a/src/resources/mapreader.cpp
+++ b/src/resources/mapreader.cpp
@@ -227,7 +227,7 @@ Map *MapReader::readMap(const std::string &filename,
// Parse the inflated map data
if (node)
{
- if (!xmlStrEqual(node->name, BAD_CAST "map"))
+ if (!xmlNameEqual(node, "map"))
logger->log("Error: Not a map file (%s)!", realFilename.c_str());
else
map = readMap(node, realFilename);
@@ -276,23 +276,23 @@ Map *MapReader::readMap(XmlNodePtr node, const std::string &path)
for_each_xml_child_node(childNode, node)
{
- if (xmlStrEqual(childNode->name, BAD_CAST "tileset"))
+ if (xmlNameEqual(childNode, "tileset"))
{
Tileset *tileset = readTileset(childNode, pathDir, map);
if (tileset)
map->addTileset(tileset);
}
- else if (xmlStrEqual(childNode->name, BAD_CAST "layer"))
+ else if (xmlNameEqual(childNode, "layer"))
{
readLayer(childNode, map);
}
- else if (xmlStrEqual(childNode->name, BAD_CAST "properties"))
+ else if (xmlNameEqual(childNode, "properties"))
{
readProperties(childNode, map);
map->setVersion(atoi(map->getProperty(
"manaplus version").c_str()));
}
- else if (xmlStrEqual(childNode->name, BAD_CAST "objectgroup"))
+ else if (xmlNameEqual(childNode, "objectgroup"))
{
// The object group offset is applied to each object individually
const int tileOffsetX = XML::getProperty(childNode, "x", 0);
@@ -302,7 +302,7 @@ Map *MapReader::readMap(XmlNodePtr node, const std::string &path)
for_each_xml_child_node(objectNode, childNode)
{
- if (xmlStrEqual(objectNode->name, BAD_CAST "object"))
+ if (xmlNameEqual(objectNode, "object"))
{
std::string objType = XML::getProperty(
objectNode, "type", "");
@@ -386,7 +386,7 @@ void MapReader::readProperties(XmlNodePtr node, Properties *props)
for_each_xml_child_node(childNode, node)
{
- if (!xmlStrEqual(childNode->name, BAD_CAST "property"))
+ if (!xmlNameEqual(childNode, "property"))
continue;
// Example: <property name="name" value="value"/>
@@ -472,7 +472,7 @@ void MapReader::readLayer(XmlNodePtr node, Map *map)
// Load the tile data
for_each_xml_child_node(childNode, node)
{
- if (!xmlStrEqual(childNode->name, BAD_CAST "data"))
+ if (!xmlNameEqual(childNode, "data"))
continue;
const std::string encoding =
@@ -619,7 +619,7 @@ void MapReader::readLayer(XmlNodePtr node, Map *map)
// Read plain XML map file
for_each_xml_child_node(childNode2, childNode)
{
- if (!xmlStrEqual(childNode2->name, BAD_CAST "tile"))
+ if (!xmlNameEqual(childNode2, "tile"))
continue;
const int gid = XML::getProperty(childNode2, "gid", -1);
@@ -678,7 +678,7 @@ Tileset *MapReader::readTileset(XmlNodePtr node, const std::string &path,
for_each_xml_child_node(childNode, node)
{
- if (xmlStrEqual(childNode->name, BAD_CAST "image"))
+ if (xmlNameEqual(childNode, "image"))
{
const std::string source = XML::getProperty(
childNode, "source", "");
@@ -703,11 +703,11 @@ Tileset *MapReader::readTileset(XmlNodePtr node, const std::string &path,
}
}
}
- else if (xmlStrEqual(childNode->name, BAD_CAST "tile"))
+ else if (xmlNameEqual(childNode, "tile"))
{
for_each_xml_child_node(tileNode, childNode)
{
- if (!xmlStrEqual(tileNode->name, BAD_CAST "properties"))
+ if (!xmlNameEqual(tileNode, "properties"))
continue;
int tileGID = firstGid + XML::getProperty(childNode, "id", 0);
@@ -716,7 +716,7 @@ Tileset *MapReader::readTileset(XmlNodePtr node, const std::string &path,
std::map<std::string, int> tileProperties;
for_each_xml_child_node(propertyNode, tileNode)
{
- if (!xmlStrEqual(propertyNode->name, BAD_CAST "property"))
+ if (!xmlNameEqual(propertyNode, "property"))
continue;
std::string name = XML::getProperty(
propertyNode, "name", "");