public override async Task ReadDomainObject(ByteArrayReader reader, DomainHeader header, DomainExportTableEntry export, bool skipProperties, bool skipParse) { ArchetypeObjectReference = reader.ReadInt32(); ArchetypeObjectNameIndex = header.GetObjectTableEntry(ArchetypeObjectReference)?.NameTableIndex; await base.ReadDomainObject(reader, header, export, skipProperties, skipParse); }
private void onFileLoading(FileLoadingMessage message) { viewModel.Properties.ForEach(p => p.PropertyChanged -= onPropertyChanged); viewModel.Properties.Clear(); export = null; }
public virtual async Task ReadDomainObject(ByteArrayReader reader, DomainHeader header, DomainExportTableEntry export, bool skipProperties, bool skipParse) { if (!skipProperties) await PropertyHeader.ReadPropertyHeader(reader, header); AdditionalDataOffset = export.SerialDataOffset + reader.CurrentOffset; AdditionalDataReader = await reader.Splice(); }
private void onExportObjectSelected(ExportTableEntrySelectedMessage message) { export = message.ExportTableEntry; viewModel.Properties.ForEach(p => p.PropertyChanged -= onPropertyChanged); viewModel.Properties = new ObservableCollection<PropertyViewEntity>(mapper.Map<IEnumerable<PropertyViewEntity>>(export.DomainObject.PropertyHeader.Properties)); viewModel.Properties.ForEach(p => p.PropertyChanged += onPropertyChanged); }
public override async Task ReadDomainObject(ByteArrayReader reader, DomainHeader header, DomainExportTableEntry export, bool skipProperties, bool skipParse) { await base.ReadDomainObject(reader, header, export, skipProperties, skipParse); if (skipParse) return; Unknown1 = await reader.ReadBytes(sizeof(uint) * 3); CompressedChunkOffset = reader.ReadInt32(); }
public override async Task ReadDomainObject(ByteArrayReader reader, DomainHeader header, DomainExportTableEntry export, bool skipProperties, bool skipParse) { await base.ReadDomainObject(reader, header, export, skipProperties, skipParse); if (skipParse) return; await ProcessCompressedBulkData(reader, async bulkChunk => { byte[] bik = (await bulkChunk.DecompressChunk(0))?.GetBytes(); if (bik == null || bik.Length == 0) return; Movie = bik; }); }
public override async Task ReadDomainObject(ByteArrayReader reader, DomainHeader header, DomainExportTableEntry export, bool skipProperties, bool skipParse) { await base.ReadDomainObject(reader, header, export, skipProperties, skipParse); if (skipParse) return; bool done = false; do { await ProcessCompressedBulkData(reader, async bulkChunk => { byte[] ogg = (await bulkChunk.DecompressChunk(0))?.GetBytes(); if (ogg == null || ogg.Length == 0) { done = true; return; } Sounds.Add(ogg); }); } while(!done); }
public override async Task ReadDomainObject(ByteArrayReader reader, DomainHeader header, DomainExportTableEntry export, bool skipProperties, bool skipParse) { await base.ReadDomainObject(reader, header, export, skipProperties, skipParse); if (skipParse) return; MipMapsCount = reader.ReadInt32(); for(int i = 0; i < MipMapsCount; ++i) { await ProcessCompressedBulkData(reader, async bulkChunk => { DomainMipMap mip = new DomainMipMap { Width = reader.ReadInt32(), Height = reader.ReadInt32() }; if (mip.Width >= 4 || mip.Height >= 4) mip.ImageData = (await bulkChunk.DecompressChunk(0))?.GetBytes(); MipMaps.Add(mip); }); } Guid = await reader.ReadBytes(16); }
private async Task readExportTable(Action<DomainLoadProgress> progress) { DomainLoadProgress message = new DomainLoadProgress { Text = "Reading Export Table...", Current = 0, Total = ExportTableCount }; reader.Seek(ExportTableOffset); for(int i = 0; i < ExportTableCount; ++i) { DomainExportTableEntry export = new DomainExportTableEntry { TableIndex = i + 1 }; await export.ReadExportTableEntry(reader, this); ExportTable.Add(export); message.IncrementCurrent(); if (ExportTableCount > 100) progress?.Invoke(message); } message.Text = "Expanding References..."; message.Current = 0; message.Total = 0; progress?.Invoke(message); await ExportTable.ForEachAsync(export => Task.Run(() => export.ExpandReferences(this))); }