Added NScripter NSA archive format (incomplete)
This commit is contained in:
parent
da5d3fcdba
commit
05cc24882e
@ -0,0 +1,58 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using UniversalEditor.IO;
|
||||
using UniversalEditor.ObjectModels.FileSystem;
|
||||
|
||||
namespace UniversalEditor.DataFormats.FileSystem.NScripter.NSA
|
||||
{
|
||||
public class NSADataFormat : DataFormat
|
||||
{
|
||||
private static DataFormatReference _dfr = null;
|
||||
public override DataFormatReference MakeReference()
|
||||
{
|
||||
if (_dfr == null)
|
||||
{
|
||||
_dfr = base.MakeReference();
|
||||
_dfr.Capabilities.Add(typeof(FileSystemObjectModel), DataFormatCapabilities.All);
|
||||
_dfr.Filters.Add("NScripter NSA archive", new string[] { "*.nsa" });
|
||||
}
|
||||
return _dfr;
|
||||
}
|
||||
|
||||
protected override void LoadInternal(ref ObjectModel objectModel)
|
||||
{
|
||||
FileSystemObjectModel fsom = (objectModel as FileSystemObjectModel);
|
||||
if (fsom == null) throw new ObjectModelNotSupportedException();
|
||||
|
||||
Reader reader = base.Accessor.Reader;
|
||||
reader.Endianness = Endianness.BigEndian;
|
||||
|
||||
ushort fileCount = reader.ReadUInt16();
|
||||
ushort unknown1 = reader.ReadUInt16();
|
||||
|
||||
byte unknown2 = reader.ReadByte();
|
||||
|
||||
for (ushort i = 0; i < fileCount; i++)
|
||||
{
|
||||
byte unknown3 = reader.ReadByte();
|
||||
string fileName = reader.ReadNullTerminatedString();
|
||||
|
||||
ushort unknown4 = reader.ReadUInt16();
|
||||
ushort unknown5 = reader.ReadUInt16();
|
||||
|
||||
uint unknown6 = reader.ReadUInt32();
|
||||
uint unknown7 = reader.ReadUInt32();
|
||||
|
||||
File file = fsom.AddFile(fileName);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
protected override void SaveInternal(ObjectModel objectModel)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -133,6 +133,7 @@
|
||||
<Compile Include="DataFormats\FileSystem\N2M\N2MDataFormat.cs" />
|
||||
<Compile Include="DataFormats\FileSystem\Nero\Internal\DirectoryEntry.cs" />
|
||||
<Compile Include="DataFormats\FileSystem\Nero\NeroDiskImageDataFormat.cs" />
|
||||
<Compile Include="DataFormats\FileSystem\NScripter\NSA\NSADataFormat.cs" />
|
||||
<Compile Include="DataFormats\FileSystem\Nvidia\NPK\NPKDataFormat.cs" />
|
||||
<Compile Include="DataFormats\FileSystem\PCK\PCKDataFormat.cs" />
|
||||
<Compile Include="DataFormats\FileSystem\PKG\PKGDataFormat.cs" />
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user