mirror of
https://github.com/RetroDECK/Duckstation.git
synced 2024-11-22 13:55:38 +00:00
System: Use default compression level
I'd intended to make this an option.
This commit is contained in:
parent
534a82d091
commit
33f6cc246e
|
@ -2995,7 +2995,7 @@ u32 System::CompressAndWriteStateData(std::FILE* fp, std::span<const u8> src, Sa
|
||||||
|
|
||||||
uLongf compressed_size = static_cast<uLongf>(buffer_size);
|
uLongf compressed_size = static_cast<uLongf>(buffer_size);
|
||||||
const int err =
|
const int err =
|
||||||
compress2(buffer.data(), &compressed_size, src.data(), static_cast<uLong>(src.size()), Z_BEST_COMPRESSION);
|
compress2(buffer.data(), &compressed_size, src.data(), static_cast<uLong>(src.size()), Z_DEFAULT_COMPRESSION);
|
||||||
if (err != Z_OK) [[unlikely]]
|
if (err != Z_OK) [[unlikely]]
|
||||||
{
|
{
|
||||||
Error::SetStringFmt(error, "compress2() failed: {}", err);
|
Error::SetStringFmt(error, "compress2() failed: {}", err);
|
||||||
|
@ -3009,7 +3009,7 @@ u32 System::CompressAndWriteStateData(std::FILE* fp, std::span<const u8> src, Sa
|
||||||
const size_t buffer_size = ZSTD_compressBound(src.size());
|
const size_t buffer_size = ZSTD_compressBound(src.size());
|
||||||
buffer.resize(buffer_size);
|
buffer.resize(buffer_size);
|
||||||
|
|
||||||
const size_t compressed_size = ZSTD_compress(buffer.data(), buffer_size, src.data(), src.size(), 19);
|
const size_t compressed_size = ZSTD_compress(buffer.data(), buffer_size, src.data(), src.size(), 0);
|
||||||
if (ZSTD_isError(compressed_size)) [[unlikely]]
|
if (ZSTD_isError(compressed_size)) [[unlikely]]
|
||||||
{
|
{
|
||||||
const char* errstr = ZSTD_getErrorString(ZSTD_getErrorCode(compressed_size));
|
const char* errstr = ZSTD_getErrorString(ZSTD_getErrorCode(compressed_size));
|
||||||
|
|
Loading…
Reference in a new issue