2019-11-25 06:30:25 -08:00
|
|
|
/* Copyright (C) 2019 Wildfire Games.
|
2009-04-18 10:00:33 -07:00
|
|
|
* This file is part of 0 A.D.
|
|
|
|
|
*
|
|
|
|
|
* 0 A.D. 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
|
|
|
|
|
* (at your option) any later version.
|
|
|
|
|
*
|
|
|
|
|
* 0 A.D. 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 0 A.D. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
*/
|
|
|
|
|
|
2007-05-07 09:33:24 -07:00
|
|
|
#ifndef INCLUDED_MESHMANAGER
|
|
|
|
|
#define INCLUDED_MESHMANAGER
|
2004-11-08 14:02:01 -08:00
|
|
|
|
2009-11-03 13:46:35 -08:00
|
|
|
#include "lib/file/vfs/vfs_path.h"
|
2007-03-01 10:52:53 -08:00
|
|
|
|
2015-01-24 19:10:58 -08:00
|
|
|
#include <memory>
|
2019-11-25 06:30:25 -08:00
|
|
|
#include <unordered_map>
|
2004-11-08 14:02:01 -08:00
|
|
|
|
2004-12-12 11:43:55 -08:00
|
|
|
class CModelDef;
|
2019-11-25 06:30:25 -08:00
|
|
|
using CModelDefPtr = std::shared_ptr<CModelDef>;
|
2006-12-19 19:22:24 -08:00
|
|
|
|
2007-03-01 10:52:53 -08:00
|
|
|
class CColladaManager;
|
2004-11-08 14:02:01 -08:00
|
|
|
|
2009-01-03 10:40:28 -08:00
|
|
|
class CMeshManager
|
2004-11-08 14:02:01 -08:00
|
|
|
{
|
2009-01-03 10:40:28 -08:00
|
|
|
NONCOPYABLE(CMeshManager);
|
2004-11-08 14:02:01 -08:00
|
|
|
public:
|
2007-03-01 10:52:53 -08:00
|
|
|
CMeshManager(CColladaManager& colladaManager);
|
2006-12-19 19:22:24 -08:00
|
|
|
~CMeshManager();
|
|
|
|
|
|
2009-11-03 13:46:35 -08:00
|
|
|
CModelDefPtr GetMesh(const VfsPath& pathname);
|
2004-11-08 14:02:01 -08:00
|
|
|
|
|
|
|
|
private:
|
2019-11-25 06:30:25 -08:00
|
|
|
using mesh_map = std::unordered_map<VfsPath, std::weak_ptr<CModelDef> >;
|
2007-03-01 10:52:53 -08:00
|
|
|
mesh_map m_MeshMap;
|
|
|
|
|
CColladaManager& m_ColladaManager;
|
2004-11-08 14:02:01 -08:00
|
|
|
};
|
|
|
|
|
|
2004-11-23 15:56:10 -08:00
|
|
|
#endif
|