mirror of
https://github.com/KillzXGaming/Switch-Toolbox
synced 2024-11-26 06:20:24 +00:00
Fix some ptcl saving issues from bfres having null data
This commit is contained in:
parent
d191d9c393
commit
a28606e150
3 changed files with 15 additions and 1 deletions
|
@ -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()
|
||||
|
|
Binary file not shown.
Binary file not shown.
Loading…
Reference in a new issue