mirror of
https://github.com/RPCSX/rpcsx.git
synced 2026-04-05 14:37:08 +00:00
PKG: Pack multiple PKGs into fast+efficient install (#13147)
This commit is contained in:
parent
7423abb136
commit
7c2d6f8a23
4 changed files with 364 additions and 266 deletions
|
|
@ -83,27 +83,28 @@ namespace rpcs3::utils
|
|||
{
|
||||
sys_log.success("Installing package: %s", path);
|
||||
|
||||
atomic_t<double> progress(0.);
|
||||
int int_progress = 0;
|
||||
|
||||
std::deque<package_reader> reader;
|
||||
reader.emplace_back(path);
|
||||
|
||||
// Run PKG unpacking asynchronously
|
||||
named_thread worker("PKG Installer", [&]
|
||||
{
|
||||
package_reader reader(path);
|
||||
return reader.extract_data(progress);
|
||||
std::deque<std::string> bootables;
|
||||
|
||||
return package_reader::extract_data(reader, bootables);
|
||||
});
|
||||
|
||||
// Wait for the completion
|
||||
while (std::this_thread::sleep_for(5ms), worker <= thread_state::aborting)
|
||||
{
|
||||
// TODO: update unified progress dialog
|
||||
double pval = progress;
|
||||
pval < 0 ? pval += 1. : pval;
|
||||
pval *= 100.;
|
||||
const int pval = reader[0].get_progress(100);
|
||||
|
||||
if (static_cast<int>(pval) > int_progress)
|
||||
if (pval > int_progress)
|
||||
{
|
||||
int_progress = static_cast<int>(pval);
|
||||
int_progress = pval;
|
||||
sys_log.success("... %u%%", int_progress);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue