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

CResFactory bug fixes

This commit is contained in:
Jack Andersen
2017-10-27 21:08:48 -10:00
parent 2f4cddd3d2
commit bb10aa9844
15 changed files with 87 additions and 44 deletions

View File

@@ -19,7 +19,7 @@ CDummyWorld::CDummyWorld(CAssetId mlvlId, bool loadMap) : x4_loadMap(loadMap), x
{
SObjectTag tag{FOURCC('MLVL'), mlvlId};
x34_loadBuf.reset(new u8[g_ResFactory->ResourceSize(tag)]);
g_ResFactory->LoadResourceAsync(tag, x34_loadBuf.get());
x30_loadToken = g_ResFactory->LoadResourceAsync(tag, x34_loadBuf.get());
}
CAssetId CDummyWorld::IGetWorldAssetId() const { return xc_mlvlId; }
@@ -103,8 +103,9 @@ bool CDummyWorld::ICheckWorldComplete()
{
case Phase::Loading:
{
if (!x34_loadBuf)
if (x30_loadToken && !x30_loadToken->IsComplete())
return false;
x30_loadToken.reset();
athena::io::MemoryReader r(x34_loadBuf.get(), UINT32_MAX, false);
r.readUint32Big();
int version = r.readUint32Big();