level/csg4.c
/*	Returns a chain of all the external surfaces with one or more visible
	faces.
*/
Returns a chain of all the external surfaces with one or more visible
faces.
Returns a chain of all the external surfaces with one or more visible faces .
void BuildSurfaces( tree_t *tree )
{
	int			i;
	face_t		**f;
	face_t		*count;
	surface_t	*s;
	surface_t	*surfhead;
	surfhead = NULL;
	for( i = 0, f = tree->validfaces; i < nummapplanes; i++, f++ ) 
	{
		if( !*f )
			continue;	
		s = AllocSurface ();
		s->planenum = i;
		s->next = surfhead;
		surfhead = s;
		s->faces = *f;
		for( count = s->faces; count; count = count->next )
			numcsgmergefaces++;
		CalcSurfaceInfo( s );	
	}
	tree->surfaces = surfhead;
}
void BuildSurfaces ( tree_t * tree ) { int i ; face_t * * f ; face_t * count ; surface_t * s ; surface_t * surfhead ; surfhead = NULL ; for ( i = 0 , f = tree -> validfaces ; i < nummapplanes ; i ++ , f ++ ) { if ( ! * f ) continue ; s = AllocSurface ( ) ; s -> planenum = i ; s -> next = surfhead ; surfhead = s ; s -> faces = * f ; for ( count = s -> faces ; count ; count = count -> next ) numcsgmergefaces ++ ; CalcSurfaceInfo ( s ) ; } tree -> surfaces = surfhead ; }
Returns a chain of all the external surfaces with one or more visible
faces.
Returns a chain of all the external surfaces with one or more visible faces .
// nothing left on this plane // create a new surface to hold the faces on this plane // bounding box and flags