From 97b9e28fbc9bb67e6a591cf3dc836deea0a7e806 Mon Sep 17 00:00:00 2001 From: morkt Date: Sun, 17 Aug 2014 01:28:42 +0400 Subject: [PATCH] changed zlib compression level to maximum (Level9). --- ArcFormats/ArcAMI.cs | 2 +- ArcFormats/ArcXP3.cs | 7 ++++--- ArcFormats/ArcYPF.cs | 3 ++- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/ArcFormats/ArcAMI.cs b/ArcFormats/ArcAMI.cs index dc034cb9..6fe9b5f3 100644 --- a/ArcFormats/ArcAMI.cs +++ b/ArcFormats/ArcAMI.cs @@ -301,7 +301,7 @@ namespace GameRes.Formats throw new FileFormatException ("GRP image encoder not available"); bool is_grp = grp.Signature == FormatCatalog.ReadSignature (input); input.Position = 0; - using (var zstream = new ZLibStream (output, CompressionMode.Compress, true)) + using (var zstream = new ZLibStream (output, CompressionMode.Compress, CompressionLevel.Level9, true)) { if (is_grp) { diff --git a/ArcFormats/ArcXP3.cs b/ArcFormats/ArcXP3.cs index c1d32a90..b35e39d0 100644 --- a/ArcFormats/ArcXP3.cs +++ b/ArcFormats/ArcXP3.cs @@ -434,7 +434,8 @@ NextEntry: writer.Write (unpacked_dir_size); long dir_start = writer.BaseStream.Position; - using (var zstream = new ZLibStream (writer.BaseStream, CompressionMode.Compress, true)) + using (var zstream = new ZLibStream (writer.BaseStream, CompressionMode.Compress, + CompressionLevel.Level9, true)) header.BaseStream.CopyTo (zstream); long packed_dir_size = writer.BaseStream.Position - dir_start; @@ -468,7 +469,7 @@ NextEntry: }; if (compress) { - using (var zstream = new ZLibStream (output, CompressionMode.Compress, true)) + using (var zstream = new ZLibStream (output, CompressionMode.Compress, CompressionLevel.Level9, true)) { xp3entry.Hash = CheckedCopy (file, zstream); zstream.Flush(); @@ -505,7 +506,7 @@ NextEntry: bool need_output_dispose = false; if (compress) { - output = new ZLibStream (output, CompressionMode.Compress, true); + output = new ZLibStream (output, CompressionMode.Compress, CompressionLevel.Level9, true); need_output_dispose = true; } unsafe diff --git a/ArcFormats/ArcYPF.cs b/ArcFormats/ArcYPF.cs index 9b366ae6..376d97f7 100644 --- a/ArcFormats/ArcYPF.cs +++ b/ArcFormats/ArcYPF.cs @@ -184,7 +184,8 @@ namespace GameRes.Formats.YuRis { if (entry.IsPacked) { - using (var zstream = new ZLibStream (checked_stream, CompressionMode.Compress, true)) + using (var zstream = new ZLibStream (checked_stream, CompressionMode.Compress, + CompressionLevel.Level9, true)) { input.CopyTo (zstream); zstream.Flush();