level/vis.c
/*
=============
GetNextPortal

Returns the next portal for a thread to work on
Returns the portals from the least complex, so the later ones can reuse
the earlier information.
=============
*/
GetNextPortal
Returns the next portal for a thread to work on
Returns the portals from the least complex, so the later ones can reuse
the earlier information.
GetNextPortal Returns the next portal for a thread to work on Returns the portals from the least complex so the later ones can reuse the earlier information .
portal_t *GetNextPortal (void)
{
	int		j;
	portal_t	*p, *tp;
	int		min;
	int		pass;
	min = 99999;
	p = NULL;
	for (pass = 0;pass < 256;pass++)
	{
		for (j=pass, tp = portals+j ; j<numportals*2 ; j += 256, tp += 256)
		{
			if (tp->nummightsee < min && tp->status == stat_none)
			{
				min = tp->nummightsee;
				p = tp;
			}
		}
	}
	if (p)
		p->status = stat_working;
	return p;
}
portal_t * GetNextPortal ( void ) { int j ; portal_t * p , * tp ; int min ; int pass ; min = 99999 ; p = NULL ; for ( pass = 0 ; pass < 256 ; pass ++ ) { for ( j = pass , tp = portals + j ; j < numportals * 2 ; j += 256 , tp += 256 ) { if ( tp -> nummightsee < min && tp -> status == stat_none ) { min = tp -> nummightsee ; p = tp ; } } } if ( p ) p -> status = stat_working ; return p ; }
GetNextPortal
Returns the next portal for a thread to work on
Returns the portals from the least complex, so the later ones can reuse
the earlier information.
GetNextPortal Returns the next portal for a thread to work on Returns the portals from the least complex so the later ones can reuse the earlier information .