From 7a9a6a607f3e9c11a460f787d04ed02d522b2592 Mon Sep 17 00:00:00 2001 From: morkt Date: Sun, 25 Dec 2016 07:15:54 +0400 Subject: [PATCH] (AbmReader): derive from BinaryImageDecoder. --- ArcFormats/Lilim/ArcABM.cs | 35 ++++------------------------------- 1 file changed, 4 insertions(+), 31 deletions(-) diff --git a/ArcFormats/Lilim/ArcABM.cs b/ArcFormats/Lilim/ArcABM.cs index 155f45ee..b0cf70d7 100644 --- a/ArcFormats/Lilim/ArcABM.cs +++ b/ArcFormats/Lilim/ArcABM.cs @@ -142,34 +142,20 @@ namespace GameRes.Formats.Lilim } } - internal sealed class AbmReader : IImageDecoder + internal sealed class AbmReader : BinaryImageDecoder { - IBinaryStream m_input; byte[] m_output; AbmImageData m_info; - ImageData m_image; int m_bpp; - public Stream Source { get { return m_input.AsStream; } } - public ImageFormat SourceFormat { get { return null; } } - public ImageMetaData Info { get { return m_info; } } - public ImageData Image - { - get - { - if (null == m_image) - m_image = ReadImage(); - return m_image; - } - } - - public AbmReader (IBinaryStream file, AbmImageData info) + public AbmReader (IBinaryStream file, AbmImageData info) : base (file) { m_info = info; m_input = file; + Info = m_info; } - ImageData ReadImage () + protected override ImageData GetImageData () { if (2 == m_info.Mode) { @@ -335,18 +321,5 @@ namespace GameRes.Formats.Lilim src += frame_w * pixel_size; } } - - #region IDisposable Members - bool m_disposed = false; - public void Dispose () - { - if (!m_disposed) - { - m_input.Dispose(); - m_disposed = true; - } - GC.SuppressFinalize (this); - } - #endregion } }