[raster] Instantly remove profiles from linked lists.
* src/raster/ftraster.c (DelOld): Remove loopy function. (Draw_Sweep): Implement instant profile removal.
This commit is contained in:
parent
6d6607b8b3
commit
046c4fc7be
|
@ -2017,39 +2017,6 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**************************************************************************
|
|
||||||
*
|
|
||||||
* DelOld
|
|
||||||
*
|
|
||||||
* Removes an old profile from a linked list.
|
|
||||||
*/
|
|
||||||
static void
|
|
||||||
DelOld( PProfileList list,
|
|
||||||
const PProfile profile )
|
|
||||||
{
|
|
||||||
PProfile *old, current;
|
|
||||||
|
|
||||||
|
|
||||||
old = list;
|
|
||||||
current = *old;
|
|
||||||
|
|
||||||
while ( current )
|
|
||||||
{
|
|
||||||
if ( current == profile )
|
|
||||||
{
|
|
||||||
*old = current->link;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
old = ¤t->link;
|
|
||||||
current = *old;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* we should never get there, unless the profile was not part of */
|
|
||||||
/* the list. */
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
*
|
*
|
||||||
* Sort
|
* Sort
|
||||||
|
@ -2589,7 +2556,7 @@
|
||||||
Int min_Y, max_Y, dropouts;
|
Int min_Y, max_Y, dropouts;
|
||||||
Int y, y_change, y_height;
|
Int y, y_change, y_height;
|
||||||
|
|
||||||
PProfile P, Q, P_Left, P_Right;
|
PProfile *Q, P, P_Left, P_Right;
|
||||||
|
|
||||||
TProfileList waiting = ras.fProfile;
|
TProfileList waiting = ras.fProfile;
|
||||||
TProfileList draw_left = NULL;
|
TProfileList draw_left = NULL;
|
||||||
|
@ -2625,23 +2592,22 @@
|
||||||
{
|
{
|
||||||
/* check waiting list for new profile activations */
|
/* check waiting list for new profile activations */
|
||||||
|
|
||||||
P = waiting;
|
Q = &waiting;
|
||||||
|
while ( *Q )
|
||||||
while ( P )
|
|
||||||
{
|
{
|
||||||
Q = P->link;
|
P = *Q;
|
||||||
P->countL -= y_height;
|
P->countL -= y_height;
|
||||||
if ( P->countL == 0 )
|
if ( P->countL == 0 )
|
||||||
{
|
{
|
||||||
DelOld( &waiting, P );
|
*Q = P->link; /* remove */
|
||||||
|
|
||||||
if ( P->flags & Flow_Up )
|
if ( P->flags & Flow_Up )
|
||||||
InsNew( &draw_left, P );
|
InsNew( &draw_left, P );
|
||||||
else
|
else
|
||||||
InsNew( &draw_right, P );
|
InsNew( &draw_right, P );
|
||||||
}
|
}
|
||||||
|
else
|
||||||
P = Q;
|
Q = &P->link;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* sort the drawing lists */
|
/* sort the drawing lists */
|
||||||
|
@ -2719,22 +2685,24 @@
|
||||||
|
|
||||||
/* remove exhausted profiles */
|
/* remove exhausted profiles */
|
||||||
|
|
||||||
P = draw_left;
|
Q = &draw_left;
|
||||||
while ( P )
|
while ( *Q )
|
||||||
{
|
{
|
||||||
Q = P->link;
|
P = *Q;
|
||||||
if ( P->height == 0 )
|
if ( P->height == 0 )
|
||||||
DelOld( &draw_left, P );
|
*Q = P->link;
|
||||||
P = Q;
|
else
|
||||||
|
Q = &P->link;
|
||||||
}
|
}
|
||||||
|
|
||||||
P = draw_right;
|
Q = &draw_right;
|
||||||
while ( P )
|
while ( *Q )
|
||||||
{
|
{
|
||||||
Q = P->link;
|
P = *Q;
|
||||||
if ( P->height == 0 )
|
if ( P->height == 0 )
|
||||||
DelOld( &draw_right, P );
|
*Q = P->link;
|
||||||
P = Q;
|
else
|
||||||
|
Q = &P->link;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue