mirror of
https://github.com/crskycode/GARbro.git
synced 2026-07-08 01:30:18 +08:00
cosmetic changes.
This commit is contained in:
@@ -294,12 +294,13 @@ namespace GameRes.Formats
|
||||
return packed_size;
|
||||
}
|
||||
|
||||
static readonly GrpFormat s_grp_format = FormatCatalog.Instance.ImageFormats.OfType<GrpFormat>().FirstOrDefault();
|
||||
|
||||
uint WriteImageEntry (PackedEntry entry, Stream input, Stream output)
|
||||
{
|
||||
var grp = FormatCatalog.Instance.ImageFormats.OfType<GrpFormat>().FirstOrDefault();
|
||||
if (null == grp) // probably never happens
|
||||
if (null == s_grp_format) // probably never happens
|
||||
throw new FileFormatException ("GRP image encoder not available");
|
||||
bool is_grp = grp.Signature == FormatCatalog.ReadSignature (input);
|
||||
bool is_grp = s_grp_format.Signature == FormatCatalog.ReadSignature (input);
|
||||
input.Position = 0;
|
||||
using (var zstream = new ZLibStream (output, CompressionMode.Compress, CompressionLevel.Level9, true))
|
||||
{
|
||||
@@ -312,7 +313,7 @@ namespace GameRes.Formats
|
||||
var image = ImageFormat.Read (input);
|
||||
if (null == image)
|
||||
throw new InvalidFormatException (string.Format (arcStrings.MsgInvalidImageFormat, entry.Name));
|
||||
grp.Write (zstream, image);
|
||||
s_grp_format.Write (zstream, image);
|
||||
entry.UnpackedSize = (uint)zstream.TotalIn;
|
||||
}
|
||||
zstream.Flush();
|
||||
|
||||
Reference in New Issue
Block a user