summaryrefslogtreecommitdiff
path: root/src/core/core.cpp
diff options
context:
space:
mode:
authorGravatar bunnei2019-04-09 19:16:37 -0400
committerGravatar GitHub2019-04-09 19:16:37 -0400
commit61f63bb994e358b925771bd51898822573e5780e (patch)
treea6a9f12b12b5946c04ccaf0856e0f3a94bbffe17 /src/core/core.cpp
parentMerge pull request #2366 from FernandoS27/xmad-fix (diff)
parentpatch_manager: Dump NSO name with build ID (diff)
downloadyuzu-61f63bb994e358b925771bd51898822573e5780e.tar.gz
yuzu-61f63bb994e358b925771bd51898822573e5780e.tar.xz
yuzu-61f63bb994e358b925771bd51898822573e5780e.zip
Merge pull request #1957 from DarkLordZach/title-provider
file_sys: Provide generic interface for accessing game data
Diffstat (limited to 'src/core/core.cpp')
-rw-r--r--src/core/core.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/core/core.cpp b/src/core/core.cpp
index 4fe77c25b..bc9e887b6 100644
--- a/src/core/core.cpp
+++ b/src/core/core.cpp
@@ -17,6 +17,7 @@
17#include "core/core_timing.h" 17#include "core/core_timing.h"
18#include "core/cpu_core_manager.h" 18#include "core/cpu_core_manager.h"
19#include "core/file_sys/mode.h" 19#include "core/file_sys/mode.h"
20#include "core/file_sys/registered_cache.h"
20#include "core/file_sys/vfs_concat.h" 21#include "core/file_sys/vfs_concat.h"
21#include "core/file_sys/vfs_real.h" 22#include "core/file_sys/vfs_real.h"
22#include "core/gdbstub/gdbstub.h" 23#include "core/gdbstub/gdbstub.h"
@@ -108,6 +109,8 @@ struct System::Impl {
108 // Create a default fs if one doesn't already exist. 109 // Create a default fs if one doesn't already exist.
109 if (virtual_filesystem == nullptr) 110 if (virtual_filesystem == nullptr)
110 virtual_filesystem = std::make_shared<FileSys::RealVfsFilesystem>(); 111 virtual_filesystem = std::make_shared<FileSys::RealVfsFilesystem>();
112 if (content_provider == nullptr)
113 content_provider = std::make_unique<FileSys::ContentProviderUnion>();
111 114
112 /// Create default implementations of applets if one is not provided. 115 /// Create default implementations of applets if one is not provided.
113 if (profile_selector == nullptr) 116 if (profile_selector == nullptr)
@@ -249,6 +252,8 @@ struct System::Impl {
249 Kernel::KernelCore kernel; 252 Kernel::KernelCore kernel;
250 /// RealVfsFilesystem instance 253 /// RealVfsFilesystem instance
251 FileSys::VirtualFilesystem virtual_filesystem; 254 FileSys::VirtualFilesystem virtual_filesystem;
255 /// ContentProviderUnion instance
256 std::unique_ptr<FileSys::ContentProviderUnion> content_provider;
252 /// AppLoader used to load the current executing application 257 /// AppLoader used to load the current executing application
253 std::unique_ptr<Loader::AppLoader> app_loader; 258 std::unique_ptr<Loader::AppLoader> app_loader;
254 std::unique_ptr<VideoCore::RendererBase> renderer; 259 std::unique_ptr<VideoCore::RendererBase> renderer;
@@ -488,6 +493,27 @@ const Frontend::SoftwareKeyboardApplet& System::GetSoftwareKeyboard() const {
488 return *impl->software_keyboard; 493 return *impl->software_keyboard;
489} 494}
490 495
496void System::SetContentProvider(std::unique_ptr<FileSys::ContentProviderUnion> provider) {
497 impl->content_provider = std::move(provider);
498}
499
500FileSys::ContentProvider& System::GetContentProvider() {
501 return *impl->content_provider;
502}
503
504const FileSys::ContentProvider& System::GetContentProvider() const {
505 return *impl->content_provider;
506}
507
508void System::RegisterContentProvider(FileSys::ContentProviderUnionSlot slot,
509 FileSys::ContentProvider* provider) {
510 impl->content_provider->SetSlot(slot, provider);
511}
512
513void System::ClearContentProvider(FileSys::ContentProviderUnionSlot slot) {
514 impl->content_provider->ClearSlot(slot);
515}
516
491void System::SetWebBrowser(std::unique_ptr<Frontend::WebBrowserApplet> applet) { 517void System::SetWebBrowser(std::unique_ptr<Frontend::WebBrowserApplet> applet) {
492 impl->web_browser = std::move(applet); 518 impl->web_browser = std::move(applet);
493} 519}