diff --git a/ArcFormats/KiriKiri/ArcXPK.cs b/ArcFormats/KiriKiri/ArcXPK.cs index bd3b0706..c26d87a6 100644 --- a/ArcFormats/KiriKiri/ArcXPK.cs +++ b/ArcFormats/KiriKiri/ArcXPK.cs @@ -25,7 +25,9 @@ using System.Collections.Generic; using System.ComponentModel.Composition; +using System.IO; using System.Text; +using GameRes.Compression; using GameRes.Utility; namespace GameRes.Formats.KiriKiri @@ -85,5 +87,13 @@ namespace GameRes.Formats.KiriKiri throw new InvalidFormatException(); return Binary.BigEndian (input.ReadUInt32()); } + + public override Stream OpenEntry(ArcFile arc, Entry entry) + { + PackedEntry packed_entry = entry as PackedEntry; + if (null == packed_entry || packed_entry.Size == packed_entry.UnpackedSize) + return arc.File.CreateStream(entry.Offset, entry.Size); + return new ZLibStream(arc.File.CreateStream(entry.Offset, entry.Size), CompressionMode.Decompress); + } } }