public Hght ReadHghts(Cols cols) { this.BaseStream.Seek(cols.HeaderOffset, SeekOrigin.Begin); Hght hght = this.ReadHghtMetadata(); while ((this.BaseStream.Position < (cols.ContentOffset + cols.Size)) && hght != null) { this.BaseStream.Seek(hght.ContentOffset, SeekOrigin.Begin); this.ReadHghtObjects(hght); cols.Hghts.Add(hght); hght = this.ReadHghtMetadata(); } return(hght); }
public void ReadHghtObjects(Hght hght) { this.BaseStream.Seek(hght.ContentOffset, SeekOrigin.Begin); while (this.BaseStream.Position < (hght.ContentOffset + hght.Size)) { HghtObject newHghtObject; byte[] mysteryData = this.ReadBytes(HghtObject.MYSTERY_SIZE); uint hghtShape = this.ReadUInt32(); newHghtObject = new HghtObject(hghtShape, this); newHghtObject.MysteryBytes = mysteryData; hght.HghtDatas.Add(newHghtObject); // skip the terminator this.BaseStream.Seek(4, SeekOrigin.Current); } }
public Hght ReadHghtMetadata() { Hght hght = null; long?position = SMFileUtils.FindNextString(this, Hght.Identifier); if (position.HasValue) { hght = new Hght(); hght.HeaderOffset = position.Value; hght.SizeOffset = position.Value + Hght.Identifier.Length; this.BaseStream.Seek(position.Value + Hght.Identifier.Length, SeekOrigin.Begin); hght.Size = BitConverter.ToUInt32(this.ReadBytes(4), 0); hght.ContentOffset = this.BaseStream.Position; } return(hght); }