diff options
Diffstat (limited to 'src/resources/db')
-rw-r--r-- | src/resources/db/mapdb.cpp | 17 | ||||
-rw-r--r-- | src/resources/db/mapdb.h | 2 |
2 files changed, 18 insertions, 1 deletions
diff --git a/src/resources/db/mapdb.cpp b/src/resources/db/mapdb.cpp index 0ca328dcf..971fa4578 100644 --- a/src/resources/db/mapdb.cpp +++ b/src/resources/db/mapdb.cpp @@ -34,6 +34,7 @@ namespace MapDB::Maps mMaps; MapDB::MapInfos mInfos; MapDB::Atlases mAtlases; + std::set<std::string> mEmptyTilesets; } // namespace namespace MapDB @@ -137,7 +138,16 @@ void MapDB::readAtlas(XmlNodePtrConst node) mAtlases[atlas].push_back(file); } } - if (atlas != "all" && atlas != paths.getStringValue("emptyAtlasName")) + if (atlas == paths.getStringValue("emptyAtlasName")) + { + const StringVect *files = &mAtlases[atlas]; + FOR_EACHP (StringVectCIter, it, files) + { + mEmptyTilesets.insert(*it); + logger->log("empty tileset: " + *it); + } + } + else if (atlas != "all") { const AtlasCIter &allAtlas = mAtlases.find("all"); if (allAtlas != mAtlases.end()) @@ -223,3 +233,8 @@ const MapInfo *MapDB::getAtlas(const std::string &name) info->files = &(*it).second; return info; } + +bool MapDB::isEmptyTileset(const std::string &name) +{ + return mEmptyTilesets.find(name) != mEmptyTilesets.end(); +} diff --git a/src/resources/db/mapdb.h b/src/resources/db/mapdb.h index 97a8f0cb1..e7ccf972c 100644 --- a/src/resources/db/mapdb.h +++ b/src/resources/db/mapdb.h @@ -57,6 +57,8 @@ namespace MapDB const MapInfo *getAtlas(const std::string &name) A_WARN_UNUSED; + bool isEmptyTileset(const std::string &name); + // Maps DB typedef std::map<std::string, std::string> Maps; typedef Maps::iterator MapIterator; |