Exemplo n.º 1
0
        /// <summary>
        /// Reads the data-block from a stream.
        /// </summary>
        public override void Read(ResourceDataReader reader, params object[] parameters)
        {
            // read structure data
            this.VFT = reader.ReadUInt32();
            this.Unknown_4h = reader.ReadUInt32();
            this.TextureDictionaryPointer = reader.ReadUInt64();
            this.ShadersPointer = reader.ReadUInt64();
            this.ShadersCount1 = reader.ReadUInt16();
            this.ShadersCount2 = reader.ReadUInt16();
            this.Unknown_1Ch = reader.ReadUInt32();
            this.Unknown_20h = reader.ReadUInt32();
            this.Unknown_24h = reader.ReadUInt32();
            this.Unknown_28h = reader.ReadUInt32();
            this.Unknown_2Ch = reader.ReadUInt32();
            this.Unknown_30h = reader.ReadUInt32();
            this.Unknown_34h = reader.ReadUInt32();
            this.Unknown_38h = reader.ReadUInt32();
            this.Unknown_3Ch = reader.ReadUInt32();

            // read reference data
            this.TextureDictionary = reader.ReadBlockAt<TextureDictionary_GTA5_pc>(
                this.TextureDictionaryPointer // offset
            );
            this.Shaders = reader.ReadBlockAt<ResourcePointerArray64<ShaderFX_GTA5_pc>>(
                this.ShadersPointer, // offset
                this.ShadersCount1
            );
        }
        /// <summary>
        /// Loads the texture dictionary from a file.
        /// </summary>
        public void Load(string fileName)
        {
            var resource = new ResourceFile_GTA5_pc<TextureDictionary_GTA5_pc>();
            resource.Load(fileName);

            textureDictionary = resource.ResourceData;
        }
        public void Load(Stream stream)
        {
            var resource = new ResourceFile_GTA5_pc<TextureDictionary_GTA5_pc>();
            resource.Load(stream);

            if (resource.Version != 13)
                throw new Exception("version error");

            textureDictionary = resource.ResourceData;
        }
 public TextureDictionaryWrapper_GTA5_pc(TextureDictionary_GTA5_pc baseClass)
 {
     this.textureDictionary = baseClass;
 }
 public TextureDictionaryFileWrapper_GTA5_pc()
 {
     textureDictionary = new TextureDictionary_GTA5_pc();
     textureDictionary.Hashes = new ResourceSimpleArray<uint_r>();
     textureDictionary.Textures = new ResourcePointerArray64<Texture_GTA5_pc>();
 }
Exemplo n.º 6
0
        /// <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.NamePointer = reader.ReadUInt64();
            this.Unknown_18h = reader.ReadUInt32();
            this.Unknown_1Ch = reader.ReadUInt32();
            this.TextureDictionaryPointer = reader.ReadUInt64();
            this.Unknown_28h = reader.ReadUInt32();
            this.Unknown_2Ch = reader.ReadUInt32();
            this.DrawableDictionaryPointer = reader.ReadUInt64();
            this.ParticleRuleDictionaryPointer = reader.ReadUInt64();
            this.Unknown_40h = reader.ReadUInt32();
            this.Unknown_44h = reader.ReadUInt32();
            this.EmitterRuleDictionaryPointer = reader.ReadUInt64();
            this.EffectRuleDictionaryPointer = reader.ReadUInt64();
            this.Unknown_58h = reader.ReadUInt32();
            this.Unknown_5Ch = reader.ReadUInt32();

            // read reference data
            this.Name = reader.ReadBlockAt<string_r>(
                this.NamePointer // offset
            );
            this.TextureDictionary = reader.ReadBlockAt<TextureDictionary_GTA5_pc>(
                this.TextureDictionaryPointer // offset
            );
            this.DrawableDictionary = reader.ReadBlockAt<DrawableBaseDictionary_GTA5_pc>(
                this.DrawableDictionaryPointer // offset
            );
            this.ParticleRuleDictionary = reader.ReadBlockAt<ParticleRuleDictionary_GTA5_pc>(
                this.ParticleRuleDictionaryPointer // offset
            );
            this.EmitterRuleDictionary = reader.ReadBlockAt<EmitterRuleDictionary_GTA5_pc>(
                this.EmitterRuleDictionaryPointer // offset
            );
            this.EffectRuleDictionary = reader.ReadBlockAt<EffectRuleDictionary_GTA5_pc>(
                this.EffectRuleDictionaryPointer // offset
            );
        }