public void Load(byte[] data, RpfFileEntry entry) { Name = entry.Name; RpfFileEntry = entry; RpfResourceFileEntry resentry = entry as RpfResourceFileEntry; if (resentry == null) { throw new Exception("File entry wasn't a resource! (is it binary data?)"); } ResourceDataReader rd = new ResourceDataReader(resentry, data); Bounds = rd.ReadBlock <Bounds>(); Bounds.OwnerYbn = this; Bounds.OwnerName = entry.Name; #if DEBUG Analyzer = new ResourceAnalyzer(rd); #endif Loaded = true; }
public void Load(byte[] data, RpfFileEntry entry) { Name = entry.Name; RpfFileEntry = entry; RpfResourceFileEntry resentry = entry as RpfResourceFileEntry; if (resentry == null) { throw new Exception("File entry wasn't a resource! (is it binary data?)"); } ResourceDataReader rd = new ResourceDataReader(resentry, data); //MemoryUsage = 0; try { PtfxList = rd.ReadBlock <ParticleEffectsList>(); //Drawable.Owner = this; //MemoryUsage += Drawable.MemoryUsage; //uses decompressed filesize now... } catch (Exception ex) { ErrorMessage = ex.ToString(); } BuildDrawableDict(); BuildParticleDict(); #if DEBUG Analyzer = new ResourceAnalyzer(rd); #endif Loaded = true; }
/// <summary> /// Reads the data-block from a stream. /// </summary> public override void Read(ResourceDataReader reader, params object[] parameters) { base.Read(reader, parameters); // read structure data this.Unknown_10h = reader.ReadInt32(); this.Unknown_14h = reader.ReadInt16(); this.HasEncryptedStrings = reader.ReadByte(); this.Unknown_17h = reader.ReadByte(); this.Unknown_18h = reader.ReadInt32(); this.RootBlockIndex = reader.ReadInt32(); this.StructureInfosPointer = reader.ReadInt64(); this.EnumInfosPointer = reader.ReadInt64(); this.DataBlocksPointer = reader.ReadInt64(); this.NamePointer = reader.ReadInt64(); this.EncryptedStringsPointer = reader.ReadInt64(); this.StructureInfosCount = reader.ReadInt16(); this.EnumInfosCount = reader.ReadInt16(); this.DataBlocksCount = reader.ReadInt16(); this.Unknown_4Eh = reader.ReadInt16(); this.Unknown_50h = reader.ReadUInt32(); this.Unknown_54h = reader.ReadUInt32(); this.Unknown_58h = reader.ReadUInt32(); this.Unknown_5Ch = reader.ReadUInt32(); this.Unknown_60h = reader.ReadUInt32(); this.Unknown_64h = reader.ReadUInt32(); this.Unknown_68h = reader.ReadUInt32(); this.Unknown_6Ch = reader.ReadUInt32(); // read reference data this.StructureInfos = reader.ReadBlockAt <ResourceSimpleArray <MetaStructureInfo> >( (ulong)this.StructureInfosPointer, // offset this.StructureInfosCount ); this.EnumInfos = reader.ReadBlockAt <ResourceSimpleArray <MetaEnumInfo> >( (ulong)this.EnumInfosPointer, // offset this.EnumInfosCount ); this.DataBlocks = reader.ReadBlockAt <ResourceSimpleArray <MetaDataBlock> >( (ulong)this.DataBlocksPointer, // offset this.DataBlocksCount ); this.Name = reader.ReadStringAt( //BlockAt<string_r>( (ulong)this.NamePointer // offset ); if (!string.IsNullOrEmpty(Name)) { } //Strings = MetaTypes.GetStrings(this); #if DEBUG EncryptedStrings = reader.ReadBlockAt <MetaEncryptedStringsBlock>((ulong)EncryptedStringsPointer); Analyzer = new ResourceAnalyzer(reader); #endif }