diff options
| author | Admiral H. Curtiss <pikachu025@gmail.com> | 2022-03-20 05:43:53 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-03-20 05:43:53 +0100 |
| commit | 7b0d5f2df35537e460ad119d091699f3c52a0ca4 (patch) | |
| tree | f4a5362f2c513135337cee8948bd8806d5002c97 /Source/Core/DiscIO/WIABlob.cpp | |
| parent | 8368b87fb8802b981f9fd3b145216a9161282b76 (diff) | |
| parent | deba9ce2564485c7fe078d4e73d0d2cba722b1ac (diff) | |
Merge pull request #10491 from Minty-Meeo/dolphin-tool-more-stuff
More dolphin-tool features and options
Diffstat (limited to 'Source/Core/DiscIO/WIABlob.cpp')
| -rw-r--r-- | Source/Core/DiscIO/WIABlob.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/Source/Core/DiscIO/WIABlob.cpp b/Source/Core/DiscIO/WIABlob.cpp index fa83e73043..8ef5a3f6b0 100644 --- a/Source/Core/DiscIO/WIABlob.cpp +++ b/Source/Core/DiscIO/WIABlob.cpp @@ -56,7 +56,7 @@ static void PushBack(std::vector<u8>* vector, const T& x) PushBack(vector, x_ptr, x_ptr + sizeof(T)); } -std::pair<int, int> GetAllowedCompressionLevels(WIARVZCompressionType compression_type) +std::pair<int, int> GetAllowedCompressionLevels(WIARVZCompressionType compression_type, bool gui) { switch (compression_type) { @@ -68,7 +68,10 @@ std::pair<int, int> GetAllowedCompressionLevels(WIARVZCompressionType compressio // The actual minimum level can be gotten by calling ZSTD_minCLevel(). However, returning that // would make the UI rather weird, because it is a negative number with very large magnitude. // Note: Level 0 is a special number which means "default level" (level 3 as of this writing). - return {1, ZSTD_maxCLevel()}; + if (gui) + return {1, ZSTD_maxCLevel()}; + else + return {ZSTD_minCLevel(), ZSTD_maxCLevel()}; default: return {0, -1}; } @@ -1985,7 +1988,8 @@ WIARVZFileReader<RVZ>::Convert(BlobReader* infile, const VolumeDisc* infile_volu header_2.disc_type = Common::swap32(disc_type); header_2.compression_type = Common::swap32(static_cast<u32>(compression_type)); - header_2.compression_level = Common::swap32(static_cast<u32>(compression_level)); + header_2.compression_level = + static_cast<s32>(Common::swap32(static_cast<u32>(compression_level))); header_2.chunk_size = Common::swap32(static_cast<u32>(chunk_size)); header_2.number_of_partition_entries = Common::swap32(static_cast<u32>(partition_entries.size())); |
