diff options
author | Zach Hilman <zachhilman@gmail.com> | 2019-03-04 12:40:53 -0500 |
---|---|---|
committer | Zach Hilman <zachhilman@gmail.com> | 2019-03-26 22:05:37 -0400 |
commit | 41d2565f2946f10ed1e3faa8c057114900a29945 (patch) | |
tree | 5735246fd762a40b6e55e8442341c6e46e0b8ffe /src/yuzu/main.cpp | |
parent | 60f39060c68605c6b3628cea37ef4353f06b5d0e (diff) |
game_list: Register content with ContentProvider
Diffstat (limited to 'src/yuzu/main.cpp')
-rw-r--r-- | src/yuzu/main.cpp | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index 41ba3c4c60..65bac76e75 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp @@ -168,7 +168,8 @@ static void InitializeLogging() { GMainWindow::GMainWindow() : config(new Config()), emu_thread(nullptr), - vfs(std::make_shared<FileSys::RealVfsFilesystem>()) { + vfs(std::make_shared<FileSys::RealVfsFilesystem>()), + provider(std::make_unique<FileSys::ManualContentProvider>()) { InitializeLogging(); debug_context = Tegra::DebugContext::Construct(); @@ -200,11 +201,15 @@ GMainWindow::GMainWindow() .arg(Common::g_build_fullname, Common::g_scm_branch, Common::g_scm_desc)); show(); + Core::System::GetInstance().SetContentProvider( + std::make_unique<FileSys::ContentProviderUnion>()); + Core::System::GetInstance().RegisterContentProvider( + FileSys::ContentProviderUnionSlot::FrontendManual, provider.get()); + Service::FileSystem::CreateFactories(*vfs); + // Gen keys if necessary OnReinitializeKeys(ReinitializeKeyBehavior::NoWarning); - // Necessary to load titles from nand in gamelist. - Service::FileSystem::CreateFactories(*vfs); game_list->LoadCompatibilityList(); game_list->PopulateAsync(UISettings::values.gamedir, UISettings::values.gamedir_deepscan); @@ -416,7 +421,7 @@ void GMainWindow::InitializeWidgets() { render_window = new GRenderWindow(this, emu_thread.get()); render_window->hide(); - game_list = new GameList(vfs, this); + game_list = new GameList(vfs, provider.get(), this); ui.horizontalLayout->addWidget(game_list); loading_screen = new LoadingScreen(this); @@ -1141,7 +1146,7 @@ void GMainWindow::OnGameListDumpRomFS(u64 program_id, const std::string& game_pa return; } - const auto installed = Service::FileSystem::GetUnionContents(); + const auto& installed = Core::System::GetInstance().GetContentProvider(); const auto romfs_title_id = SelectRomFSDumpTarget(installed, program_id); if (!romfs_title_id) { @@ -1886,14 +1891,14 @@ void GMainWindow::OnReinitializeKeys(ReinitializeKeyBehavior behavior) { } } -std::optional<u64> GMainWindow::SelectRomFSDumpTarget( - const FileSys::RegisteredCacheUnion& installed, u64 program_id) { +std::optional<u64> GMainWindow::SelectRomFSDumpTarget(const FileSys::ContentProvider& installed, + u64 program_id) { const auto dlc_entries = installed.ListEntriesFilter(FileSys::TitleType::AOC, FileSys::ContentRecordType::Data); - std::vector<FileSys::RegisteredCacheEntry> dlc_match; + std::vector<FileSys::ContentProviderEntry> dlc_match; dlc_match.reserve(dlc_entries.size()); std::copy_if(dlc_entries.begin(), dlc_entries.end(), std::back_inserter(dlc_match), - [&program_id, &installed](const FileSys::RegisteredCacheEntry& entry) { + [&program_id, &installed](const FileSys::ContentProviderEntry& entry) { return (entry.title_id & DLC_BASE_TITLE_ID_MASK) == program_id && installed.GetEntry(entry)->GetStatus() == Loader::ResultStatus::Success; }); |