From 09bcf4114caa67849d8116b0324076fe569f6d25 Mon Sep 17 00:00:00 2001 From: Aruki Date: Mon, 22 May 2017 00:26:24 -0600 Subject: [PATCH] Updated disc extraction/building progress bar code to use the new progress reporting functionality in nod --- src/Core/GameProject/CGameExporter.cpp | 6 +++--- src/Core/GameProject/CGameProject.cpp | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Core/GameProject/CGameExporter.cpp b/src/Core/GameProject/CGameExporter.cpp index 92703eee..37bd5cd6 100644 --- a/src/Core/GameProject/CGameExporter.cpp +++ b/src/Core/GameProject/CGameExporter.cpp @@ -118,9 +118,9 @@ bool CGameExporter::ExtractDiscData() nod::Partition *pDataPartition = mpDisc->getDataPartition(); nod::ExtractionContext Context; Context.force = false; - Context.verbose = false; - Context.progressCB = [&](const std::string& rkDesc) { - mpProgress->Report(0, 1, rkDesc); + Context.verbose = true; + Context.progressCB = [&](const std::string& rkDesc, float ProgressPercent) { + mpProgress->Report((int) (ProgressPercent * 10000), 10000, rkDesc); }; bool Success = ExtractDiscNodeRecursive(&pDataPartition->getFSTRoot(), AbsDiscDir, Context); diff --git a/src/Core/GameProject/CGameProject.cpp b/src/Core/GameProject/CGameProject.cpp index 4069bc7b..fc057dfd 100644 --- a/src/Core/GameProject/CGameProject.cpp +++ b/src/Core/GameProject/CGameProject.cpp @@ -107,9 +107,9 @@ bool CGameProject::BuildISO(const TString& rkIsoPath, IProgressNotifier *pProgre else { - auto ProgressCallback = [&](size_t, const nod::SystemString& rkInfoString, size_t) + auto ProgressCallback = [&](float ProgressPercent, const nod::SystemString& rkInfoString, size_t) { - pProgress->Report(0, 0, TWideString(rkInfoString).ToUTF8()); + pProgress->Report((int) (ProgressPercent * 10000), 10000, TWideString(rkInfoString).ToUTF8()); }; nod::DiscBuilderGCN *pBuilder = new nod::DiscBuilderGCN(*rkIsoPath.ToUTF16(), *mGameID, *mProjectName, mFilesystemAddress, ProgressCallback); @@ -119,7 +119,7 @@ bool CGameProject::BuildISO(const TString& rkIsoPath, IProgressNotifier *pProgre TWideString DiscRoot = DiscDir(false).ToUTF16(); TWideString DolPath = ProjRoot + mDolPath.ToUTF16(); TWideString ApploaderPath = ProjRoot + mApploaderPath.ToUTF16(); - return pBuilder->buildFromDirectory(*DiscRoot, *DolPath, *ApploaderPath); + return pBuilder->buildFromDirectory(*DiscRoot, *DolPath, *ApploaderPath) == nod::EBuildResult::Success; } }