summaryrefslogtreecommitdiff
path: root/src/resources
diff options
context:
space:
mode:
Diffstat (limited to 'src/resources')
-rw-r--r--src/resources/db/mapdb.cpp17
-rw-r--r--src/resources/db/mapdb.h2
2 files changed, 15 insertions, 4 deletions
diff --git a/src/resources/db/mapdb.cpp b/src/resources/db/mapdb.cpp
index 15c80f2ae..13f671ff4 100644
--- a/src/resources/db/mapdb.cpp
+++ b/src/resources/db/mapdb.cpp
@@ -46,7 +46,7 @@ void MapDB::load()
unload();
loadRemap();
- loadInfo();
+ loadInfo(paths.getStringValue("mapsFile"));
mLoaded = true;
}
@@ -125,9 +125,9 @@ void MapDB::readAtlas(XmlNodePtr node)
}
}
-void MapDB::loadInfo()
+void MapDB::loadInfo(const std::string &fileName)
{
- XML::Document *doc = new XML::Document(paths.getStringValue("mapsFile"));
+ XML::Document *doc = new XML::Document(fileName);
const XmlNodePtr root = doc->rootNode();
if (!root)
{
@@ -138,9 +138,20 @@ void MapDB::loadInfo()
for_each_xml_child_node(node, root)
{
if (xmlNameEqual(node, "map"))
+ {
readMap(node);
+ }
else if (xmlNameEqual(node, "atlas"))
+ {
readAtlas(node);
+ }
+ else if (xmlNameEqual(node, "include"))
+ {
+ const std::string name = XML::getProperty(node, "name", "");
+ if (!name.empty())
+ loadInfo(name);
+ continue;
+ }
}
delete doc;
}
diff --git a/src/resources/db/mapdb.h b/src/resources/db/mapdb.h
index 527d15ba4..c2fbb3137 100644
--- a/src/resources/db/mapdb.h
+++ b/src/resources/db/mapdb.h
@@ -52,7 +52,7 @@ namespace MapDB
void loadRemap();
- void loadInfo();
+ void loadInfo(const std::string &fileName);
/**
* Clear the remap data