2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-08 22:27:43 +00:00

CModelData imps

This commit is contained in:
Jack Andersen
2016-04-14 11:42:47 -10:00
parent f6c35bfc9b
commit 8608b52774
55 changed files with 546 additions and 146 deletions

View File

@@ -609,6 +609,33 @@ const urde::SObjectTag* ProjectResourceFactoryBase::GetResourceIdByName(const ch
return &search->second;
}
FourCC ProjectResourceFactoryBase::GetResourceTypeById(ResId id) const
{
std::unique_lock<std::mutex> lk(((ProjectResourceFactoryBase*)this)->m_backgroundIndexMutex);
SObjectTag searchTag = {FourCC(), id};
auto search = m_tagToPath.find(searchTag);
if (search == m_tagToPath.end())
{
if (m_backgroundRunning)
{
while (m_backgroundRunning)
{
lk.unlock();
lk.lock();
search = m_tagToPath.find(searchTag);
if (search != m_tagToPath.end())
break;
}
if (search == m_tagToPath.end())
return {};
}
else
return {};
}
return search->first.type;
}
void ProjectResourceFactoryBase::AsyncIdle()
{
/* Consume completed transactions, they will be processed this cycle at the latest */