Add parallel race/motion loading and thread-safe Pack/Pool managers

This commit is contained in:
savis
2026-01-04 17:25:51 +01:00
parent 2550008f6d
commit d5624a8cdd
7 changed files with 102 additions and 24 deletions

View File

@@ -23,8 +23,19 @@ bool CPackManager::AddPack(const std::string& path)
{
std::shared_ptr<CPack> pack = std::make_shared<CPack>();
if (!pack->Load(path))
{
return false;
}
std::lock_guard<std::mutex> lock(m_mutex);
return pack->Open(path, m_entries);
const auto& index = pack->GetIndex();
for (const auto& entry : index)
{
m_entries[entry.file_name] = std::make_pair(pack, entry);
}
return true;
}
bool CPackManager::GetFile(std::string_view path, TPackFile& result)