Fix some ptcl saving issues from bfres having null data

This commit is contained in:
KillzXGaming 2019-07-10 19:21:53 -04:00
parent d191d9c393
commit a28606e150
3 changed files with 15 additions and 1 deletions

View file

@ -44,6 +44,20 @@ namespace Switch_Toolbox.Library.IO
return signature == Identifier;
}
public bool CheckSignature(uint Identifier, long position = 0)
{
if (Position + 4 >= BaseStream.Length || position < 0)
return false;
Position = position;
uint signature = ReadUInt32();
//Reset position
Position = 0;
return signature == Identifier;
}
public string ReadNameOffset(bool IsRelative, Type OffsetType, bool ReadNameLength = false, bool IsNameLengthShort = false)
{
long pos = Position;
@ -205,7 +219,7 @@ namespace Switch_Toolbox.Library.IO
}
public byte[] getSection(int offset, int size)
{
Seek(offset, SeekOrigin.Begin);
Position = offset;
return ReadBytes(size);
}
public Vector4 ReadVec4()