2015-08-17 22:05:00 +00:00
|
|
|
#include "CAssetFactory.hpp"
|
2016-04-15 03:02:21 +00:00
|
|
|
#include "CAnimCharacterSet.hpp"
|
|
|
|
#include "CCharacterFactory.hpp"
|
|
|
|
#include "GameGlobalObjects.hpp"
|
|
|
|
#include "CModelData.hpp"
|
2016-08-23 03:12:50 +00:00
|
|
|
#include "Character/CCharLayoutInfo.hpp"
|
2015-08-17 22:05:00 +00:00
|
|
|
|
2016-03-04 23:04:53 +00:00
|
|
|
namespace urde
|
2015-08-17 22:05:00 +00:00
|
|
|
{
|
|
|
|
|
2016-04-15 03:02:21 +00:00
|
|
|
CFactoryFnReturn CCharacterFactoryBuilder::CDummyFactory::Build(const SObjectTag& tag,
|
2016-09-02 19:32:57 +00:00
|
|
|
const CVParamTransfer&,
|
|
|
|
CObjectReference* selfRef)
|
2016-04-15 03:02:21 +00:00
|
|
|
{
|
|
|
|
TLockedToken<CAnimCharacterSet> ancs =
|
|
|
|
g_SimplePool->GetObj({SBIG('ANCS'), tag.id});
|
|
|
|
return TToken<CCharacterFactory>::GetIObjObjectFor(
|
|
|
|
std::make_unique<CCharacterFactory>(*g_SimplePool, *ancs.GetObj(), tag.id));
|
|
|
|
}
|
|
|
|
|
|
|
|
void CCharacterFactoryBuilder::CDummyFactory::BuildAsync(const SObjectTag& tag,
|
|
|
|
const CVParamTransfer& parms,
|
2016-09-02 19:32:57 +00:00
|
|
|
IObj** objOut,
|
|
|
|
CObjectReference* selfRef)
|
2016-04-15 03:02:21 +00:00
|
|
|
{
|
2016-09-02 19:32:57 +00:00
|
|
|
*objOut = Build(tag, parms, selfRef).release();
|
2016-04-15 03:02:21 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void CCharacterFactoryBuilder::CDummyFactory::CancelBuild(const SObjectTag&)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
bool CCharacterFactoryBuilder::CDummyFactory::CanBuild(const SObjectTag&)
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
const SObjectTag* CCharacterFactoryBuilder::CDummyFactory::GetResourceIdByName(const char*) const
|
|
|
|
{
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
2017-08-13 05:26:14 +00:00
|
|
|
FourCC CCharacterFactoryBuilder::CDummyFactory::GetResourceTypeById(CAssetId id) const
|
2016-04-15 03:02:21 +00:00
|
|
|
{
|
|
|
|
return {};
|
|
|
|
}
|
|
|
|
|
2016-09-25 01:58:20 +00:00
|
|
|
void CCharacterFactoryBuilder::CDummyFactory::EnumerateResources(
|
|
|
|
const std::function<bool(const SObjectTag&)>& lambda) const
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void CCharacterFactoryBuilder::CDummyFactory::EnumerateNamedResources(
|
|
|
|
const std::function<bool(const std::string&, const SObjectTag&)>& lambda) const
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2016-07-23 21:41:18 +00:00
|
|
|
u32 CCharacterFactoryBuilder::CDummyFactory::ResourceSize(const urde::SObjectTag& tag)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool CCharacterFactoryBuilder::CDummyFactory::LoadResourceAsync(const urde::SObjectTag& tag,
|
|
|
|
std::unique_ptr<u8[]>& target)
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool CCharacterFactoryBuilder::CDummyFactory::LoadResourcePartAsync(const urde::SObjectTag& tag,
|
|
|
|
u32 size, u32 off,
|
|
|
|
std::unique_ptr<u8[]>& target)
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
std::unique_ptr<u8[]> CCharacterFactoryBuilder::CDummyFactory::LoadResourceSync(const urde::SObjectTag& tag)
|
|
|
|
{
|
|
|
|
return {};
|
|
|
|
}
|
|
|
|
|
|
|
|
std::unique_ptr<u8[]> CCharacterFactoryBuilder::CDummyFactory::LoadResourcePartSync(const urde::SObjectTag& tag,
|
|
|
|
u32 size, u32 off)
|
|
|
|
{
|
|
|
|
return {};
|
|
|
|
}
|
|
|
|
|
2016-04-15 03:02:21 +00:00
|
|
|
CCharacterFactoryBuilder::CCharacterFactoryBuilder() : x4_dummyStore(x0_dummyFactory) {}
|
|
|
|
|
|
|
|
TToken<CCharacterFactory> CCharacterFactoryBuilder::GetFactory(const CAnimRes& res)
|
|
|
|
{
|
2016-04-27 19:59:38 +00:00
|
|
|
return x4_dummyStore.GetObj({SBIG('ANCS'), res.GetId()});
|
2016-04-15 03:02:21 +00:00
|
|
|
}
|
|
|
|
|
2015-08-17 22:05:00 +00:00
|
|
|
}
|