1
0
mirror of synced 2025-01-31 04:13:51 +01:00

More rstb fixes

This commit is contained in:
KillzXGaming 2019-06-15 11:27:50 -04:00
parent 8f18e77ab7
commit 70b15a94b7
6 changed files with 18 additions and 2 deletions

Binary file not shown.

View File

@ -265,7 +265,7 @@ namespace Switch_Toolbox.Library
float.TryParse(value, out output);
}
public int CalculateFileSize(string FileName, byte[] Data, bool IsWiiU,bool IsYaz0Compressed, bool Force)
public int CalculateFileSize(string FileName, byte[] Data, bool IsWiiU, bool IsYaz0Compressed, bool Force)
{
return CalculateFileSizeByExtension(FileName, Data, IsWiiU, System.IO.Path.GetExtension(FileName), IsYaz0Compressed, Force);
}
@ -285,10 +285,26 @@ namespace Switch_Toolbox.Library
}
}
else
{
Size = (int)new System.IO.FileInfo(FileName).Length;
}
}
else
Size = Data.Length;
{
if (IsYaz0Compressed)
{
using (var reader = new FileReader(new System.IO.MemoryStream(Data)))
{
reader.ByteOrder = Syroot.BinaryData.ByteOrder.BigEndian;
reader.Seek(4, System.IO.SeekOrigin.Begin);
Size = reader.ReadInt32();
}
}
else
{
Size = Data.Length;
}
}
byte[] FileData = Data;