D3D9: Rework the converted vertex declaration management
H. Verbeet
hverbeet at gmail.com
Mon Apr 16 01:47:48 CDT 2007
On 16/04/07, Stefan Dösinger <stefan at codeweavers.com> wrote:
> I have hope that this fixes the converted decl issues finally(appart of
> sorting the array, which will be another patch)
>
> + convertedDecls = HeapAlloc(GetProcessHeap(), 0, sizeof(IDirect3DVertexDeclaration9 *) * (This->numConvertedDecls + 1));
> + if(!convertedDecls) {
> + /* This will destroy it */
> + IDirect3DVertexDeclaration9_Release(pDecl);
> + return NULL;
> + }
> +
> + memcpy(convertedDecls, This->convertedDecls, sizeof(IDirect3DVertexDeclaration9 *) * (This->numConvertedDecls));
> + HeapFree(GetProcessHeap(), 0, This->convertedDecls);
Growing the array by a single element each time looks a bit expensive.
Also note that you could use HeapReAlloc there.
More information about the wine-patches
mailing list