예제 #1
0
void PrintTree_r (node_t *node, int depth)
{
	int			i;
	uBrush_t	*bb;

	for (i=0 ; i<depth ; i++)
		common->Printf("  ");
	if (node->planenum == PLANENUM_LEAF)
	{
		if (!node->brushlist)
			common->Printf("NULL\n");
		else
		{
			for (bb=node->brushlist ; bb ; bb=bb->next)
				common->Printf("%i ", bb->original->brushnum);
			common->Printf("\n");
		}
		return;
	}

	idPlane &plane = dmapGlobals.mapPlanes[node->planenum];
	common->Printf( "#%i (%5.2f %5.2f %5.2f %5.2f)\n", node->planenum,
					plane[0], plane[1], plane[2], plane[3] );
	PrintTree_r( node->children[0], depth+1 );
	PrintTree_r( node->children[1], depth+1 );
}
예제 #2
0
void PrintTree_r( node_t *node, int depth ){
	int i;
	plane_t *plane;
	bspbrush_t  *bb;

	for ( i = 0 ; i < depth ; i++ )
		Sys_Printf( "  " );
	if ( node->planenum == PLANENUM_LEAF ) {
		if ( !node->brushlist ) {
			Sys_Printf( "NULL\n" );
		}
		else
		{
			for ( bb = node->brushlist ; bb ; bb = bb->next )
				Sys_Printf( "%i ", bb->original->brushnum );
			Sys_Printf( "\n" );
		}
		return;
	}

	plane = &mapplanes[node->planenum];
	Sys_Printf( "#%i (%5.2f %5.2f %5.2f):%5.2f\n", node->planenum,
				plane->normal[0], plane->normal[1], plane->normal[2],
				plane->dist );
	PrintTree_r( node->children[0], depth + 1 );
	PrintTree_r( node->children[1], depth + 1 );
}