diff options
author | Zach Hilman <DarkLordZach@users.noreply.github.com> | 2019-10-06 20:47:48 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-10-06 20:47:48 -0400 |
commit | 5326d3cb3a75a1f7df531e47cf0acadc3c5db32b (patch) | |
tree | 83697ca2dba90470ba59eff2f56e71769b03e3d9 /src/core/file_sys | |
parent | dcdd887df3549d41c3fdaf4ad8a20218179039d5 (diff) | |
parent | 839b38c404224592372647c4adb316bbe6f856e4 (diff) |
Merge pull request #2951 from lioncash/global
core: Remove Core::CurrentProcess()
Diffstat (limited to 'src/core/file_sys')
-rw-r--r-- | src/core/file_sys/romfs_factory.cpp | 4 | ||||
-rw-r--r-- | src/core/file_sys/romfs_factory.h | 2 | ||||
-rw-r--r-- | src/core/file_sys/savedata_factory.cpp | 5 |
3 files changed, 6 insertions, 5 deletions
diff --git a/src/core/file_sys/romfs_factory.cpp b/src/core/file_sys/romfs_factory.cpp index 84cd4684c..4bd2e6183 100644 --- a/src/core/file_sys/romfs_factory.cpp +++ b/src/core/file_sys/romfs_factory.cpp @@ -35,11 +35,11 @@ void RomFSFactory::SetPackedUpdate(VirtualFile update_raw) { this->update_raw = std::move(update_raw); } -ResultVal<VirtualFile> RomFSFactory::OpenCurrentProcess() const { +ResultVal<VirtualFile> RomFSFactory::OpenCurrentProcess(u64 current_process_title_id) const { if (!updatable) return MakeResult<VirtualFile>(file); - const PatchManager patch_manager(Core::CurrentProcess()->GetTitleID()); + const PatchManager patch_manager(current_process_title_id); return MakeResult<VirtualFile>( patch_manager.PatchRomFS(file, ivfc_offset, ContentRecordType::Program, update_raw)); } diff --git a/src/core/file_sys/romfs_factory.h b/src/core/file_sys/romfs_factory.h index da63a313a..c5d40285c 100644 --- a/src/core/file_sys/romfs_factory.h +++ b/src/core/file_sys/romfs_factory.h @@ -33,7 +33,7 @@ public: ~RomFSFactory(); void SetPackedUpdate(VirtualFile update_raw); - ResultVal<VirtualFile> OpenCurrentProcess() const; + ResultVal<VirtualFile> OpenCurrentProcess(u64 current_process_title_id) const; ResultVal<VirtualFile> Open(u64 title_id, StorageId storage, ContentRecordType type) const; private: diff --git a/src/core/file_sys/savedata_factory.cpp b/src/core/file_sys/savedata_factory.cpp index f77cc02ac..fc8755c78 100644 --- a/src/core/file_sys/savedata_factory.cpp +++ b/src/core/file_sys/savedata_factory.cpp @@ -127,8 +127,9 @@ std::string SaveDataFactory::GetFullPath(SaveDataSpaceId space, SaveDataType typ u128 user_id, u64 save_id) { // According to switchbrew, if a save is of type SaveData and the title id field is 0, it should // be interpreted as the title id of the current process. - if (type == SaveDataType::SaveData && title_id == 0) - title_id = Core::CurrentProcess()->GetTitleID(); + if (type == SaveDataType::SaveData && title_id == 0) { + title_id = Core::System::GetInstance().CurrentProcess()->GetTitleID(); + } std::string out = GetSaveDataSpaceIdPath(space); |