diff options
| author | bunnei <bunneidev@gmail.com> | 2020-11-21 22:12:34 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-11-21 22:12:34 -0800 |
| commit | c0ca8b9fa4d1a6c4bdbef2fdb1bf72d57679d9a4 (patch) | |
| tree | be80bf80153857db46a24de4b34a7d8bbac7a0ae /src/core/loader/xci.cpp | |
| parent | e718f63b22e77ef4d0fe080e14534aee5b5e0271 (diff) | |
| parent | b4b63c878fafaa787d3d40d33582471ed4b7c07d (diff) | |
Merge pull request #4944 from lioncash/system-rem
patch_manager: Remove usages of the global system instance
Diffstat (limited to 'src/core/loader/xci.cpp')
| -rw-r--r-- | src/core/loader/xci.cpp | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/core/loader/xci.cpp b/src/core/loader/xci.cpp index 25e83af0f6..536e721fc5 100644 --- a/src/core/loader/xci.cpp +++ b/src/core/loader/xci.cpp @@ -20,18 +20,24 @@ namespace Loader { -AppLoader_XCI::AppLoader_XCI(FileSys::VirtualFile file) +AppLoader_XCI::AppLoader_XCI(FileSys::VirtualFile file, + const Service::FileSystem::FileSystemController& fsc, + const FileSys::ContentProvider& content_provider) : AppLoader(file), xci(std::make_unique<FileSys::XCI>(file)), nca_loader(std::make_unique<AppLoader_NCA>(xci->GetProgramNCAFile())) { - if (xci->GetStatus() != ResultStatus::Success) + if (xci->GetStatus() != ResultStatus::Success) { return; + } const auto control_nca = xci->GetNCAByType(FileSys::NCAContentType::Control); - if (control_nca == nullptr || control_nca->GetStatus() != ResultStatus::Success) + if (control_nca == nullptr || control_nca->GetStatus() != ResultStatus::Success) { return; + } - std::tie(nacp_file, icon_file) = - FileSys::PatchManager(xci->GetProgramTitleID()).ParseControlNCA(*control_nca); + std::tie(nacp_file, icon_file) = [this, &content_provider, &control_nca, &fsc] { + const FileSys::PatchManager pm{xci->GetProgramTitleID(), fsc, content_provider}; + return pm.ParseControlNCA(*control_nca); + }(); } AppLoader_XCI::~AppLoader_XCI() = default; |
