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

Lots of CResFactory fixes

This commit is contained in:
Jack Andersen
2017-10-27 00:10:32 -10:00
parent 8346f56595
commit 2f4cddd3d2
29 changed files with 210 additions and 139 deletions

View File

@@ -18,7 +18,8 @@ CWorld::CSoundGroupData::CSoundGroupData(int grpId, CAssetId agsc) : x0_groupId(
CDummyWorld::CDummyWorld(CAssetId mlvlId, bool loadMap) : x4_loadMap(loadMap), xc_mlvlId(mlvlId)
{
SObjectTag tag{FOURCC('MLVL'), mlvlId};
static_cast<ProjectResourceFactoryBase*>(g_ResFactory)->LoadResourceAsync(tag, x34_loadBuf);
x34_loadBuf.reset(new u8[g_ResFactory->ResourceSize(tag)]);
g_ResFactory->LoadResourceAsync(tag, x34_loadBuf.get());
}
CAssetId CDummyWorld::IGetWorldAssetId() const { return xc_mlvlId; }
@@ -186,7 +187,8 @@ CWorld::CWorld(IObjectStore& objStore, IFactory& resFactory, CAssetId mlvlId)
{
x70_24_currentAreaNeedsAllocation = true;
SObjectTag tag{FOURCC('MLVL'), mlvlId};
static_cast<ProjectResourceFactoryBase&>(resFactory).LoadResourceAsync(tag, x40_loadBuf);
x40_loadBuf.reset(new u8[resFactory.ResourceSize(tag)]);
resFactory.LoadResourceAsync(tag, x40_loadBuf.get());
}
CAssetId CWorld::IGetWorldAssetId() const { return x8_mlvlId; }