diff options
| author | 2019-11-28 01:18:10 -0500 | |
|---|---|---|
| committer | 2019-11-28 01:18:10 -0500 | |
| commit | fe65045dcb645ef57d02d617d8153382471732f9 (patch) | |
| tree | 02d377df3ecfd8abb1229c79cdcde3ba26f02a1f /src/core/file_sys/romfs.cpp | |
| parent | patch_manager: Adds check for disabled cheats to prevent them from being enab... (diff) | |
| parent | filesys/romfs: Remove unused includes (diff) | |
| download | yuzu-fe65045dcb645ef57d02d617d8153382471732f9.tar.gz yuzu-fe65045dcb645ef57d02d617d8153382471732f9.tar.xz yuzu-fe65045dcb645ef57d02d617d8153382471732f9.zip | |
Merge pull request #3171 from lioncash/internal-link
filesys/romfs: Make ProcessFile and ProcessDirectory internally linked
Diffstat (limited to 'src/core/file_sys/romfs.cpp')
| -rw-r--r-- | src/core/file_sys/romfs.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/core/file_sys/romfs.cpp b/src/core/file_sys/romfs.cpp index ebbdf081e..c909d1ce4 100644 --- a/src/core/file_sys/romfs.cpp +++ b/src/core/file_sys/romfs.cpp | |||
| @@ -2,6 +2,8 @@ | |||
| 2 | // Licensed under GPLv2 or any later version | 2 | // Licensed under GPLv2 or any later version |
| 3 | // Refer to the license.txt file included. | 3 | // Refer to the license.txt file included. |
| 4 | 4 | ||
| 5 | #include <memory> | ||
| 6 | |||
| 5 | #include "common/common_types.h" | 7 | #include "common/common_types.h" |
| 6 | #include "common/swap.h" | 8 | #include "common/swap.h" |
| 7 | #include "core/file_sys/fsmitm_romfsbuild.h" | 9 | #include "core/file_sys/fsmitm_romfsbuild.h" |
| @@ -12,7 +14,7 @@ | |||
| 12 | #include "core/file_sys/vfs_vector.h" | 14 | #include "core/file_sys/vfs_vector.h" |
| 13 | 15 | ||
| 14 | namespace FileSys { | 16 | namespace FileSys { |
| 15 | 17 | namespace { | |
| 16 | constexpr u32 ROMFS_ENTRY_EMPTY = 0xFFFFFFFF; | 18 | constexpr u32 ROMFS_ENTRY_EMPTY = 0xFFFFFFFF; |
| 17 | 19 | ||
| 18 | struct TableLocation { | 20 | struct TableLocation { |
| @@ -51,7 +53,7 @@ struct FileEntry { | |||
| 51 | static_assert(sizeof(FileEntry) == 0x20, "FileEntry has incorrect size."); | 53 | static_assert(sizeof(FileEntry) == 0x20, "FileEntry has incorrect size."); |
| 52 | 54 | ||
| 53 | template <typename Entry> | 55 | template <typename Entry> |
| 54 | static std::pair<Entry, std::string> GetEntry(const VirtualFile& file, std::size_t offset) { | 56 | std::pair<Entry, std::string> GetEntry(const VirtualFile& file, std::size_t offset) { |
| 55 | Entry entry{}; | 57 | Entry entry{}; |
| 56 | if (file->ReadObject(&entry, offset) != sizeof(Entry)) | 58 | if (file->ReadObject(&entry, offset) != sizeof(Entry)) |
| 57 | return {}; | 59 | return {}; |
| @@ -99,6 +101,7 @@ void ProcessDirectory(VirtualFile file, std::size_t dir_offset, std::size_t file | |||
| 99 | this_dir_offset = entry.first.sibling; | 101 | this_dir_offset = entry.first.sibling; |
| 100 | } | 102 | } |
| 101 | } | 103 | } |
| 104 | } // Anonymous namespace | ||
| 102 | 105 | ||
| 103 | VirtualDir ExtractRomFS(VirtualFile file, RomFSExtractionType type) { | 106 | VirtualDir ExtractRomFS(VirtualFile file, RomFSExtractionType type) { |
| 104 | RomFSHeader header{}; | 107 | RomFSHeader header{}; |