engine/EngineModel.c
/*	Duplicate the drawing hull structure as a clipping hull
*/
Duplicate the drawing hull structure as a clipping hull
Duplicate the drawing hull structure as a clipping hull
void Mod_MakeHull0 (void)
{
	mnode_t			*in, *child;
	BSPClipNode_t	*out; 
	int			i, j, count;
	hull_t		*hull;
	hull = &loadmodel->hulls[0];
	in = loadmodel->nodes;
	count = loadmodel->numnodes;
	out = (BSPClipNode_t*)Hunk_AllocName ( count*sizeof(*out), loadname);
	hull->clipnodes = out;
	hull->firstclipnode = 0;
	hull->lastclipnode = count-1;
	hull->planes = loadmodel->planes;
	for (i=0 ; i<count ; i++, out++, in++)
	{
		out->iPlaneNum = in->plane - loadmodel->planes;
		for (j=0 ; j<2 ; j++)
		{
			child = in->children[j];
			if (child->contents < 0)
				out->iChildren[j] = child->contents;
			else
				out->iChildren[j] = child - loadmodel->nodes;
		}
	}
}
void Mod_MakeHull0 ( void ) { mnode_t * in , * child ; BSPClipNode_t * out ; int i , j , count ; hull_t * hull ; hull = & loadmodel -> hulls [ 0 ] ; in = loadmodel -> nodes ; count = loadmodel -> numnodes ; out = ( BSPClipNode_t * ) Hunk_AllocName ( count * sizeof ( * out ) , loadname ) ; hull -> clipnodes = out ; hull -> firstclipnode = 0 ; hull -> lastclipnode = count - 1 ; hull -> planes = loadmodel -> planes ; for ( i = 0 ; i < count ; i ++ , out ++ , in ++ ) { out -> iPlaneNum = in -> plane - loadmodel -> planes ; for ( j = 0 ; j < 2 ; j ++ ) { child = in -> children [ j ] ; if ( child -> contents < 0 ) out -> iChildren [ j ] = child -> contents ; else out -> iChildren [ j ] = child - loadmodel -> nodes ; } } }
Duplicate the drawing hull structure as a clipping hull
Duplicate the drawing hull structure as a clipping hull
//johnfitz -- was dclipnode_t