diff options
| author | 2018-09-23 21:50:16 -0400 | |
|---|---|---|
| committer | 2018-09-23 21:50:20 -0400 | |
| commit | b3c2ec362bbbdd89da9c0aa84b425717f5e3d351 (patch) | |
| tree | d3f4e621532f1f280f94bac4e6d071707aabbd35 /src/core/file_sys/romfs.cpp | |
| parent | qt: Add UI elements for LayeredFS and related tools (diff) | |
| download | yuzu-b3c2ec362bbbdd89da9c0aa84b425717f5e3d351.tar.gz yuzu-b3c2ec362bbbdd89da9c0aa84b425717f5e3d351.tar.xz yuzu-b3c2ec362bbbdd89da9c0aa84b425717f5e3d351.zip | |
fsmitm: Cleanup and modernize fsmitm port
Diffstat (limited to 'src/core/file_sys/romfs.cpp')
| -rw-r--r-- | src/core/file_sys/romfs.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/core/file_sys/romfs.cpp b/src/core/file_sys/romfs.cpp index 71e4e0e2f..205284a4d 100644 --- a/src/core/file_sys/romfs.cpp +++ b/src/core/file_sys/romfs.cpp | |||
| @@ -4,7 +4,7 @@ | |||
| 4 | 4 | ||
| 5 | #include "common/common_types.h" | 5 | #include "common/common_types.h" |
| 6 | #include "common/swap.h" | 6 | #include "common/swap.h" |
| 7 | #include "core/file_sys/fsmitm_romfsbuild.hpp" | 7 | #include "core/file_sys/fsmitm_romfsbuild.h" |
| 8 | #include "core/file_sys/romfs.h" | 8 | #include "core/file_sys/romfs.h" |
| 9 | #include "core/file_sys/vfs.h" | 9 | #include "core/file_sys/vfs.h" |
| 10 | #include "core/file_sys/vfs_concat.h" | 10 | #include "core/file_sys/vfs_concat.h" |
| @@ -100,7 +100,7 @@ void ProcessDirectory(VirtualFile file, std::size_t dir_offset, std::size_t file | |||
| 100 | } | 100 | } |
| 101 | } | 101 | } |
| 102 | 102 | ||
| 103 | VirtualDir ExtractRomFS(VirtualFile file, bool traverse_into_data) { | 103 | VirtualDir ExtractRomFS(VirtualFile file, RomFSExtractionType type) { |
| 104 | RomFSHeader header{}; | 104 | RomFSHeader header{}; |
| 105 | if (file->ReadObject(&header) != sizeof(RomFSHeader)) | 105 | if (file->ReadObject(&header) != sizeof(RomFSHeader)) |
| 106 | return nullptr; | 106 | return nullptr; |
| @@ -119,8 +119,9 @@ VirtualDir ExtractRomFS(VirtualFile file, bool traverse_into_data) { | |||
| 119 | 119 | ||
| 120 | VirtualDir out = std::move(root); | 120 | VirtualDir out = std::move(root); |
| 121 | 121 | ||
| 122 | while (out->GetSubdirectories().size() == 1 && out->GetFiles().size() == 0) { | 122 | while (out->GetSubdirectories().size() == 1 && out->GetFiles().empty()) { |
| 123 | if (out->GetSubdirectories().front()->GetName() == "data" && !traverse_into_data) | 123 | if (out->GetSubdirectories().front()->GetName() == "data" && |
| 124 | type == RomFSExtractionType::Truncated) | ||
| 124 | break; | 125 | break; |
| 125 | out = out->GetSubdirectories().front(); | 126 | out = out->GetSubdirectories().front(); |
| 126 | } | 127 | } |