src/sgp/MouseSystem.cc
static void MSYS_AddRegionToList(MOUSE_REGION* const r)
{
	/* If region seems to already be in list, delete it so we can re-insert the
	 * region. */
	MSYS_DeleteRegionFromList(r);

	MOUSE_REGION* i = MSYS_RegList;
	if (!i)
	{ // Empty list, so add it straight up.
		MSYS_RegList = r;
	}
	else
	{
		// Walk down list until we find place to insert (or at end of list)
		for (; i->next; i = i->next)
		{
			if (i->PriorityLevel <= r->PriorityLevel) break;
		}

		if (i->PriorityLevel > r->PriorityLevel)
		{ // Add after node
			r->prev = i;
			r->next = i->next;
			if (r->next) r->next->prev = r;
			i->next = r;
		}
		else
		{ // Add before node
			r->prev = i->prev;
			r->next = i;
			*(r->prev ? &r->prev->next : &MSYS_RegList) = r;
			i->prev = r;
		}
	}
}
/* Add a region struct to the current list. The list is sorted by priority
 * levels. If two entries have the same priority level, then the latest to enter
 * the list gets the higher priority. */
Add a region struct to the current list. The list is sorted by priority
levels. If two entries have the same priority level, then the latest to enter
the list gets the higher priority.
Add a region struct to the current list . The list is sorted by priority levels . If two entries have the same priority level then the latest to enter the list gets the higher priority .
static void MSYS_AddRegionToList(MOUSE_REGION* const r)
{
	MSYS_DeleteRegionFromList(r);
	MOUSE_REGION* i = MSYS_RegList;
	if (!i)
	{ 
		MSYS_RegList = r;
	}
	else
	{
		for (; i->next; i = i->next)
		{
			if (i->PriorityLevel <= r->PriorityLevel) break;
		}
		if (i->PriorityLevel > r->PriorityLevel)
		{ 
			r->prev = i;
			r->next = i->next;
			if (r->next) r->next->prev = r;
			i->next = r;
		}
		else
		{ 
			r->prev = i->prev;
			r->next = i;
			*(r->prev ? &r->prev->next : &MSYS_RegList) = r;
			i->prev = r;
		}
	}
}
static void MSYS_AddRegionToList ( MOUSE_REGION * const r ) { MSYS_DeleteRegionFromList ( r ) ; MOUSE_REGION * i = MSYS_RegList ; if ( ! i ) { MSYS_RegList = r ; } else { for ( ; i -> next ; i = i -> next ) { if ( i -> PriorityLevel <= r -> PriorityLevel ) break ; } if ( i -> PriorityLevel > r -> PriorityLevel ) { r -> prev = i ; r -> next = i -> next ; if ( r -> next ) r -> next -> prev = r ; i -> next = r ; } else { r -> prev = i -> prev ; r -> next = i ; * ( r -> prev ? & r -> prev -> next : & MSYS_RegList ) = r ; i -> prev = r ; } } }
Add a region struct to the current list.
Add a region struct to the current list .
/* If region seems to already be in list, delete it so we can re-insert the
	 * region. */ // Empty list, so add it straight up. // Walk down list until we find place to insert (or at end of list) // Add after node // Add before node