Exemplo n.º 1
0
        public void DeserializeExtraData(BinaryReader reader)
        {
            VertexElementCount = reader.ReadUInt32();
            uint vertexStreamCount = reader.ReadUInt32();

            IsStreaming = reader.ReadBooleanStrict();

            Streams = new VertexStream[vertexStreamCount];

            for (int i = 0; i < Streams.Length; i++)
            {
                var stream = new VertexStream();
                Streams[i] = stream;

                stream.Flags = reader.ReadUInt32();
                uint vertexByteStride = reader.ReadUInt32();
                stream.UnknownData = new byte[reader.ReadUInt32()][];

                for (uint j = 0; j < stream.UnknownData.Length; j++)
                {
                    // 4 bytes read separately
                    stream.UnknownData[j] = reader.ReadBytesStrict(4);
                }

                stream.GUID   = GGUUID.FromData(reader);
                stream.Buffer = HwBuffer.FromVertexData(reader, IsStreaming, vertexByteStride, VertexElementCount);
            }
        }
        public void DeserializeExtraData(BinaryReader reader)
        {
            uint vertexElementCount = reader.ReadUInt32();
            uint vertexStreamCount  = reader.ReadUInt32();
            bool isStreaming        = reader.ReadBooleanStrict();

            ResourceGUIDs = new GGUUID[vertexStreamCount];
            Buffers       = new HwBuffer[vertexStreamCount];

            for (uint i = 0; i < Buffers.Length; i++)
            {
                uint unknownFlags     = reader.ReadUInt32();
                uint vertexByteStride = reader.ReadUInt32();
                uint unknownCounter   = reader.ReadUInt32();

                for (uint j = 0; j < unknownCounter; j++)
                {
                    // 4 bytes read separately
                    var packedData = reader.ReadBytesStrict(4);
                }

                ResourceGUIDs[i] = GGUUID.FromData(reader);
                Buffers[i]       = HwBuffer.FromVertexData(reader, isStreaming, vertexByteStride, vertexElementCount);
            }
        }