public static BSTSection readStream(BeBinaryReader br) { //Console.WriteLine($"Section {br.BaseStream.Position:X}"); var newSect = new BSTSection(); newSect.count = br.ReadInt32(); newSect.groups = new BSTGroup[newSect.count]; var groupPointers = Helpers.readInt32Array(br, newSect.count); for (int i = 0; i < groupPointers.Length; i++) { br.BaseStream.Position = groupPointers[i]; newSect.groups[i] = BSTGroup.readStream(br); } return(newSect); }
public static BSTGroup readStream(BeBinaryReader br) { var newSect = new BSTGroup(); var count = br.ReadInt32(); br.ReadInt32(); // Alignment (skip 4 bytes, always 0); newSect.waves = new BSTWaveInfo[count]; for (int i = 0; i < count; i++) { var anch = br.BaseStream.Position + 4; // Return to the section in front of the current one var type = br.ReadByte(); // Describes type var addr = Helpers.ReadUInt24BE(br); br.BaseStream.Position = addr; newSect.waves[i] = BSTWaveInfo.readStream(br, type); br.BaseStream.Position = anch; } return(newSect); }