WTA : Add support for uncompressed files.
This commit is contained in:
parent
2138a4b954
commit
43d0a498b5
@ -110,12 +110,14 @@ namespace FirstPlugin
|
||||
reader.SeekBegin(dataOffset);
|
||||
for (int i = 0; i < FileCount; i++)
|
||||
{
|
||||
if (files[i].CompressedSize == 0)
|
||||
continue;
|
||||
|
||||
files[i].FileName = $"File {i}";
|
||||
files[i].DataOffset = reader.Position;
|
||||
reader.Seek((int)files[i].CompressedSize);
|
||||
if (files[i].CompressedSize != 0)
|
||||
reader.Seek((int)files[i].CompressedSize);
|
||||
else
|
||||
reader.Seek((int)files[i].UncompressedSize);
|
||||
|
||||
// Console.WriteLine($"{i} {files[i].DataOffset} {files[i].CompressedSize} {files[i].Alignment}");
|
||||
|
||||
if (files[i].Alignment != 0)
|
||||
reader.Align((int)files[i].Alignment);
|
||||
@ -130,7 +132,7 @@ namespace FirstPlugin
|
||||
|
||||
reader.SeekBegin(files[i].DataOffset);
|
||||
var data = reader.ReadBytes((int)files[i].CompressedSize);
|
||||
if (files[i].CompressedSize != files[i].UncompressedSize && data[0] == 0x78 && data[1] == 0x5E)
|
||||
if (files[i].CompressedSize != 0 && files[i].CompressedSize != files[i].UncompressedSize && data[0] == 0x78 && data[1] == 0x5E)
|
||||
data = STLibraryCompression.ZLIB.Decompress(data);
|
||||
|
||||
using (var dataReader = new FileReader(data))
|
||||
|
@ -16,7 +16,7 @@ using LayoutBXLYT.Revolution;
|
||||
|
||||
namespace LayoutBXLYT
|
||||
{
|
||||
public class BRLYT : IFileFormat, IEditorForm<LayoutEditor>, IConvertableTextFormat
|
||||
public class BRLYT : IFileFormat, IEditorForm<LayoutEditor>, IConvertableTextFormat, ILeaveOpenOnLoad
|
||||
{
|
||||
public FileType FileType { get; set; } = FileType.Layout;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user