[4/5] d3dx9: Implement D3DXMESHOPT_ATTRSORT vertex reordering.

Matteo Bruni matteo.mystral at gmail.com
Sun May 8 14:18:54 CDT 2011


2011/5/6 Dylan Smith <dylan.ah.smith at gmail.com>:
> +struct vertex_attrib_duplication {
> +    DWORD attrib;
> +    DWORD vertex_index;
> +    struct vertex_attrib_duplication *ptr;
> +};
...
> +            struct vertex_attrib_duplication **heads = NULL; /* head of list for each vertex */

You probably want to use Wine lists (from include/wine/list.h) instead
of your own implementation.

> +            heads = HeapAlloc(GetProcessHeap(), 0, This->numvertices * sizeof(*heads) + max_entries * sizeof(*duplications));
> +            duplications = (struct vertex_attrib_duplication *)(heads + This->numvertices);

I'm not sure why you are usually sticking together many arrays in a
single allocation. Economizing on the number of HeapAllocs is not a
great reason IMHO.



More information about the wine-devel mailing list