Example #1
0
File: fog.c Project: Elzair/q3map2
winding_t *WindingFromDrawSurf( mapDrawSurface_t *ds ){
	winding_t   *w;
	int i;

	// we use the first point of the surface, maybe something more clever would be useful
	// (actually send the whole draw surface would be cool?)
	if ( ds->numVerts >= MAX_POINTS_ON_WINDING ) {
		int max = ds->numVerts;
		vec3_t p[256];

		if ( max > 256 ) {
			max = 256;
		}

		for ( i = 0 ; i < max ; i++ ) {
			VectorCopy( ds->verts[i].xyz, p[i] );
		}

		xml_Winding( "WindingFromDrawSurf failed: MAX_POINTS_ON_WINDING exceeded", p, max, qtrue );
	}

	w = AllocWinding( ds->numVerts );
	w->numpoints = ds->numVerts;
	for ( i = 0 ; i < ds->numVerts ; i++ ) {
		VectorCopy( ds->verts[i].xyz, w->p[i] );
	}
	return w;
}
Example #2
0
/*
==================
MakeTreePortals_r
==================
*/
void MakeTreePortals_r (node_t *node)
{
    int		i;

    CalcNodeBounds (node);
    if (node->mins[0] >= node->maxs[0])
    {
        Sys_Printf ("WARNING: node without a volume\n");
        Sys_Printf("node has %d tiny portals\n", node->tinyportals);
        Sys_Printf("node reference point %1.2f %1.2f %1.2f\n", node->referencepoint[0],
                   node->referencepoint[1],
                   node->referencepoint[2]);
    }

    for (i=0 ; i<3 ; i++)
    {
        if (node->mins[i] < MIN_WORLD_COORD || node->maxs[i] > MAX_WORLD_COORD)
        {
            if(node->portals && node->portals->winding)
                xml_Winding("WARNING: Node With Unbounded Volume", node->portals->winding->p, node->portals->winding->numpoints, qfalse);

            break;
        }
    }
    if (node->planenum == PLANENUM_LEAF)
        return;

    MakeNodePortal (node);
    SplitNodePortals (node);

    MakeTreePortals_r (node->children[0]);
    MakeTreePortals_r (node->children[1]);
}
Example #3
0
void Sys_Error(winding_t *winding, const char *text, ... )
{
	char out_buffer[4096];
	va_list argptr;

	/* print */
	va_start( argptr, text );
	vsprintf( out_buffer, text, argptr );
	va_end( argptr );

	/* send */
	xml_Winding( out_buffer, winding->p, winding->numpoints, qtrue );
}
Example #4
0
void Sys_Error(vec3_t windingpoints[], int numpoints, const char *text, ... )
{
	char out_buffer[4096];
	va_list argptr;

	/* print */
	va_start( argptr, text );
	vsprintf( out_buffer, text, argptr );
	va_end( argptr );

	/* send */
	xml_Winding( out_buffer, windingpoints, numpoints, qtrue );
}