Re: [2/5] d3dx9: Support triangulation of complex glyphs in D3DXCreateText.
Dylan Smith <dylan.ah.smith(a)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(a)winehq.org
On Wed, Mar 9, 2011 at 8:02 AM, Alexandre Julliard <julliard(a)winehq.org>wrote:
Is there a reason for not using qsort?
No.
I didn't realize the function existed in the c standard library.
participants (2)
-
Alexandre Julliard -
Dylan Smith