コード例 #1
0
ファイル: ShaderFX.cs プロジェクト: snakewiz/gta-toolkit
        /// <summary>
        /// Reads the data-block from a stream.
        /// </summary>
        public override void Read(ResourceDataReader reader, params object[] parameters)
        {
            // read structure data
            this.ParametersPointer      = reader.ReadUInt64();
            this.ShaderHash             = reader.ReadUInt32();
            this.Unknown_Ch             = reader.ReadUInt32();
            this.ParameterCount         = reader.ReadByte();
            this.DrawBucket             = reader.ReadByte();
            this.Unknown_12h            = reader.ReadUInt16();
            this.ParametersSize         = reader.ReadUInt16();
            this.ParametersTotalSize    = reader.ReadUInt16();
            this.SpsHash                = reader.ReadUInt32();
            this.Unknown_1Ch            = reader.ReadUInt32();
            this.Unknown_20h            = reader.ReadUInt32();
            this.Unknown_24h            = reader.ReadUInt16();
            this.Unknown_26h            = reader.ReadByte();
            this.TextureParametersCount = reader.ReadByte();
            this.Unknown_28h            = reader.ReadUInt32();
            this.Unknown_2Ch            = reader.ReadUInt32();

            // read reference data
            //this.Parameters = reader.ReadBlockAt<ResourceSimpleArray<ShaderParameter_GTA5_pc>>(
            //	this.ParametersPointer, // offset
            //	this.ParameterCount
            //);
            //this.ParameterHashes = reader.ReadBlockAt<SimpleArrayOFFSET<uint_r>>(
            //	this.ParametersPointer, // offset
            //	this.ParameterCount,
            //	this.TextureParametersCount
            //);


            this.ParametersList = reader.ReadBlockAt <ShaderParametersBlock_GTA5_pc>(
                this.ParametersPointer, // offset
                this.ParameterCount
                );
        }
コード例 #2
0
        /// <summary>
        /// Reads the data-block from a stream.
        /// </summary>
        public override void Read(ResourceDataReader reader, params object[] parameters)
        {
            // read structure data
            this.ParametersPointer = reader.ReadUInt64();
            this.Unknown_8h = reader.ReadUInt32();
            this.Unknown_Ch = reader.ReadUInt32();
            this.ParameterCount = reader.ReadByte();
            this.Unknown_11h = reader.ReadByte();
            this.Unknown_12h = reader.ReadUInt16();
            this.Unknown_14h = reader.ReadUInt32();
            this.Unknown_18h = reader.ReadUInt32();
            this.Unknown_1Ch = reader.ReadUInt32();
            this.Unknown_20h = reader.ReadUInt32();
            this.Unknown_24h = reader.ReadUInt16();
            this.Unknown_26h = reader.ReadByte();
            this.TextureParametersCount = reader.ReadByte();
            this.Unknown_28h = reader.ReadUInt32();
            this.Unknown_2Ch = reader.ReadUInt32();

            // read reference data
            //this.Parameters = reader.ReadBlockAt<ResourceSimpleArray<ShaderParameter_GTA5_pc>>(
            //	this.ParametersPointer, // offset
            //	this.ParameterCount
            //);
            //this.ParameterHashes = reader.ReadBlockAt<SimpleArrayOFFSET<uint_r>>(
            //	this.ParametersPointer, // offset
            //	this.ParameterCount,
            //	this.TextureParametersCount
            //);


            this.ParametersList = reader.ReadBlockAt<ShaderParametersBlock_GTA5_pc>(
                this.ParametersPointer, // offset
                this.ParameterCount
            );
        }