summaryrefslogtreecommitdiff
path: root/src/resources
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-02-07 20:38:10 +0300
committerAndrei Karas <akaras@inbox.ru>2017-03-24 00:08:35 +0300
commitd1590377de1141144d59ca1160de2822177f6f2a (patch)
treea368b251dedc7164cadbfe459de4cf5c983acf98 /src/resources
parent65422e722cfe0616c65498c71aa0651857dcc49a (diff)
downloadmanaplus-d1590377de1141144d59ca1160de2822177f6f2a.tar.gz
manaplus-d1590377de1141144d59ca1160de2822177f6f2a.tar.bz2
manaplus-d1590377de1141144d59ca1160de2822177f6f2a.tar.xz
manaplus-d1590377de1141144d59ca1160de2822177f6f2a.zip
Add support for tinyxml2 for reading / writing xml files.
Diffstat (limited to 'src/resources')
-rw-r--r--src/resources/animation/simpleanimation.cpp4
-rw-r--r--src/resources/animation/simpleanimation.h4
-rw-r--r--src/resources/db/avatardb.cpp2
-rw-r--r--src/resources/db/chardb.cpp4
-rw-r--r--src/resources/db/chardb.h2
-rw-r--r--src/resources/db/colordb.cpp4
-rw-r--r--src/resources/db/commandsdb.cpp2
-rw-r--r--src/resources/db/deaddb.cpp2
-rw-r--r--src/resources/db/elementaldb.cpp2
-rw-r--r--src/resources/db/homunculusdb.cpp2
-rw-r--r--src/resources/db/itemdb.cpp24
-rw-r--r--src/resources/db/itemfielddb.cpp4
-rw-r--r--src/resources/db/mapdb.cpp4
-rw-r--r--src/resources/db/mercenarydb.cpp2
-rw-r--r--src/resources/db/moddb.cpp2
-rw-r--r--src/resources/db/monsterdb.cpp2
-rw-r--r--src/resources/db/npcdb.cpp2
-rw-r--r--src/resources/db/npcdialogdb.cpp6
-rw-r--r--src/resources/db/petdb.cpp2
-rw-r--r--src/resources/db/questdb.cpp6
-rw-r--r--src/resources/db/skillunitdb.cpp2
-rw-r--r--src/resources/db/sounddb.cpp2
-rw-r--r--src/resources/db/statdb.cpp6
-rw-r--r--src/resources/db/statuseffectdb.cpp2
-rw-r--r--src/resources/db/unitsdb.cpp2
-rw-r--r--src/resources/mapreader.cpp8
-rw-r--r--src/resources/mapreader.h8
-rw-r--r--src/resources/sprite/spritedef.cpp12
-rw-r--r--src/resources/sprite/spritedef.h10
29 files changed, 67 insertions, 67 deletions
diff --git a/src/resources/animation/simpleanimation.cpp b/src/resources/animation/simpleanimation.cpp
index ee489debb..7f20b5eef 100644
--- a/src/resources/animation/simpleanimation.cpp
+++ b/src/resources/animation/simpleanimation.cpp
@@ -49,7 +49,7 @@ SimpleAnimation::SimpleAnimation(Animation *const animation) :
{
}
-SimpleAnimation::SimpleAnimation(const XmlNodePtr animationNode,
+SimpleAnimation::SimpleAnimation(XmlNodeConstPtr animationNode,
const std::string& dyePalettes) :
mAnimation(new Animation("simple animation")),
mAnimationTime(0),
@@ -145,7 +145,7 @@ Image *SimpleAnimation::getCurrentImage() const
return nullptr;
}
-void SimpleAnimation::initializeAnimation(const XmlNodePtr animationNode,
+void SimpleAnimation::initializeAnimation(XmlNodeConstPtr animationNode,
const std::string &dyePalettes)
{
mInitialized = false;
diff --git a/src/resources/animation/simpleanimation.h b/src/resources/animation/simpleanimation.h
index 630477d42..2c068acff 100644
--- a/src/resources/animation/simpleanimation.h
+++ b/src/resources/animation/simpleanimation.h
@@ -50,7 +50,7 @@ class SimpleAnimation final
/**
* Creates a simple animation that creates its animation from XML Data.
*/
- SimpleAnimation(const XmlNodePtr animationNode,
+ SimpleAnimation(XmlNodeConstPtr animationNode,
const std::string& dyePalettes);
A_DELETE_COPY(SimpleAnimation)
@@ -74,7 +74,7 @@ class SimpleAnimation final
Image *getCurrentImage() const A_WARN_UNUSED;
private:
- void initializeAnimation(const XmlNodePtr animationNode,
+ void initializeAnimation(XmlNodeConstPtr animationNode,
const std::string&
dyePalettes = std::string());
diff --git a/src/resources/db/avatardb.cpp b/src/resources/db/avatardb.cpp
index 8af32cd6c..eddf08b29 100644
--- a/src/resources/db/avatardb.cpp
+++ b/src/resources/db/avatardb.cpp
@@ -57,7 +57,7 @@ void AvatarDB::loadXmlFile(const std::string &fileName,
XML::Document doc(fileName,
UseVirtFs_true,
skipError);
- const XmlNodePtrConst rootNode = doc.rootNode();
+ XmlNodeConstPtrConst rootNode = doc.rootNode();
if (!rootNode || !xmlNameEqual(rootNode, "avatars"))
{
diff --git a/src/resources/db/chardb.cpp b/src/resources/db/chardb.cpp
index eb96538c5..b0984a56f 100644
--- a/src/resources/db/chardb.cpp
+++ b/src/resources/db/chardb.cpp
@@ -52,7 +52,7 @@ void CharDB::load()
paths.getStringValue("charCreationFile"),
UseVirtFs_true,
SkipError_false);
- const XmlNodePtrConst root = doc->rootNode();
+ XmlNodeConstPtrConst root = doc->rootNode();
if (!root || !xmlNameEqual(root, "chars"))
{
@@ -109,7 +109,7 @@ void CharDB::load()
mLoaded = true;
}
-void CharDB::loadMinMax(const XmlNodePtr node,
+void CharDB::loadMinMax(XmlNodeConstPtr node,
unsigned *restrict const min,
unsigned *restrict const max)
{
diff --git a/src/resources/db/chardb.h b/src/resources/db/chardb.h
index 128777827..9715497f1 100644
--- a/src/resources/db/chardb.h
+++ b/src/resources/db/chardb.h
@@ -43,7 +43,7 @@ namespace CharDB
*/
void unload();
- void loadMinMax(const XmlNodePtr node,
+ void loadMinMax(XmlNodeConstPtr node,
unsigned *restrict const min,
unsigned *restrict const max);
diff --git a/src/resources/db/colordb.cpp b/src/resources/db/colordb.cpp
index 9261e8a76..cf377eca1 100644
--- a/src/resources/db/colordb.cpp
+++ b/src/resources/db/colordb.cpp
@@ -81,7 +81,7 @@ void ColorDB::loadHair(const std::string &fileName,
XML::Document *doc = new XML::Document(fileName,
UseVirtFs_true,
skipError);
- const XmlNodePtrConst root = doc->rootNode();
+ XmlNodeConstPtrConst root = doc->rootNode();
if (!root || !xmlNameEqual(root, "colors"))
{
@@ -127,7 +127,7 @@ void ColorDB::loadColorLists(const std::string &fileName,
XML::Document *doc = new XML::Document(fileName,
UseVirtFs_true,
skipError);
- const XmlNodePtrConst root = doc->rootNode();
+ XmlNodeConstPtrConst root = doc->rootNode();
if (!root)
{
delete doc;
diff --git a/src/resources/db/commandsdb.cpp b/src/resources/db/commandsdb.cpp
index 2338287c2..115046b1d 100644
--- a/src/resources/db/commandsdb.cpp
+++ b/src/resources/db/commandsdb.cpp
@@ -62,7 +62,7 @@ void CommandsDB::loadXmlFile(const std::string &fileName,
const SkipError skipError)
{
XML::Document doc(fileName, UseVirtFs_true, skipError);
- const XmlNodePtrConst rootNode = doc.rootNode();
+ XmlNodeConstPtrConst rootNode = doc.rootNode();
if (!rootNode || !xmlNameEqual(rootNode, "commands"))
{
diff --git a/src/resources/db/deaddb.cpp b/src/resources/db/deaddb.cpp
index eddc4ff42..53a0f6e0f 100644
--- a/src/resources/db/deaddb.cpp
+++ b/src/resources/db/deaddb.cpp
@@ -52,7 +52,7 @@ void DeadDB::loadXmlFile(const std::string &fileName,
XML::Document *doc = new XML::Document(fileName,
UseVirtFs_true,
skipError);
- const XmlNodePtrConst root = doc->rootNode();
+ XmlNodeConstPtrConst root = doc->rootNode();
if (!root || !xmlNameEqual(root, "messages"))
{
diff --git a/src/resources/db/elementaldb.cpp b/src/resources/db/elementaldb.cpp
index 21788b08e..2a626a10e 100644
--- a/src/resources/db/elementaldb.cpp
+++ b/src/resources/db/elementaldb.cpp
@@ -55,7 +55,7 @@ void ElementalDb::loadXmlFile(const std::string &fileName,
const SkipError skipError)
{
XML::Document doc(fileName, UseVirtFs_true, skipError);
- const XmlNodePtr rootNode = doc.rootNode();
+ XmlNodeConstPtr rootNode = doc.rootNode();
if (!rootNode || !xmlNameEqual(rootNode, "elementals"))
{
diff --git a/src/resources/db/homunculusdb.cpp b/src/resources/db/homunculusdb.cpp
index 77c1b4323..cf627dc01 100644
--- a/src/resources/db/homunculusdb.cpp
+++ b/src/resources/db/homunculusdb.cpp
@@ -56,7 +56,7 @@ void HomunculusDB::loadXmlFile(const std::string &fileName,
const SkipError skipError)
{
XML::Document doc(fileName, UseVirtFs_true, skipError);
- const XmlNodePtr rootNode = doc.rootNode();
+ XmlNodeConstPtr rootNode = doc.rootNode();
if (!rootNode || !xmlNameEqual(rootNode, "homunculuses"))
{
diff --git a/src/resources/db/itemdb.cpp b/src/resources/db/itemdb.cpp
index e347528eb..e6affd378 100644
--- a/src/resources/db/itemdb.cpp
+++ b/src/resources/db/itemdb.cpp
@@ -64,15 +64,15 @@ namespace
// Forward declarations
static void loadSpriteRef(ItemInfo *const itemInfo,
- const XmlNodePtr node) A_NONNULL(1);
+ XmlNodeConstPtr node) A_NONNULL(1);
static void loadSoundRef(ItemInfo *const itemInfo,
- const XmlNodePtr node) A_NONNULL(1);
+ XmlNodeConstPtr node) A_NONNULL(1);
static void loadFloorSprite(SpriteDisplay &display,
- const XmlNodePtrConst node);
+ XmlNodeConstPtrConst node);
static void loadReplaceSprite(ItemInfo *const itemInfo,
- const XmlNodePtr replaceNode) A_NONNULL(1);
+ XmlNodeConstPtr replaceNode) A_NONNULL(1);
static void loadOrderSprite(ItemInfo *const itemInfo,
- const XmlNodePtr node,
+ XmlNodeConstPtr node,
const bool drawAfter) A_NONNULL(1);
static int parseSpriteName(const std::string &name);
static int parseDirectionName(const std::string &name);
@@ -125,7 +125,7 @@ static std::string useButton2FromItemType(const ItemDbTypeT &type)
}
static void readFields(std::string &effect,
- const XmlNodePtr node,
+ XmlNodeConstPtr node,
const ItemFieldDb::FieldInfos &fields)
{
FOR_EACH (ItemFieldDb::FieldInfos::const_iterator, it, fields)
@@ -243,7 +243,7 @@ void ItemDB::loadXmlFile(const std::string &fileName,
XML::Document doc(fileName,
UseVirtFs_true,
skipError);
- const XmlNodePtrConst rootNode = doc.rootNode();
+ XmlNodeConstPtrConst rootNode = doc.rootNode();
if (!rootNode || !xmlNameEqual(rootNode, "items"))
{
@@ -829,7 +829,7 @@ static int parseDirectionName(const std::string &name)
return id;
}
-static void loadSpriteRef(ItemInfo *const itemInfo, const XmlNodePtr node)
+static void loadSpriteRef(ItemInfo *const itemInfo, XmlNodeConstPtr node)
{
const std::string gender = XML::getProperty(node, "gender", "unisex");
if (!node || !XmlHaveChildContent(node))
@@ -846,7 +846,7 @@ static void loadSpriteRef(ItemInfo *const itemInfo, const XmlNodePtr node)
itemInfo->setSprite(filename, Gender::OTHER, race);
}
-static void loadSoundRef(ItemInfo *const itemInfo, const XmlNodePtr node)
+static void loadSoundRef(ItemInfo *const itemInfo, XmlNodeConstPtr node)
{
if (!node || !XmlHaveChildContent(node))
return;
@@ -868,7 +868,7 @@ static void loadSoundRef(ItemInfo *const itemInfo, const XmlNodePtr node)
}
static void loadFloorSprite(SpriteDisplay &display,
- const XmlNodePtrConst floorNode)
+ XmlNodeConstPtrConst floorNode)
{
if (!floorNode)
return;
@@ -892,7 +892,7 @@ static void loadFloorSprite(SpriteDisplay &display,
}
static void loadReplaceSprite(ItemInfo *const itemInfo,
- const XmlNodePtr replaceNode)
+ XmlNodeConstPtr replaceNode)
{
if (!replaceNode)
return;
@@ -1025,7 +1025,7 @@ static void loadReplaceSprite(ItemInfo *const itemInfo,
}
static void loadOrderSprite(ItemInfo *const itemInfo,
- const XmlNodePtr node,
+ XmlNodeConstPtr node,
const bool drawAfter)
{
const int sprite = parseSpriteName(XML::getProperty(node, "name", ""));
diff --git a/src/resources/db/itemfielddb.cpp b/src/resources/db/itemfielddb.cpp
index 6ba76db2c..65020e824 100644
--- a/src/resources/db/itemfielddb.cpp
+++ b/src/resources/db/itemfielddb.cpp
@@ -51,7 +51,7 @@ void ItemFieldDb::load()
mLoaded = true;
}
-static void loadFields(const XmlNodePtr groupNode,
+static void loadFields(XmlNodeConstPtr groupNode,
ItemFieldDb::FieldInfos &fields1,
ItemFieldDb::FieldInfos &fields2)
{
@@ -105,7 +105,7 @@ void ItemFieldDb::loadXmlFile(const std::string &fileName,
XML::Document doc(fileName,
UseVirtFs_true,
skipError);
- const XmlNodePtrConst rootNode = doc.rootNode();
+ XmlNodeConstPtrConst rootNode = doc.rootNode();
if (!rootNode || !xmlNameEqual(rootNode, "itemfields"))
{
diff --git a/src/resources/db/mapdb.cpp b/src/resources/db/mapdb.cpp
index b9c6818b3..14c10b3b8 100644
--- a/src/resources/db/mapdb.cpp
+++ b/src/resources/db/mapdb.cpp
@@ -66,7 +66,7 @@ void MapDB::loadRemapXmlFile(const std::string &fileName,
UseVirtFs_true,
skipError);
- const XmlNodePtrConst root = doc->rootNode();
+ XmlNodeConstPtrConst root = doc->rootNode();
if (!root)
{
delete doc;
@@ -153,7 +153,7 @@ void MapDB::loadInfo(const std::string &fileName,
XML::Document *doc = new XML::Document(fileName,
UseVirtFs_true,
skipError);
- const XmlNodePtrConst root = doc->rootNode();
+ XmlNodeConstPtrConst root = doc->rootNode();
if (!root)
{
delete doc;
diff --git a/src/resources/db/mercenarydb.cpp b/src/resources/db/mercenarydb.cpp
index 0e2fdcae0..bc1b20840 100644
--- a/src/resources/db/mercenarydb.cpp
+++ b/src/resources/db/mercenarydb.cpp
@@ -58,7 +58,7 @@ void MercenaryDB::loadXmlFile(const std::string &fileName,
XML::Document doc(fileName,
UseVirtFs_true,
skipError);
- const XmlNodePtr rootNode = doc.rootNode();
+ XmlNodeConstPtr rootNode = doc.rootNode();
if (!rootNode || !xmlNameEqual(rootNode, "mercenaries"))
{
diff --git a/src/resources/db/moddb.cpp b/src/resources/db/moddb.cpp
index 4e67cb612..7a23e255f 100644
--- a/src/resources/db/moddb.cpp
+++ b/src/resources/db/moddb.cpp
@@ -52,7 +52,7 @@ void ModDB::loadXmlFile(const std::string &fileName,
const SkipError skipError)
{
XML::Document doc(fileName, UseVirtFs_true, skipError);
- const XmlNodePtrConst rootNode = doc.rootNode();
+ XmlNodeConstPtrConst rootNode = doc.rootNode();
if (!rootNode || !xmlNameEqual(rootNode, "mods"))
{
diff --git a/src/resources/db/monsterdb.cpp b/src/resources/db/monsterdb.cpp
index 2c87f19f8..1ed0caa27 100644
--- a/src/resources/db/monsterdb.cpp
+++ b/src/resources/db/monsterdb.cpp
@@ -60,7 +60,7 @@ void MonsterDB::loadXmlFile(const std::string &fileName,
const SkipError skipError)
{
XML::Document doc(fileName, UseVirtFs_true, skipError);
- const XmlNodePtr rootNode = doc.rootNode();
+ XmlNodeConstPtr rootNode = doc.rootNode();
if (!rootNode || !xmlNameEqual(rootNode, "monsters"))
{
diff --git a/src/resources/db/npcdb.cpp b/src/resources/db/npcdb.cpp
index 9c77950b7..9be217819 100644
--- a/src/resources/db/npcdb.cpp
+++ b/src/resources/db/npcdb.cpp
@@ -61,7 +61,7 @@ void NPCDB::loadXmlFile(const std::string &fileName,
const SkipError skipError)
{
XML::Document doc(fileName, UseVirtFs_true, skipError);
- const XmlNodePtrConst rootNode = doc.rootNode();
+ XmlNodeConstPtrConst rootNode = doc.rootNode();
if (!rootNode || !xmlNameEqual(rootNode, "npcs"))
{
diff --git a/src/resources/db/npcdialogdb.cpp b/src/resources/db/npcdialogdb.cpp
index 6ab48e4bd..76eaea7c5 100644
--- a/src/resources/db/npcdialogdb.cpp
+++ b/src/resources/db/npcdialogdb.cpp
@@ -50,7 +50,7 @@ void NpcDialogDB::load()
}
static void loadNpcDialogMenu(NpcDialogInfo *const dialog,
- const XmlNodePtrConst node)
+ XmlNodeConstPtrConst node)
{
for_each_xml_child_node(childNode, node)
{
@@ -132,7 +132,7 @@ static void loadNpcDialogInventory(NpcDialogInfo *const dialog,
}
static void loadNpcDialog(NpcDialogInfo *const dialog,
- const XmlNodePtrConst node)
+ XmlNodeConstPtrConst node)
{
for_each_xml_child_node(childNode, node)
{
@@ -154,7 +154,7 @@ void NpcDialogDB::loadXmlFile(const std::string &fileName,
UseVirtFs_true,
skipError);
- const XmlNodePtrConst root = doc->rootNode();
+ XmlNodeConstPtrConst root = doc->rootNode();
if (!root)
{
delete doc;
diff --git a/src/resources/db/petdb.cpp b/src/resources/db/petdb.cpp
index d3d166675..5dca543a0 100644
--- a/src/resources/db/petdb.cpp
+++ b/src/resources/db/petdb.cpp
@@ -59,7 +59,7 @@ void PETDB::loadXmlFile(const std::string &fileName,
XML::Document doc(fileName,
UseVirtFs_true,
skipError);
- const XmlNodePtrConst rootNode = doc.rootNode();
+ XmlNodeConstPtrConst rootNode = doc.rootNode();
if (!rootNode || !xmlNameEqual(rootNode, "pets"))
{
diff --git a/src/resources/db/questdb.cpp b/src/resources/db/questdb.cpp
index 91dd44ac4..41b3b0062 100644
--- a/src/resources/db/questdb.cpp
+++ b/src/resources/db/questdb.cpp
@@ -52,7 +52,7 @@ void QuestDb::load()
}
static void loadQuest(const int var,
- const XmlNodePtr node)
+ XmlNodeConstPtr node)
{
if (!node)
return;
@@ -155,7 +155,7 @@ static void loadQuest(const int var,
}
static void loadEffect(const int var,
- const XmlNodePtr node)
+ XmlNodeConstPtr node)
{
QuestEffect *const effect = new QuestEffect;
effect->map = XML::getProperty(node, "map", "");
@@ -180,7 +180,7 @@ void QuestDb::loadXmlFile(const std::string &fileName,
XML::Document doc(fileName,
UseVirtFs_true,
skipError);
- const XmlNodePtrConst root = doc.rootNode();
+ XmlNodeConstPtrConst root = doc.rootNode();
if (!root)
return;
diff --git a/src/resources/db/skillunitdb.cpp b/src/resources/db/skillunitdb.cpp
index 8beae1ac2..cec48a4a1 100644
--- a/src/resources/db/skillunitdb.cpp
+++ b/src/resources/db/skillunitdb.cpp
@@ -57,7 +57,7 @@ void SkillUnitDb::loadXmlFile(const std::string &fileName,
const SkipError skipError)
{
XML::Document doc(fileName, UseVirtFs_true, skipError);
- const XmlNodePtrConst rootNode = doc.rootNode();
+ XmlNodeConstPtrConst rootNode = doc.rootNode();
if (!rootNode || !xmlNameEqual(rootNode, "skillunits"))
{
diff --git a/src/resources/db/sounddb.cpp b/src/resources/db/sounddb.cpp
index a62045505..d58a585ee 100644
--- a/src/resources/db/sounddb.cpp
+++ b/src/resources/db/sounddb.cpp
@@ -49,7 +49,7 @@ void SoundDB::loadXmlFile(const std::string &fileName,
XML::Document *doc = new XML::Document(fileName,
UseVirtFs_true,
skipError);
- const XmlNodePtrConst root = doc->rootNode();
+ XmlNodeConstPtrConst root = doc->rootNode();
if (!root || !xmlNameEqual(root, "sounds"))
{
diff --git a/src/resources/db/statdb.cpp b/src/resources/db/statdb.cpp
index e2d4292a1..12126f36a 100644
--- a/src/resources/db/statdb.cpp
+++ b/src/resources/db/statdb.cpp
@@ -96,7 +96,7 @@ void StatDb::load()
mLoaded = true;
}
-static void loadBasicStats(const XmlNodePtr rootNode)
+static void loadBasicStats(XmlNodeConstPtr rootNode)
{
const int maxAttr = static_cast<int>(Attributes::MAX_ATTRIBUTE);
for_each_xml_child_node(node, rootNode)
@@ -131,7 +131,7 @@ static void loadBasicStats(const XmlNodePtr rootNode)
}
}
-static void loadStats(const XmlNodePtr rootNode,
+static void loadStats(XmlNodeConstPtr rootNode,
const std::string &page)
{
const int maxAttr = static_cast<int>(Attributes::MAX_ATTRIBUTE);
@@ -173,7 +173,7 @@ void StatDb::loadXmlFile(const std::string &fileName,
XML::Document doc(fileName,
UseVirtFs_true,
skipError);
- const XmlNodePtrConst rootNode = doc.rootNode();
+ XmlNodeConstPtrConst rootNode = doc.rootNode();
if (!rootNode || !xmlNameEqual(rootNode, "stats"))
{
diff --git a/src/resources/db/statuseffectdb.cpp b/src/resources/db/statuseffectdb.cpp
index fea06230e..58c5cf30d 100644
--- a/src/resources/db/statuseffectdb.cpp
+++ b/src/resources/db/statuseffectdb.cpp
@@ -88,7 +88,7 @@ void StatusEffectDB::loadXmlFile(const std::string &fileName,
const SkipError skipError)
{
XML::Document doc(fileName, UseVirtFs_true, skipError);
- const XmlNodePtrConst rootNode = doc.rootNode();
+ XmlNodeConstPtrConst rootNode = doc.rootNode();
if (!rootNode || !xmlNameEqual(rootNode, "status-effects"))
{
diff --git a/src/resources/db/unitsdb.cpp b/src/resources/db/unitsdb.cpp
index 0c06f6a4c..0437c81e4 100644
--- a/src/resources/db/unitsdb.cpp
+++ b/src/resources/db/unitsdb.cpp
@@ -191,7 +191,7 @@ void UnitsDb::loadXmlFile(const std::string &fileName,
const SkipError skipError)
{
XML::Document doc(fileName, UseVirtFs_true, skipError);
- const XmlNodePtrConst root = doc.rootNode();
+ XmlNodeConstPtrConst root = doc.rootNode();
if (!root || !xmlNameEqual(root, "units"))
{
diff --git a/src/resources/mapreader.cpp b/src/resources/mapreader.cpp
index 59ddaddb7..2fa44f57e 100644
--- a/src/resources/mapreader.cpp
+++ b/src/resources/mapreader.cpp
@@ -501,7 +501,7 @@ Map *MapReader::readMap(XmlNodePtrConst node, const std::string &path)
return map;
}
-void MapReader::readProperties(const XmlNodePtrConst node,
+void MapReader::readProperties(XmlNodeConstPtrConst node,
Properties *const props)
{
BLOCK_START("MapReader::readProperties")
@@ -635,7 +635,7 @@ inline static void setTile(Map *const map,
}
}
-bool MapReader::readBase64Layer(const XmlNodePtrConst childNode,
+bool MapReader::readBase64Layer(XmlNodeConstPtrConst childNode,
Map *const map,
MapLayer *const layer,
const MapLayerTypeT &layerType,
@@ -772,7 +772,7 @@ bool MapReader::readBase64Layer(const XmlNodePtrConst childNode,
return true;
}
-bool MapReader::readCsvLayer(const XmlNodePtrConst childNode,
+bool MapReader::readCsvLayer(XmlNodeConstPtrConst childNode,
Map *const map,
MapLayer *const layer,
const MapLayerTypeT &layerType,
@@ -854,7 +854,7 @@ bool MapReader::readCsvLayer(const XmlNodePtrConst childNode,
return true;
}
-void MapReader::readLayer(const XmlNodePtr node, Map *const map)
+void MapReader::readLayer(XmlNodeConstPtr node, Map *const map)
{
if (!node)
return;
diff --git a/src/resources/mapreader.h b/src/resources/mapreader.h
index 30ce41c93..2fd1e067c 100644
--- a/src/resources/mapreader.h
+++ b/src/resources/mapreader.h
@@ -63,7 +63,7 @@ class MapReader final
/**
* Reads a map layer and adds it to the given map.
*/
- static void readLayer(const XmlNodePtr node,
+ static void readLayer(XmlNodeConstPtr node,
Map *const map) A_NONNULL(2);
#ifdef USE_OPENGL
@@ -79,10 +79,10 @@ class MapReader final
* @param props The Properties instance to which the properties will
* be assigned.
*/
- static void readProperties(const XmlNodePtrConst node,
+ static void readProperties(XmlNodeConstPtrConst node,
Properties *const props) A_NONNULL(2);
- static bool readBase64Layer(const XmlNodePtrConst childNode,
+ static bool readBase64Layer(XmlNodeConstPtrConst childNode,
Map *const map,
MapLayer *const layer,
const MapLayerTypeT &layerType,
@@ -91,7 +91,7 @@ class MapReader final
int &restrict x, int &restrict y,
const int w, const int h) A_NONNULL(2);
- static bool readCsvLayer(const XmlNodePtrConst childNode,
+ static bool readCsvLayer(XmlNodeConstPtrConst childNode,
Map *const map,
MapLayer *const layer,
const MapLayerTypeT &layerType,
diff --git a/src/resources/sprite/spritedef.cpp b/src/resources/sprite/spritedef.cpp
index 3eb30d27d..fc168b53f 100644
--- a/src/resources/sprite/spritedef.cpp
+++ b/src/resources/sprite/spritedef.cpp
@@ -197,7 +197,7 @@ void SpriteDef::substituteActions()
substituteAction(SpriteAction::DEADRIDE, SpriteAction::DEAD);
}
-void SpriteDef::loadSprite(const XmlNodePtr spriteNode,
+void SpriteDef::loadSprite(XmlNodeConstPtr spriteNode,
const int variant,
const std::string &palettes)
{
@@ -230,7 +230,7 @@ void SpriteDef::loadSprite(const XmlNodePtr spriteNode,
BLOCK_END("SpriteDef::loadSprite")
}
-void SpriteDef::loadImageSet(const XmlNodePtr node,
+void SpriteDef::loadImageSet(XmlNodeConstPtr node,
const std::string &palettes)
{
const std::string name = XML::getProperty(node, "name", "");
@@ -275,7 +275,7 @@ const ImageSet *SpriteDef::getImageSet(const std::string &imageSetName) const
return si->second;
}
-void SpriteDef::loadAction(const XmlNodePtr node,
+void SpriteDef::loadAction(XmlNodeConstPtr node,
const int variant_offset)
{
if (!node)
@@ -315,7 +315,7 @@ void SpriteDef::loadAction(const XmlNodePtr node,
}
}
-void SpriteDef::loadAnimation(const XmlNodePtr animationNode,
+void SpriteDef::loadAnimation(XmlNodeConstPtr animationNode,
Action *const action,
const ImageSet *const imageSet0,
const int variant_offset) const
@@ -471,7 +471,7 @@ void SpriteDef::loadAnimation(const XmlNodePtr animationNode,
} // for frameNode
}
-void SpriteDef::includeSprite(const XmlNodePtr includeNode, const int variant)
+void SpriteDef::includeSprite(XmlNodeConstPtr includeNode, const int variant)
{
std::string filename = XML::getProperty(includeNode, "file", "");
@@ -493,7 +493,7 @@ void SpriteDef::includeSprite(const XmlNodePtr includeNode, const int variant)
SkipError_false);
if (!doc)
return;
- const XmlNodePtr rootNode = doc->rootNode();
+ XmlNodeConstPtr rootNode = doc->rootNode();
if (!rootNode || !xmlNameEqual(rootNode, "sprite"))
{
diff --git a/src/resources/sprite/spritedef.h b/src/resources/sprite/spritedef.h
index 3afc3c42c..fcb019d31 100644
--- a/src/resources/sprite/spritedef.h
+++ b/src/resources/sprite/spritedef.h
@@ -100,26 +100,26 @@ class SpriteDef final : public Resource
/**
* Loads a sprite element.
*/
- void loadSprite(const XmlNodePtr spriteNode,
+ void loadSprite(XmlNodeConstPtr spriteNode,
const int variant,
const std::string &palettes = "");
/**
* Loads an imageset element.
*/
- void loadImageSet(const XmlNodePtr node,
+ void loadImageSet(XmlNodeConstPtr node,
const std::string &palettes);
/**
* Loads an action element.
*/
- void loadAction(const XmlNodePtr node,
+ void loadAction(XmlNodeConstPtr node,
const int variant_offset);
/**
* Loads an animation element.
*/
- void loadAnimation(const XmlNodePtr animationNode,
+ void loadAnimation(XmlNodeConstPtr animationNode,
Action *const action,
const ImageSet *const imageSet,
const int variant_offset) const;
@@ -127,7 +127,7 @@ class SpriteDef final : public Resource
/**
* Include another sprite into this one.
*/
- void includeSprite(const XmlNodePtr includeNode,
+ void includeSprite(XmlNodeConstPtr includeNode,
const int variant);
const ImageSet *getImageSet(const std::string &imageSetName) const;