summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-05-19 18:05:14 +0300
committerAndrei Karas <akaras@inbox.ru>2014-05-19 18:05:14 +0300
commitf3fdd048e6265ab2c6e88ddff21dffd9409c03db (patch)
treea6a564e2ecc3a081aabf140991770765a3d6c1e1
parent0fd434e3102a5aad5e6f24cf384f03c527ce7c04 (diff)
downloadplus-f3fdd048e6265ab2c6e88ddff21dffd9409c03db.tar.gz
plus-f3fdd048e6265ab2c6e88ddff21dffd9409c03db.tar.bz2
plus-f3fdd048e6265ab2c6e88ddff21dffd9409c03db.tar.xz
plus-f3fdd048e6265ab2c6e88ddff21dffd9409c03db.zip
Move mapinfo into separate file.
-rw-r--r--src/CMakeLists.txt1
-rw-r--r--src/Makefile.am1
-rw-r--r--src/resources/db/mapdb.cpp2
-rw-r--r--src/resources/db/mapdb.h14
-rw-r--r--src/resources/mapinfo.h41
-rw-r--r--src/resources/mapreader.cpp2
6 files changed, 47 insertions, 14 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 471cac4da..db6655678 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -562,6 +562,7 @@ SET(SRCS
resources/db/mapdb.h
resources/db/moddb.cpp
resources/db/moddb.h
+ resources/mapinfo.h
resources/mapreader.cpp
resources/mapreader.h
resources/modinfo.cpp
diff --git a/src/Makefile.am b/src/Makefile.am
index 5b9099e8f..bffceb704 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -671,6 +671,7 @@ manaplus_SOURCES += gui/widgets/avatarlistbox.cpp \
resources/db/mapdb.h \
resources/db/moddb.cpp \
resources/db/moddb.h \
+ resources/mapinfo.h \
resources/mapreader.cpp \
resources/mapreader.h \
resources/modinfo.cpp \
diff --git a/src/resources/db/mapdb.cpp b/src/resources/db/mapdb.cpp
index 20d108f13..ea734a150 100644
--- a/src/resources/db/mapdb.cpp
+++ b/src/resources/db/mapdb.cpp
@@ -177,7 +177,7 @@ const std::string MapDB::getMapName(const std::string &name)
return name;
}
-const MapDB::MapInfo *MapDB::getMapAtlas(const std::string &name)
+const MapInfo *MapDB::getMapAtlas(const std::string &name)
{
const MapInfoIter it = mInfos.find(name);
if (it == mInfos.end())
diff --git a/src/resources/db/mapdb.h b/src/resources/db/mapdb.h
index c2fbb3137..ae001ccad 100644
--- a/src/resources/db/mapdb.h
+++ b/src/resources/db/mapdb.h
@@ -24,6 +24,8 @@
#include "utils/stringvector.h"
+#include "resources/mapinfo.h"
+
#include <map>
#include "localconsts.h"
@@ -33,18 +35,6 @@
*/
namespace MapDB
{
- struct MapInfo
- {
- MapInfo() :
- atlas(),
- files(nullptr)
- {
- }
-
- std::string atlas;
- const StringVect *files;
- };
-
/**
* Loads the map remap data from <code>maps\remap.xml</code>.
*/
diff --git a/src/resources/mapinfo.h b/src/resources/mapinfo.h
new file mode 100644
index 000000000..ebe7ec66c
--- /dev/null
+++ b/src/resources/mapinfo.h
@@ -0,0 +1,41 @@
+/*
+ * Color database
+ * Copyright (C) 2008 Aethyra Development Team
+ * Copyright (C) 2011-2014 The ManaPlus Developers
+ *
+ * This file is part of The ManaPlus Client.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef RESOURCES_MAPINFO_H
+#define RESOURCES_MAPINFO_H
+
+#include "utils/stringvector.h"
+
+#include "localconsts.h"
+
+struct MapInfo final
+{
+ MapInfo() :
+ atlas(),
+ files(nullptr)
+ {
+ }
+
+ std::string atlas;
+ const StringVect *files;
+};
+
+#endif // RESOURCES_MAPINFO_H
diff --git a/src/resources/mapreader.cpp b/src/resources/mapreader.cpp
index c1fbf038a..6a15555d9 100644
--- a/src/resources/mapreader.cpp
+++ b/src/resources/mapreader.cpp
@@ -326,7 +326,7 @@ Map *MapReader::readMap(XmlNodePtrConst node, const std::string &path)
#ifdef USE_OPENGL
if (graphicsManager.getUseAtlases())
{
- const MapDB::MapInfo *const info = MapDB::getMapAtlas(fileName);
+ const MapInfo *const info = MapDB::getMapAtlas(fileName);
if (info)
{
map->setAtlas(resman->getAtlas(