Fix inverse sort for rects.

svn path=/trunk/; revision=31601
This commit is contained in:
James Tabor 2008-01-05 05:58:40 +00:00
parent 21fd38fc61
commit 3a4e403d40

View file

@ -6,13 +6,20 @@ VOID
FASTCALL FASTCALL
SortRects(PRECT pRect, INT nCount) SortRects(PRECT pRect, INT nCount)
{ {
INT i = 0, a = 0, b = 0; INT i = 0, a = 0, b = 0, c, s;
RECT sRect; RECT sRect;
if (nCount > 0) if (nCount > 0)
{ {
for(;;) i = 1; // set index point
c = nCount; // set inverse count
do
{ {
s = i; // set sort count
if ( i < nCount )
{
a = i - 1;
b = i;
do do
{ {
if(pRect[b].top != pRect[i].bottom) break; if(pRect[b].top != pRect[i].bottom) break;
@ -22,8 +29,12 @@ SortRects(PRECT pRect, INT nCount)
pRect[a] = pRect[b]; pRect[a] = pRect[b];
pRect[b] = sRect; pRect[b] = sRect;
} }
} while(0); ++s;
++b;
} while ( s < nCount );
} }
++i;
} while ( c-- != 1 );
} }
} }