if ( ds->numVerts == 0 || ds->type != SURFACE_PATCH || ( patchMeta == qfalse && !forcePatchMeta ) ) {
return;
}
+
/* make a mesh from the drawsurf */
src.width = ds->patchWidth;
src.height = ds->patchHeight;
ClassifySurfaces( 1, ds );
}
+
+
#define TINY_AREA 1.0f
#define MAXAREA_MAXTRIES 8
int MaxAreaIndexes( bspDrawVert_t *vert, int cnt, int *indexes ){
return -1;
}
+
+
/*
MaxAreaFaceSurface() - divVerent
creates a triangle list using max area indexes
}
+
/*
FanFaceSurface() - ydnar
creates a tri-fan from a brush face winding
/* add a new vertex at the beginning of the surface */
verts = safe_malloc( ( ds->numVerts + 1 ) * sizeof( bspDrawVert_t ) );
+ /* beware to only zero the new vertexi at the beginning, nor more! */
memset( verts, 0, sizeof( bspDrawVert_t ) );
memcpy( &verts[ 1 ], ds->verts, ds->numVerts * sizeof( bspDrawVert_t ) );
free( ds->verts );
}
+
/*
EmitMetaStatictics
vortex: prints meta statistics in general output
Sys_Printf( "%9d meta triangles\n", numMetaTriangles );
}
+
+
/*
MakeEntityMetaTriangles()
builds meta triangles from brush faces (tristrips and fans)
Sys_FPrintf( SYS_VRB, "--- SmoothMetaTriangles ---\n" );
/* allocate shade angle table */
- shadeAngles = safe_malloc( numMetaVerts * sizeof( float ) );
- memset( shadeAngles, 0, numMetaVerts * sizeof( float ) );
+ shadeAngles = safe_malloc0( numMetaVerts * sizeof( float ) );
/* allocate smoothed table */
cs = ( numMetaVerts / 8 ) + 1;
- smoothed = safe_malloc( cs );
- memset( smoothed, 0, cs );
+ smoothed = safe_malloc0( cs );
/* set default shade angle */
defaultShadeAngle = DEG2RAD( npDegrees );
}
}
-
-
if ( metaMaxBBoxDistance >= 0 ) {
if ( ds->numIndexes > 0 ) {
VectorCopy( ds->mins, mins );
( bi == ds->indexes[ i ] && ci == ds->indexes[ i + 2 ] && ai == ds->indexes[ i + 1 ] ) ||
( ci == ds->indexes[ i ] && ai == ds->indexes[ i + 2 ] && bi == ds->indexes[ i + 1 ] ) ) {
/* warn about it */
- Sys_Printf( "WARNING: Flipped triangle: (%6.0f %6.0f %6.0f) (%6.0f %6.0f %6.0f) (%6.0f %6.0f %6.0f)\n",
+ Sys_FPrintf( SYS_WRN, "WARNING: Flipped triangle: (%6.0f %6.0f %6.0f) (%6.0f %6.0f %6.0f) (%6.0f %6.0f %6.0f)\n",
ds->verts[ ai ].xyz[ 0 ], ds->verts[ ai ].xyz[ 1 ], ds->verts[ ai ].xyz[ 2 ],
ds->verts[ bi ].xyz[ 0 ], ds->verts[ bi ].xyz[ 1 ], ds->verts[ bi ].xyz[ 2 ],
ds->verts[ ci ].xyz[ 0 ], ds->verts[ ci ].xyz[ 1 ], ds->verts[ ci ].xyz[ 2 ] );