(PngFormat): added HeaderBytes static field.

This commit is contained in:
morkt
2018-01-17 02:11:30 +04:00
parent 02853c4438
commit 880f2189f5
5 changed files with 8 additions and 11 deletions

View File

@@ -75,7 +75,6 @@ namespace GameRes.Formats.Morning
return new ArcFile (file, this, dir);
}
static readonly byte[] PngHeader = { 0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A };
static readonly byte[] PngIHdr = { 0x00, 0x00, 0x00, 0x0D, 0x49, 0x48, 0x44, 0x52 };
public override Stream OpenEntry (ArcFile arc, Entry entry)
@@ -83,7 +82,7 @@ namespace GameRes.Formats.Morning
if (entry.Size <= 8 || !arc.File.View.BytesEqual (entry.Offset, PngIHdr))
return base.OpenEntry (arc, entry);
Stream input = arc.File.CreateStream (entry.Offset, entry.Size);
return new PrefixStream (PngHeader, input);
return new PrefixStream (PngFormat.HeaderBytes, input);
}
void DecryptIndex (byte[] data, byte[] key)