metaforce/Runtime/CPakFile.cpp

43 lines
937 B
C++
Raw Normal View History

2017-02-08 06:48:43 +00:00
#include "CPakFile.hpp"
namespace urde
{
2017-04-15 05:32:25 +00:00
CPakFile::CPakFile(const std::string& filename, bool buildDepList, bool worldPak)
2017-02-08 06:48:43 +00:00
: CDvdFile(filename.c_str())
{
2017-04-15 05:32:25 +00:00
x28_24_buildDepList = buildDepList;
2017-02-08 06:48:43 +00:00
x28_26_worldPak = worldPak;
}
const SObjectTag* CPakFile::GetResIdByName(const char* name) const
{
2017-04-15 05:32:25 +00:00
for (const std::pair<std::string, SObjectTag>& p : x54_nameList)
2017-02-08 06:48:43 +00:00
if (!CStringExtras::CompareCaseInsensitive(p.first.c_str(), name))
return &p.second;
return nullptr;
}
void CPakFile::AsyncIdle()
{
if (x2c_asyncLoadPhase == EAsyncPhase::Loaded)
return;
2017-04-15 05:32:25 +00:00
if (x30_dvdReq && x30_dvdReq->IsComplete())
2017-02-08 06:48:43 +00:00
return;
switch (x2c_asyncLoadPhase)
{
case EAsyncPhase::Warmup:
Warmup();
break;
case EAsyncPhase::InitialHeader:
InitialHeaderLoad();
break;
case EAsyncPhase::DataLoad:
DataLoad();
break;
default: break;
}
}
}