Esempio 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.Unknown_8h          = reader.ReadUInt32();
            this.Unknown_Ch          = reader.ReadUInt32();
            this.Unknown_10h         = reader.ReadUInt32();
            this.Unknown_14h         = reader.ReadUInt32();
            this.VertexBufferPointer = reader.ReadUInt64();
            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.IndexBufferPointer  = reader.ReadUInt64();
            this.Unknown_40h         = reader.ReadUInt32();
            this.Unknown_44h         = reader.ReadUInt32();
            this.Unknown_48h         = reader.ReadUInt32();
            this.Unknown_4Ch         = reader.ReadUInt32();
            this.Unknown_50h         = reader.ReadUInt32();
            this.Unknown_54h         = reader.ReadUInt32();
            this.IndicesCount        = reader.ReadUInt32();
            this.Unknown_5Ch         = reader.ReadUInt32();
            this.VerticesCount       = reader.ReadUInt16();
            this.Unknown_62h         = reader.ReadUInt16();
            this.Unknown_64h         = reader.ReadUInt32();
            this.Unknown_68h_Pointer = reader.ReadUInt64();
            this.VertexStride        = reader.ReadUInt16();
            this.Count1              = reader.ReadUInt16();
            this.Unknown_74h         = reader.ReadUInt32();
            this.VertexDataPointer   = reader.ReadUInt64();
            this.Unknown_80h         = reader.ReadUInt32();
            this.Unknown_84h         = reader.ReadUInt32();
            this.Unknown_88h         = reader.ReadUInt32();
            this.Unknown_8Ch         = reader.ReadUInt32();
            this.Unknown_90h         = reader.ReadUInt32();
            this.Unknown_94h         = reader.ReadUInt32();

            // read reference data
            this.VertexBuffer = reader.ReadBlockAt <VertexBuffer_GTA5_pc>(
                this.VertexBufferPointer // offset
                );
            this.IndexBuffer = reader.ReadBlockAt <IndexBuffer_GTA5_pc>(
                this.IndexBufferPointer // offset
                );
            this.Unknown_68h_Data = reader.ReadBlockAt <ResourceSimpleArray <ushort_r> >(
                this.Unknown_68h_Pointer, // offset
                this.Count1
                );
            this.VertexData = reader.ReadBlockAt <VertexData_GTA5_pc>(
                this.VertexDataPointer, // offset
                this.VertexStride,
                this.VerticesCount
                );
        }
        /// <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.Unknown_8h = reader.ReadUInt32();
            this.Unknown_Ch = reader.ReadUInt32();
            this.Unknown_10h = reader.ReadUInt32();
            this.Unknown_14h = reader.ReadUInt32();
            this.VertexBufferPointer = reader.ReadUInt64();
            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.IndexBufferPointer = reader.ReadUInt64();
            this.Unknown_40h = reader.ReadUInt32();
            this.Unknown_44h = reader.ReadUInt32();
            this.Unknown_48h = reader.ReadUInt32();
            this.Unknown_4Ch = reader.ReadUInt32();
            this.Unknown_50h = reader.ReadUInt32();
            this.Unknown_54h = reader.ReadUInt32();
            this.IndicesCount = reader.ReadUInt32();
            this.Unknown_5Ch = reader.ReadUInt32();
            this.VerticesCount = reader.ReadUInt16();
            this.Unknown_62h = reader.ReadUInt16();
            this.Unknown_64h = reader.ReadUInt32();
            this.Unknown_68h_Pointer = reader.ReadUInt64();
            this.VertexStride = reader.ReadUInt16();
            this.Count1 = reader.ReadUInt16();
            this.Unknown_74h = reader.ReadUInt32();
            this.VertexDataPointer = reader.ReadUInt64();
            this.Unknown_80h = reader.ReadUInt32();
            this.Unknown_84h = reader.ReadUInt32();
            this.Unknown_88h = reader.ReadUInt32();
            this.Unknown_8Ch = reader.ReadUInt32();
            this.Unknown_90h = reader.ReadUInt32();
            this.Unknown_94h = reader.ReadUInt32();

            // read reference data
            this.VertexBuffer = reader.ReadBlockAt<VertexBuffer_GTA5_pc>(
                this.VertexBufferPointer // offset
            );
            this.IndexBuffer = reader.ReadBlockAt<IndexBuffer_GTA5_pc>(
                this.IndexBufferPointer // offset
            );
            this.Unknown_68h_Data = reader.ReadBlockAt<ResourceSimpleArray<ushort_r>>(
                this.Unknown_68h_Pointer, // offset
                this.Count1
            );
            this.VertexData = reader.ReadBlockAt<VertexData_GTA5_pc>(
                this.VertexDataPointer, // offset
                this.VertexStride,
                this.VerticesCount
            );
        }