From 32b33e54335e24297c18e6a2f4502ee5666ea67d Mon Sep 17 00:00:00 2001 From: morkt Date: Tue, 29 Jul 2014 07:05:28 +0400 Subject: [PATCH] cosmetic changes. --- ArcFormats/ArcXP3.cs | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/ArcFormats/ArcXP3.cs b/ArcFormats/ArcXP3.cs index f347ed4d..de67616d 100644 --- a/ArcFormats/ArcXP3.cs +++ b/ArcFormats/ArcXP3.cs @@ -229,10 +229,10 @@ namespace GameRes.Formats.KiriKiri if (!string.IsNullOrEmpty (entry.Name) && entry.Segments.Any()) { dir.Add (entry); - Trace.WriteLine (string.Format ("{0,-16} {3:X8} {1,11} {2,12}", entry.Name, - entry.IsEncrypted ? "[encrypted]" : "", - entry.Segments.First().IsCompressed ? "[compressed]" : "", - entry.Hash)); +// Trace.WriteLine (string.Format ("{0,-16} {3:X8} {1,11} {2,12}", entry.Name, +// entry.IsEncrypted ? "[encrypted]" : "", +// entry.Segments.First().IsCompressed ? "[compressed]" : "", +// entry.Hash)); } NextEntry: header.BaseStream.Position = dir_offset; @@ -269,11 +269,6 @@ NextEntry: }; } - public override ResourceOptions GetOptions (object widget) - { - return this.GetDefaultOptions(); - } - public override object GetCreationWidget () { return new GUI.CreateXP3Widget(); @@ -529,7 +524,8 @@ NextEntry: try { var checksum = new Adler32(); - if (!xp3entry.Cipher.HashAfterCrypt) + bool hash_after_crypt = xp3entry.Cipher.HashAfterCrypt; + if (!hash_after_crypt) xp3entry.Hash = checksum.Update (ptr, (int)unpacked_size); int offset = 0; int remaining = (int)unpacked_size; @@ -539,12 +535,12 @@ NextEntry: remaining -= amount; Marshal.Copy ((IntPtr)(ptr+offset), read_buffer, 0, amount); xp3entry.Cipher.Encrypt (xp3entry, offset, read_buffer, 0, amount); - if (xp3entry.Cipher.HashAfterCrypt) + if (hash_after_crypt) checksum.Update (read_buffer, 0, amount); output.Write (read_buffer, 0, amount); offset += amount; } - if (xp3entry.Cipher.HashAfterCrypt) + if (hash_after_crypt) xp3entry.Hash = checksum.Value; if (compress) {