Pyrogenesis  trunk
MeshManager.h
Go to the documentation of this file.
1 /* Copyright (C) 2019 Wildfire Games.
2  * This file is part of 0 A.D.
3  *
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.
8  *
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.
13  *
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/>.
16  */
17 
18 #ifndef INCLUDED_MESHMANAGER
19 #define INCLUDED_MESHMANAGER
20 
21 #include "lib/file/vfs/vfs_path.h"
22 
23 #include <memory>
24 #include <unordered_map>
25 
26 class CModelDef;
27 using CModelDefPtr = std::shared_ptr<CModelDef>;
28 
29 class CColladaManager;
30 
32 {
34 public:
35  CMeshManager(CColladaManager& colladaManager);
36  ~CMeshManager();
37 
38  CModelDefPtr GetMesh(const VfsPath& pathname);
39 
40 private:
41  using mesh_map = std::unordered_map<VfsPath, std::weak_ptr<CModelDef> >;
44 };
45 
46 #endif
CColladaManager & m_ColladaManager
Definition: MeshManager.h:43
std::shared_ptr< CModelDef > CModelDefPtr
Definition: MeshManager.h:27
CMeshManager(CColladaManager &colladaManager)
Definition: MeshManager.cpp:32
Definition: ModelDef.h:140
std::unordered_map< VfsPath, std::weak_ptr< CModelDef > > mesh_map
Definition: MeshManager.h:41
~CMeshManager()
Definition: MeshManager.cpp:37
Definition: path.h:79
NONCOPYABLE(CMeshManager)
Definition: MeshManager.h:31
CModelDefPtr GetMesh(const VfsPath &pathname)
Definition: MeshManager.cpp:41
Definition: ColladaManager.h:25
mesh_map m_MeshMap
Definition: MeshManager.h:42