diff options
| author | 2015-01-01 12:39:27 -0500 | |
|---|---|---|
| committer | 2015-01-02 21:13:54 -0500 | |
| commit | aade417b143a756da10b69747793c707ef8316fd (patch) | |
| tree | d5fd49926dbfb4e7c289a8fa060df9c1e4401fde /src/core/hle | |
| parent | SaveDataCheck: Preliminary work in this archive. (diff) | |
| download | yuzu-aade417b143a756da10b69747793c707ef8316fd.tar.gz yuzu-aade417b143a756da10b69747793c707ef8316fd.tar.xz yuzu-aade417b143a756da10b69747793c707ef8316fd.zip | |
Archives: Reduced duplicate code in RomFS and SaveCheck.
Fixed a few warnings and cleaned up the code
Diffstat (limited to 'src/core/hle')
| -rw-r--r-- | src/core/hle/service/fs/archive.cpp | 7 | ||||
| -rw-r--r-- | src/core/hle/service/fs/archive.h | 2 |
2 files changed, 5 insertions, 4 deletions
diff --git a/src/core/hle/service/fs/archive.cpp b/src/core/hle/service/fs/archive.cpp index a8383d4e5..f761c6ab9 100644 --- a/src/core/hle/service/fs/archive.cpp +++ b/src/core/hle/service/fs/archive.cpp | |||
| @@ -14,6 +14,7 @@ | |||
| 14 | #include "core/file_sys/archive_extsavedata.h" | 14 | #include "core/file_sys/archive_extsavedata.h" |
| 15 | #include "core/file_sys/archive_romfs.h" | 15 | #include "core/file_sys/archive_romfs.h" |
| 16 | #include "core/file_sys/archive_savedata.h" | 16 | #include "core/file_sys/archive_savedata.h" |
| 17 | #include "core/file_sys/archive_savedatacheck.h" | ||
| 17 | #include "core/file_sys/archive_sdmc.h" | 18 | #include "core/file_sys/archive_sdmc.h" |
| 18 | #include "core/file_sys/directory_backend.h" | 19 | #include "core/file_sys/directory_backend.h" |
| 19 | #include "core/hle/service/fs/archive.h" | 20 | #include "core/hle/service/fs/archive.h" |
| @@ -353,7 +354,7 @@ ResultCode DeleteDirectoryFromArchive(ArchiveHandle archive_handle, const FileSy | |||
| 353 | ErrorSummary::Canceled, ErrorLevel::Status); | 354 | ErrorSummary::Canceled, ErrorLevel::Status); |
| 354 | } | 355 | } |
| 355 | 356 | ||
| 356 | ResultCode CreateFileInArchive(Handle archive_handle, const FileSys::Path& path, u32 file_size) { | 357 | ResultCode CreateFileInArchive(ArchiveHandle archive_handle, const FileSys::Path& path, u32 file_size) { |
| 357 | Archive* archive = GetArchive(archive_handle); | 358 | Archive* archive = GetArchive(archive_handle); |
| 358 | if (archive == nullptr) | 359 | if (archive == nullptr) |
| 359 | return InvalidHandle(ErrorModule::FS); | 360 | return InvalidHandle(ErrorModule::FS); |
| @@ -463,8 +464,8 @@ void ArchiveInit() { | |||
| 463 | sharedextsavedata_directory.c_str()); | 464 | sharedextsavedata_directory.c_str()); |
| 464 | 465 | ||
| 465 | // Create the SaveDataCheck archive, basically a small variation of the RomFS archive | 466 | // Create the SaveDataCheck archive, basically a small variation of the RomFS archive |
| 466 | std::string savedatacheck_directory = FileUtil::GetUserPath(D_SAVEDATA_IDX) + "../savedatacheck/"; | 467 | std::string savedatacheck_directory = FileUtil::GetUserPath(D_SAVEDATACHECK_IDX); |
| 467 | auto savedatacheck_archive = Common::make_unique<FileSys::Archive_RomFS>(savedatacheck_directory); | 468 | auto savedatacheck_archive = Common::make_unique<FileSys::Archive_SaveDataCheck>(savedatacheck_directory); |
| 468 | CreateArchive(std::move(savedatacheck_archive), ArchiveIdCode::SaveDataCheck); | 469 | CreateArchive(std::move(savedatacheck_archive), ArchiveIdCode::SaveDataCheck); |
| 469 | } | 470 | } |
| 470 | 471 | ||
diff --git a/src/core/hle/service/fs/archive.h b/src/core/hle/service/fs/archive.h index f2e4e4a53..9e9efa019 100644 --- a/src/core/hle/service/fs/archive.h +++ b/src/core/hle/service/fs/archive.h | |||
| @@ -91,7 +91,7 @@ ResultCode DeleteDirectoryFromArchive(ArchiveHandle archive_handle, const FileSy | |||
| 91 | * @param file_size The size of the new file, filled with zeroes | 91 | * @param file_size The size of the new file, filled with zeroes |
| 92 | * @return File creation result code | 92 | * @return File creation result code |
| 93 | */ | 93 | */ |
| 94 | ResultCode CreateFileInArchive(Handle archive_handle, const FileSys::Path& path, u32 file_size); | 94 | ResultCode CreateFileInArchive(ArchiveHandle archive_handle, const FileSys::Path& path, u32 file_size); |
| 95 | 95 | ||
| 96 | /** | 96 | /** |
| 97 | * Create a Directory from an Archive | 97 | * Create a Directory from an Archive |