summaryrefslogtreecommitdiff
path: root/src/resources/mapreader.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-06-06 22:35:47 +0300
committerAndrei Karas <akaras@inbox.ru>2016-06-06 22:35:47 +0300
commitee41cd5a5a37e4d41df49cd92c61868fe2ce1a51 (patch)
tree4a189407ebb6240fd52b1909f38cb539ac1ef029 /src/resources/mapreader.cpp
parent89c3f9e88ab1a11959eacc18c6b4c9fb6e4a3dc9 (diff)
downloadmv-ee41cd5a5a37e4d41df49cd92c61868fe2ce1a51.tar.gz
mv-ee41cd5a5a37e4d41df49cd92c61868fe2ce1a51.tar.bz2
mv-ee41cd5a5a37e4d41df49cd92c61868fe2ce1a51.tar.xz
mv-ee41cd5a5a37e4d41df49cd92c61868fe2ce1a51.zip
Load special tilesets in ignored atlas.
Special tilesets for now is collision and levels. After can be other.
Diffstat (limited to 'src/resources/mapreader.cpp')
-rw-r--r--src/resources/mapreader.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/resources/mapreader.cpp b/src/resources/mapreader.cpp
index 67ce2f465..8c45cfc3c 100644
--- a/src/resources/mapreader.cpp
+++ b/src/resources/mapreader.cpp
@@ -64,6 +64,10 @@
typedef std::map<std::string, XmlNodePtr>::iterator LayerInfoIterator;
typedef std::set<XML::Document*>::iterator DocIterator;
+#ifdef USE_OPENGL
+Resource *MapReader::mEmptyAtlas = nullptr;
+#endif // USE_OPENGL
+
namespace
{
std::map<std::string, XmlNodePtr> mKnownLayers;
@@ -1235,3 +1239,26 @@ void MapReader::updateMusic(Map *const map)
if (PhysFs::exists(paths.getStringValue("music").append(name).c_str()))
map->setProperty("music", name);
}
+
+#ifdef USE_OPENGL
+void MapReader::loadEmptyAtlas()
+{
+ if (!graphicsManager.getUseAtlases())
+ return;
+
+ const MapInfo *const info = MapDB::getAtlas(
+ paths.getStringValue("emptyAtlasName"));
+ if (info)
+ {
+ mEmptyAtlas = Loader::getAtlas(
+ info->atlas,
+ *info->files);
+ }
+}
+
+void MapReader::unloadEmptyAtlas()
+{
+ if (mEmptyAtlas)
+ mEmptyAtlas->decRef();
+}
+#endif // USE_OPENGL