2
0
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:
Jack Andersen
2015-07-20 13:25:16 -10:00
parent 9d3bee522e
commit a4d6e32e48
12 changed files with 116 additions and 18 deletions

View File

@@ -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;
}