public override void Deserialize(FxArchive Owner, BinaryReader reader) { base.Deserialize(Owner, reader); Unk10 = reader.ReadUInt32(); // Unknown; could be data about published or not. // Read FxMasterBoneListEntries uint NumMasterBoneEntries = reader.ReadUInt32(); MasterBoneList = new FxMasterBoneListEntry[NumMasterBoneEntries]; for (int i = 0; i < MasterBoneList.Length; i++) { FxMasterBoneListEntry DataObject = new FxMasterBoneListEntry(); DataObject.ReadFromFile(Owner, reader); MasterBoneList[i] = DataObject; } // Read FxCompiledFaceGraphNodes uint NumFaceGraphNodes = reader.ReadUInt32(); FaceGraphNodes = new FxCompiledFaceGraphNode[NumFaceGraphNodes]; for (int i = 0; i < FaceGraphNodes.Length; i++) { FxCompiledFaceGraphNode DataObject = new FxCompiledFaceGraphNode(); DataObject.ReadFromFile(Owner, reader); FaceGraphNodes[i] = DataObject; } uint NumUnk2s = reader.ReadUInt32(); Unk03s = new FxUnk3[NumUnk2s]; for (int i = 0; i < Unk03s.Length; i++) { FxUnk3 ClassObject = new FxUnk3(); ClassObject.ReadFromFile(reader); Unk03s[i] = ClassObject; } Unk04 = reader.ReadUInt32(); Unk05 = reader.ReadUInt32(); Unk06 = reader.ReadUInt32(); uint PhonToNameMapCount = reader.ReadUInt32(); PhoneToNameMap = new FxPhonToNameMap[PhonToNameMapCount]; for (int i = 0; i < PhoneToNameMap.Length; i++) { FxPhonToNameMap PhonToName = new FxPhonToNameMap(); PhonToName.Deserialize(Owner, reader); PhoneToNameMap[i] = PhonToName; } uint NumUnk3 = reader.ReadUInt32(); Unk3s = new uint[NumUnk3]; for (int i = 0; i < Unk3s.Length; i++) { Unk3s[i] = reader.ReadUInt32(); } }
public void ReadFromFile(BinaryReader reader) { uint FaceMagic = reader.ReadUInt32(); if (FaceMagic != 0x45434146) { // Invalid 'FACE' Magic return; } uint SDKVersion = reader.ReadUInt32(); if (SDKVersion != 1730) { // Invalid SDKVersion. 1730 == 1073 return; } // 0 == Little, 1 == Big uint EndianOrder = reader.ReadUInt32(); if (EndianOrder != 0) { // Invalid EndianOrder return; } string LicenseeName = StringHelpers.ReadString32(reader); // 'Illusion Softworks' string LicenseeProjectName = StringHelpers.ReadString32(reader); // 'Mafia II' uint Unk01 = reader.ReadUInt32(); // 1000 ushort Unk02 = reader.ReadUInt16(); // 1 uint Unk03 = reader.ReadUInt32(); // 10 - 7. Types of serialized OC3 classes // Read used OC3 types OC3Types = new SerializedOC3Type[Unk03]; for (int i = 0; i < OC3Types.Length; i++) { SerializedOC3Type ClassType = new SerializedOC3Type(); ClassType.Unk01 = reader.ReadUInt32(); ClassType.Unk02 = reader.ReadUInt32(); ClassType.Name = StringHelpers.ReadString32(reader); ClassType.Unk03 = reader.ReadUInt16(); OC3Types[i] = ClassType; } // Read StringTable uint NumStrings = reader.ReadUInt32(); StringTable = new string[NumStrings]; for (int i = 0; i < StringTable.Length; i++) { StringTable[i] = StringHelpers.ReadString32(reader); } // ActorNameID uint ActorNameIndex = reader.ReadUInt32(); uint Unk04 = reader.ReadUInt32(); // Unknown; could be data about published or not. // Read FxUnk0 uint NumUnk0s = reader.ReadUInt32(); FxMasterBoneListEntry[] Unk01s = new FxMasterBoneListEntry[NumUnk0s]; for (int i = 0; i < Unk01s.Length; i++) { FxMasterBoneListEntry DataObject = new FxMasterBoneListEntry(); DataObject.ReadFromFile(reader); Unk01s[i] = DataObject; } // Read FxUnk1 uint NumUnk1s = reader.ReadUInt32(); FxUnk02[] Unk02s = new FxUnk02[NumUnk1s]; for (int i = 0; i < Unk02s.Length; i++) { FxUnk02 DataObject = new FxUnk02(); DataObject.ReadFromFile(reader); Unk02s[i] = DataObject; } reader.BaseStream.Seek(0xa4e9, SeekOrigin.Begin); uint NumUnk2s = reader.ReadUInt32(); FxUnk3[] Unk03s = new FxUnk3[NumUnk2s]; for (int i = 0; i < Unk03s.Length; i++) { FxUnk3 ClassObject = new FxUnk3(); ClassObject.ReadFromFile(reader); Unk03s[i] = ClassObject; } reader.BaseStream.Seek(0xb252, SeekOrigin.Begin); uint PhonToNameMapCount = reader.ReadUInt32(); PhoneToNameMap = new FxPhonToNameMap[PhonToNameMapCount]; for (int i = 0; i < PhonToNameMapCount; i++) { FxPhonToNameMap PhonToName = new FxPhonToNameMap(); PhonToName.ReadFromFIle(reader); PhoneToNameMap[i] = PhonToName; } }