summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-05-06 23:13:00 +0300
committerAndrei Karas <akaras@inbox.ru>2015-05-06 23:13:00 +0300
commit6c9ef6af1b72b74b9ab94cc1c1349c3cd70c8be6 (patch)
treec31a7e703e9452f667ef5a7f0958375ba388c50e
parenta86bdc28fb8bc8a70c6a19523789495d87c7a56d (diff)
downloadmv-6c9ef6af1b72b74b9ab94cc1c1349c3cd70c8be6.tar.gz
mv-6c9ef6af1b72b74b9ab94cc1c1349c3cd70c8be6.tar.bz2
mv-6c9ef6af1b72b74b9ab94cc1c1349c3cd70c8be6.tar.xz
mv-6c9ef6af1b72b74b9ab94cc1c1349c3cd70c8be6.zip
Add strong types bool type UseResman.
-rw-r--r--src/client.cpp4
-rw-r--r--src/configuration.cpp9
-rw-r--r--src/configuration.h4
-rw-r--r--src/effectmanager.cpp2
-rw-r--r--src/enums/simpletypes.h12
-rw-r--r--src/gui/theme.cpp6
-rw-r--r--src/gui/windows/equipmentwindow.cpp2
-rw-r--r--src/gui/windows/questswindow.cpp2
-rw-r--r--src/gui/windows/serverdialog.cpp4
-rw-r--r--src/gui/windows/skilldialog.cpp2
-rw-r--r--src/gui/windows/updaterwindow.cpp2
-rw-r--r--src/particle/particle.cpp2
-rw-r--r--src/resources/db/avatardb.cpp2
-rw-r--r--src/resources/db/chardb.cpp2
-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/emotedb.cpp4
-rw-r--r--src/resources/db/homunculusdb.cpp2
-rw-r--r--src/resources/db/horsedb.cpp2
-rw-r--r--src/resources/db/itemdb.cpp2
-rw-r--r--src/resources/db/mapdb.cpp8
-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/petdb.cpp2
-rw-r--r--src/resources/db/sounddb.cpp2
-rw-r--r--src/resources/mapreader.cpp6
-rw-r--r--src/resources/spritedef.cpp4
-rw-r--r--src/statuseffect.cpp2
-rw-r--r--src/units.cpp2
-rw-r--r--src/utils/xml.cpp4
-rw-r--r--src/utils/xml.h4
-rw-r--r--src/utils/xmlutils.cpp2
35 files changed, 64 insertions, 53 deletions
diff --git a/src/client.cpp b/src/client.cpp
index a9354342c..98fa33e18 100644
--- a/src/client.cpp
+++ b/src/client.cpp
@@ -1226,7 +1226,7 @@ int Client::gameExec()
}
logger->log("Init paths");
- paths.init("paths.xml", true);
+ paths.init("paths.xml", UseResman_true);
paths.setDefaultValues(getPathsDefaults());
if (!SpriteReference::Empty)
{
@@ -1726,7 +1726,7 @@ void Client::action(const ActionEvent &event)
void Client::initFeatures()
{
- features.init(paths.getStringValue("featuresFile"), true);
+ features.init(paths.getStringValue("featuresFile"), UseResman_true);
features.setDefaultValues(getFeaturesDefaults());
settings.fixDeadAnimation = features.getBoolValue("fixDeadAnimation");
}
diff --git a/src/configuration.cpp b/src/configuration.cpp
index f1691baad..0ed1299bb 100644
--- a/src/configuration.cpp
+++ b/src/configuration.cpp
@@ -350,7 +350,7 @@ Configuration::Configuration() :
mDefaultsData(nullptr),
mDirectory(),
mFilename(),
- mUseResManager(false),
+ mUseResManager(UseResman_false),
mUpdated(false)
{
#ifdef DEBUG_CONFIG
@@ -384,7 +384,7 @@ void Configuration::unload()
mConfigPath.clear();
mDirectory.clear();
mFilename.clear();
- mUseResManager = false;
+ mUseResManager = UseResman_false;
ConfigurationObject::clear();
}
@@ -710,14 +710,15 @@ void ConfigurationObject::initFromXML(const XmlNodePtrConst parent_node)
}
}
-void Configuration::init(const std::string &filename, const bool useResManager)
+void Configuration::init(const std::string &filename,
+ const UseResman useResManager)
{
cleanDefaults();
XML::Document doc(filename, useResManager, false);
mFilename = filename;
mUseResManager = useResManager;
- if (useResManager)
+ if (useResManager == UseResman_true)
{
mConfigPath = "PhysFS://" + filename;
mDirectory.clear();
diff --git a/src/configuration.h b/src/configuration.h
index 0002a815b..c4ce39675 100644
--- a/src/configuration.h
+++ b/src/configuration.h
@@ -244,7 +244,7 @@ class Configuration final : public ConfigurationObject
* @param useResManager Make use of the resource manager.
*/
void init(const std::string &filename,
- const bool useResManager = false);
+ const UseResman useResManager = UseResman_false);
void reInit();
@@ -365,7 +365,7 @@ class Configuration final : public ConfigurationObject
DefaultsData *mDefaultsData;
std::string mDirectory;
std::string mFilename;
- bool mUseResManager;
+ UseResman mUseResManager;
bool mUpdated;
};
diff --git a/src/effectmanager.cpp b/src/effectmanager.cpp
index e029faefa..10ef68089 100644
--- a/src/effectmanager.cpp
+++ b/src/effectmanager.cpp
@@ -47,7 +47,7 @@ EffectManager::EffectManager() :
void EffectManager::loadXmlFile(const std::string &fileName)
{
- XML::Document doc(fileName, true, false);
+ XML::Document doc(fileName, UseResman_true, false);
const XmlNodePtrConst root = doc.rootNode();
if (!root || !xmlNameEqual(root, "being-effects"))
diff --git a/src/enums/simpletypes.h b/src/enums/simpletypes.h
index 652ddf630..217028f56 100644
--- a/src/enums/simpletypes.h
+++ b/src/enums/simpletypes.h
@@ -28,13 +28,13 @@
#define defBoolEnum(name) \
enum class name : bool \
{ \
- False = false, \
- True = true \
+ MFalse = false, \
+ MTrue = true \
}; \
- const name name##_true = name::True; \
- const name name##_false = name::False
+ const name name##_true = name::MTrue; \
+ const name name##_false = name::MFalse
#define fromBool(val, name) \
- (val) ? name::True : name::False
+ (val) ? name::MTrue : name::MFalse
#else // ADVGCC
@@ -47,6 +47,7 @@
#endif // ADVGCC
+
defBoolEnum(Identified);
defBoolEnum(Damaged);
defBoolEnum(Favorite);
@@ -64,5 +65,6 @@ defBoolEnum(AllowSort);
defBoolEnum(NpcNames);
defBoolEnum(Enable);
defBoolEnum(ForceDisplay);
+defBoolEnum(UseResman);
#endif // ENUMS_SIMPLETYPES_H
diff --git a/src/gui/theme.cpp b/src/gui/theme.cpp
index f2cfc4c09..6f6f622a5 100644
--- a/src/gui/theme.cpp
+++ b/src/gui/theme.cpp
@@ -373,7 +373,7 @@ Skin *Theme::readSkin(const std::string &filename, const bool full)
// logger->log("Loading skin '%s'.", filename.c_str());
- XML::Document doc(resolveThemePath(filename), true, true);
+ XML::Document doc(resolveThemePath(filename), UseResman_true, true);
const XmlNodePtr rootNode = doc.rootNode();
if (!rootNode || !xmlNameEqual(rootNode, "skinset"))
@@ -967,7 +967,7 @@ void Theme::loadColors(std::string file)
else
file.append("/colors.xml");
- XML::Document doc(resolveThemePath(file), true, false);
+ XML::Document doc(resolveThemePath(file), UseResman_true, false);
const XmlNodePtrConst root = doc.rootNode();
if (!root || !xmlNameEqual(root, "colors"))
@@ -1156,7 +1156,7 @@ ThemeInfo *Theme::loadInfo(const std::string &themeName)
themeName).append("/info.xml");
}
logger->log("loading: " + path);
- XML::Document doc(path, true, false);
+ XML::Document doc(path, UseResman_true, false);
const XmlNodePtrConst rootNode = doc.rootNode();
if (!rootNode || !xmlNameEqual(rootNode, "info"))
diff --git a/src/gui/windows/equipmentwindow.cpp b/src/gui/windows/equipmentwindow.cpp
index 44cb01bc1..08cb4eccb 100644
--- a/src/gui/windows/equipmentwindow.cpp
+++ b/src/gui/windows/equipmentwindow.cpp
@@ -572,7 +572,7 @@ void EquipmentWindow::fillBoxes()
{
XML::Document *const doc = new XML::Document(
paths.getStringValue("equipmentWindowFile"),
- true,
+ UseResman_true,
false);
const XmlNodePtr root = doc->rootNode();
if (!root)
diff --git a/src/gui/windows/questswindow.cpp b/src/gui/windows/questswindow.cpp
index d5fdf895a..cb7c8ae5f 100644
--- a/src/gui/windows/questswindow.cpp
+++ b/src/gui/windows/questswindow.cpp
@@ -166,7 +166,7 @@ QuestsWindow::~QuestsWindow()
void QuestsWindow::loadXmlFile(const std::string &fileName)
{
- XML::Document doc(fileName, true, false);
+ XML::Document doc(fileName, UseResman_true, false);
const XmlNodePtrConst root = doc.rootNode();
if (!root)
return;
diff --git a/src/gui/windows/serverdialog.cpp b/src/gui/windows/serverdialog.cpp
index 57a8af078..8aae85e23 100644
--- a/src/gui/windows/serverdialog.cpp
+++ b/src/gui/windows/serverdialog.cpp
@@ -451,7 +451,9 @@ void ServerDialog::downloadServerList()
void ServerDialog::loadServers(const bool addNew)
{
XML::Document doc(std::string(mDir).append("/").append(
- branding.getStringValue("onlineServerFile")), false, false);
+ branding.getStringValue("onlineServerFile")),
+ UseResman_false,
+ false);
const XmlNodePtr rootNode = doc.rootNode();
if (!rootNode || !xmlNameEqual(rootNode, "serverlist"))
diff --git a/src/gui/windows/skilldialog.cpp b/src/gui/windows/skilldialog.cpp
index a11ba562b..a512a89ad 100644
--- a/src/gui/windows/skilldialog.cpp
+++ b/src/gui/windows/skilldialog.cpp
@@ -261,7 +261,7 @@ void SkillDialog::loadSkills()
void SkillDialog::loadXmlFile(const std::string &fileName)
{
- XML::Document doc(fileName, true, false);
+ XML::Document doc(fileName, UseResman_true, false);
XmlNodePtrConst root = doc.rootNode();
int setCount = 0;
diff --git a/src/gui/windows/updaterwindow.cpp b/src/gui/windows/updaterwindow.cpp
index 6a9ad373c..9dd27a9c1 100644
--- a/src/gui/windows/updaterwindow.cpp
+++ b/src/gui/windows/updaterwindow.cpp
@@ -77,7 +77,7 @@ static std::vector<UpdateFile> loadXMLFile(const std::string &fileName,
const bool loadMods)
{
std::vector<UpdateFile> files;
- XML::Document doc(fileName, false, false);
+ XML::Document doc(fileName, UseResman_false, false);
const XmlNodePtrConst rootNode = doc.rootNode();
if (!rootNode || !xmlNameEqual(rootNode, "updates"))
diff --git a/src/particle/particle.cpp b/src/particle/particle.cpp
index 2d22dc262..2fdb6eab0 100644
--- a/src/particle/particle.cpp
+++ b/src/particle/particle.cpp
@@ -290,7 +290,7 @@ Particle *Particle::addEffect(const std::string &particleEffectFile,
const size_t pos = particleEffectFile.find('|');
const std::string dyePalettes = (pos != std::string::npos)
? particleEffectFile.substr(pos + 1) : "";
- XML::Document doc(particleEffectFile.substr(0, pos), true, false);
+ XML::Document doc(particleEffectFile.substr(0, pos), UseResman_true, false);
const XmlNodePtrConst rootNode = doc.rootNode();
if (!rootNode || !xmlNameEqual(rootNode, "effect"))
diff --git a/src/resources/db/avatardb.cpp b/src/resources/db/avatardb.cpp
index 52242b4fe..ab8e7d2c9 100644
--- a/src/resources/db/avatardb.cpp
+++ b/src/resources/db/avatardb.cpp
@@ -52,7 +52,7 @@ void AvatarDB::load()
void AvatarDB::loadXmlFile(const std::string &fileName)
{
- XML::Document doc(fileName, true, false);
+ XML::Document doc(fileName, UseResman_true, false);
const XmlNodePtrConst rootNode = doc.rootNode();
if (!rootNode || !xmlNameEqual(rootNode, "avatars"))
diff --git a/src/resources/db/chardb.cpp b/src/resources/db/chardb.cpp
index b05beb75c..6f304cf65 100644
--- a/src/resources/db/chardb.cpp
+++ b/src/resources/db/chardb.cpp
@@ -50,7 +50,7 @@ void CharDB::load()
XML::Document *doc = new XML::Document(
paths.getStringValue("charCreationFile"),
- true,
+ UseResman_true,
false);
const XmlNodePtrConst root = doc->rootNode();
diff --git a/src/resources/db/colordb.cpp b/src/resources/db/colordb.cpp
index bf8c06986..d1ac10e3f 100644
--- a/src/resources/db/colordb.cpp
+++ b/src/resources/db/colordb.cpp
@@ -70,7 +70,7 @@ void ColorDB::load()
void ColorDB::loadHair(const std::string &fileName,
std::map<int, ItemColor> &colors)
{
- XML::Document *doc = new XML::Document(fileName, true, false);
+ XML::Document *doc = new XML::Document(fileName, UseResman_true, false);
const XmlNodePtrConst root = doc->rootNode();
if (!root || !xmlNameEqual(root, "colors"))
@@ -108,7 +108,7 @@ void ColorDB::loadHair(const std::string &fileName,
void ColorDB::loadColorLists(const std::string &fileName)
{
- XML::Document *doc = new XML::Document(fileName, true, false);
+ XML::Document *doc = new XML::Document(fileName, UseResman_true, false);
const XmlNodePtrConst root = doc->rootNode();
if (!root)
{
diff --git a/src/resources/db/commandsdb.cpp b/src/resources/db/commandsdb.cpp
index daab8ef2e..be7666f32 100644
--- a/src/resources/db/commandsdb.cpp
+++ b/src/resources/db/commandsdb.cpp
@@ -58,7 +58,7 @@ static SpellTarget parseTarget(const std::string &text)
void CommandsDB::loadXmlFile(const std::string &fileName)
{
- XML::Document doc(fileName, true, false);
+ XML::Document doc(fileName, UseResman_true, false);
const XmlNodePtrConst rootNode = doc.rootNode();
if (!rootNode || !xmlNameEqual(rootNode, "commands"))
diff --git a/src/resources/db/deaddb.cpp b/src/resources/db/deaddb.cpp
index fcb44e63f..a3465dabd 100644
--- a/src/resources/db/deaddb.cpp
+++ b/src/resources/db/deaddb.cpp
@@ -48,7 +48,7 @@ void DeadDB::load()
void DeadDB::loadXmlFile(const std::string &fileName)
{
- XML::Document *doc = new XML::Document(fileName, true, false);
+ XML::Document *doc = new XML::Document(fileName, UseResman_true, false);
const XmlNodePtrConst root = doc->rootNode();
if (!root || !xmlNameEqual(root, "messages"))
diff --git a/src/resources/db/emotedb.cpp b/src/resources/db/emotedb.cpp
index 7da44c0da..37c0bacc7 100644
--- a/src/resources/db/emotedb.cpp
+++ b/src/resources/db/emotedb.cpp
@@ -67,7 +67,7 @@ void EmoteDB::load()
void EmoteDB::loadXmlFile(const std::string &fileName)
{
- XML::Document doc(fileName, true, false);
+ XML::Document doc(fileName, UseResman_true, false);
XmlNodePtrConst rootNode = doc.rootNode();
if (!rootNode || !xmlNameEqual(rootNode, "emotes"))
@@ -143,7 +143,7 @@ void EmoteDB::loadXmlFile(const std::string &fileName)
void EmoteDB::loadSpecialXmlFile(const std::string &fileName)
{
- XML::Document doc(fileName, true, false);
+ XML::Document doc(fileName, UseResman_true, false);
XmlNodePtrConst rootNode = doc.rootNode();
if (!rootNode || !xmlNameEqual(rootNode, "emotes"))
diff --git a/src/resources/db/homunculusdb.cpp b/src/resources/db/homunculusdb.cpp
index 75194c4c7..b954ea9ab 100644
--- a/src/resources/db/homunculusdb.cpp
+++ b/src/resources/db/homunculusdb.cpp
@@ -56,7 +56,7 @@ void HomunculusDB::load()
void HomunculusDB::loadXmlFile(const std::string &fileName)
{
- XML::Document doc(fileName, true, false);
+ XML::Document doc(fileName, UseResman_true, false);
const XmlNodePtr rootNode = doc.rootNode();
if (!rootNode || !xmlNameEqual(rootNode, "homunculuses"))
diff --git a/src/resources/db/horsedb.cpp b/src/resources/db/horsedb.cpp
index c6d364b27..df653ecfe 100644
--- a/src/resources/db/horsedb.cpp
+++ b/src/resources/db/horsedb.cpp
@@ -58,7 +58,7 @@ void HorseDB::load()
void HorseDB::loadXmlFile(const std::string &fileName)
{
- XML::Document doc(fileName, true, false);
+ XML::Document doc(fileName, UseResman_true, false);
XmlNodePtrConst rootNode = doc.rootNode();
if (!rootNode || !xmlNameEqual(rootNode, "horses"))
diff --git a/src/resources/db/itemdb.cpp b/src/resources/db/itemdb.cpp
index 11b6f47f4..cf78a0a06 100644
--- a/src/resources/db/itemdb.cpp
+++ b/src/resources/db/itemdb.cpp
@@ -234,7 +234,7 @@ void ItemDB::load()
void ItemDB::loadXmlFile(const std::string &fileName, int &tagNum)
{
- XML::Document doc(fileName, true, false);
+ XML::Document doc(fileName, UseResman_true, false);
const XmlNodePtrConst rootNode = doc.rootNode();
if (!rootNode || !xmlNameEqual(rootNode, "items"))
diff --git a/src/resources/db/mapdb.cpp b/src/resources/db/mapdb.cpp
index 73a4a9905..a40a7b2ae 100644
--- a/src/resources/db/mapdb.cpp
+++ b/src/resources/db/mapdb.cpp
@@ -59,7 +59,9 @@ void MapDB::load()
void MapDB::loadRemapXmlFile(const std::string &fileName)
{
- XML::Document *const doc = new XML::Document(fileName, true, false);
+ XML::Document *const doc = new XML::Document(fileName,
+ UseResman_true,
+ false);
const XmlNodePtrConst root = doc->rootNode();
if (!root)
@@ -140,7 +142,9 @@ void MapDB::readAtlas(XmlNodePtrConst node)
void MapDB::loadInfo(const std::string &fileName)
{
- XML::Document *doc = new XML::Document(fileName, true, false);
+ XML::Document *doc = new XML::Document(fileName,
+ UseResman_true,
+ false);
const XmlNodePtrConst root = doc->rootNode();
if (!root)
{
diff --git a/src/resources/db/mercenarydb.cpp b/src/resources/db/mercenarydb.cpp
index c63e8acd2..f8ecd9839 100644
--- a/src/resources/db/mercenarydb.cpp
+++ b/src/resources/db/mercenarydb.cpp
@@ -56,7 +56,7 @@ void MercenaryDB::load()
void MercenaryDB::loadXmlFile(const std::string &fileName)
{
- XML::Document doc(fileName, true, false);
+ XML::Document doc(fileName, UseResman_true, false);
const XmlNodePtr rootNode = doc.rootNode();
if (!rootNode || !xmlNameEqual(rootNode, "mercenaries"))
diff --git a/src/resources/db/moddb.cpp b/src/resources/db/moddb.cpp
index 5c4ffe0f6..82cd14be8 100644
--- a/src/resources/db/moddb.cpp
+++ b/src/resources/db/moddb.cpp
@@ -50,7 +50,7 @@ void ModDB::load()
void ModDB::loadXmlFile(const std::string &fileName)
{
- XML::Document doc(fileName, true, false);
+ XML::Document doc(fileName, UseResman_true, false);
const XmlNodePtrConst rootNode = doc.rootNode();
if (!rootNode || !xmlNameEqual(rootNode, "mods"))
diff --git a/src/resources/db/monsterdb.cpp b/src/resources/db/monsterdb.cpp
index 3e4c78e63..0c546ff25 100644
--- a/src/resources/db/monsterdb.cpp
+++ b/src/resources/db/monsterdb.cpp
@@ -59,7 +59,7 @@ void MonsterDB::load()
void MonsterDB::loadXmlFile(const std::string &fileName)
{
- XML::Document doc(fileName, true, false);
+ XML::Document doc(fileName, UseResman_true, false);
const XmlNodePtr rootNode = doc.rootNode();
if (!rootNode || !xmlNameEqual(rootNode, "monsters"))
diff --git a/src/resources/db/npcdb.cpp b/src/resources/db/npcdb.cpp
index 6ba5fd0da..101f95f1a 100644
--- a/src/resources/db/npcdb.cpp
+++ b/src/resources/db/npcdb.cpp
@@ -56,7 +56,7 @@ void NPCDB::load()
void NPCDB::loadXmlFile(const std::string &fileName)
{
- XML::Document doc(fileName, true, false);
+ XML::Document doc(fileName, UseResman_true, false);
const XmlNodePtrConst rootNode = doc.rootNode();
if (!rootNode || !xmlNameEqual(rootNode, "npcs"))
diff --git a/src/resources/db/petdb.cpp b/src/resources/db/petdb.cpp
index 1f7fee0b7..47723b92d 100644
--- a/src/resources/db/petdb.cpp
+++ b/src/resources/db/petdb.cpp
@@ -54,7 +54,7 @@ void PETDB::load()
void PETDB::loadXmlFile(const std::string &fileName)
{
- XML::Document doc(fileName, true, false);
+ XML::Document doc(fileName, UseResman_true, false);
const XmlNodePtrConst rootNode = doc.rootNode();
if (!rootNode || !xmlNameEqual(rootNode, "pets"))
diff --git a/src/resources/db/sounddb.cpp b/src/resources/db/sounddb.cpp
index ce61bf6d4..8e1d22bc0 100644
--- a/src/resources/db/sounddb.cpp
+++ b/src/resources/db/sounddb.cpp
@@ -44,7 +44,7 @@ void SoundDB::load()
void SoundDB::loadXmlFile(const std::string &fileName)
{
- XML::Document *doc = new XML::Document(fileName, true, false);
+ XML::Document *doc = new XML::Document(fileName, UseResman_true, false);
const XmlNodePtrConst root = doc->rootNode();
if (!root || !xmlNameEqual(root, "sounds"))
diff --git a/src/resources/mapreader.cpp b/src/resources/mapreader.cpp
index 49e3ced2d..474e339ec 100644
--- a/src/resources/mapreader.cpp
+++ b/src/resources/mapreader.cpp
@@ -204,7 +204,7 @@ int inflateMemory(unsigned char *restrict const in,
void MapReader::addLayerToList(const std::string &fileName)
{
- XML::Document *doc = new XML::Document(fileName, true, false);
+ XML::Document *doc = new XML::Document(fileName, UseResman_true, false);
XmlNodePtrConst node = doc->rootNode();
if (!node)
{
@@ -236,7 +236,7 @@ Map *MapReader::readMap(const std::string &restrict filename,
BLOCK_START("MapReader::readMap str")
logger->log("Attempting to read map %s", realFilename.c_str());
- XML::Document doc(realFilename, true, false);
+ XML::Document doc(realFilename, UseResman_true, false);
if (!doc.isLoaded())
{
BLOCK_END("MapReader::readMap str")
@@ -894,7 +894,7 @@ Tileset *MapReader::readTileset(XmlNodePtr node,
std::string filename = XML::getProperty(node, "source", "");
filename = resolveRelativePath(path, filename);
- doc = new XML::Document(filename, true, false);
+ doc = new XML::Document(filename, UseResman_true, false);
node = doc->rootNode();
if (!node)
{
diff --git a/src/resources/spritedef.cpp b/src/resources/spritedef.cpp
index 1f5b02610..d22cc7899 100644
--- a/src/resources/spritedef.cpp
+++ b/src/resources/spritedef.cpp
@@ -87,7 +87,7 @@ SpriteDef *SpriteDef::load(const std::string &animationFile,
if (pos != std::string::npos)
palettes = animationFile.substr(pos + 1);
- XML::Document doc(animationFile.substr(0, pos), true, false);
+ XML::Document doc(animationFile.substr(0, pos), UseResman_true, false);
XmlNodePtrConst rootNode = doc.rootNode();
if (!rootNode || !xmlNameEqual(rootNode, "sprite"))
@@ -434,7 +434,7 @@ void SpriteDef::includeSprite(const XmlNodePtr includeNode, const int variant)
}
mProcessedFiles.insert(filename);
- XML::Document doc(filename, true, false);
+ XML::Document doc(filename, UseResman_true, false);
const XmlNodePtr rootNode = doc.rootNode();
if (!rootNode || !xmlNameEqual(rootNode, "sprite"))
diff --git a/src/statuseffect.cpp b/src/statuseffect.cpp
index 16936ec2b..60b32f31d 100644
--- a/src/statuseffect.cpp
+++ b/src/statuseffect.cpp
@@ -151,7 +151,7 @@ void StatusEffect::load()
void StatusEffect::loadXmlFile(const std::string &fileName)
{
- XML::Document doc(fileName, true, false);
+ XML::Document doc(fileName, UseResman_true, false);
const XmlNodePtrConst rootNode = doc.rootNode();
if (!rootNode || !xmlNameEqual(rootNode, "status-effects"))
diff --git a/src/units.cpp b/src/units.cpp
index 237aa04e8..79fca0ea9 100644
--- a/src/units.cpp
+++ b/src/units.cpp
@@ -107,7 +107,7 @@ void Units::loadUnits()
void Units::loadXmlFile(const std::string &fileName)
{
- XML::Document doc(fileName, true, false);
+ XML::Document doc(fileName, UseResman_true, false);
const XmlNodePtrConst root = doc.rootNode();
if (!root || !xmlNameEqual(root, "units"))
diff --git a/src/utils/xml.cpp b/src/utils/xml.cpp
index 33173b3ee..487c177bb 100644
--- a/src/utils/xml.cpp
+++ b/src/utils/xml.cpp
@@ -76,7 +76,7 @@ static void xmlErrorLogger(void *ctx A_UNUSED, const char *msg, ...)
namespace XML
{
Document::Document(const std::string &filename,
- const bool useResman,
+ const UseResman useResman,
const bool skipError) :
mDoc(nullptr),
mIsValid(false)
@@ -89,7 +89,7 @@ namespace XML
int size = 0;
char *data = nullptr;
valid = true;
- if (useResman)
+ if (useResman == UseResman_true)
{
data = static_cast<char*>(PhysFs::loadFile(
filename.c_str(), size));
diff --git a/src/utils/xml.h b/src/utils/xml.h
index 35e7bb7e6..f8d531963 100644
--- a/src/utils/xml.h
+++ b/src/utils/xml.h
@@ -23,6 +23,8 @@
#ifndef UTILS_XML_H
#define UTILS_XML_H
+#include "enums/simpletypes.h"
+
#include <libxml/tree.h>
#include <libxml/xmlwriter.h>
@@ -66,7 +68,7 @@ namespace XML
* resource manager. Logs errors.
*/
Document(const std::string &filename,
- const bool useResman,
+ const UseResman useResman,
const bool skipError);
/**
diff --git a/src/utils/xmlutils.cpp b/src/utils/xmlutils.cpp
index 7c370dda0..f275477c0 100644
--- a/src/utils/xmlutils.cpp
+++ b/src/utils/xmlutils.cpp
@@ -34,7 +34,7 @@ void readXmlIntVector(const std::string &fileName,
std::vector<int> &arr)
{
arr.clear();
- XML::Document doc(fileName, true, false);
+ XML::Document doc(fileName, UseResman_true, false);
const XmlNodePtrConst rootNode = doc.rootNode();
if (!rootNode || !xmlNameEqual(rootNode, rootName.c_str()))