2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-09 13:07:42 +00:00

various implementation

This commit is contained in:
Jack Andersen
2015-08-22 20:42:29 -10:00
parent 6577d4ca13
commit f3b5b9f49a
45 changed files with 580 additions and 84 deletions

28
Runtime/CFactoryMgr.hpp Normal file
View File

@@ -0,0 +1,28 @@
#ifndef __RETRO_CFACTORYMGR_HPP__
#define __RETRO_CFACTORYMGR_HPP__
#include <unordered_map>
#include "RetroTypes.hpp"
namespace Retro
{
class SObjectTag;
class CVParamTransfer;
class CInputStream;
typedef void(*CFactoryFnReturn)(const SObjectTag&, CInputStream&, const CVParamTransfer&);
class CFactoryMgr
{
std::unordered_map<u32, CFactoryFnReturn> m_factories;
public:
MakeObjectFromMemory(const SObjectTag&, void*, int, bool, const CVParamTransfer&);
void AddFactory(FourCC key, CFactoryFnReturn func)
{
m_factories[key] = func;
}
};
}
#endif // __RETRO_CFACTORYMGR_HPP__