Merge 'remotes/trunk'
[0ad.git] / source / graphics / MeshManager.h
bloba1f7019470a04519bce8024eaa51fdba43da1e33
1 /* Copyright (C) 2019 Wildfire Games.
2 * This file is part of 0 A.D.
4 * 0 A.D. is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 2 of the License, or
7 * (at your option) any later version.
9 * 0 A.D. is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with 0 A.D. If not, see <http://www.gnu.org/licenses/>.
18 #ifndef INCLUDED_MESHMANAGER
19 #define INCLUDED_MESHMANAGER
21 #include "lib/file/vfs/vfs_path.h"
23 #include <memory>
24 #include <unordered_map>
26 class CModelDef;
27 using CModelDefPtr = std::shared_ptr<CModelDef>;
29 class CColladaManager;
31 class CMeshManager
33 NONCOPYABLE(CMeshManager);
34 public:
35 CMeshManager(CColladaManager& colladaManager);
36 ~CMeshManager();
38 CModelDefPtr GetMesh(const VfsPath& pathname);
40 private:
41 using mesh_map = std::unordered_map<VfsPath, std::weak_ptr<CModelDef> >;
42 mesh_map m_MeshMap;
43 CColladaManager& m_ColladaManager;
46 #endif