Added progress bars for most major blocking operations

This commit is contained in:
Aruki
2017-05-21 18:01:09 -06:00
parent 31621874a6
commit 0a9b052413
23 changed files with 569 additions and 655 deletions

View File

@@ -95,9 +95,7 @@ void CGameProject::Serialize(IArchive& rArc)
}
}
void ProgressDummy(size_t, const nod::SystemString&, size_t) {}
bool CGameProject::BuildISO(const TString& rkIsoPath)
bool CGameProject::BuildISO(const TString& rkIsoPath, IProgressNotifier *pProgress)
{
ASSERT( FileUtil::IsValidPath(rkIsoPath, false) );
@@ -109,7 +107,13 @@ bool CGameProject::BuildISO(const TString& rkIsoPath)
else
{
nod::DiscBuilderGCN *pBuilder = new nod::DiscBuilderGCN(*rkIsoPath.ToUTF16(), *mGameID, *mProjectName, mFilesystemAddress, &ProgressDummy);
auto ProgressCallback = [&](size_t, const nod::SystemString& rkInfoString, size_t)
{
pProgress->Report(0, 0, TWideString(rkInfoString).ToUTF8());
};
nod::DiscBuilderGCN *pBuilder = new nod::DiscBuilderGCN(*rkIsoPath.ToUTF16(), *mGameID, *mProjectName, mFilesystemAddress, ProgressCallback);
pProgress->SetTask(0, "Building " + rkIsoPath.GetFileName());
TWideString ProjRoot = ProjectRoot().ToUTF16();
TWideString DiscRoot = DiscDir(false).ToUTF16();