mirror of https://github.com/AxioDL/metaforce.git
Fix area token loading
This commit is contained in:
parent
a37fb861e1
commit
0d3a67e78f
|
@ -792,6 +792,11 @@ void SpecBase::doPackage(const hecl::ProjectPath& path, const hecl::Database::Da
|
|||
pakOut.close();
|
||||
}
|
||||
|
||||
void SpecBase::interruptCook()
|
||||
{
|
||||
cancelBackgroundIndex();
|
||||
}
|
||||
|
||||
hecl::ProjectPath SpecBase::getCookedPath(const hecl::ProjectPath& working, bool pcTarget) const
|
||||
{
|
||||
const hecl::Database::DataSpecEntry* spec = &getOriginalSpec();
|
||||
|
@ -1269,6 +1274,10 @@ void SpecBase::backgroundIndexRecursiveProc(const hecl::ProjectPath& dir,
|
|||
/* Enumerate all items */
|
||||
for (const hecl::DirectoryEnumerator::Entry& ent : dEnum)
|
||||
{
|
||||
/* bail if cancelled by client */
|
||||
if (!m_backgroundRunning)
|
||||
break;
|
||||
|
||||
hecl::ProjectPath path(dir, ent.m_name);
|
||||
if (ent.m_isDir)
|
||||
backgroundIndexRecursiveProc(path, cacheWriter, nameWriter, level + 1);
|
||||
|
@ -1287,10 +1296,6 @@ void SpecBase::backgroundIndexRecursiveProc(const hecl::ProjectPath& dir,
|
|||
/* Index the regular file */
|
||||
addFileToIndex(path, cacheWriter);
|
||||
}
|
||||
|
||||
/* bail if cancelled by client */
|
||||
if (!m_backgroundRunning)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1323,6 +1328,9 @@ void SpecBase::backgroundIndexProc()
|
|||
size_t loadIdx = 0;
|
||||
for (const auto& child : cacheReader.getRootNode()->m_mapChildren)
|
||||
{
|
||||
if (!m_backgroundRunning)
|
||||
return;
|
||||
|
||||
const athena::io::YAMLNode& node = *child.second;
|
||||
unsigned long id = strtoul(child.first.c_str(), nullptr, 16);
|
||||
hecl::FourCC type(node.m_seqChildren.at(0)->m_scalarString.c_str());
|
||||
|
|
|
@ -53,6 +53,8 @@ struct SpecBase : hecl::Database::IDataSpec
|
|||
bool fast, hecl::blender::Token& btok, const hecl::MultiProgressPrinter& progress,
|
||||
hecl::ClientProcess* cp);
|
||||
|
||||
void interruptCook();
|
||||
|
||||
/* Extract handlers */
|
||||
virtual bool checkStandaloneID(const char* id) const=0;
|
||||
virtual bool checkFromStandaloneDisc(nod::DiscBase& disc,
|
||||
|
|
|
@ -1313,7 +1313,7 @@ struct SpecMP1 : SpecBase
|
|||
auto layerIt = area.depLayers.cbegin();
|
||||
while (it != area.deps.cend())
|
||||
{
|
||||
if (layerIt != area.depLayers.cend() && it - area.deps.cbegin() == *layerIt)
|
||||
while (layerIt != area.depLayers.cend() && it - area.deps.cbegin() == *layerIt)
|
||||
{
|
||||
strippedDepLayers.push_back(atUint32(strippedDeps.size()));
|
||||
++layerIt;
|
||||
|
|
|
@ -363,6 +363,7 @@ void CGameGlobalObjects::AddPaksAndFactories()
|
|||
fmgr->AddFactory(FOURCC('MAPA'), FFactoryFunc(FMapAreaFactory));
|
||||
fmgr->AddFactory(FOURCC('MAPU'), FFactoryFunc(FMapUniverseFactory));
|
||||
fmgr->AddFactory(FOURCC('AFSM'), FFactoryFunc(FAiFiniteStateMachineFactory));
|
||||
fmgr->AddFactory(FOURCC('PATH'), FMemFactoryFunc(FPathFindAreaFactory));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1313,22 +1313,19 @@ void CGameArea::VerifyTokenList(CStateManager& stateMgr)
|
|||
if (xac_deps2.empty())
|
||||
return;
|
||||
|
||||
u32 lastOff = 0;
|
||||
int lidx = 0;
|
||||
for (u32 off : xbc_layerDepOffsets)
|
||||
auto end = xac_deps2.end();
|
||||
for (int lidx = int(xbc_layerDepOffsets.size() - 1) ; lidx >= 0 ; --lidx)
|
||||
{
|
||||
auto begin = xac_deps2.begin() + xbc_layerDepOffsets[lidx];
|
||||
if (stateMgr.LayerState()->IsLayerActive(x4_selfIdx, lidx))
|
||||
{
|
||||
auto it = xac_deps2.begin() + lastOff;
|
||||
auto end = xac_deps2.begin() + off;
|
||||
for (; it != end ; ++it)
|
||||
for (auto it = begin ; it != end ; ++it)
|
||||
{
|
||||
xdc_tokens.push_back(g_SimplePool->GetObj(*it));
|
||||
xdc_tokens.back().Lock();
|
||||
}
|
||||
}
|
||||
lastOff = off;
|
||||
++lidx;
|
||||
end = begin;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -5,6 +5,8 @@
|
|||
namespace urde
|
||||
{
|
||||
|
||||
static logvisor::Module Log("CPathFindArea");
|
||||
|
||||
CPFAreaOctree::CPFAreaOctree(CMemoryInStream& in)
|
||||
{
|
||||
x0_isLeaf = in.readUint32Big();
|
||||
|
@ -137,6 +139,10 @@ CPFArea::CPFArea(std::unique_ptr<u8[]>&& buf, u32 len)
|
|||
{
|
||||
CMemoryInStream r(buf.get(), len);
|
||||
|
||||
u32 version = r.readUint32Big();
|
||||
if (version != 4)
|
||||
Log.report(logvisor::Fatal, "Unexpected PATH version %d, should be 4", version);
|
||||
|
||||
u32 numNodes = r.readUint32Big();
|
||||
x140_nodes.reserve(numNodes);
|
||||
for (u32 i=0 ; i<numNodes ; ++i)
|
||||
|
|
2
hecl
2
hecl
|
@ -1 +1 @@
|
|||
Subproject commit 4ae0a61756a33f650ac4094ecc314ab24cf2f22f
|
||||
Subproject commit fab000e10c85c813628b14ed539e5220e902a6ae
|
Loading…
Reference in New Issue