public BoneOffsetEntryV1 Read(DAIIO io) { xLength = io.ReadBit2(LengthBits); int count = io.ReadBit(0x10); BoneName = io.ReadString(count); Value = new byte[0xC]; for (int j = 0; j < 0xC; j++) { Value[j] = (byte)io.ReadBit(0x8); } return(this); }
public ValueFlag Read(DAIIO io) { Guid = new byte[0x10]; for (int j = 0; j < 0x10; j++) { Guid[j] = (byte)io.ReadBit(0x8); } Value = io.ReadInt32(); return(this); }
public VectorShaderParam Read(DAIIO io) { xLength = io.ReadBit2(LengthBits); VSParameterHandle = io.ReadBit2(0x20); Value = new byte[0x10]; for (int j = 0; j < 0x10; j++) { Value[j] = (byte)io.ReadBit(0x8); } return(this); }
public BoneOffsetEntryV2 Read(DAIIO io) { xLength = io.ReadBit2(LengthBits); BoneNameHash = io.ReadBit2(0x20); Value = new byte[0xC]; for (int j = 0; j < 0xC; j++) { Value[j] = (byte)io.ReadBit(0x8); } return(this); }
public HeadVariation Read(DAIIO io) { xLength = io.ReadBit2(LengthBits); Index = (byte)io.ReadBit2(0x8); FaceVerticesSize = io.ReadBit2(0x20); FaceVerticesBytes = new byte[FaceVerticesSize]; for (int j = 0; j < FaceVerticesSize; j++) { FaceVerticesBytes[j] = (byte)io.ReadBit(0x8); } return(this); }
public LootMap Read(DAIIO io) { xLength = io.ReadBit2(LengthBits); LevelId = io.ReadBit2(0x20); BufferSize = io.ReadBit2(0x20); Buffer = new byte[BufferSize]; for (int j = 0; j < BufferSize; j++) { Buffer[j] = (byte)io.ReadBit(0x8); } return(this); }
public BooleanFlags Read(DAIIO io) { Count = io.ReadInt16(); Guids = new byte[Count][]; for (int i = 0; i < Count; i++) { Guids[i] = new byte[0x10]; for (int j = 0; j < 0x10; j++) { Guids[i][j] = (byte)io.ReadBit(0x8); } } return(this); }
public Map Read(DAIIO io) { xLength = io.ReadBit2(LengthBits); MapID = io.ReadInt32(); IsPersistent = io.ReadBoolean(); UncompressedSize = io.ReadInt32(); IsCompressed = io.ReadBoolean(); Size = io.ReadInt32(); Blob = new byte[Size]; for (int i = 0; i < Size; i++) { Blob[i] = (byte)io.ReadBit(0x8); } return(this); }
public StateHistory Read(DAIIO io) { xLength = io.ReadBit2(LengthBits); Name = ""; var xpos = io.Position; var count = (ushort)io.ReadBit(0x10); if (count == 0) { Unknown = io.ReadData(xLength - 0x10); } else { Name = io.ReadString(count); count = (ushort)io.ReadBit(0x10); var xl = io.Position - xpos; Hash = new byte[count]; if (count == 0) { Unknown = io.ReadData((int)(xLength - xl)); } else { io.Read(Hash, 0, count); } xl = io.Position - xpos; if (xl < xLength) { //var x1 = io.ReadBit2(0x18); var d = io.ReadData((int)(xLength - xl)); Console.WriteLine(BitConverter.ToString(d).Replace("-", "") + @" ==== > "); } } return(this); }
public BWMapManager Read(DAIIO io) { xLength = io.ReadBit2(LengthBits); //if(6 (<-????) > 5) //{ UserWaypoint_MapId = io.ReadInt32(); UserWaypoint_WorldPos = new byte[8]; for (int i = 0; i < 8; i++) { UserWaypoint_WorldPos[i] = (byte)io.ReadBit(0x8); } FogArchive = new FogArchive().Read(io); DynamicPinsMaps = new DynamicPinsMaps().Read(io); DiscoveredPins = new MapPins().Read(io); ExploredPins = new MapPins().Read(io); //} return(this); }
public Customization Read(DAIIO io) { xLength = io.ReadBit2(LengthBits); HeadOverrideIndex = io.ReadBit2(8); Gender = io.ReadBit2(8); Race = io.ReadBit2(8); Hair = io.ReadBit2(8); Beard = io.ReadBit2(8); if (_data.Version >= 9) { Horns = io.ReadBit2(0x8); } VectorShaderParams = new VectorShader().Read(io); TextureShaderParams = new TextureShader().Read(io); if (_data.Version >= 0xF) { BodyShaderHandles = new BodyShaderHandles().Read(io); } if (_data.Version >= 0xC) { if (_data.Version < 0xE) { BoneOffsetsV1 = new BoneOffsetsV1().Read(io); } else { BoneOffsetsV2 = new BoneOffsetsV2().Read(io); } } if (_data.Version >= 0x9) { if (_data.Version >= 0xB) { HeadVariations = new HeadVariations().Read(io); } else { FaceVerticesSize = io.ReadBit2(0x20); FaceVerticesBytes = new byte[FaceVerticesSize]; for (int j = 0; j < FaceVerticesSize; j++) { FaceVerticesBytes[j] = (byte)io.ReadBit(0x8); } } } else { FaceCodeVersion = io.ReadBit2(0x20); int count = io.ReadBit(0x10); FaceCode = ""; for (int j = 0; j < count; j++) { FaceCode += (char)io.ReadBit(0x8); } } if (_data.Version >= 0x10) { DnaSize = io.ReadBit2(0x20); DnaData = new byte[DnaSize]; for (int j = 0; j < DnaSize; j++) { if (j == (DnaSize - 3)) { Console.WriteLine(); } DnaData[j] = (byte)io.ReadBit(0x8); } } return(this); }
public SaveDataStructure Read(DAIIO io) { byte[] xdm = io.ReadBytes(0x41, false); if (!xdm.MemCompare(DataMagic, 0)) { throw new Exception("Invalid Save Data Header!"); } SavedTime = io.ReadInt64().ToUnixTime(); ushort count = io.ReadUInt16(); SID = io.ReadString(count); GameVersion = io.ReadUInt16(); SaveVersion = io.ReadUInt16(); ProjectVersion = io.ReadUInt16(); BitstreamFeatures = io.ReadUInt16(); ChangeList = io.ReadUInt32(); count = io.ReadUInt16(); Level = io.ReadString(count); Difficulty = io.ReadUInt32(); BundleCount = io.ReadUInt16(); BundleList = new string[BundleCount]; for (int i = 0; i < BundleCount; i++) { count = io.ReadUInt16(); BundleList[i] = io.ReadString(count); } InclusionCount = io.ReadUInt16(); Inclusions = new Inclusion[InclusionCount]; for (int i = 0; i < InclusionCount; i++) { Inclusions[i] = new Inclusion().Read(io); } SubLevelInfoCount = io.ReadBit2(0xc); if (SubLevelInfoCount <= 0x40 && SubLevelInfoCount > 0) { SubLevelEntries = new SubLevelInfo[SubLevelInfoCount]; for (int i = 0; i < SubLevelInfoCount; i++) { SubLevelEntries[i] = new SubLevelInfo().Read(io); } } LevelChecksum = new byte[0x10]; for (int i = 0; i < 0x10; i++) { LevelChecksum[i] = (byte)io.ReadBit(0x8); } DLC = io.ReadBit2(0x14); EntityVersion = (short)io.ReadBit2(0x10); ProjectVersionContext = (short)io.ReadBit2(0x10); HasDebugInfo = io.ReadBoolean(); AgentTocBookmark = io.ReadBit2(0x1A); ClientDataBookmark = io.ReadBit2(0x1A); EntityContentLength = io.ReadBit2(0x20); /////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////UNFINISHED SECTION!!!!!///////////////////////////////// var xpos = io.Position; //////// EntityContent = new EntityData(this).Read(io); //////// tmpdata = io.ReadData((int)(EntityContentLength - (io.Position - xpos))); //////// ////////////////////////////////////////////////////////////////////////////////// SaveEntityComplexLength = io.ReadBit2(6); SaveEntityComplex = io.ReadData((int)SaveEntityComplexLength); SaveEntityBookmark = io.ReadBit2(0x1A); SaveEntity = new SaveEntity(this).Read(io); EntityMetaData = new EntityMeta(this).Read(io); AgentToc = new AgentToc().Read(io); //var xdio = new DAIIO(io.xbaseStream, io.Position, ClientDataLength) {IsBigEndian = true}; ClientData = new ClientAgent().Read(io); //io.Position += ClientDataLength; LastPartSeedLength = (int)(io.Length - io.Position); if (LastPartSeedLength > 0) { LastPartSeed = io.ReadBit2((uint)LastPartSeedLength); } return(this); }