summaryrefslogtreecommitdiff
path: root/src/resources
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
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')
-rw-r--r--src/resources/chardb.cpp8
-rw-r--r--src/resources/colordb.cpp10
-rw-r--r--src/resources/emotedb.cpp16
-rw-r--r--src/resources/itemdb.cpp28
-rw-r--r--src/resources/mapdb.cpp2
-rw-r--r--src/resources/mapreader.cpp26
-rw-r--r--src/resources/monsterdb.cpp12
-rw-r--r--src/resources/npcdb.cpp8
-rw-r--r--src/resources/specialdb.cpp6
-rw-r--r--src/resources/spritedef.cpp24
10 files changed, 70 insertions, 70 deletions
diff --git a/src/resources/chardb.cpp b/src/resources/chardb.cpp
index 4be2e2b04..f38f13224 100644
--- a/src/resources/chardb.cpp
+++ b/src/resources/chardb.cpp
@@ -46,7 +46,7 @@ void CharDB::load()
XML::Document *doc = new XML::Document("charcreation.xml");
XmlNodePtr root = doc->rootNode();
- if (!root || !xmlStrEqual(root->name, BAD_CAST "chars"))
+ if (!root || !xmlNameEqual(root, "chars"))
{
logger->log1("CharDB: Failed to parse charcreation.xml.");
@@ -56,15 +56,15 @@ void CharDB::load()
for_each_xml_child_node(node, root)
{
- if (xmlStrEqual(node->name, BAD_CAST "haircolor"))
+ if (xmlNameEqual(node, "haircolor"))
{
loadMinMax(node, &mMinHairColor, &mMaxHairColor);
}
- else if (xmlStrEqual(node->name, BAD_CAST "hairstyle"))
+ else if (xmlNameEqual(node, "hairstyle"))
{
loadMinMax(node, &mMinHairStyle, &mMaxHairStyle);
}
- else if (xmlStrEqual(node->name, BAD_CAST "stat"))
+ else if (xmlNameEqual(node, "stat"))
{
loadMinMax(node, &mMinStat, &mMaxStat);
mSumStat = XML::getProperty(node, "sum", 0);
diff --git a/src/resources/colordb.cpp b/src/resources/colordb.cpp
index cdbfbeba8..1ffe507b2 100644
--- a/src/resources/colordb.cpp
+++ b/src/resources/colordb.cpp
@@ -52,7 +52,7 @@ void ColorDB::loadHair()
XmlNodePtr root = doc->rootNode();
bool hairXml = true;
- if (!root || !xmlStrEqual(root->name, BAD_CAST "colors"))
+ if (!root || !xmlNameEqual(root, "colors"))
{
logger->log1("Trying to fall back on colors.xml");
@@ -62,7 +62,7 @@ void ColorDB::loadHair()
doc = new XML::Document("colors.xml");
root = doc->rootNode();
- if (!root || !xmlStrEqual(root->name, BAD_CAST "colors"))
+ if (!root || !xmlNameEqual(root, "colors"))
{
logger->log1("ColorDB: Failed to find any color files.");
mHairColors[0] = mFail;
@@ -76,7 +76,7 @@ void ColorDB::loadHair()
for_each_xml_child_node(node, root)
{
- if (xmlStrEqual(node->name, BAD_CAST "color"))
+ if (xmlNameEqual(node, "color"))
{
int id = XML::getProperty(node, "id", 0);
@@ -106,7 +106,7 @@ void ColorDB::loadColorLists()
for_each_xml_child_node(node, root)
{
- if (xmlStrEqual(node->name, BAD_CAST "list"))
+ if (xmlNameEqual(node, "list"))
{
std::string name = XML::getProperty(node, "name", "");
if (name.empty())
@@ -120,7 +120,7 @@ void ColorDB::loadColorLists()
for_each_xml_child_node(colorNode, node)
{
- if (xmlStrEqual(colorNode->name, BAD_CAST "color"))
+ if (xmlNameEqual(colorNode, "color"))
{
ItemColor c(XML::getProperty(colorNode, "id", -1),
XML::getProperty(colorNode, "name", ""),
diff --git a/src/resources/emotedb.cpp b/src/resources/emotedb.cpp
index 163d8b879..c6126a57b 100644
--- a/src/resources/emotedb.cpp
+++ b/src/resources/emotedb.cpp
@@ -54,7 +54,7 @@ void EmoteDB::load()
XML::Document doc("emotes.xml");
XmlNodePtr rootNode = doc.rootNode();
- if (!rootNode || !xmlStrEqual(rootNode->name, BAD_CAST "emotes"))
+ if (!rootNode || !xmlNameEqual(rootNode, "emotes"))
{
logger->log1("Emote Database: Error while loading emotes.xml!");
return;
@@ -63,7 +63,7 @@ void EmoteDB::load()
//iterate <emote>s
for_each_xml_child_node(emoteNode, rootNode)
{
- if (!xmlStrEqual(emoteNode->name, BAD_CAST "emote"))
+ if (!xmlNameEqual(emoteNode, "emote"))
continue;
int id = XML::getProperty(emoteNode, "id", -1);
@@ -81,7 +81,7 @@ void EmoteDB::load()
if (!spriteNode->xmlChildrenNode)
continue;
- if (xmlStrEqual(spriteNode->name, BAD_CAST "sprite"))
+ if (xmlNameEqual(spriteNode, "sprite"))
{
EmoteSprite *currentSprite = new EmoteSprite;
std::string file = paths.getStringValue("sprites")
@@ -92,7 +92,7 @@ void EmoteDB::load()
currentSprite->name = XML::getProperty(spriteNode, "name", "");
currentInfo->sprites.push_back(currentSprite);
}
- else if (xmlStrEqual(spriteNode->name, BAD_CAST "particlefx"))
+ else if (xmlNameEqual(spriteNode, "particlefx"))
{
std::string particlefx = reinterpret_cast<const char*>(
spriteNode->xmlChildrenNode->content);
@@ -108,7 +108,7 @@ void EmoteDB::load()
XML::Document doc2("graphics/sprites/manaplus_emotes.xml");
rootNode = doc2.rootNode();
- if (!rootNode || !xmlStrEqual(rootNode->name, BAD_CAST "emotes"))
+ if (!rootNode || !xmlNameEqual(rootNode, "emotes"))
{
logger->log1("Emote Database: Error while loading"
" manaplus_emotes.xml!");
@@ -118,7 +118,7 @@ void EmoteDB::load()
//iterate <emote>s
for_each_xml_child_node(emoteNode, rootNode)
{
- if (!xmlStrEqual(emoteNode->name, BAD_CAST "emote"))
+ if (!xmlNameEqual(emoteNode, "emote"))
continue;
int id = XML::getProperty(emoteNode, "id", -1);
@@ -136,7 +136,7 @@ void EmoteDB::load()
if (!spriteNode->xmlChildrenNode)
continue;
- if (xmlStrEqual(spriteNode->name, BAD_CAST "sprite"))
+ if (xmlNameEqual(spriteNode, "sprite"))
{
EmoteSprite *currentSprite = new EmoteSprite;
std::string file = paths.getStringValue("sprites")
@@ -147,7 +147,7 @@ void EmoteDB::load()
currentSprite->name = XML::getProperty(spriteNode, "name", "");
currentInfo->sprites.push_back(currentSprite);
}
- else if (xmlStrEqual(spriteNode->name, BAD_CAST "particlefx"))
+ else if (xmlNameEqual(spriteNode, "particlefx"))
{
std::string particlefx = reinterpret_cast<const char*>(
spriteNode->xmlChildrenNode->content);
diff --git a/src/resources/itemdb.cpp b/src/resources/itemdb.cpp
index fcc20613d..5fa68a88f 100644
--- a/src/resources/itemdb.cpp
+++ b/src/resources/itemdb.cpp
@@ -174,7 +174,7 @@ void ItemDB::load()
XML::Document doc("items.xml");
XmlNodePtr rootNode = doc.rootNode();
- if (!rootNode || !xmlStrEqual(rootNode->name, BAD_CAST "items"))
+ if (!rootNode || !xmlNameEqual(rootNode, "items"))
{
logger->log("ItemDB: Error while loading items.xml!");
mLoaded = true;
@@ -183,7 +183,7 @@ void ItemDB::load()
for_each_xml_child_node(node, rootNode)
{
- if (!xmlStrEqual(node->name, BAD_CAST "item"))
+ if (!xmlNameEqual(node, "item"))
continue;
int id = XML::getProperty(node, "id", 0);
@@ -324,7 +324,7 @@ void ItemDB::load()
for_each_xml_child_node(itemChild, node)
{
- if (xmlStrEqual(itemChild->name, BAD_CAST "sprite"))
+ if (xmlNameEqual(itemChild, "sprite"))
{
std::string attackParticle = XML::getProperty(
itemChild, "particle-effect", "");
@@ -332,23 +332,23 @@ void ItemDB::load()
loadSpriteRef(itemInfo, itemChild);
}
- else if (xmlStrEqual(itemChild->name, BAD_CAST "sound"))
+ else if (xmlNameEqual(itemChild, "sound"))
{
loadSoundRef(itemInfo, itemChild);
}
- else if (xmlStrEqual(itemChild->name, BAD_CAST "floor"))
+ else if (xmlNameEqual(itemChild, "floor"))
{
loadFloorSprite(&display, itemChild);
}
- else if (xmlStrEqual(itemChild->name, BAD_CAST "replace"))
+ else if (xmlNameEqual(itemChild, "replace"))
{
loadReplaceSprite(itemInfo, itemChild);
}
- else if (xmlStrEqual(itemChild->name, BAD_CAST "drawAfter"))
+ else if (xmlNameEqual(itemChild, "drawAfter"))
{
loadOrderSprite(itemInfo, itemChild, true);
}
- else if (xmlStrEqual(itemChild->name, BAD_CAST "drawBefore"))
+ else if (xmlNameEqual(itemChild, "drawBefore"))
{
loadOrderSprite(itemInfo, itemChild, false);
}
@@ -630,7 +630,7 @@ void loadFloorSprite(SpriteDisplay *display, XmlNodePtr floorNode)
{
for_each_xml_child_node(spriteNode, floorNode)
{
- if (xmlStrEqual(spriteNode->name, BAD_CAST "sprite"))
+ if (xmlNameEqual(spriteNode, "sprite"))
{
SpriteReference *currentSprite = new SpriteReference;
currentSprite->sprite = reinterpret_cast<const char*>(
@@ -639,7 +639,7 @@ void loadFloorSprite(SpriteDisplay *display, XmlNodePtr floorNode)
= XML::getProperty(spriteNode, "variant", 0);
display->sprites.push_back(currentSprite);
}
- else if (xmlStrEqual(spriteNode->name, BAD_CAST "particlefx"))
+ else if (xmlNameEqual(spriteNode, "particlefx"))
{
std::string particlefx = reinterpret_cast<const char*>(
spriteNode->xmlChildrenNode->content);
@@ -669,7 +669,7 @@ void loadReplaceSprite(ItemInfo *itemInfo, XmlNodePtr replaceNode)
continue;
for_each_xml_child_node(itemNode, replaceNode)
{
- if (xmlStrEqual(itemNode->name, BAD_CAST "item"))
+ if (xmlNameEqual(itemNode, "item"))
{
int from = XML::getProperty(itemNode, "from", 0);
int to = XML::getProperty(itemNode, "to", 1);
@@ -691,7 +691,7 @@ void loadReplaceSprite(ItemInfo *itemInfo, XmlNodePtr replaceNode)
for_each_xml_child_node(itemNode, replaceNode)
{
- if (xmlStrEqual(itemNode->name, BAD_CAST "item"))
+ if (xmlNameEqual(itemNode, "item"))
{
int from = XML::getProperty(itemNode, "from", 0);
int to = XML::getProperty(itemNode, "to", 1);
@@ -724,7 +724,7 @@ void loadReplaceSprite(ItemInfo *itemInfo, XmlNodePtr replaceNode)
for_each_xml_child_node(itemNode, replaceNode)
{
- if (xmlStrEqual(itemNode->name, BAD_CAST "item"))
+ if (xmlNameEqual(itemNode, "item"))
{
int from = XML::getProperty(itemNode, "from", 0);
int to = XML::getProperty(itemNode, "to", 1);
@@ -754,7 +754,7 @@ void loadReplaceSprite(ItemInfo *itemInfo, XmlNodePtr replaceNode)
return;
for_each_xml_child_node(itemNode, replaceNode)
{
- if (xmlStrEqual(itemNode->name, BAD_CAST "item"))
+ if (xmlNameEqual(itemNode, "item"))
{
int from = XML::getProperty(itemNode, "from", 0);
int to = XML::getProperty(itemNode, "to", 1);
diff --git a/src/resources/mapdb.cpp b/src/resources/mapdb.cpp
index aa10aff85..b186ad658 100644
--- a/src/resources/mapdb.cpp
+++ b/src/resources/mapdb.cpp
@@ -52,7 +52,7 @@ void MapDB::load()
for_each_xml_child_node(node, root)
{
- if (xmlStrEqual(node->name, BAD_CAST "map"))
+ if (xmlNameEqual(node, "map"))
{
std::string name = XML::getProperty(node, "name", "");
if (name.empty())
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", "");
diff --git a/src/resources/monsterdb.cpp b/src/resources/monsterdb.cpp
index e6901fa2f..9d295db35 100644
--- a/src/resources/monsterdb.cpp
+++ b/src/resources/monsterdb.cpp
@@ -54,7 +54,7 @@ void MonsterDB::load()
XML::Document doc("monsters.xml");
XmlNodePtr rootNode = doc.rootNode();
- if (!rootNode || !xmlStrEqual(rootNode->name, BAD_CAST "monsters"))
+ if (!rootNode || !xmlNameEqual(rootNode, "monsters"))
{
logger->log("Monster Database: Error while loading monster.xml!");
mLoaded = true;
@@ -71,7 +71,7 @@ void MonsterDB::load()
//iterate <monster>s
for_each_xml_child_node(monsterNode, rootNode)
{
- if (!xmlStrEqual(monsterNode->name, BAD_CAST "monster"))
+ if (!xmlNameEqual(monsterNode, "monster"))
continue;
BeingInfo *currentInfo = new BeingInfo;
@@ -119,7 +119,7 @@ void MonsterDB::load()
if (!spriteNode->xmlChildrenNode)
continue;
- if (xmlStrEqual(spriteNode->name, BAD_CAST "sprite"))
+ if (xmlNameEqual(spriteNode, "sprite"))
{
SpriteReference *currentSprite = new SpriteReference;
currentSprite->sprite = reinterpret_cast<const char*>(
@@ -129,7 +129,7 @@ void MonsterDB::load()
spriteNode, "variant", 0);
display.sprites.push_back(currentSprite);
}
- else if (xmlStrEqual(spriteNode->name, BAD_CAST "sound"))
+ else if (xmlNameEqual(spriteNode, "sound"))
{
std::string event = XML::getProperty(spriteNode, "event", "");
const char *filename;
@@ -172,7 +172,7 @@ void MonsterDB::load()
currentInfo->getName().c_str());
}
}
- else if (xmlStrEqual(spriteNode->name, BAD_CAST "attack"))
+ else if (xmlNameEqual(spriteNode, "attack"))
{
const int id = XML::getProperty(spriteNode, "id", 0);
const std::string particleEffect = XML::getProperty(
@@ -185,7 +185,7 @@ void MonsterDB::load()
currentInfo->addAttack(id, spriteAction,
particleEffect, missileParticle);
}
- else if (xmlStrEqual(spriteNode->name, BAD_CAST "particlefx"))
+ else if (xmlNameEqual(spriteNode, "particlefx"))
{
display.particles.push_back(reinterpret_cast<const char*>(
spriteNode->xmlChildrenNode->content));
diff --git a/src/resources/npcdb.cpp b/src/resources/npcdb.cpp
index b823620f0..832fa26d6 100644
--- a/src/resources/npcdb.cpp
+++ b/src/resources/npcdb.cpp
@@ -48,7 +48,7 @@ void NPCDB::load()
XML::Document doc("npcs.xml");
XmlNodePtr rootNode = doc.rootNode();
- if (!rootNode || !xmlStrEqual(rootNode->name, BAD_CAST "npcs"))
+ if (!rootNode || !xmlNameEqual(rootNode, "npcs"))
{
logger->log("NPC Database: Error while loading npcs.xml!");
mLoaded = true;
@@ -58,7 +58,7 @@ void NPCDB::load()
//iterate <npc>s
for_each_xml_child_node(npcNode, rootNode)
{
- if (!xmlStrEqual(npcNode->name, BAD_CAST "npc"))
+ if (!xmlNameEqual(npcNode, "npc"))
continue;
int id = XML::getProperty(npcNode, "id", 0);
@@ -84,7 +84,7 @@ void NPCDB::load()
if (!spriteNode->xmlChildrenNode)
continue;
- if (xmlStrEqual(spriteNode->name, BAD_CAST "sprite"))
+ if (xmlNameEqual(spriteNode, "sprite"))
{
SpriteReference *currentSprite = new SpriteReference;
currentSprite->sprite = reinterpret_cast<const char*>(
@@ -93,7 +93,7 @@ void NPCDB::load()
XML::getProperty(spriteNode, "variant", 0);
display.sprites.push_back(currentSprite);
}
- else if (xmlStrEqual(spriteNode->name, BAD_CAST "particlefx"))
+ else if (xmlNameEqual(spriteNode, "particlefx"))
{
std::string particlefx = reinterpret_cast<const char*>(
spriteNode->xmlChildrenNode->content);
diff --git a/src/resources/specialdb.cpp b/src/resources/specialdb.cpp
index eb4a81c9a..b1a3a9c4d 100644
--- a/src/resources/specialdb.cpp
+++ b/src/resources/specialdb.cpp
@@ -57,7 +57,7 @@ void SpecialDB::load()
XML::Document doc("specials.xml");
XmlNodePtr root = doc.rootNode();
- if (!root || !xmlStrEqual(root->name, BAD_CAST "specials"))
+ if (!root || !xmlNameEqual(root, "specials"))
{
logger->log("Error loading specials file specials.xml");
return;
@@ -67,13 +67,13 @@ void SpecialDB::load()
for_each_xml_child_node(set, root)
{
- if (xmlStrEqual(set->name, BAD_CAST "set"))
+ if (xmlNameEqual(set, "set"))
{
setName = XML::getProperty(set, "name", "Actions");
for_each_xml_child_node(special, set)
{
- if (xmlStrEqual(special->name, BAD_CAST "special"))
+ if (xmlNameEqual(special, "special"))
{
SpecialInfo *info = new SpecialInfo();
int id = XML::getProperty(special, "id", 0);
diff --git a/src/resources/spritedef.cpp b/src/resources/spritedef.cpp
index 7ff74ac18..0d9b95f6f 100644
--- a/src/resources/spritedef.cpp
+++ b/src/resources/spritedef.cpp
@@ -83,7 +83,7 @@ SpriteDef *SpriteDef::load(const std::string &animationFile, int variant)
XML::Document doc(animationFile.substr(0, pos));
XmlNodePtr rootNode = doc.rootNode();
- if (!rootNode || !xmlStrEqual(rootNode->name, BAD_CAST "sprite"))
+ if (!rootNode || !xmlNameEqual(rootNode, "sprite"))
{
logger->log("Error, failed to parse %s", animationFile.c_str());
@@ -149,11 +149,11 @@ void SpriteDef::loadSprite(XmlNodePtr spriteNode, int variant,
for_each_xml_child_node(node, spriteNode)
{
- if (xmlStrEqual(node->name, BAD_CAST "imageset"))
+ if (xmlNameEqual(node, "imageset"))
loadImageSet(node, palettes);
- else if (xmlStrEqual(node->name, BAD_CAST "action"))
+ else if (xmlNameEqual(node, "action"))
loadAction(node, variant_offset);
- else if (xmlStrEqual(node->name, BAD_CAST "include"))
+ else if (xmlNameEqual(node, "include"))
includeSprite(node);
}
}
@@ -223,7 +223,7 @@ void SpriteDef::loadAction(XmlNodePtr node, int variant_offset)
// Load animations
for_each_xml_child_node(animationNode, node)
{
- if (xmlStrEqual(animationNode->name, BAD_CAST "animation"))
+ if (xmlNameEqual(animationNode, "animation"))
loadAnimation(animationNode, action, imageSet, variant_offset);
}
}
@@ -262,7 +262,7 @@ void SpriteDef::loadAnimation(XmlNodePtr animationNode,
offsetY -= imageSet->getHeight() - 32;
offsetX -= imageSet->getWidth() / 2 - 16;
- if (xmlStrEqual(frameNode->name, BAD_CAST "frame"))
+ if (xmlNameEqual(frameNode, "frame"))
{
const int index = XML::getProperty(frameNode, "index", -1);
@@ -282,7 +282,7 @@ void SpriteDef::loadAnimation(XmlNodePtr animationNode,
animation->addFrame(img, delay, offsetX, offsetY, rand);
}
- else if (xmlStrEqual(frameNode->name, BAD_CAST "sequence"))
+ else if (xmlNameEqual(frameNode, "sequence"))
{
const int start = XML::getProperty(frameNode, "start", -1);
const int end = XML::getProperty(frameNode, "end", -1);
@@ -322,22 +322,22 @@ void SpriteDef::loadAnimation(XmlNodePtr animationNode,
repeat --;
}
}
- else if (xmlStrEqual(frameNode->name, BAD_CAST "end"))
+ else if (xmlNameEqual(frameNode, "end"))
{
animation->addTerminator(rand);
}
- else if (xmlStrEqual(frameNode->name, BAD_CAST "jump"))
+ else if (xmlNameEqual(frameNode, "jump"))
{
animation->addJump(XML::getProperty(
frameNode, "action", ""), rand);
}
- else if (xmlStrEqual(frameNode->name, BAD_CAST "label"))
+ else if (xmlNameEqual(frameNode, "label"))
{
std::string name = XML::getProperty(frameNode, "name", "");
if (!name.empty())
animation->addLabel(name);
}
- else if (xmlStrEqual(frameNode->name, BAD_CAST "goto"))
+ else if (xmlNameEqual(frameNode, "goto"))
{
std::string name = XML::getProperty(frameNode, "label", "");
if (!name.empty())
@@ -365,7 +365,7 @@ void SpriteDef::includeSprite(XmlNodePtr includeNode)
XML::Document doc(filename);
XmlNodePtr rootNode = doc.rootNode();
- if (!rootNode || !xmlStrEqual(rootNode->name, BAD_CAST "sprite"))
+ if (!rootNode || !xmlNameEqual(rootNode, "sprite"))
{
logger->log("Error, no sprite root node in %s", filename.c_str());
return;