mirror of
https://github.com/crskycode/GARbro.git
synced 2026-07-08 01:30:18 +08:00
(NSA): decompress NBZ entries.
This commit is contained in:
@@ -30,6 +30,7 @@ using System.ComponentModel.Composition;
|
|||||||
using System.Text;
|
using System.Text;
|
||||||
using GameRes.Formats.Strings;
|
using GameRes.Formats.Strings;
|
||||||
using GameRes.Utility;
|
using GameRes.Utility;
|
||||||
|
using ICSharpCode.SharpZipLib.BZip2;
|
||||||
|
|
||||||
namespace GameRes.Formats.NScripter
|
namespace GameRes.Formats.NScripter
|
||||||
{
|
{
|
||||||
@@ -158,6 +159,8 @@ namespace GameRes.Formats.NScripter
|
|||||||
case 4: entry.CompressionType = Compression.NBZ; break;
|
case 4: entry.CompressionType = Compression.NBZ; break;
|
||||||
default: entry.CompressionType = Compression.Unknown; break;
|
default: entry.CompressionType = Compression.Unknown; break;
|
||||||
}
|
}
|
||||||
|
if (name.HasExtension (".nbz"))
|
||||||
|
entry.Type = "audio";
|
||||||
dir.Add (entry);
|
dir.Add (entry);
|
||||||
}
|
}
|
||||||
return dir;
|
return dir;
|
||||||
@@ -179,9 +182,15 @@ namespace GameRes.Formats.NScripter
|
|||||||
|
|
||||||
protected Stream UnpackEntry (Stream input, NsaEntry nsa_entry)
|
protected Stream UnpackEntry (Stream input, NsaEntry nsa_entry)
|
||||||
{
|
{
|
||||||
if (null == nsa_entry
|
if (null == nsa_entry)
|
||||||
|| !(Compression.LZSS == nsa_entry.CompressionType ||
|
return input;
|
||||||
Compression.SPB == nsa_entry.CompressionType))
|
if (nsa_entry.Name.HasExtension (".nbz"))
|
||||||
|
{
|
||||||
|
input.Position = 4;
|
||||||
|
return new BZip2InputStream (input);
|
||||||
|
}
|
||||||
|
if (!(Compression.LZSS == nsa_entry.CompressionType ||
|
||||||
|
Compression.SPB == nsa_entry.CompressionType))
|
||||||
return input;
|
return input;
|
||||||
using (input)
|
using (input)
|
||||||
{
|
{
|
||||||
@@ -335,7 +344,6 @@ namespace GameRes.Formats.NScripter
|
|||||||
internal class Unpacker : MsbBitStream
|
internal class Unpacker : MsbBitStream
|
||||||
{
|
{
|
||||||
private byte[] m_output;
|
private byte[] m_output;
|
||||||
private byte[] m_read_buf = new byte[4096];
|
|
||||||
|
|
||||||
public byte[] Output { get { return m_output; } }
|
public byte[] Output { get { return m_output; } }
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user