From 03e9e5f7b9ca87948493536c6b6c2463d901cda0 Mon Sep 17 00:00:00 2001 From: morkt Date: Thu, 10 Dec 2015 20:03:47 +0400 Subject: [PATCH] should do something with two signature declarations. --- ArcFormats/KiriKiri/ArcXP3.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ArcFormats/KiriKiri/ArcXP3.cs b/ArcFormats/KiriKiri/ArcXP3.cs index 4085d272..85f40a4a 100644 --- a/ArcFormats/KiriKiri/ArcXP3.cs +++ b/ArcFormats/KiriKiri/ArcXP3.cs @@ -94,6 +94,10 @@ namespace GameRes.Formats.KiriKiri static readonly string SignatureBytes = "XP3\x0d\x0a\x20\x0a\x1a\x8b\x67\x01"; + static readonly byte[] s_xp3_header = { + (byte)'X', (byte)'P', (byte)'3', 0x0d, 0x0a, 0x20, 0x0a, 0x1a, 0x8b, 0x67, 0x01 + }; + public override ResourceScheme Scheme { get { return new Xp3Scheme { KnownSchemes = KnownSchemes }; } @@ -314,9 +318,9 @@ NextEntry: for (byte* ptr = page_begin; ptr != page_end; ++ptr) { int i = 0; - while (ptr[i] == SignatureBytes[i]) + while (ptr[i] == s_xp3_header[i]) { - if (++i == SignatureBytes.Length) + if (++i == s_xp3_header.Length) return offset + (ptr - page_begin); } } @@ -402,10 +406,6 @@ NextEntry: return sum.Value; } - static readonly byte[] s_xp3_header = { - (byte)'X', (byte)'P', (byte)'3', 0x0d, 0x0a, 0x20, 0x0a, 0x1a, 0x8b, 0x67, 0x01 - }; - public override void Create (Stream output, IEnumerable list, ResourceOptions options, EntryCallback callback) {