mirror of
https://github.com/chev2/botw-toolset.git
synced 2025-12-24 00:42:50 +00:00
Update SARC comments
This commit is contained in:
parent
e401feaf34
commit
3ab86ea5d9
1 changed files with 14 additions and 11 deletions
|
|
@ -39,7 +39,7 @@ namespace BOTWToolset.IO.SARC
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets a <see cref="SARC"/> from an array of bytes.
|
/// Gets a <see cref="SARC"/> from an array of bytes.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="stream">Array of bytes to get <see cref="SARC"/> info from.</param>
|
/// <param name="bytes">Array of bytes to get <see cref="SARC"/> info from.</param>
|
||||||
/// <returns><see cref="SARC"/> with the stream's data.</returns>
|
/// <returns><see cref="SARC"/> with the stream's data.</returns>
|
||||||
public static SARC FromBytes(byte[] bytes)
|
public static SARC FromBytes(byte[] bytes)
|
||||||
{
|
{
|
||||||
|
|
@ -49,7 +49,8 @@ namespace BOTWToolset.IO.SARC
|
||||||
{
|
{
|
||||||
// SARC header
|
// SARC header
|
||||||
s.Magic = new string(r.ReadChars(4));
|
s.Magic = new string(r.ReadChars(4));
|
||||||
if (s.Magic != "SARC") // TODO: raise an exception here instead of returning null
|
if (s.Magic != "SARC")
|
||||||
|
// TODO: raise an exception here instead of returning null
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
s.HeaderLength = r.ReadUInt16();
|
s.HeaderLength = r.ReadUInt16();
|
||||||
|
|
@ -58,11 +59,13 @@ namespace BOTWToolset.IO.SARC
|
||||||
s.DataOffset = r.ReadUInt32();
|
s.DataOffset = r.ReadUInt32();
|
||||||
s.Version = r.ReadUInt16();
|
s.Version = r.ReadUInt16();
|
||||||
|
|
||||||
r.Advance(2); // Skip 2 reserved bytes
|
// Skip 2 reserved bytes
|
||||||
|
r.Advance(2);
|
||||||
|
|
||||||
// SFAT header
|
// SFAT header
|
||||||
string sfat_magic = new string(r.ReadChars(4));
|
string sfat_magic = new string(r.ReadChars(4));
|
||||||
if (sfat_magic != "SFAT") // TODO: raise an exception here instead of returning null
|
if (sfat_magic != "SFAT")
|
||||||
|
// TODO: raise an exception here instead of returning null
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
ushort sfat_headerlen = r.ReadUInt16();
|
ushort sfat_headerlen = r.ReadUInt16();
|
||||||
|
|
@ -95,7 +98,8 @@ namespace BOTWToolset.IO.SARC
|
||||||
|
|
||||||
// SFNT header
|
// SFNT header
|
||||||
var sfnt_magic = new string(r.ReadChars(4));
|
var sfnt_magic = new string(r.ReadChars(4));
|
||||||
if (sfnt_magic != "SFNT") // TODO: raise an exception here instead of returning null
|
if (sfnt_magic != "SFNT")
|
||||||
|
// TODO: raise an exception here instead of returning null
|
||||||
return null;
|
return null;
|
||||||
var sfnt_headerlen = r.ReadUInt16();
|
var sfnt_headerlen = r.ReadUInt16();
|
||||||
|
|
||||||
|
|
@ -166,7 +170,6 @@ namespace BOTWToolset.IO.SARC
|
||||||
/// <returns>byte[] containg the <see cref="SARC"/> data.</returns>
|
/// <returns>byte[] containg the <see cref="SARC"/> data.</returns>
|
||||||
public static byte[] ToBytes(SARC sarc)
|
public static byte[] ToBytes(SARC sarc)
|
||||||
{
|
{
|
||||||
// TODO: Make this an actual function
|
|
||||||
List<byte> bytes = new List<byte>();
|
List<byte> bytes = new List<byte>();
|
||||||
|
|
||||||
// SARC header
|
// SARC header
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue