diff --git a/ArcFormats/ArcAST.cs b/ArcFormats/ArcAST.cs index d41aa47e..b8e13269 100644 --- a/ArcFormats/ArcAST.cs +++ b/ArcFormats/ArcAST.cs @@ -27,6 +27,7 @@ using System; using System.Collections.Generic; using System.ComponentModel.Composition; using System.IO; +using GameRes.Compression; using GameRes.Utility; namespace GameRes.Formats.AST diff --git a/ArcFormats/ArcAdvCls.cs b/ArcFormats/ArcAdvCls.cs index 4fb4cca0..ff483f6e 100644 --- a/ArcFormats/ArcAdvCls.cs +++ b/ArcFormats/ArcAdvCls.cs @@ -28,6 +28,7 @@ using System.Collections.Generic; using System.ComponentModel.Composition; using System.IO; using System.Text; +using GameRes.Compression; using GameRes.Utility; namespace GameRes.Formats.AdvCls diff --git a/ArcFormats/ArcBlackPackage.cs b/ArcFormats/ArcBlackPackage.cs index 5155da8f..d97ba1ff 100644 --- a/ArcFormats/ArcBlackPackage.cs +++ b/ArcFormats/ArcBlackPackage.cs @@ -27,6 +27,7 @@ using System; using System.Collections.Generic; using System.ComponentModel.Composition; using System.IO; +using GameRes.Compression; using GameRes.Utility; namespace GameRes.Formats.Ffa diff --git a/ArcFormats/ArcCommon.cs b/ArcFormats/ArcCommon.cs index 2ca0bbe6..e62a694e 100644 --- a/ArcFormats/ArcCommon.cs +++ b/ArcFormats/ArcCommon.cs @@ -291,270 +291,6 @@ namespace GameRes.Formats } } - public enum LzssMode - { - Decompress, - Compress, - }; - - public class LzssSettings - { - public int FrameSize { get; set; } - public byte FrameFill { get; set; } - public int FrameInitPos { get; set; } - } - - internal sealed class LzssCoroutine : LzssSettings - { - byte[] m_buffer; - int m_offset; - int m_length; - - Stream m_input; - - IEnumerator m_unpack; - - public bool Eof { get; private set; } - - public LzssCoroutine (Stream input) - { - m_input = input; - - FrameSize = 0x1000; - FrameFill = 0; - FrameInitPos = 0xfee; - } - - public int Continue (byte[] buffer, int offset, int count) - { - m_buffer = buffer; - m_offset = offset; - m_length = count; - if (null == m_unpack) - m_unpack = Unpack(); - Eof = !m_unpack.MoveNext(); - return m_offset - offset; - } - - private IEnumerator Unpack () - { - byte[] frame = new byte[FrameSize]; - int frame_pos = FrameInitPos; - int frame_mask = FrameSize-1; - for (;;) - { - int ctl = m_input.ReadByte(); - if (-1 == ctl) - yield break; - for (int bit = 1; bit != 0x100; bit <<= 1) - { - if (0 != (ctl & bit)) - { - int b = m_input.ReadByte(); - if (-1 == b) - yield break; - frame[frame_pos++] = (byte)b; - frame_pos &= frame_mask; - m_buffer[m_offset++] = (byte)b; - if (0 == --m_length) - yield return m_offset; - } - else - { - int lo = m_input.ReadByte(); - if (-1 == lo) - yield break; - int hi = m_input.ReadByte(); - if (-1 == hi) - yield break; - int offset = (hi & 0xf0) << 4 | lo; - for (int count = 3 + (hi & 0xF); count != 0; --count) - { - byte v = frame[offset++]; - offset &= frame_mask; - frame[frame_pos++] = v; - frame_pos &= frame_mask; - m_buffer[m_offset++] = v; - if (0 == --m_length) - yield return m_offset; - } - } - } - } - } - } - - public class LzssStream : Stream - { - Stream m_input; - LzssCoroutine m_reader; - bool m_should_dispose; - - public LzssStream (Stream input, LzssMode mode = LzssMode.Decompress, bool leave_open = false) - { - if (mode != LzssMode.Decompress) - throw new NotImplementedException ("LzssStream compression not implemented"); - m_input = input; - m_reader = new LzssCoroutine (input); - m_should_dispose = !leave_open; - } - - public LzssSettings Config { get { return m_reader; } } - - public override bool CanRead { get { return m_input.CanRead; } } - public override bool CanSeek { get { return false; } } - public override bool CanWrite { get { return false; } } - public override long Length - { - get { throw new NotSupportedException ("LzssStream.Length property is not supported"); } - } - public override long Position - { - get { throw new NotSupportedException ("LzssStream.Position property is not supported"); } - set { throw new NotSupportedException ("LzssStream.Position property is not supported"); } - } - - public override int Read (byte[] buffer, int offset, int count) - { - if (!m_reader.Eof && count > 0) - return m_reader.Continue (buffer, offset, count); - return 0; - } - - public override void Flush() - { - } - - public override long Seek (long offset, SeekOrigin origin) - { - throw new NotSupportedException ("LzssStream.Seek method is not supported"); - } - - public override void SetLength (long length) - { - throw new NotSupportedException ("LzssStream.SetLength method is not supported"); - } - - public override void Write (byte[] buffer, int offset, int count) - { - throw new NotSupportedException ("LzssStream.Write method is not supported"); - } - - public override void WriteByte (byte value) - { - throw new NotSupportedException ("LzssStream.WriteByte method is not supported"); - } - - #region IDisposable Members - bool m_disposed = false; - protected override void Dispose (bool disposing) - { - if (!m_disposed) - { - if (m_should_dispose && disposing) - m_input.Dispose(); - m_disposed = true; - base.Dispose (disposing); - } - } - #endregion - } - - public class LzssReader : IDisposable - { - BinaryReader m_input; - byte[] m_output; - int m_size; - - public BinaryReader Input { get { return m_input; } } - public byte[] Data { get { return m_output; } } - public int FrameSize { get; set; } - public byte FrameFill { get; set; } - public int FrameInitPos { get; set; } - - public LzssReader (Stream input, int input_length, int output_length) - { - m_input = new BinaryReader (input, Encoding.ASCII, true); - m_output = new byte[output_length]; - m_size = input_length; - - FrameSize = 0x1000; - FrameFill = 0; - FrameInitPos = 0xfee; - } - - public void Unpack () - { - int dst = 0; - var frame = new byte[FrameSize]; - if (FrameFill != 0) - for (int i = 0; i < frame.Length; ++i) - frame[i] = FrameFill; - int frame_pos = FrameInitPos; - int frame_mask = FrameSize-1; - int remaining = (int)m_size; - while (remaining > 0) - { - int ctl = m_input.ReadByte(); - --remaining; - for (int bit = 1; remaining > 0 && bit != 0x100; bit <<= 1) - { - if (dst >= m_output.Length) - return; - if (0 != (ctl & bit)) - { - byte b = m_input.ReadByte(); - --remaining; - frame[frame_pos++] = b; - frame_pos &= frame_mask; - m_output[dst++] = b; - } - else - { - if (remaining < 2) - return; - int lo = m_input.ReadByte(); - int hi = m_input.ReadByte(); - remaining -= 2; - int offset = (hi & 0xf0) << 4 | lo; - for (int count = 3 + (hi & 0xF); count != 0; --count) - { - if (dst >= m_output.Length) - break; - byte v = frame[offset++]; - offset &= frame_mask; - frame[frame_pos++] = v; - frame_pos &= frame_mask; - m_output[dst++] = v; - } - } - } - } - } - - #region IDisposable Members - bool disposed = false; - - public void Dispose () - { - Dispose (true); - GC.SuppressFinalize (this); - } - - protected virtual void Dispose (bool disposing) - { - if (!disposed) - { - if (disposing) - { - m_input.Dispose(); - } - disposed = true; - } - } - #endregion - } - public class HuffmanDecoder { byte[] m_src; diff --git a/ArcFormats/ArcFormats.csproj b/ArcFormats/ArcFormats.csproj index 8d17bcc1..a1280158 100644 --- a/ArcFormats/ArcFormats.csproj +++ b/ArcFormats/ArcFormats.csproj @@ -235,6 +235,7 @@ + True diff --git a/ArcFormats/ArcGsPack.cs b/ArcFormats/ArcGsPack.cs index 6953dca0..7b007849 100644 --- a/ArcFormats/ArcGsPack.cs +++ b/ArcFormats/ArcGsPack.cs @@ -28,6 +28,7 @@ using System.Collections.Generic; using System.ComponentModel.Composition; using System.IO; using System.Linq; +using GameRes.Compression; using GameRes.Utility; namespace GameRes.Formats.Gs diff --git a/ArcFormats/ArcIFL.cs b/ArcFormats/ArcIFL.cs index e00fbe5e..eaec80ae 100644 --- a/ArcFormats/ArcIFL.cs +++ b/ArcFormats/ArcIFL.cs @@ -27,6 +27,7 @@ using System; using System.Collections.Generic; using System.ComponentModel.Composition; using System.IO; +using GameRes.Compression; using GameRes.Utility; namespace GameRes.Formats.Silky diff --git a/ArcFormats/ArcLPK.cs b/ArcFormats/ArcLPK.cs index 7854dd57..f50aaaae 100644 --- a/ArcFormats/ArcLPK.cs +++ b/ArcFormats/ArcLPK.cs @@ -29,6 +29,7 @@ using System.ComponentModel.Composition; using System.IO; using System.Linq; using System.Text; +using GameRes.Compression; using GameRes.Formats.Properties; using GameRes.Formats.Strings; using GameRes.Utility; diff --git a/ArcFormats/ArcNexas.cs b/ArcFormats/ArcNexas.cs index d71bed80..1e877d10 100644 --- a/ArcFormats/ArcNexas.cs +++ b/ArcFormats/ArcNexas.cs @@ -29,6 +29,7 @@ using System.Linq; using System.Text; using System.Collections.Generic; using System.ComponentModel.Composition; +using GameRes.Compression; using GameRes.Formats.Strings; using GameRes.Utility; using ZLibNet; diff --git a/ArcFormats/ArcTactics.cs b/ArcFormats/ArcTactics.cs index 00903ba9..5d3af347 100644 --- a/ArcFormats/ArcTactics.cs +++ b/ArcFormats/ArcTactics.cs @@ -29,6 +29,7 @@ using System.ComponentModel.Composition; using System.IO; using System.Linq; using System.Security.Cryptography; +using GameRes.Compression; using GameRes.Utility; namespace GameRes.Formats.Tactics diff --git a/ArcFormats/AudioWA1.cs b/ArcFormats/AudioWA1.cs index be9d7596..37d60960 100644 --- a/ArcFormats/AudioWA1.cs +++ b/ArcFormats/AudioWA1.cs @@ -27,6 +27,7 @@ using System; using System.ComponentModel.Composition; using System.IO; using System.Text; +using GameRes.Compression; using GameRes.Utility; namespace GameRes.Formats.Ffa diff --git a/ArcFormats/CreateONSWidget.xaml.cs b/ArcFormats/CreateONSWidget.xaml.cs index 148f119d..76361f64 100644 --- a/ArcFormats/CreateONSWidget.xaml.cs +++ b/ArcFormats/CreateONSWidget.xaml.cs @@ -3,7 +3,6 @@ using System.Globalization; using System.Windows; using System.Windows.Controls; using System.Windows.Data; -using GameRes.Formats.ONScripter; using GameRes.Formats.Strings; namespace GameRes.Formats.GUI @@ -19,17 +18,17 @@ namespace GameRes.Formats.GUI } } - [ValueConversion (typeof (Compression), typeof (string))] + [ValueConversion (typeof (ONScripter.Compression), typeof (string))] class CompressionToStringConverter : IValueConverter { public object Convert (object value, Type targetType, object parameter, CultureInfo culture) { - switch ((Compression)value) + switch ((ONScripter.Compression)value) { - case Compression.SPB: return "SPB"; - case Compression.LZSS: return "LZSS"; - case Compression.NBZ: return "NBZ"; - default: return arcStrings.ONSCompressionNone; + case ONScripter.Compression.SPB: return "SPB"; + case ONScripter.Compression.LZSS: return "LZSS"; + case ONScripter.Compression.NBZ: return "NBZ"; + default: return arcStrings.ONSCompressionNone; } } @@ -39,13 +38,13 @@ namespace GameRes.Formats.GUI if (!string.IsNullOrEmpty (s)) { if ("SPB" == s) - return Compression.SPB; + return ONScripter.Compression.SPB; else if ("LZSS" == s) - return Compression.LZSS; + return ONScripter.Compression.LZSS; else if ("NBZ" == s) - return Compression.NBZ; + return ONScripter.Compression.NBZ; } - return Compression.None; + return ONScripter.Compression.None; } } } diff --git a/ArcFormats/ImageBMD.cs b/ArcFormats/ImageBMD.cs index 4bb87e6a..7fbf9637 100644 --- a/ArcFormats/ImageBMD.cs +++ b/ArcFormats/ImageBMD.cs @@ -32,6 +32,7 @@ using System.Text; using System.Windows; using System.Windows.Media; using System.Windows.Media.Imaging; +using GameRes.Compression; using GameRes.Utility; namespace GameRes.Formats.BlackRainbow diff --git a/ArcFormats/ImageCWL.cs b/ArcFormats/ImageCWL.cs index 5cca16bc..071d5887 100644 --- a/ArcFormats/ImageCWL.cs +++ b/ArcFormats/ImageCWL.cs @@ -29,6 +29,7 @@ using System.IO; using System.Linq; using System.Text; using System.Windows.Media; +using GameRes.Compression; using GameRes.Utility; namespace GameRes.Formats.Crowd diff --git a/ArcFormats/ImageDRG.cs b/ArcFormats/ImageDRG.cs index e7323d7c..af94ff01 100644 --- a/ArcFormats/ImageDRG.cs +++ b/ArcFormats/ImageDRG.cs @@ -31,6 +31,7 @@ using System.Text; using System.Windows; using System.Windows.Media; using System.Windows.Media.Imaging; +using GameRes.Compression; using GameRes.Utility; namespace GameRes.Formats.DRS diff --git a/ArcFormats/ImageGCC.cs b/ArcFormats/ImageGCC.cs index c986072d..ff1b4033 100644 --- a/ArcFormats/ImageGCC.cs +++ b/ArcFormats/ImageGCC.cs @@ -29,6 +29,7 @@ using System.ComponentModel.Composition; using System.Diagnostics; using System.IO; using System.Windows.Media; +using GameRes.Compression; using GameRes.Utility; namespace GameRes.Formats.Elf diff --git a/ArcFormats/ImageGR.cs b/ArcFormats/ImageGR.cs index 8e053668..da2226c1 100644 --- a/ArcFormats/ImageGR.cs +++ b/ArcFormats/ImageGR.cs @@ -27,6 +27,7 @@ using System; using System.ComponentModel.Composition; using System.Windows.Media; using System.IO; +using GameRes.Compression; using GameRes.Utility; namespace GameRes.Formats.Eagls diff --git a/ArcFormats/ImageGRP.cs b/ArcFormats/ImageGRP.cs index e76a5421..70cfeeed 100644 --- a/ArcFormats/ImageGRP.cs +++ b/ArcFormats/ImageGRP.cs @@ -28,6 +28,7 @@ using System.ComponentModel.Composition; using System.IO; using System.Windows.Media; using System.Windows.Media.Imaging; +using GameRes.Compression; using GameRes.Utility; namespace GameRes.Formats.Cherry diff --git a/ArcFormats/ImageGS.cs b/ArcFormats/ImageGS.cs index c5241e7b..14c19cd6 100644 --- a/ArcFormats/ImageGS.cs +++ b/ArcFormats/ImageGS.cs @@ -30,6 +30,7 @@ using System.IO; using System.Windows; using System.Windows.Media; using System.Windows.Media.Imaging; +using GameRes.Compression; using GameRes.Utility; namespace GameRes.Formats.Gs diff --git a/ArcFormats/ImageIAF.cs b/ArcFormats/ImageIAF.cs index 8328c8df..46010b2c 100644 --- a/ArcFormats/ImageIAF.cs +++ b/ArcFormats/ImageIAF.cs @@ -27,6 +27,7 @@ using System; using System.ComponentModel.Composition; using System.IO; using System.Windows.Media; +using GameRes.Compression; using GameRes.Utility; namespace GameRes.Formats.Triangle diff --git a/ArcFormats/ImageIGF.cs b/ArcFormats/ImageIGF.cs index b64a2fea..78fee5e6 100644 --- a/ArcFormats/ImageIGF.cs +++ b/ArcFormats/ImageIGF.cs @@ -28,6 +28,7 @@ using System.ComponentModel.Composition; using System.IO; using System.Windows.Media; using System.Windows.Media.Imaging; +using GameRes.Compression; using GameRes.Utility; namespace GameRes.Formats.Silky diff --git a/ArcFormats/ImageMNV.cs b/ArcFormats/ImageMNV.cs index b176247b..d7c7e06c 100644 --- a/ArcFormats/ImageMNV.cs +++ b/ArcFormats/ImageMNV.cs @@ -29,6 +29,7 @@ using System.IO; using System.Windows; using System.Windows.Media; using System.Windows.Media.Imaging; +using GameRes.Compression; namespace GameRes.Formats.MnoViolet { diff --git a/ArcFormats/ImageZBM.cs b/ArcFormats/ImageZBM.cs index dc7c6f8b..f8111b8f 100644 --- a/ArcFormats/ImageZBM.cs +++ b/ArcFormats/ImageZBM.cs @@ -26,6 +26,7 @@ using System; using System.ComponentModel.Composition; using System.IO; +using GameRes.Compression; using GameRes.Utility; namespace GameRes.Formats.Crowd diff --git a/ArcFormats/LzssStream.cs b/ArcFormats/LzssStream.cs new file mode 100644 index 00000000..950782ac --- /dev/null +++ b/ArcFormats/LzssStream.cs @@ -0,0 +1,297 @@ +//! \file LzssStream.cs +//! \date Sat Jul 25 03:48:03 2015 +//! \brief LZSS compressed stream I/O +// +// Lempel–Ziv–Storer–Szymanski (LZSS) compression algorithm. +// +// C# implementation Copyright (C) 2014-2015 by morkt +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to +// deal in the Software without restriction, including without limitation the +// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +// sell copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +// IN THE SOFTWARE. +// + +using System; +using System.Collections.Generic; +using System.IO; + +namespace GameRes.Compression +{ + public enum LzssMode + { + Decompress, + Compress, + }; + + public class LzssSettings + { + public int FrameSize { get; set; } + public byte FrameFill { get; set; } + public int FrameInitPos { get; set; } + } + + internal sealed class LzssCoroutine : LzssSettings + { + byte[] m_buffer; + int m_offset; + int m_length; + + Stream m_input; + + IEnumerator m_unpack; + + public bool Eof { get; private set; } + + public LzssCoroutine (Stream input) + { + m_input = input; + + FrameSize = 0x1000; + FrameFill = 0; + FrameInitPos = 0xfee; + } + + public int Continue (byte[] buffer, int offset, int count) + { + m_buffer = buffer; + m_offset = offset; + m_length = count; + if (null == m_unpack) + m_unpack = Unpack(); + Eof = !m_unpack.MoveNext(); + return m_offset - offset; + } + + private IEnumerator Unpack () + { + byte[] frame = new byte[FrameSize]; + int frame_pos = FrameInitPos; + int frame_mask = FrameSize-1; + for (;;) + { + int ctl = m_input.ReadByte(); + if (-1 == ctl) + yield break; + for (int bit = 1; bit != 0x100; bit <<= 1) + { + if (0 != (ctl & bit)) + { + int b = m_input.ReadByte(); + if (-1 == b) + yield break; + frame[frame_pos++] = (byte)b; + frame_pos &= frame_mask; + m_buffer[m_offset++] = (byte)b; + if (0 == --m_length) + yield return m_offset; + } + else + { + int lo = m_input.ReadByte(); + if (-1 == lo) + yield break; + int hi = m_input.ReadByte(); + if (-1 == hi) + yield break; + int offset = (hi & 0xf0) << 4 | lo; + for (int count = 3 + (hi & 0xF); count != 0; --count) + { + byte v = frame[offset++]; + offset &= frame_mask; + frame[frame_pos++] = v; + frame_pos &= frame_mask; + m_buffer[m_offset++] = v; + if (0 == --m_length) + yield return m_offset; + } + } + } + } + } + } + + public class LzssStream : Stream + { + Stream m_input; + LzssCoroutine m_reader; + bool m_should_dispose; + + public LzssStream (Stream input, LzssMode mode = LzssMode.Decompress, bool leave_open = false) + { + if (mode != LzssMode.Decompress) + throw new NotImplementedException ("LzssStream compression not implemented"); + m_input = input; + m_reader = new LzssCoroutine (input); + m_should_dispose = !leave_open; + } + + public LzssSettings Config { get { return m_reader; } } + + public override bool CanRead { get { return m_input.CanRead; } } + public override bool CanSeek { get { return false; } } + public override bool CanWrite { get { return false; } } + public override long Length + { + get { throw new NotSupportedException ("LzssStream.Length property is not supported"); } + } + public override long Position + { + get { throw new NotSupportedException ("LzssStream.Position property is not supported"); } + set { throw new NotSupportedException ("LzssStream.Position property is not supported"); } + } + + public override int Read (byte[] buffer, int offset, int count) + { + if (!m_reader.Eof && count > 0) + return m_reader.Continue (buffer, offset, count); + return 0; + } + + public override void Flush() + { + } + + public override long Seek (long offset, SeekOrigin origin) + { + throw new NotSupportedException ("LzssStream.Seek method is not supported"); + } + + public override void SetLength (long length) + { + throw new NotSupportedException ("LzssStream.SetLength method is not supported"); + } + + public override void Write (byte[] buffer, int offset, int count) + { + throw new NotSupportedException ("LzssStream.Write method is not supported"); + } + + public override void WriteByte (byte value) + { + throw new NotSupportedException ("LzssStream.WriteByte method is not supported"); + } + + #region IDisposable Members + bool m_disposed = false; + protected override void Dispose (bool disposing) + { + if (!m_disposed) + { + if (m_should_dispose && disposing) + m_input.Dispose(); + m_disposed = true; + base.Dispose (disposing); + } + } + #endregion + } + + public class LzssReader : IDisposable + { + BinaryReader m_input; + byte[] m_output; + int m_size; + + public BinaryReader Input { get { return m_input; } } + public byte[] Data { get { return m_output; } } + public int FrameSize { get; set; } + public byte FrameFill { get; set; } + public int FrameInitPos { get; set; } + + public LzssReader (Stream input, int input_length, int output_length) + { + m_input = new BinaryReader (input, System.Text.Encoding.ASCII, true); + m_output = new byte[output_length]; + m_size = input_length; + + FrameSize = 0x1000; + FrameFill = 0; + FrameInitPos = 0xfee; + } + + public void Unpack () + { + int dst = 0; + var frame = new byte[FrameSize]; + if (FrameFill != 0) + for (int i = 0; i < frame.Length; ++i) + frame[i] = FrameFill; + int frame_pos = FrameInitPos; + int frame_mask = FrameSize-1; + int remaining = (int)m_size; + while (remaining > 0) + { + int ctl = m_input.ReadByte(); + --remaining; + for (int bit = 1; remaining > 0 && bit != 0x100; bit <<= 1) + { + if (dst >= m_output.Length) + return; + if (0 != (ctl & bit)) + { + byte b = m_input.ReadByte(); + --remaining; + frame[frame_pos++] = b; + frame_pos &= frame_mask; + m_output[dst++] = b; + } + else + { + if (remaining < 2) + return; + int lo = m_input.ReadByte(); + int hi = m_input.ReadByte(); + remaining -= 2; + int offset = (hi & 0xf0) << 4 | lo; + for (int count = 3 + (hi & 0xF); count != 0; --count) + { + if (dst >= m_output.Length) + break; + byte v = frame[offset++]; + offset &= frame_mask; + frame[frame_pos++] = v; + frame_pos &= frame_mask; + m_output[dst++] = v; + } + } + } + } + } + + #region IDisposable Members + bool disposed = false; + + public void Dispose () + { + Dispose (true); + GC.SuppressFinalize (this); + } + + protected virtual void Dispose (bool disposing) + { + if (!disposed) + { + if (disposing) + { + m_input.Dispose(); + } + disposed = true; + } + } + #endregion + } +} diff --git a/ArcFormats/Properties/AssemblyInfo.cs b/ArcFormats/Properties/AssemblyInfo.cs index b417732b..ca6b9675 100644 --- a/ArcFormats/Properties/AssemblyInfo.cs +++ b/ArcFormats/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ using System.Runtime.InteropServices; // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion ("1.0.8.83")] -[assembly: AssemblyFileVersion ("1.0.8.83")] +[assembly: AssemblyVersion ("1.0.8.85")] +[assembly: AssemblyFileVersion ("1.0.8.85")]