public static fogHeader extractFogData(BinaryReaderBigEndian input) { fogHeader newHeader; input.BaseStream.Position = 0xBC; // fog header offset location input.BaseStream.Position = input.ReadUInt32(); // fog header offset if (input.BaseStream.Position == 0) { throw new Exception("No fog header found!"); } newHeader.fogType = (fogTypes)input.ReadByte(); input.ReadBytes(3); // unknown/null newHeader.fogStartDistance = input.ReadSingle(); newHeader.fogEndDistance = input.ReadSingle(); newHeader.color.X = input.ReadSingle(); newHeader.color.Y = input.ReadSingle(); newHeader.color.Z = input.ReadSingle(); return(newHeader); }