diff options
| -rw-r--r-- | src/core/file_sys/bis_factory.cpp | 12 | ||||
| -rw-r--r-- | src/core/file_sys/bis_factory.h | 8 | ||||
| -rw-r--r-- | src/core/file_sys/patch_manager.cpp | 2 | ||||
| -rw-r--r-- | src/core/file_sys/registered_cache.cpp | 14 | ||||
| -rw-r--r-- | src/core/file_sys/registered_cache.h | 12 | ||||
| -rw-r--r-- | src/core/file_sys/sdmc_factory.cpp | 8 | ||||
| -rw-r--r-- | src/core/file_sys/sdmc_factory.h | 4 | ||||
| -rw-r--r-- | src/core/hle/service/filesystem/filesystem.cpp | 13 | ||||
| -rw-r--r-- | src/core/hle/service/filesystem/filesystem.h | 8 | ||||
| -rw-r--r-- | src/core/hle/service/ns/pl_u.cpp | 2 | ||||
| -rw-r--r-- | src/yuzu/game_list_worker.cpp | 19 | ||||
| -rw-r--r-- | src/yuzu/game_list_worker.h | 2 |
12 files changed, 53 insertions, 51 deletions
diff --git a/src/core/file_sys/bis_factory.cpp b/src/core/file_sys/bis_factory.cpp index 6102ef476..76a2b7e86 100644 --- a/src/core/file_sys/bis_factory.cpp +++ b/src/core/file_sys/bis_factory.cpp | |||
| @@ -10,19 +10,19 @@ namespace FileSys { | |||
| 10 | 10 | ||
| 11 | BISFactory::BISFactory(VirtualDir nand_root_, VirtualDir load_root_) | 11 | BISFactory::BISFactory(VirtualDir nand_root_, VirtualDir load_root_) |
| 12 | : nand_root(std::move(nand_root_)), load_root(std::move(load_root_)), | 12 | : nand_root(std::move(nand_root_)), load_root(std::move(load_root_)), |
| 13 | sysnand_cache(std::make_shared<RegisteredCache>( | 13 | sysnand_cache(std::make_unique<RegisteredCache>( |
| 14 | GetOrCreateDirectoryRelative(nand_root, "/system/Contents/registered"))), | 14 | GetOrCreateDirectoryRelative(nand_root, "/system/Contents/registered"))), |
| 15 | usrnand_cache(std::make_shared<RegisteredCache>( | 15 | usrnand_cache(std::make_unique<RegisteredCache>( |
| 16 | GetOrCreateDirectoryRelative(nand_root, "/user/Contents/registered"))) {} | 16 | GetOrCreateDirectoryRelative(nand_root, "/user/Contents/registered"))) {} |
| 17 | 17 | ||
| 18 | BISFactory::~BISFactory() = default; | 18 | BISFactory::~BISFactory() = default; |
| 19 | 19 | ||
| 20 | std::shared_ptr<RegisteredCache> BISFactory::GetSystemNANDContents() const { | 20 | RegisteredCache* BISFactory::GetSystemNANDContents() const { |
| 21 | return sysnand_cache; | 21 | return sysnand_cache.get(); |
| 22 | } | 22 | } |
| 23 | 23 | ||
| 24 | std::shared_ptr<RegisteredCache> BISFactory::GetUserNANDContents() const { | 24 | RegisteredCache* BISFactory::GetUserNANDContents() const { |
| 25 | return usrnand_cache; | 25 | return usrnand_cache.get(); |
| 26 | } | 26 | } |
| 27 | 27 | ||
| 28 | VirtualDir BISFactory::GetModificationLoadRoot(u64 title_id) const { | 28 | VirtualDir BISFactory::GetModificationLoadRoot(u64 title_id) const { |
diff --git a/src/core/file_sys/bis_factory.h b/src/core/file_sys/bis_factory.h index c352e0925..364d309bd 100644 --- a/src/core/file_sys/bis_factory.h +++ b/src/core/file_sys/bis_factory.h | |||
| @@ -20,8 +20,8 @@ public: | |||
| 20 | explicit BISFactory(VirtualDir nand_root, VirtualDir load_root); | 20 | explicit BISFactory(VirtualDir nand_root, VirtualDir load_root); |
| 21 | ~BISFactory(); | 21 | ~BISFactory(); |
| 22 | 22 | ||
| 23 | std::shared_ptr<RegisteredCache> GetSystemNANDContents() const; | 23 | RegisteredCache* GetSystemNANDContents() const; |
| 24 | std::shared_ptr<RegisteredCache> GetUserNANDContents() const; | 24 | RegisteredCache* GetUserNANDContents() const; |
| 25 | 25 | ||
| 26 | VirtualDir GetModificationLoadRoot(u64 title_id) const; | 26 | VirtualDir GetModificationLoadRoot(u64 title_id) const; |
| 27 | 27 | ||
| @@ -29,8 +29,8 @@ private: | |||
| 29 | VirtualDir nand_root; | 29 | VirtualDir nand_root; |
| 30 | VirtualDir load_root; | 30 | VirtualDir load_root; |
| 31 | 31 | ||
| 32 | std::shared_ptr<RegisteredCache> sysnand_cache; | 32 | std::unique_ptr<RegisteredCache> sysnand_cache; |
| 33 | std::shared_ptr<RegisteredCache> usrnand_cache; | 33 | std::unique_ptr<RegisteredCache> usrnand_cache; |
| 34 | }; | 34 | }; |
| 35 | 35 | ||
| 36 | } // namespace FileSys | 36 | } // namespace FileSys |
diff --git a/src/core/file_sys/patch_manager.cpp b/src/core/file_sys/patch_manager.cpp index 019caebe9..c15ac8e19 100644 --- a/src/core/file_sys/patch_manager.cpp +++ b/src/core/file_sys/patch_manager.cpp | |||
| @@ -346,7 +346,7 @@ std::map<std::string, std::string, std::less<>> PatchManager::GetPatchVersionNam | |||
| 346 | } | 346 | } |
| 347 | 347 | ||
| 348 | std::pair<std::unique_ptr<NACP>, VirtualFile> PatchManager::GetControlMetadata() const { | 348 | std::pair<std::unique_ptr<NACP>, VirtualFile> PatchManager::GetControlMetadata() const { |
| 349 | const auto& installed{Service::FileSystem::GetUnionContents()}; | 349 | const auto installed{Service::FileSystem::GetUnionContents()}; |
| 350 | 350 | ||
| 351 | const auto base_control_nca = installed->GetEntry(title_id, ContentRecordType::Control); | 351 | const auto base_control_nca = installed->GetEntry(title_id, ContentRecordType::Control); |
| 352 | if (base_control_nca == nullptr) | 352 | if (base_control_nca == nullptr) |
diff --git a/src/core/file_sys/registered_cache.cpp b/src/core/file_sys/registered_cache.cpp index e9b040689..1febb398e 100644 --- a/src/core/file_sys/registered_cache.cpp +++ b/src/core/file_sys/registered_cache.cpp | |||
| @@ -308,14 +308,14 @@ VirtualFile RegisteredCache::GetEntryRaw(RegisteredCacheEntry entry) const { | |||
| 308 | return GetEntryRaw(entry.title_id, entry.type); | 308 | return GetEntryRaw(entry.title_id, entry.type); |
| 309 | } | 309 | } |
| 310 | 310 | ||
| 311 | std::shared_ptr<NCA> RegisteredCache::GetEntry(u64 title_id, ContentRecordType type) const { | 311 | std::unique_ptr<NCA> RegisteredCache::GetEntry(u64 title_id, ContentRecordType type) const { |
| 312 | const auto raw = GetEntryRaw(title_id, type); | 312 | const auto raw = GetEntryRaw(title_id, type); |
| 313 | if (raw == nullptr) | 313 | if (raw == nullptr) |
| 314 | return nullptr; | 314 | return nullptr; |
| 315 | return std::make_shared<NCA>(raw); | 315 | return std::make_unique<NCA>(raw); |
| 316 | } | 316 | } |
| 317 | 317 | ||
| 318 | std::shared_ptr<NCA> RegisteredCache::GetEntry(RegisteredCacheEntry entry) const { | 318 | std::unique_ptr<NCA> RegisteredCache::GetEntry(RegisteredCacheEntry entry) const { |
| 319 | return GetEntry(entry.title_id, entry.type); | 319 | return GetEntry(entry.title_id, entry.type); |
| 320 | } | 320 | } |
| 321 | 321 | ||
| @@ -516,7 +516,7 @@ bool RegisteredCache::RawInstallYuzuMeta(const CNMT& cnmt) { | |||
| 516 | }) != yuzu_meta.end(); | 516 | }) != yuzu_meta.end(); |
| 517 | } | 517 | } |
| 518 | 518 | ||
| 519 | RegisteredCacheUnion::RegisteredCacheUnion(std::vector<std::shared_ptr<RegisteredCache>> caches) | 519 | RegisteredCacheUnion::RegisteredCacheUnion(std::vector<RegisteredCache*> caches) |
| 520 | : caches(std::move(caches)) {} | 520 | : caches(std::move(caches)) {} |
| 521 | 521 | ||
| 522 | void RegisteredCacheUnion::Refresh() { | 522 | void RegisteredCacheUnion::Refresh() { |
| @@ -572,14 +572,14 @@ VirtualFile RegisteredCacheUnion::GetEntryRaw(RegisteredCacheEntry entry) const | |||
| 572 | return GetEntryRaw(entry.title_id, entry.type); | 572 | return GetEntryRaw(entry.title_id, entry.type); |
| 573 | } | 573 | } |
| 574 | 574 | ||
| 575 | std::shared_ptr<NCA> RegisteredCacheUnion::GetEntry(u64 title_id, ContentRecordType type) const { | 575 | std::unique_ptr<NCA> RegisteredCacheUnion::GetEntry(u64 title_id, ContentRecordType type) const { |
| 576 | const auto raw = GetEntryRaw(title_id, type); | 576 | const auto raw = GetEntryRaw(title_id, type); |
| 577 | if (raw == nullptr) | 577 | if (raw == nullptr) |
| 578 | return nullptr; | 578 | return nullptr; |
| 579 | return std::make_shared<NCA>(raw); | 579 | return std::make_unique<NCA>(raw); |
| 580 | } | 580 | } |
| 581 | 581 | ||
| 582 | std::shared_ptr<NCA> RegisteredCacheUnion::GetEntry(RegisteredCacheEntry entry) const { | 582 | std::unique_ptr<NCA> RegisteredCacheUnion::GetEntry(RegisteredCacheEntry entry) const { |
| 583 | return GetEntry(entry.title_id, entry.type); | 583 | return GetEntry(entry.title_id, entry.type); |
| 584 | } | 584 | } |
| 585 | 585 | ||
diff --git a/src/core/file_sys/registered_cache.h b/src/core/file_sys/registered_cache.h index c0cd59fc5..5ddacba47 100644 --- a/src/core/file_sys/registered_cache.h +++ b/src/core/file_sys/registered_cache.h | |||
| @@ -88,8 +88,8 @@ public: | |||
| 88 | VirtualFile GetEntryRaw(u64 title_id, ContentRecordType type) const; | 88 | VirtualFile GetEntryRaw(u64 title_id, ContentRecordType type) const; |
| 89 | VirtualFile GetEntryRaw(RegisteredCacheEntry entry) const; | 89 | VirtualFile GetEntryRaw(RegisteredCacheEntry entry) const; |
| 90 | 90 | ||
| 91 | std::shared_ptr<NCA> GetEntry(u64 title_id, ContentRecordType type) const; | 91 | std::unique_ptr<NCA> GetEntry(u64 title_id, ContentRecordType type) const; |
| 92 | std::shared_ptr<NCA> GetEntry(RegisteredCacheEntry entry) const; | 92 | std::unique_ptr<NCA> GetEntry(RegisteredCacheEntry entry) const; |
| 93 | 93 | ||
| 94 | std::vector<RegisteredCacheEntry> ListEntries() const; | 94 | std::vector<RegisteredCacheEntry> ListEntries() const; |
| 95 | // If a parameter is not boost::none, it will be filtered for from all entries. | 95 | // If a parameter is not boost::none, it will be filtered for from all entries. |
| @@ -142,7 +142,7 @@ private: | |||
| 142 | // Combines multiple RegisteredCaches (i.e. SysNAND, UserNAND, SDMC) into one interface. | 142 | // Combines multiple RegisteredCaches (i.e. SysNAND, UserNAND, SDMC) into one interface. |
| 143 | class RegisteredCacheUnion { | 143 | class RegisteredCacheUnion { |
| 144 | public: | 144 | public: |
| 145 | explicit RegisteredCacheUnion(std::vector<std::shared_ptr<RegisteredCache>> caches); | 145 | explicit RegisteredCacheUnion(std::vector<RegisteredCache*> caches); |
| 146 | 146 | ||
| 147 | void Refresh(); | 147 | void Refresh(); |
| 148 | 148 | ||
| @@ -157,8 +157,8 @@ public: | |||
| 157 | VirtualFile GetEntryRaw(u64 title_id, ContentRecordType type) const; | 157 | VirtualFile GetEntryRaw(u64 title_id, ContentRecordType type) const; |
| 158 | VirtualFile GetEntryRaw(RegisteredCacheEntry entry) const; | 158 | VirtualFile GetEntryRaw(RegisteredCacheEntry entry) const; |
| 159 | 159 | ||
| 160 | std::shared_ptr<NCA> GetEntry(u64 title_id, ContentRecordType type) const; | 160 | std::unique_ptr<NCA> GetEntry(u64 title_id, ContentRecordType type) const; |
| 161 | std::shared_ptr<NCA> GetEntry(RegisteredCacheEntry entry) const; | 161 | std::unique_ptr<NCA> GetEntry(RegisteredCacheEntry entry) const; |
| 162 | 162 | ||
| 163 | std::vector<RegisteredCacheEntry> ListEntries() const; | 163 | std::vector<RegisteredCacheEntry> ListEntries() const; |
| 164 | // If a parameter is not boost::none, it will be filtered for from all entries. | 164 | // If a parameter is not boost::none, it will be filtered for from all entries. |
| @@ -168,7 +168,7 @@ public: | |||
| 168 | boost::optional<u64> title_id = boost::none) const; | 168 | boost::optional<u64> title_id = boost::none) const; |
| 169 | 169 | ||
| 170 | private: | 170 | private: |
| 171 | std::vector<std::shared_ptr<RegisteredCache>> caches; | 171 | std::vector<RegisteredCache*> caches; |
| 172 | }; | 172 | }; |
| 173 | 173 | ||
| 174 | } // namespace FileSys | 174 | } // namespace FileSys |
diff --git a/src/core/file_sys/sdmc_factory.cpp b/src/core/file_sys/sdmc_factory.cpp index d66a9c9a4..bd3a57058 100644 --- a/src/core/file_sys/sdmc_factory.cpp +++ b/src/core/file_sys/sdmc_factory.cpp | |||
| @@ -10,10 +10,10 @@ | |||
| 10 | namespace FileSys { | 10 | namespace FileSys { |
| 11 | 11 | ||
| 12 | SDMCFactory::SDMCFactory(VirtualDir dir_) | 12 | SDMCFactory::SDMCFactory(VirtualDir dir_) |
| 13 | : dir(std::move(dir_)), contents(std::make_shared<RegisteredCache>( | 13 | : dir(std::move(dir_)), contents(std::make_unique<RegisteredCache>( |
| 14 | GetOrCreateDirectoryRelative(dir, "/Nintendo/Contents/registered"), | 14 | GetOrCreateDirectoryRelative(dir, "/Nintendo/Contents/registered"), |
| 15 | [](const VirtualFile& file, const NcaID& id) { | 15 | [](const VirtualFile& file, const NcaID& id) { |
| 16 | return std::make_shared<NAX>(file, id)->GetDecrypted(); | 16 | return NAX{file, id}.GetDecrypted(); |
| 17 | })) {} | 17 | })) {} |
| 18 | 18 | ||
| 19 | SDMCFactory::~SDMCFactory() = default; | 19 | SDMCFactory::~SDMCFactory() = default; |
| @@ -22,8 +22,8 @@ ResultVal<VirtualDir> SDMCFactory::Open() { | |||
| 22 | return MakeResult<VirtualDir>(dir); | 22 | return MakeResult<VirtualDir>(dir); |
| 23 | } | 23 | } |
| 24 | 24 | ||
| 25 | std::shared_ptr<RegisteredCache> SDMCFactory::GetSDMCContents() const { | 25 | RegisteredCache* SDMCFactory::GetSDMCContents() const { |
| 26 | return contents; | 26 | return contents.get(); |
| 27 | } | 27 | } |
| 28 | 28 | ||
| 29 | } // namespace FileSys | 29 | } // namespace FileSys |
diff --git a/src/core/file_sys/sdmc_factory.h b/src/core/file_sys/sdmc_factory.h index ea12149de..42794ba5b 100644 --- a/src/core/file_sys/sdmc_factory.h +++ b/src/core/file_sys/sdmc_factory.h | |||
| @@ -19,12 +19,12 @@ public: | |||
| 19 | ~SDMCFactory(); | 19 | ~SDMCFactory(); |
| 20 | 20 | ||
| 21 | ResultVal<VirtualDir> Open(); | 21 | ResultVal<VirtualDir> Open(); |
| 22 | std::shared_ptr<RegisteredCache> GetSDMCContents() const; | 22 | RegisteredCache* GetSDMCContents() const; |
| 23 | 23 | ||
| 24 | private: | 24 | private: |
| 25 | VirtualDir dir; | 25 | VirtualDir dir; |
| 26 | 26 | ||
| 27 | std::shared_ptr<RegisteredCache> contents; | 27 | std::unique_ptr<RegisteredCache> contents; |
| 28 | }; | 28 | }; |
| 29 | 29 | ||
| 30 | } // namespace FileSys | 30 | } // namespace FileSys |
diff --git a/src/core/hle/service/filesystem/filesystem.cpp b/src/core/hle/service/filesystem/filesystem.cpp index e06712603..e32a7c48e 100644 --- a/src/core/hle/service/filesystem/filesystem.cpp +++ b/src/core/hle/service/filesystem/filesystem.cpp | |||
| @@ -319,13 +319,12 @@ ResultVal<FileSys::VirtualDir> OpenSDMC() { | |||
| 319 | return sdmc_factory->Open(); | 319 | return sdmc_factory->Open(); |
| 320 | } | 320 | } |
| 321 | 321 | ||
| 322 | std::shared_ptr<FileSys::RegisteredCacheUnion> GetUnionContents() { | 322 | std::unique_ptr<FileSys::RegisteredCacheUnion> GetUnionContents() { |
| 323 | return std::make_shared<FileSys::RegisteredCacheUnion>( | 323 | return std::make_unique<FileSys::RegisteredCacheUnion>(std::vector<FileSys::RegisteredCache*>{ |
| 324 | std::vector<std::shared_ptr<FileSys::RegisteredCache>>{ | 324 | GetSystemNANDContents(), GetUserNANDContents(), GetSDMCContents()}); |
| 325 | GetSystemNANDContents(), GetUserNANDContents(), GetSDMCContents()}); | ||
| 326 | } | 325 | } |
| 327 | 326 | ||
| 328 | std::shared_ptr<FileSys::RegisteredCache> GetSystemNANDContents() { | 327 | FileSys::RegisteredCache* GetSystemNANDContents() { |
| 329 | LOG_TRACE(Service_FS, "Opening System NAND Contents"); | 328 | LOG_TRACE(Service_FS, "Opening System NAND Contents"); |
| 330 | 329 | ||
| 331 | if (bis_factory == nullptr) | 330 | if (bis_factory == nullptr) |
| @@ -334,7 +333,7 @@ std::shared_ptr<FileSys::RegisteredCache> GetSystemNANDContents() { | |||
| 334 | return bis_factory->GetSystemNANDContents(); | 333 | return bis_factory->GetSystemNANDContents(); |
| 335 | } | 334 | } |
| 336 | 335 | ||
| 337 | std::shared_ptr<FileSys::RegisteredCache> GetUserNANDContents() { | 336 | FileSys::RegisteredCache* GetUserNANDContents() { |
| 338 | LOG_TRACE(Service_FS, "Opening User NAND Contents"); | 337 | LOG_TRACE(Service_FS, "Opening User NAND Contents"); |
| 339 | 338 | ||
| 340 | if (bis_factory == nullptr) | 339 | if (bis_factory == nullptr) |
| @@ -343,7 +342,7 @@ std::shared_ptr<FileSys::RegisteredCache> GetUserNANDContents() { | |||
| 343 | return bis_factory->GetUserNANDContents(); | 342 | return bis_factory->GetUserNANDContents(); |
| 344 | } | 343 | } |
| 345 | 344 | ||
| 346 | std::shared_ptr<FileSys::RegisteredCache> GetSDMCContents() { | 345 | FileSys::RegisteredCache* GetSDMCContents() { |
| 347 | LOG_TRACE(Service_FS, "Opening SDMC Contents"); | 346 | LOG_TRACE(Service_FS, "Opening SDMC Contents"); |
| 348 | 347 | ||
| 349 | if (sdmc_factory == nullptr) | 348 | if (sdmc_factory == nullptr) |
diff --git a/src/core/hle/service/filesystem/filesystem.h b/src/core/hle/service/filesystem/filesystem.h index 2df1faeb0..6ca5c5636 100644 --- a/src/core/hle/service/filesystem/filesystem.h +++ b/src/core/hle/service/filesystem/filesystem.h | |||
| @@ -47,11 +47,11 @@ ResultVal<FileSys::VirtualDir> OpenSaveData(FileSys::SaveDataSpaceId space, | |||
| 47 | FileSys::SaveDataDescriptor save_struct); | 47 | FileSys::SaveDataDescriptor save_struct); |
| 48 | ResultVal<FileSys::VirtualDir> OpenSDMC(); | 48 | ResultVal<FileSys::VirtualDir> OpenSDMC(); |
| 49 | 49 | ||
| 50 | std::shared_ptr<FileSys::RegisteredCacheUnion> GetUnionContents(); | 50 | std::unique_ptr<FileSys::RegisteredCacheUnion> GetUnionContents(); |
| 51 | 51 | ||
| 52 | std::shared_ptr<FileSys::RegisteredCache> GetSystemNANDContents(); | 52 | FileSys::RegisteredCache* GetSystemNANDContents(); |
| 53 | std::shared_ptr<FileSys::RegisteredCache> GetUserNANDContents(); | 53 | FileSys::RegisteredCache* GetUserNANDContents(); |
| 54 | std::shared_ptr<FileSys::RegisteredCache> GetSDMCContents(); | 54 | FileSys::RegisteredCache* GetSDMCContents(); |
| 55 | 55 | ||
| 56 | FileSys::VirtualDir GetModificationLoadRoot(u64 title_id); | 56 | FileSys::VirtualDir GetModificationLoadRoot(u64 title_id); |
| 57 | 57 | ||
diff --git a/src/core/hle/service/ns/pl_u.cpp b/src/core/hle/service/ns/pl_u.cpp index 4b2f758a8..44accecb7 100644 --- a/src/core/hle/service/ns/pl_u.cpp +++ b/src/core/hle/service/ns/pl_u.cpp | |||
| @@ -161,7 +161,7 @@ PL_U::PL_U() : ServiceFramework("pl:u"), impl{std::make_unique<Impl>()} { | |||
| 161 | }; | 161 | }; |
| 162 | RegisterHandlers(functions); | 162 | RegisterHandlers(functions); |
| 163 | // Attempt to load shared font data from disk | 163 | // Attempt to load shared font data from disk |
| 164 | const auto nand = FileSystem::GetSystemNANDContents(); | 164 | const auto* nand = FileSystem::GetSystemNANDContents(); |
| 165 | std::size_t offset = 0; | 165 | std::size_t offset = 0; |
| 166 | // Rebuild shared fonts from data ncas | 166 | // Rebuild shared fonts from data ncas |
| 167 | if (nand->HasEntry(static_cast<u64>(FontArchives::Standard), | 167 | if (nand->HasEntry(static_cast<u64>(FontArchives::Standard), |
diff --git a/src/yuzu/game_list_worker.cpp b/src/yuzu/game_list_worker.cpp index 8f99a1c78..3881aba5f 100644 --- a/src/yuzu/game_list_worker.cpp +++ b/src/yuzu/game_list_worker.cpp | |||
| @@ -96,7 +96,7 @@ void GameListWorker::AddInstalledTitlesToGameList() { | |||
| 96 | FileSys::ContentRecordType::Program); | 96 | FileSys::ContentRecordType::Program); |
| 97 | 97 | ||
| 98 | for (const auto& game : installed_games) { | 98 | for (const auto& game : installed_games) { |
| 99 | const auto& file = cache->GetEntryUnparsed(game); | 99 | const auto file = cache->GetEntryUnparsed(game); |
| 100 | std::unique_ptr<Loader::AppLoader> loader = Loader::GetLoader(file); | 100 | std::unique_ptr<Loader::AppLoader> loader = Loader::GetLoader(file); |
| 101 | if (!loader) | 101 | if (!loader) |
| 102 | continue; | 102 | continue; |
| @@ -107,7 +107,7 @@ void GameListWorker::AddInstalledTitlesToGameList() { | |||
| 107 | loader->ReadProgramId(program_id); | 107 | loader->ReadProgramId(program_id); |
| 108 | 108 | ||
| 109 | const FileSys::PatchManager patch{program_id}; | 109 | const FileSys::PatchManager patch{program_id}; |
| 110 | const auto& control = cache->GetEntry(game.title_id, FileSys::ContentRecordType::Control); | 110 | const auto control = cache->GetEntry(game.title_id, FileSys::ContentRecordType::Control); |
| 111 | if (control != nullptr) | 111 | if (control != nullptr) |
| 112 | GetMetadataFromControlNCA(patch, *control, icon, name); | 112 | GetMetadataFromControlNCA(patch, *control, icon, name); |
| 113 | 113 | ||
| @@ -135,9 +135,10 @@ void GameListWorker::AddInstalledTitlesToGameList() { | |||
| 135 | FileSys::ContentRecordType::Control); | 135 | FileSys::ContentRecordType::Control); |
| 136 | 136 | ||
| 137 | for (const auto& entry : control_data) { | 137 | for (const auto& entry : control_data) { |
| 138 | const auto nca = cache->GetEntry(entry); | 138 | auto nca = cache->GetEntry(entry); |
| 139 | if (nca != nullptr) | 139 | if (nca != nullptr) { |
| 140 | nca_control_map.insert_or_assign(entry.title_id, nca); | 140 | nca_control_map.insert_or_assign(entry.title_id, std::move(nca)); |
| 141 | } | ||
| 141 | } | 142 | } |
| 142 | } | 143 | } |
| 143 | 144 | ||
| @@ -153,9 +154,11 @@ void GameListWorker::FillControlMap(const std::string& dir_path) { | |||
| 153 | QFileInfo file_info(physical_name.c_str()); | 154 | QFileInfo file_info(physical_name.c_str()); |
| 154 | if (!is_dir && file_info.suffix().toStdString() == "nca") { | 155 | if (!is_dir && file_info.suffix().toStdString() == "nca") { |
| 155 | auto nca = | 156 | auto nca = |
| 156 | std::make_shared<FileSys::NCA>(vfs->OpenFile(physical_name, FileSys::Mode::Read)); | 157 | std::make_unique<FileSys::NCA>(vfs->OpenFile(physical_name, FileSys::Mode::Read)); |
| 157 | if (nca->GetType() == FileSys::NCAContentType::Control) | 158 | if (nca->GetType() == FileSys::NCAContentType::Control) { |
| 158 | nca_control_map.insert_or_assign(nca->GetTitleId(), nca); | 159 | const u64 title_id = nca->GetTitleId(); |
| 160 | nca_control_map.insert_or_assign(title_id, std::move(nca)); | ||
| 161 | } | ||
| 159 | } | 162 | } |
| 160 | return true; | 163 | return true; |
| 161 | }; | 164 | }; |
diff --git a/src/yuzu/game_list_worker.h b/src/yuzu/game_list_worker.h index 09d20c42f..0e42d0bde 100644 --- a/src/yuzu/game_list_worker.h +++ b/src/yuzu/game_list_worker.h | |||
| @@ -63,7 +63,7 @@ private: | |||
| 63 | void AddFstEntriesToGameList(const std::string& dir_path, unsigned int recursion = 0); | 63 | void AddFstEntriesToGameList(const std::string& dir_path, unsigned int recursion = 0); |
| 64 | 64 | ||
| 65 | std::shared_ptr<FileSys::VfsFilesystem> vfs; | 65 | std::shared_ptr<FileSys::VfsFilesystem> vfs; |
| 66 | std::map<u64, std::shared_ptr<FileSys::NCA>> nca_control_map; | 66 | std::map<u64, std::unique_ptr<FileSys::NCA>> nca_control_map; |
| 67 | QStringList watch_list; | 67 | QStringList watch_list; |
| 68 | QString dir_path; | 68 | QString dir_path; |
| 69 | bool deep_scan; | 69 | bool deep_scan; |