public override void LoadData(BinaryReaderEx reader) { base.LoadData(reader); shapOffset = reader.BaseStream.Position; this.ShapHeader = new ShapHeader(); this.ShapHeader.NumThings = reader.ReadInt32(Endianness.BigEndian); this.ShapHeader.ThingOffset = reader.ReadInt32(Endianness.BigEndian); this.ShapHeader.NumThings2 = reader.ReadInt32(Endianness.BigEndian); this.ShapHeader.Thing2Offset = reader.ReadInt32(Endianness.BigEndian); this.ShapHeader.NameOffset = reader.ReadInt32(Endianness.BigEndian); this.ShapHeader.Unknown = reader.ReadInt32(Endianness.BigEndian); reader.BaseStream.Position = shapOffset + this.ShapHeader.ThingOffset; this.Things = new List<ShapThing1>(); for (var i = 0; i < this.ShapHeader.NumThings; i++) { ShapThing1 t = new ShapThing1(); t.Unk1 = reader.ReadInt16(Endianness.BigEndian); t.Unk2 = reader.ReadInt16(Endianness.BigEndian); this.Things.Add(t); } reader.BaseStream.Position = shapOffset + this.ShapHeader.Thing2Offset; this.Things2 = new List<ShapThing2>(); for (var j = 0; j < this.ShapHeader.NumThings2; j++) { ShapThing2 t = new ShapThing2(); t.Unk1 = reader.ReadSingle(Endianness.BigEndian); t.Unk2 = reader.ReadSingle(Endianness.BigEndian); t.Unk3 = reader.ReadSingle(Endianness.BigEndian); this.Things2.Add(t); } reader.BaseStream.Position = shapOffset + this.ShapHeader.NameOffset; this.Name = reader.ReadNullTerminatedString(); this.DisplayName = String.Format("SHAP [{0}]", this.Name); }
public override void LoadData(BinaryReaderEx reader) { base.LoadData(reader); shapOffset = reader.BaseStream.Position; this.ShapHeader = new ShapHeader(); this.ShapHeader.NumThings = reader.ReadInt32(Endianness.BigEndian); this.ShapHeader.ThingOffset = reader.ReadInt32(Endianness.BigEndian); this.ShapHeader.NumThings2 = reader.ReadInt32(Endianness.BigEndian); this.ShapHeader.Thing2Offset = reader.ReadInt32(Endianness.BigEndian); this.ShapHeader.NameOffset = reader.ReadInt32(Endianness.BigEndian); this.ShapHeader.Unknown = reader.ReadInt32(Endianness.BigEndian); reader.BaseStream.Position = shapOffset + this.ShapHeader.ThingOffset; this.Things = new List <ShapThing1>(); for (var i = 0; i < this.ShapHeader.NumThings; i++) { ShapThing1 t = new ShapThing1(); t.Unk1 = reader.ReadInt16(Endianness.BigEndian); t.Unk2 = reader.ReadInt16(Endianness.BigEndian); this.Things.Add(t); } reader.BaseStream.Position = shapOffset + this.ShapHeader.Thing2Offset; this.Things2 = new List <ShapThing2>(); for (var j = 0; j < this.ShapHeader.NumThings2; j++) { ShapThing2 t = new ShapThing2(); t.Unk1 = reader.ReadSingle(Endianness.BigEndian); t.Unk2 = reader.ReadSingle(Endianness.BigEndian); t.Unk3 = reader.ReadSingle(Endianness.BigEndian); this.Things2.Add(t); } reader.BaseStream.Position = shapOffset + this.ShapHeader.NameOffset; this.Name = reader.ReadNullTerminatedString(); this.DisplayName = String.Format("SHAP [{0}]", this.Name); }