Пример #1
0
/*
==================
WriteClipNodes_r

==================
*/
int WriteClipNodes_r (node_t *node)
{
  int			i, c;
  dclipnode_t	*cn;
  int			num;
	
  // FIXME: free more stuff?	
  if (node->planenum == -1)
    {
      num = node->contents;
      free (node);
      return num;
    }
	
  // emit a clipnode
  c = numclipnodes;
  cn = &dclipnodes[numclipnodes];
  numclipnodes++;
  cn->planenum = node->outputplanenum;
  for (i=0 ; i<2 ; i++)
    cn->children[i] = WriteClipNodes_r(node->children[i]);
	
  free (node);
  return c;
}
Пример #2
0
/*
==================
WriteClipNodes_r

==================
*/
int WriteClipNodes_r (node_t *node)
{
	int			i, c;
	dclipnode_t	*cn;
	int			num;
	
	if (node->planenum == -1)
	{
		num = node->contents;
		free (node->markfaces);
		free (node);
		return num;
	}
	
// emit a clipnode
	if (numclipnodes == MAX_MAP_CLIPNODES)
		Error ("MAX_MAP_CLIPNODES");
	c = numclipnodes;
	cn = &dclipnodes[numclipnodes];
	numclipnodes++;
	if (node->planenum & 1)
		Error ("WriteClipNodes_r: odd planenum");
	cn->planenum = node->planenum;
	for (i=0 ; i<2 ; i++)
		cn->children[i] = WriteClipNodes_r(node->children[i]);
	
	free (node);
	return c;
}
Пример #3
0
/*
==================
WriteClipNodes

Called after the clipping hull is completed.  Generates a disk format
representation and frees the original memory.
==================
*/
void WriteClipNodes (node_t *nodes)
{
  headclipnode = numclipnodes;
  WriteClipNodes_r (nodes);
}
Пример #4
0
/*
==================
WriteClipNodes

Called after the clipping hull is completed.  Generates a disk format
representation and frees the original memory.
==================
*/
void WriteClipNodes (node_t *nodes)
{
	WriteClipNodes_r (nodes);
}