summaryrefslogtreecommitdiff
path: root/src/core/loader/xci.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/loader/xci.cpp')
-rw-r--r--src/core/loader/xci.cpp16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/core/loader/xci.cpp b/src/core/loader/xci.cpp
index 25e83af0f..536e721fc 100644
--- a/src/core/loader/xci.cpp
+++ b/src/core/loader/xci.cpp
@@ -20,18 +20,24 @@
20 20
21namespace Loader { 21namespace Loader {
22 22
23AppLoader_XCI::AppLoader_XCI(FileSys::VirtualFile file) 23AppLoader_XCI::AppLoader_XCI(FileSys::VirtualFile file,
24 const Service::FileSystem::FileSystemController& fsc,
25 const FileSys::ContentProvider& content_provider)
24 : AppLoader(file), xci(std::make_unique<FileSys::XCI>(file)), 26 : AppLoader(file), xci(std::make_unique<FileSys::XCI>(file)),
25 nca_loader(std::make_unique<AppLoader_NCA>(xci->GetProgramNCAFile())) { 27 nca_loader(std::make_unique<AppLoader_NCA>(xci->GetProgramNCAFile())) {
26 if (xci->GetStatus() != ResultStatus::Success) 28 if (xci->GetStatus() != ResultStatus::Success) {
27 return; 29 return;
30 }
28 31
29 const auto control_nca = xci->GetNCAByType(FileSys::NCAContentType::Control); 32 const auto control_nca = xci->GetNCAByType(FileSys::NCAContentType::Control);
30 if (control_nca == nullptr || control_nca->GetStatus() != ResultStatus::Success) 33 if (control_nca == nullptr || control_nca->GetStatus() != ResultStatus::Success) {
31 return; 34 return;
35 }
32 36
33 std::tie(nacp_file, icon_file) = 37 std::tie(nacp_file, icon_file) = [this, &content_provider, &control_nca, &fsc] {
34 FileSys::PatchManager(xci->GetProgramTitleID()).ParseControlNCA(*control_nca); 38 const FileSys::PatchManager pm{xci->GetProgramTitleID(), fsc, content_provider};
39 return pm.ParseControlNCA(*control_nca);
40 }();
35} 41}
36 42
37AppLoader_XCI::~AppLoader_XCI() = default; 43AppLoader_XCI::~AppLoader_XCI() = default;