diff --git a/ArcFormats/NonColor/ArcACV.cs b/ArcFormats/NonColor/ArcACV.cs index 2f417281..98479a00 100644 --- a/ArcFormats/NonColor/ArcACV.cs +++ b/ArcFormats/NonColor/ArcACV.cs @@ -23,12 +23,7 @@ // IN THE SOFTWARE. // -using System; -using System.Collections.Generic; using System.ComponentModel.Composition; -using System.IO; -using GameRes.Compression; -using GameRes.Utility; namespace GameRes.Formats.NonColor { @@ -65,29 +60,8 @@ namespace GameRes.Formats.NonColor var dir = index.Read (file_map); if (null == dir) return null; - if (is_script) - { - foreach (ArcDatEntry entry in dir) - entry.Hash ^= scheme.Hash; - } - return new ArcFile (file, this, dir); + return new ArcDatArchive (file, this, dir, scheme.Hash); } } - - public override Stream OpenEntry (ArcFile arc, Entry entry) - { - var dent = entry as ArcDatEntry; - if (null == dent || 0 == dent.Size) - return arc.File.CreateStream (entry.Offset, entry.Size); - var data = arc.File.View.ReadBytes (entry.Offset, entry.Size); - if (dent.IsPacked) - { - DecryptData (data, (uint)dent.Hash); - return new ZLibStream (new MemoryStream (data), CompressionMode.Decompress); - } - if (dent.RawName != null && 0 != dent.Flags) - DecryptWithName (data, dent.RawName); - return new BinMemoryStream (data, entry.Name); - } } }