public override void Load(Stream fileStream) { var reader = new ExtendedBinaryReader(fileStream, false); // Determine what type of file this is uint magic1 = reader.ReadUInt32(); uint magic2 = reader.ReadUInt32(); reader.JumpTo(0); // Pack File if (magic1 == HavokPackFile.Magic1 && magic2 == HavokPackFile.Magic2) { HavokPackFile.Read(this, reader); return; } // Tag File if (magic2 == HavokTagFile.TAGMagic) { HavokTagFile.Read(this, reader); return; } // XML if (magic1 == 0x6D783F3C && magic2 == 0x6576206C) { HavokXML.Read(this, fileStream); return; } throw new NotSupportedException("The given file's format is unsupported!"); }
public void LoadTagFile(Stream fileStream) { var reader = new ExtendedBinaryReader(fileStream, false); HavokTagFile.Read(this, reader); }