if ( fabs( dist ) > PLANAR_EPSILON ) {
//% if( ds->planeNum >= 0 )
//% {
- //% Sys_Printf( "WARNING: Planar surface marked unplanar (%f > %f)\n", fabs( dist ), PLANAR_EPSILON );
+ //% Sys_FPrintf( SYS_WRN, "WARNING: Planar surface marked unplanar (%f > %f)\n", fabs( dist ), PLANAR_EPSILON );
//% ds->verts[ i ].color[ 0 ][ 0 ] = ds->verts[ i ].color[ 0 ][ 2 ] = 0;
//% }
ds->planar = qfalse;
ds->planeNum = -1;
VectorClear( ds->lightmapVecs[ 2 ] );
//% if( ds->type == SURF_META || ds->type == SURF_FACE )
- //% Sys_Printf( "WARNING: Non-planar face (%d): %s\n", ds->planeNum, ds->shaderInfo->shader );
+ //% Sys_FPrintf( SYS_WRN, "WARNING: Non-planar face (%d): %s\n", ds->planeNum, ds->shaderInfo->shader );
}
/* -----------------------------------------------------------------
}
+#define snprintf_ignore(s, n, format, ...) do { \
+ size_t __n = snprintf(s, n, format, __VA_ARGS__); \
+ if (n >= n) {} /* truncated, ignore */ \
+} while (0)
/*
GetIndexedShader() - ydnar
/* make a shader name */
if ( minShaderIndex == maxShaderIndex ) {
- sprintf( shader, "textures/%s_%d", im->shader, maxShaderIndex );
+ snprintf_ignore( shader, sizeof shader, "textures/%s_%d", im->shader, maxShaderIndex );
}
else{
- sprintf( shader, "textures/%s_%dto%d", im->shader, minShaderIndex, maxShaderIndex );
+ snprintf_ignore( shader, sizeof shader, "textures/%s_%dto%d", im->shader, minShaderIndex, maxShaderIndex );
}
/* get the shader */
/* ydnar: sky hack/fix for GL_CLAMP borders on ati cards */
if ( skyFixHack && si->skyParmsImageBase[ 0 ] != '\0' ) {
//% Sys_FPrintf( SYS_VRB, "Enabling sky hack for shader %s using env %s\n", si->shader, si->skyParmsImageBase );
- sprintf( tempShader, "%s_lf", si->skyParmsImageBase );
+ snprintf_ignore( tempShader, sizeof tempShader, "%s_lf", si->skyParmsImageBase );
DrawSurfaceForShader( tempShader );
- sprintf( tempShader, "%s_rt", si->skyParmsImageBase );
+ snprintf_ignore( tempShader, sizeof tempShader, "%s_rt", si->skyParmsImageBase );
DrawSurfaceForShader( tempShader );
- sprintf( tempShader, "%s_ft", si->skyParmsImageBase );
+ snprintf_ignore( tempShader, sizeof tempShader, "%s_ft", si->skyParmsImageBase );
DrawSurfaceForShader( tempShader );
- sprintf( tempShader, "%s_bk", si->skyParmsImageBase );
+ snprintf_ignore( tempShader, sizeof tempShader, "%s_bk", si->skyParmsImageBase );
DrawSurfaceForShader( tempShader );
- sprintf( tempShader, "%s_up", si->skyParmsImageBase );
+ snprintf_ignore( tempShader, sizeof tempShader, "%s_up", si->skyParmsImageBase );
DrawSurfaceForShader( tempShader );
- sprintf( tempShader, "%s_dn", si->skyParmsImageBase );
+ snprintf_ignore( tempShader, sizeof tempShader, "%s_dn", si->skyParmsImageBase );
DrawSurfaceForShader( tempShader );
}
/* spew forth errors */
if ( VectorLength( plane ) < 0.001f ) {
- Sys_Printf( "BOGUS " );
+ Sys_Printf( "DrawSurfaceForMesh: bogus plane\n" );
}
/* test each vert */
return AddReferenceToLeaf( ds, node );
}
+
+
/*
FilterPointConvexHullIntoTree_r() - ydnar
filters the convex hull of multiple points from a surface into the tree
}
+
/*
FilterWindingIntoTree_r() - ydnar
filters a winding from a drawsurface into the tree
si->mins[ 2 ] != 0.0f || si->maxs[ 2 ] != 0.0f ) ) {
static qboolean warned = qfalse;
if ( !warned ) {
- Sys_Printf( "WARNING: this map uses the deformVertexes move hack\n" );
+ Sys_FPrintf( SYS_WRN, "WARNING: this map uses the deformVertexes move hack\n" );
warned = qtrue;
}
return FilterWindingIntoTree_r( w, ds, node->children[ 1 ] );
}
#else
+ (void) plane2;
/* div0: this is the cholera (doesn't hit enough) */
/* the drawsurf might have an associated plane, if so, force a filter here */
/* validate the index */
if ( ds->type != SURFACE_PATCH ) {
if ( bspDrawIndexes[ numBSPDrawIndexes ] < 0 || bspDrawIndexes[ numBSPDrawIndexes ] >= ds->numVerts ) {
- Sys_Printf( "WARNING: %d %s has invalid index %d (%d)\n",
+ Sys_FPrintf( SYS_WRN, "WARNING: %d %s has invalid index %d (%d)\n",
numBSPDrawSurfaces,
ds->shaderInfo->shader,
bspDrawIndexes[ numBSPDrawIndexes ],
numSurfacesByType[ ds->type ]++;
}
+
+
/*
EmitPatchSurface()
emits a bsp patch drawsurface
numSurfacesByType[ ds->type ]++;
}
+
+
/*
OptimizeTriangleSurface() - ydnar
optimizes the vertex/index data in a triangle surface
}
+
/*
MakeDebugPortalSurfs_r() - ydnar
generates drawsurfaces for passable portals in the bsp
bspDrawSurface_t *out;
out = &bspDrawSurfaces[ numBSPDrawSurfaces - 1 ];
if ( out->numVerts == 3 && out->numIndexes > 3 ) {
- Sys_Printf( "\nWARNING: Potentially bad %s surface (%d: %d, %d)\n %s\n",
+ Sys_FPrintf( SYS_WRN, "WARNING: Potentially bad %s surface (%d: %d, %d)\n %s\n",
surfaceTypes[ ds->type ],
numBSPDrawSurfaces - 1, out->numVerts, out->numIndexes, si->shader );
}