Added functionality to determine what AGSC a sound ID belongs to

This commit is contained in:
parax0
2016-08-31 19:42:12 -06:00
parent 1f357b4250
commit f6ae1376ac
20 changed files with 416 additions and 43 deletions

View File

@@ -20,6 +20,7 @@ bool CGameProject::Load(const TWideString& rkPath)
Serialize(Reader);
mpResourceStore->LoadResourceDatabase();
mAudioManager.LoadAssets();
return true;
}
@@ -95,3 +96,26 @@ void CGameProject::GetWorldList(std::list<CAssetID>& rOut) const
}
}
}
CAssetID CGameProject::FindNamedResource(const TString& rkName) const
{
for (u32 iPkg = 0; iPkg < mPackages.size(); iPkg++)
{
CPackage *pPkg = mPackages[iPkg];
for (u32 iCol = 0; iCol < pPkg->NumCollections(); iCol++)
{
CResourceCollection *pCol = pPkg->CollectionByIndex(iCol);
for (u32 iRes = 0; iRes < pCol->NumResources(); iRes++)
{
const SNamedResource& rkRes = pCol->ResourceByIndex(iRes);
if (rkRes.Name == rkName)
return rkRes.ID;
}
}
}
return CAssetID::InvalidID(mGame);
}