mirror of
https://github.com/AxioDL/metaforce.git
synced 2025-12-09 13:47:43 +00:00
Added progress bars to extract system
This commit is contained in:
@@ -57,8 +57,10 @@ ResExtractor PAKBridge::LookupExtractor(const DNAMP1::PAK::Entry& entry)
|
||||
|
||||
bool PAKBridge::extractResources(const HECL::ProjectPath& workingOut,
|
||||
const HECL::ProjectPath& cookedOut,
|
||||
bool force)
|
||||
bool force,
|
||||
std::function<void(float)> progress)
|
||||
{
|
||||
size_t count = 0;
|
||||
for (const std::pair<UniqueID32, DNAMP1::PAK::Entry*>& item : m_pak.m_idMap)
|
||||
{
|
||||
PAKEntryReadStream s;
|
||||
@@ -81,6 +83,9 @@ bool PAKBridge::extractResources(const HECL::ProjectPath& workingOut,
|
||||
fwrite(s.data(), 1, s.length(), fout);
|
||||
fclose(fout);
|
||||
}
|
||||
|
||||
++count;
|
||||
progress(count / (float)m_pak.m_idMap.size());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user