[2/5] d3dx9: Support triangulation of complex glyphs in D3DXCreateText.

Alexandre Julliard julliard at winehq.org
Wed Mar 9 07:02:11 CST 2011


Dylan Smith <dylan.ah.smith at gmail.com> writes:

> +static void sort_vertex_indices(struct point2d_index *start, int count)
> +{
> +    struct point2d_index *current, *middle_value, *last;
> +    int below_count;
> +
> +    if (count <= 1)
> +        return;
> +
> +    /* quick sort */
> +    last = start + count - 1;
> +    middle_value = last--;
> +    current = start;
> +    while (current <= last)
> +    {
> +        if (compare_vertex_indices(current, middle_value) < 0) {
> +            current++;
> +        } else {
> +            swap_vertex_indices(current, last);
> +            last--;
> +        }
> +    }
> +    swap_vertex_indices(current, middle_value);
> +
> +    below_count = current - start;
> +    sort_vertex_indices(start, below_count);
> +    sort_vertex_indices(current + 1, count - below_count - 1);
> +}

Is there a reason for not using qsort?

-- 
Alexandre Julliard
julliard at winehq.org



More information about the wine-devel mailing list