mirror of
https://github.com/AxioDL/metaforce.git
synced 2025-12-08 21:47:42 +00:00
Tons of PART rendering preparation
This commit is contained in:
@@ -3,21 +3,27 @@
|
||||
|
||||
#include <unordered_map>
|
||||
#include "RetroTypes.hpp"
|
||||
#include "IOStreams.hpp"
|
||||
|
||||
namespace pshag
|
||||
{
|
||||
class SObjectTag;
|
||||
class CVParamTransfer;
|
||||
class CInputStream;
|
||||
|
||||
typedef void(*CFactoryFnReturn)(const SObjectTag&, CInputStream&, const CVParamTransfer&);
|
||||
class IObj;
|
||||
|
||||
using CFactoryFnReturn = std::unique_ptr<IObj>;
|
||||
using FFactoryFunc = std::function<CFactoryFnReturn(const pshag::SObjectTag& tag,
|
||||
pshag::CInputStream& in,
|
||||
const pshag::CVParamTransfer& vparms)>;
|
||||
class CFactoryMgr
|
||||
{
|
||||
std::unordered_map<u32, CFactoryFnReturn> m_factories;
|
||||
std::unordered_map<FourCC, FFactoryFunc> m_factories;
|
||||
public:
|
||||
MakeObjectFromMemory(const SObjectTag&, void*, int, bool, const CVParamTransfer&);
|
||||
void AddFactory(FourCC key, CFactoryFnReturn func)
|
||||
CFactoryFnReturn MakeObject(const SObjectTag& tag, pshag::CInputStream& in,
|
||||
const CVParamTransfer& paramXfer);
|
||||
CFactoryFnReturn MakeObjectFromMemory(const SObjectTag& tag, void* buf, int size, bool compressed,
|
||||
const CVParamTransfer& paramXfer);
|
||||
void AddFactory(FourCC key, FFactoryFunc func)
|
||||
{
|
||||
m_factories[key] = func;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user