Add kirikiri XPK uncompress support

This commit is contained in:
crskycode 2021-04-08 11:51:13 +08:00
parent 4fad98038f
commit 6855967b04

View File

@ -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);
}
}
}