diff options
author | Thorbjørn Lindeijer <bjorn@lindeijer.nl> | 2024-09-28 21:31:41 +0200 |
---|---|---|
committer | Thorbjørn Lindeijer <bjorn@lindeijer.nl> | 2024-09-28 21:31:41 +0200 |
commit | 61f21c0131bbb6631a16205ce5447e8eea2a2db2 (patch) | |
tree | ee2826d05a45029a48d9a69e8c56e39d19a6c9a1 /src | |
parent | 3c89797394c83db8bc2204fdf5841dd3068f09d0 (diff) | |
download | mana-61f21c0131bbb6631a16205ce5447e8eea2a2db2.tar.gz mana-61f21c0131bbb6631a16205ce5447e8eea2a2db2.tar.bz2 mana-61f21c0131bbb6631a16205ce5447e8eea2a2db2.tar.xz mana-61f21c0131bbb6631a16205ce5447e8eea2a2db2.zip |
Replaced all "xmlChildrenNode" with "children"
Because "xmlChildrenNode" is a macro defined for compatibility with
libxml1, which we don't support.
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/serverdialog.cpp | 4 | ||||
-rw-r--r-- | src/particle.cpp | 4 | ||||
-rw-r--r-- | src/particleemitter.cpp | 2 | ||||
-rw-r--r-- | src/resources/itemdb.cpp | 10 | ||||
-rw-r--r-- | src/resources/mapreader.cpp | 2 | ||||
-rw-r--r-- | src/resources/monsterdb.cpp | 4 | ||||
-rw-r--r-- | src/resources/npcdb.cpp | 4 | ||||
-rw-r--r-- | src/simpleanimation.cpp | 3 |
8 files changed, 16 insertions, 17 deletions
diff --git a/src/gui/serverdialog.cpp b/src/gui/serverdialog.cpp index 62437bab..d437baae 100644 --- a/src/gui/serverdialog.cpp +++ b/src/gui/serverdialog.cpp @@ -493,9 +493,9 @@ void ServerDialog::loadServers() server.port = ServerInfo::defaultPortForServerType(server.type); } } - else if (subNode->xmlChildrenNode && subNode->xmlChildrenNode->content) + else if (subNode->children && subNode->children->content) { - const char *text = (const char*) subNode->xmlChildrenNode->content; + const char *text = (const char*) subNode->children->content; if (xmlStrEqual(subNode->name, BAD_CAST "description")) { diff --git a/src/particle.cpp b/src/particle.cpp index 6d78024c..61290884 100644 --- a/src/particle.cpp +++ b/src/particle.cpp @@ -294,7 +294,7 @@ Particle *Particle::addEffect(const std::string &particleEffectFile, // Image else if ((node = XML::findFirstChildByName(effectChildNode, "image"))) { - std::string imageSrc = (const char*)node->xmlChildrenNode->content; + std::string imageSrc = (const char*)node->children->content; if (!imageSrc.empty() && !dyePalettes.empty()) Dye::instantiate(imageSrc, dyePalettes); @@ -333,7 +333,7 @@ Particle *Particle::addEffect(const std::string &particleEffectFile, } else if (xmlStrEqual(emitterNode->name, BAD_CAST "deatheffect")) { - std::string deathEffect = (const char*)emitterNode->xmlChildrenNode->content; + std::string deathEffect = (const char*)emitterNode->children->content; char deathEffectConditions = 0x00; if (XML::getBoolProperty(emitterNode, "on-floor", true)) { diff --git a/src/particleemitter.cpp b/src/particleemitter.cpp index 0afa4794..3add4cb0 100644 --- a/src/particleemitter.cpp +++ b/src/particleemitter.cpp @@ -340,7 +340,7 @@ ParticleEmitter::ParticleEmitter(xmlNodePtr emitterNode, Particle *target, } // for frameNode } else if (xmlStrEqual(propertyNode->name, BAD_CAST "deatheffect")) { - mDeathEffect = (const char*)propertyNode->xmlChildrenNode->content; + mDeathEffect = (const char*)propertyNode->children->content; mDeathEffectConditions = 0x00; if (XML::getBoolProperty(propertyNode, "on-floor", true)) { diff --git a/src/resources/itemdb.cpp b/src/resources/itemdb.cpp index 2e59457d..543caf8a 100644 --- a/src/resources/itemdb.cpp +++ b/src/resources/itemdb.cpp @@ -119,7 +119,7 @@ const ItemInfo &ItemDB::get(const std::string &name) const void ItemDB::loadSpriteRef(ItemInfo &itemInfo, xmlNodePtr node) { std::string gender = XML::getProperty(node, "gender", "unisex"); - std::string filename = (const char*) node->xmlChildrenNode->content; + std::string filename = (const char*) node->children->content; const int race = XML::getProperty(node, "race", 0); if (gender == "male" || gender == "unisex") @@ -133,7 +133,7 @@ void ItemDB::loadSpriteRef(ItemInfo &itemInfo, xmlNodePtr node) void ItemDB::loadSoundRef(ItemInfo &itemInfo, xmlNodePtr node) { std::string event = XML::getProperty(node, "event", std::string()); - std::string filename = (const char*) node->xmlChildrenNode->content; + std::string filename = (const char*) node->children->content; if (event == "hit") { @@ -157,13 +157,13 @@ void ItemDB::loadFloorSprite(SpriteDisplay &display, xmlNodePtr floorNode) if (xmlStrEqual(spriteNode->name, BAD_CAST "sprite")) { SpriteReference ¤tSprite = display.sprites.emplace_back(); - currentSprite.sprite = (const char*)spriteNode->xmlChildrenNode->content; + currentSprite.sprite = (const char*)spriteNode->children->content; currentSprite.variant = XML::getProperty(spriteNode, "variant", 0); } else if (xmlStrEqual(spriteNode->name, BAD_CAST "particlefx")) { display.particles.emplace_back( - (const char*)spriteNode->xmlChildrenNode->content); + (const char*)spriteNode->children->content); } } } @@ -457,7 +457,7 @@ void ManaServItemDB::readItemNode(xmlNodePtr node, const std::string &filename) triggerLabel->second)); else if (xmlStrEqual(effectChild->name, BAD_CAST "label")) effect.emplace_back( - (const char*)effectChild->xmlChildrenNode->content); + (const char*)effectChild->children->content); } } diff --git a/src/resources/mapreader.cpp b/src/resources/mapreader.cpp index bbcd33e5..395024d5 100644 --- a/src/resources/mapreader.cpp +++ b/src/resources/mapreader.cpp @@ -340,7 +340,7 @@ static void readLayer(xmlNodePtr node, Map *map) } // Read base64 encoded map file - xmlNodePtr dataChild = childNode->xmlChildrenNode; + xmlNodePtr dataChild = childNode->children; if (!dataChild || !dataChild->content) continue; diff --git a/src/resources/monsterdb.cpp b/src/resources/monsterdb.cpp index 80f26fb2..3ad03117 100644 --- a/src/resources/monsterdb.cpp +++ b/src/resources/monsterdb.cpp @@ -91,7 +91,7 @@ void MonsterDB::readMonsterNode(xmlNodePtr node, const std::string &filename) if (xmlStrEqual(spriteNode->name, BAD_CAST "sprite")) { SpriteReference ¤tSprite = display.sprites.emplace_back(); - currentSprite.sprite = (const char*)spriteNode->xmlChildrenNode->content; + currentSprite.sprite = (const char*)spriteNode->children->content; currentSprite.variant = XML::getProperty(spriteNode, "variant", 0); } else if (xmlStrEqual(spriteNode->name, BAD_CAST "sound")) @@ -146,7 +146,7 @@ void MonsterDB::readMonsterNode(xmlNodePtr node, const std::string &filename) else if (xmlStrEqual(spriteNode->name, BAD_CAST "particlefx")) { display.particles.emplace_back( - (const char*) spriteNode->xmlChildrenNode->content); + (const char*) spriteNode->children->content); } } currentInfo->setDisplay(std::move(display)); diff --git a/src/resources/npcdb.cpp b/src/resources/npcdb.cpp index 09537c17..13d01699 100644 --- a/src/resources/npcdb.cpp +++ b/src/resources/npcdb.cpp @@ -66,13 +66,13 @@ void NPCDB::readNPCNode(xmlNodePtr node, const std::string &filename) if (xmlStrEqual(spriteNode->name, BAD_CAST "sprite")) { SpriteReference ¤tSprite = display.sprites.emplace_back(); - currentSprite.sprite = (const char*)spriteNode->xmlChildrenNode->content; + currentSprite.sprite = (const char*)spriteNode->children->content; currentSprite.variant = XML::getProperty(spriteNode, "variant", 0); } else if (xmlStrEqual(spriteNode->name, BAD_CAST "particlefx")) { display.particles.emplace_back( - (const char*)spriteNode->xmlChildrenNode->content); + (const char*)spriteNode->children->content); } } diff --git a/src/simpleanimation.cpp b/src/simpleanimation.cpp index 8496f3b1..2d3634bb 100644 --- a/src/simpleanimation.cpp +++ b/src/simpleanimation.cpp @@ -125,8 +125,7 @@ void SimpleAnimation::initializeAnimation(xmlNodePtr animationNode, return; // Get animation frames - for (xmlNodePtr frameNode = animationNode->xmlChildrenNode; frameNode; - frameNode = frameNode->next) + for (auto frameNode : XML::Children(animationNode)) { int delay = XML::getProperty(frameNode, "delay", 0); int offsetX = XML::getProperty(frameNode, "offsetX", 0); |