From f3fdd048e6265ab2c6e88ddff21dffd9409c03db Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 19 May 2014 18:05:14 +0300 Subject: Move mapinfo into separate file. --- src/resources/db/mapdb.cpp | 2 +- src/resources/db/mapdb.h | 14 ++------------ src/resources/mapinfo.h | 41 +++++++++++++++++++++++++++++++++++++++++ src/resources/mapreader.cpp | 2 +- 4 files changed, 45 insertions(+), 14 deletions(-) create mode 100644 src/resources/mapinfo.h (limited to 'src/resources') 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 #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 maps\remap.xml. */ 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 . + */ + +#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( -- cgit v1.2.3-60-g2f50