PR #84 changes

This commit is contained in:
dexy
2024-07-10 22:31:16 +10:00
Unverified
parent f9a3559263
commit 9b8331e696
2 changed files with 8 additions and 10 deletions
@@ -96,17 +96,16 @@ namespace CodeWalker.GameFiles
{
public override long BlockLength
{
get { return 20 + (256 * 16); }
get { return 16 + (8 * (SystemPagesCount + GraphicsPagesCount)); }
}
// structure data
public uint Unknown_0h { get; set; }
public uint Unknown_4h { get; set; }
public byte SystemPagesCount { get; set; }
public byte SystemPagesCount { get; set; } = 128;//default sizing to ensure there is enough space allocated when writing files
public byte GraphicsPagesCount { get; set; }
public ushort Unknown_Ah { get; set; }
public uint Unknown_Ch { get; set; }
public uint Unknown_10h { get; set; }
/// <summary>
/// Reads the data-block from a stream.
@@ -120,7 +119,7 @@ namespace CodeWalker.GameFiles
this.GraphicsPagesCount = reader.ReadByte();
this.Unknown_Ah = reader.ReadUInt16();
this.Unknown_Ch = reader.ReadUInt32();
this.Unknown_10h = reader.ReadUInt32();
reader.Position += 8 * (SystemPagesCount + GraphicsPagesCount);
}
/// <summary>
@@ -135,9 +134,8 @@ namespace CodeWalker.GameFiles
writer.Write(this.GraphicsPagesCount);
writer.Write(this.Unknown_Ah);
writer.Write(this.Unknown_Ch);
writer.Write(this.Unknown_10h);
var pad = 256 * 16;
var pad = 8 * (SystemPagesCount + GraphicsPagesCount);
writer.Write(new byte[pad]);
}