mirror of
https://github.com/AxioDL/metaforce.git
synced 2025-12-08 18:24:55 +00:00
Tons of PART rendering preparation
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
#include "CFactoryMgr.hpp"
|
||||
#include "IObj.hpp"
|
||||
|
||||
namespace pshag
|
||||
{
|
||||
|
||||
CFactoryFnReturn CFactoryMgr::MakeObject(const SObjectTag& tag, pshag::CInputStream& in,
|
||||
const CVParamTransfer& paramXfer)
|
||||
{
|
||||
auto search = m_factories.find(tag.type);
|
||||
if (search == m_factories.end())
|
||||
return {};
|
||||
|
||||
return search->second(tag, in, paramXfer);
|
||||
}
|
||||
|
||||
CFactoryFnReturn CFactoryMgr::MakeObjectFromMemory(const SObjectTag& tag, void* buf, int size,
|
||||
bool compressed, const CVParamTransfer& paramXfer)
|
||||
{
|
||||
auto search = m_factories.find(tag.type);
|
||||
if (search == m_factories.end())
|
||||
return {};
|
||||
|
||||
if (compressed)
|
||||
{
|
||||
CZipInputStream r(std::make_unique<Athena::io::MemoryReader>(buf, size));
|
||||
return search->second(tag, r, paramXfer);
|
||||
}
|
||||
else
|
||||
{
|
||||
Athena::io::MemoryReader r(buf, size);
|
||||
return search->second(tag, r, paramXfer);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user