internal static SdkMeshRawVertexBufferHeader Read(BinaryReader reader)
        {
            var header = new SdkMeshRawVertexBufferHeader
            {
                NumVertices = reader.ReadInt64(),
                SizeBytes   = reader.ReadInt64(),
                StrideBytes = reader.ReadInt64()
            };

            bool add = true;

            for (int i = 0; i < MaxVertexElements; i++)
            {
                D3DVertexElement element = D3DVertexElement.Read(reader);

                if (add && element.Type == D3DDeclType.Unused)
                {
                    add = false;
                }

                if (add)
                {
                    header.Decl.Add(element);
                }
            }

            header.DataOffset = reader.ReadInt64();

            return(header);
        }
コード例 #2
0
        internal static D3DVertexElement Read(BinaryReader reader)
        {
            var element = new D3DVertexElement
            {
                StreamIndex = reader.ReadInt16(),
                Offset      = reader.ReadInt16(),
                Type        = (D3DDeclType)reader.ReadByte(),
                Method      = (D3DDeclMethod)reader.ReadByte(),
                Usage       = (D3DDeclUsage)reader.ReadByte(),
                UsageIndex  = reader.ReadByte()
            };

            return(element);
        }