q3map2 * modify message flags system to allow SYS_WRN | SYS_VRB, SYS_ERR | SYS_NOXML etc combinations

This commit is contained in:
Garux 2018-03-20 19:37:47 +03:00
parent 0f65e67896
commit 43202af380
21 changed files with 95 additions and 89 deletions

View File

@ -626,7 +626,7 @@ void UnparseEntities( void ) {
continue; // ent got removed
}
strcat( end,"{\n" );
strcat( end, "{\n" );
end += 2;
for ( ep = entities[i].epairs ; ep ; ep = ep->next ) {
@ -639,7 +639,7 @@ void UnparseEntities( void ) {
strcat( end, line );
end += strlen( line );
}
strcat( end,"}\n" );
strcat( end, "}\n" );
end += 2;
if ( end > buf + MAX_MAP_ENTSTRING ) {

View File

@ -94,7 +94,7 @@ void xml_SendNode( xmlNodePtr node ){
}
else{
size = MAX_NETMESSAGE - 10;
Sys_FPrintf( SYS_NOXML, "Got to split the buffer\n" ); //++timo just a debug thing
Sys_FPrintf( SYS_NOXMLflag | SYS_WRN, "Got to split the buffer\n" ); //++timo just a debug thing
}
memcpy( xmlbuf, xml_buf->content + pos, size );
xmlbuf[size] = '\0';
@ -118,9 +118,9 @@ void xml_SendNode( xmlNodePtr node ){
// if we send that we are probably gonna break the stream at the other end..
// and Error will call right there
//Error( "MAX_NETMESSAGE exceeded for XML feedback stream in FPrintf (%d)\n", xml_buf->use);
Sys_FPrintf( SYS_NOXML, "MAX_NETMESSAGE exceeded for XML feedback stream in FPrintf (%d)\n", xml_buf->use );
Sys_FPrintf( SYS_NOXMLflag | SYS_WRN, "MAX_NETMESSAGE exceeded for XML feedback stream in FPrintf (%d)\n", xml_buf->use );
xml_buf->content[xml_buf->use] = '\0'; //++timo this corrupts the buffer but we don't care it's for printing
Sys_FPrintf( SYS_NOXML, xml_buf->content );
Sys_FPrintf( SYS_NOXMLflag | SYS_WRN, xml_buf->content );
}
@ -160,7 +160,7 @@ void xml_Select( char *msg, int entitynum, int brushnum, qboolean bError ){
Error( buf );
}
else{
Sys_FPrintf( SYS_NOXML, "%s\n", buf );
Sys_FPrintf( SYS_NOXMLflag | SYS_WRN, "%s\n", buf );
}
}
@ -247,7 +247,9 @@ void set_console_colour_for_flag( int flag ){
}
if( curFlag != flag ){
curFlag = flag;
SetConsoleTextAttribute( hConsole, flag == SYS_WRN ? FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_INTENSITY : flag == SYS_ERR ? FOREGROUND_RED | FOREGROUND_INTENSITY : colour_saved );
SetConsoleTextAttribute( hConsole, flag == SYS_WRN ? FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_INTENSITY
: flag == SYS_ERR ? FOREGROUND_RED | FOREGROUND_INTENSITY
: colour_saved );
}
#endif
}
@ -333,11 +335,11 @@ void xml_message_push( int flag, const char* characters, size_t length ){
void FPrintf( int flag, char *buf ){
static qboolean bGotXML = qfalse;
set_console_colour_for_flag( flag );
set_console_colour_for_flag( flag & ~( SYS_NOXMLflag | SYS_VRBflag ) );
printf( "%s", buf );
// the following part is XML stuff only.. but maybe we don't want that message to go down the XML pipe?
if ( flag == SYS_NOXML ) {
if ( flag & SYS_NOXMLflag ) {
return;
}
@ -355,7 +357,7 @@ void FPrintf( int flag, char *buf ){
doc->children = xmlNewDocRawNode( doc, NULL, (xmlChar*)"q3map_feedback", NULL );
bGotXML = qtrue;
}
xml_message_push( flag, buf, strlen( buf ) );
xml_message_push( flag & ~( SYS_NOXMLflag | SYS_VRBflag ), buf, strlen( buf ) );
}
#ifdef DBG_XML
@ -368,7 +370,7 @@ void Sys_FPrintf( int flag, const char *format, ... ){
char out_buffer[4096];
va_list argptr;
if ( ( flag == SYS_VRB ) && ( verbose == qfalse ) ) {
if ( ( flag & SYS_VRBflag ) && ( verbose == qfalse ) ) {
return;
}

View File

@ -38,15 +38,19 @@ void xml_Select( char *msg, int entitynum, int brushnum, qboolean bError );
void xml_Winding( char *msg, vec3_t p[], int numpoints, qboolean die );
void xml_Point( char *msg, vec3_t pt );
extern qboolean bNetworkBroadcast;
void Broadcast_Setup( const char *dest );
void Broadcast_Shutdown();
#define SYS_VRB 0 // verbose support (on/off)
#define SYS_VRBflag 8 // verbose support (on/off) //internal only, not for sending!
#define SYS_NOXMLflag 16 // don't send that down the XML stream //internal only, not for sending!
//#define SYS_VRB 0 // verbose support (on/off)
#define SYS_STD 1 // standard print level
#define SYS_WRN 2 // warnings
#define SYS_ERR 3 // error
#define SYS_NOXML 4 // don't send that down the XML stream
//#define SYS_NOXML 4 // don't send that down the XML stream
#define SYS_VRB SYS_STD | SYS_VRBflag // verbose support (on/off) //a shortcut, not for sending!
extern qboolean verbose;
void Sys_Printf( const char *text, ... );

View File

@ -278,7 +278,7 @@ void Load3DSTriangleList( char *filename, triangle_t **pptri, int *numtriangles
trisfound = 0;
if ( ( input = fopen( filename, "rb" ) ) == 0 ) {
fprintf( stderr,"reader: could not open file '%s'\n", filename );
fprintf( stderr, "reader: could not open file '%s'\n", filename );
exit( 0 );
}
@ -287,7 +287,7 @@ void Load3DSTriangleList( char *filename, triangle_t **pptri, int *numtriangles
// should only be MAIN3DS, but some files seem to start with EDIT3DS, with
// no MAIN3DS
if ( ( tshort != MAIN3DS ) && ( tshort != EDIT3DS ) ) {
fprintf( stderr,"File is not a 3DS file.\n" );
fprintf( stderr, "File is not a 3DS file.\n" );
exit( 0 );
}

View File

@ -765,7 +765,7 @@ void ChopWindingInPlaceAccu( winding_accu_t **inout, vec3_t normal, vec_t dist,
Error( "ChopWindingInPlaceAccu: MAX_POINTS_ON_WINDING" );
}
if ( f->numpoints >= maxpts ) { // This will probably never happen.
Sys_FPrintf( SYS_VRB, "WARNING: estimate on chopped winding size incorrect (no problem)\n" );
Sys_FPrintf( SYS_WRN | SYS_VRBflag, "WARNING: estimate on chopped winding size incorrect (no problem)\n" );
f = CopyWindingAccuIncreaseSizeAndFreeOld( f );
maxpts++;
}
@ -801,7 +801,7 @@ void ChopWindingInPlaceAccu( winding_accu_t **inout, vec3_t normal, vec_t dist,
Error( "ChopWindingInPlaceAccu: MAX_POINTS_ON_WINDING" );
}
if ( f->numpoints >= maxpts ) { // This will probably never happen.
Sys_FPrintf( SYS_VRB, "WARNING: estimate on chopped winding size incorrect (no problem)\n" );
Sys_FPrintf( SYS_WRN | SYS_VRBflag, "WARNING: estimate on chopped winding size incorrect (no problem)\n" );
f = CopyWindingAccuIncreaseSizeAndFreeOld( f );
maxpts++;
}

View File

@ -159,13 +159,13 @@ void TRI_LoadPolysets( const char *filename, polyset_t **ppPSET, int *numpsets )
strlwr( pPSET[pset].name );
// indent();
// fprintf(stdout,"OBJECT START: %s\n",name);
// fprintf( stdout, "OBJECT START: %s\n", name );
fread( &count, sizeof( int ), 1, input );
count = BigLong( count );
++iLevel;
if ( count != 0 ) {
// indent();
// fprintf(stdout,"NUMBER OF TRIANGLES: %d\n",count);
// fprintf( stdout, "NUMBER OF TRIANGLES: %d\n", count );
i = -1;
do {
@ -182,7 +182,7 @@ void TRI_LoadPolysets( const char *filename, polyset_t **ppPSET, int *numpsets )
*/
// indent();
// fprintf(stdout," Object texture name: '%s'\n",tex);
// fprintf( stdout, " Object texture name: '%s'\n", tex );
}
/* Else (count == 0) this is the start of a group, and */
@ -211,7 +211,7 @@ void TRI_LoadPolysets( const char *filename, polyset_t **ppPSET, int *numpsets )
strlwr( pPSET[pset].name );
// indent();
// fprintf(stdout,"OBJECT END: %s\n",name);
// fprintf( stdout, "OBJECT END: %s\n", name );
continue;
}
}

View File

@ -123,7 +123,7 @@ void FreeBrush( brush_t *b ){
/* error check */
if ( *( (unsigned int*) b ) == 0xFEFEFEFE ) {
Sys_FPrintf( SYS_VRB, "WARNING: Attempt to free an already freed brush!\n" );
Sys_FPrintf( SYS_WRN | SYS_VRBflag, "WARNING: Attempt to free an already freed brush!\n" );
return;
}
@ -366,7 +366,7 @@ qboolean FixWinding( winding_t *w ){
dist = VectorLength( vec );
if ( dist < DEGENERATE_EPSILON ) {
valid = qfalse;
//Sys_FPrintf( SYS_VRB, "WARNING: Degenerate winding edge found, fixing...\n" );
//Sys_FPrintf( SYS_WRN | SYS_VRBflag, "WARNING: Degenerate winding edge found, fixing...\n" );
/* create an average point (ydnar 2002-01-26: using nearest-integer weld preference) */
SnapWeldVector( w->p[ i ], w->p[ j ], vec );
@ -664,9 +664,9 @@ void WriteBSPBrushMap( char *name, brush_t *list ){
// Is WriteBSPBrushMap() used only to decompile maps?
w = BaseWindingForPlane( mapplanes[s->planenum].normal, mapplanes[s->planenum].dist );
fprintf( f,"( %i %i %i ) ", (int)w->p[0][0], (int)w->p[0][1], (int)w->p[0][2] );
fprintf( f,"( %i %i %i ) ", (int)w->p[1][0], (int)w->p[1][1], (int)w->p[1][2] );
fprintf( f,"( %i %i %i ) ", (int)w->p[2][0], (int)w->p[2][1], (int)w->p[2][2] );
fprintf( f, "( %i %i %i ) ", (int)w->p[0][0], (int)w->p[0][1], (int)w->p[0][2] );
fprintf( f, "( %i %i %i ) ", (int)w->p[1][0], (int)w->p[1][1], (int)w->p[1][2] );
fprintf( f, "( %i %i %i ) ", (int)w->p[2][0], (int)w->p[2][1], (int)w->p[2][2] );
fprintf( f, "notexture 0 0 0 1 1\n" );
FreeWinding( w );
@ -1017,7 +1017,7 @@ void SplitBrush( brush_t *brush, int planenum, brush_t **front, brush_t **back )
}
if ( WindingIsHuge( w ) ) {
Sys_FPrintf( SYS_VRB,"WARNING: huge winding\n" );
Sys_FPrintf( SYS_WRN | SYS_VRBflag, "WARNING: huge winding\n" );
}
midwinding = w;
@ -1062,7 +1062,7 @@ void SplitBrush( brush_t *brush, int planenum, brush_t **front, brush_t **back )
{
if ( b[i]->numsides < 3 || !BoundBrush( b[i] ) ) {
if ( b[i]->numsides >= 3 ) {
Sys_FPrintf( SYS_VRB,"bogus brush after clip\n" );
Sys_FPrintf( SYS_WRN | SYS_VRBflag, "bogus brush after clip\n" );
}
FreeBrush( b[i] );
b[i] = NULL;
@ -1071,10 +1071,10 @@ void SplitBrush( brush_t *brush, int planenum, brush_t **front, brush_t **back )
if ( !( b[0] && b[1] ) ) {
if ( !b[0] && !b[1] ) {
Sys_FPrintf( SYS_VRB,"split removed brush\n" );
Sys_FPrintf( SYS_WRN | SYS_VRBflag, "split removed brush\n" );
}
else{
Sys_FPrintf( SYS_VRB,"split not on both sides\n" );
Sys_FPrintf( SYS_WRN | SYS_VRBflag, "split not on both sides\n" );
}
if ( b[0] ) {
FreeBrush( b[0] );
@ -1114,7 +1114,7 @@ void SplitBrush( brush_t *brush, int planenum, brush_t **front, brush_t **back )
if ( v1 < 1.0 ) {
FreeBrush( b[i] );
b[i] = NULL;
// Sys_FPrintf (SYS_VRB,"tiny volume after clip\n");
// Sys_FPrintf( SYS_WRN | SYS_VRBflag, "tiny volume after clip\n" );
}
}
}

View File

@ -344,9 +344,9 @@ void ProcessWorldModel( void ){
{
leaked = qtrue;
Sys_FPrintf( SYS_NOXML, "**********************\n" );
Sys_FPrintf( SYS_NOXML, "******* leaked *******\n" );
Sys_FPrintf( SYS_NOXML, "**********************\n" );
Sys_FPrintf( SYS_NOXMLflag | SYS_ERR, "**********************\n" );
Sys_FPrintf( SYS_NOXMLflag | SYS_ERR, "******* leaked *******\n" );
Sys_FPrintf( SYS_NOXMLflag | SYS_ERR, "**********************\n" );
polyline = LeakFile( tree );
xml_message_flush();
leaknode = xmlNewNode( NULL, (xmlChar*)"message" );

View File

@ -737,7 +737,7 @@ void UnparseEntities( void ){
}
/* add trailing brace */
strcat( end,"}\n" );
strcat( end, "}\n" );
end += 2;
/* check for overflow */

View File

@ -191,7 +191,7 @@ static void SelectSplitPlaneNum( node_t *node, face_t *list, int *splitPlaneNum,
return;
}
//Sys_FPrintf (SYS_VRB, "F: %d B:%d S:%d FA:%ds\n",frontC,backC,splitsC,facingC );
//Sys_FPrintf( SYS_VRB, "F: %d B:%d S:%d FA:%ds\n", frontC, backC, splitsC, facingC );
/* set best split data */
*splitPlaneNum = bestSplit->planenum;

View File

@ -123,7 +123,7 @@ void SplitMeshByPlane( mesh_t *in, vec3_t normal, float dist, mesh_t **front, me
if ( split == -1 ) {
if ( i == 1 ) {
Sys_FPrintf( SYS_VRB, "No crossing points in patch\n" );
Sys_FPrintf( SYS_WRN | SYS_VRBflag, "No crossing points in patch\n" );
*front = in;
return;
}

View File

@ -71,7 +71,7 @@ xmlNodePtr LeakFile( tree_t *tree ){
return NULL;
}
Sys_FPrintf( SYS_VRB,"--- LeakFile ---\n" );
Sys_FPrintf( SYS_VRB, "--- LeakFile ---\n" );
//
// write the points to the file

View File

@ -2773,14 +2773,14 @@ void IlluminateRawLightmap( int rawLightmapNum ){
luxel = SUPER_LUXEL( lightmapNum, x, y );
deluxel = SUPER_DELUXEL( x, y );
if ( !luxel || !deluxel || !cluster ) {
Sys_FPrintf( SYS_VRB, "WARNING: I got NULL'd.\n" );
Sys_FPrintf( SYS_WRN | SYS_VRBflag, "WARNING: I got NULL'd.\n" );
continue;
}
else if ( *cluster < 0 ) {
// unmapped pixel
// should have neither deluxemap nor lightmap
if ( deluxel[3] ) {
Sys_FPrintf( SYS_VRB, "WARNING: I have written deluxe to an unmapped luxel. Sorry.\n" );
Sys_FPrintf( SYS_WRN | SYS_VRBflag, "WARNING: I have written deluxe to an unmapped luxel. Sorry.\n" );
}
}
else
@ -2788,7 +2788,7 @@ void IlluminateRawLightmap( int rawLightmapNum ){
// mapped pixel
// should have both deluxemap and lightmap
if ( deluxel[3] ) {
Sys_FPrintf( SYS_VRB, "WARNING: I forgot to write deluxe to a mapped luxel. Sorry.\n" );
Sys_FPrintf( SYS_WRN | SYS_VRBflag, "WARNING: I forgot to write deluxe to a mapped luxel. Sorry.\n" );
}
}
}

View File

@ -695,7 +695,7 @@ qboolean AddSurfaceToRawLightmap( int num, rawLightmap_t *lm ){
if ( sampleSize != lm->sampleSize && lmLimitSize == 0 ){
if ( debugSampleSize == 1 || lm->customWidth > 128 ){
Sys_FPrintf( SYS_VRB,"WARNING: surface at (%6.0f %6.0f %6.0f) (%6.0f %6.0f %6.0f) too large for desired samplesize/lightmapsize/lightmapscale combination, increased samplesize from %d to %d\n",
Sys_FPrintf( SYS_WRN | SYS_VRBflag, "WARNING: surface at (%6.0f %6.0f %6.0f) (%6.0f %6.0f %6.0f) too large for desired samplesize/lightmapsize/lightmapscale combination, increased samplesize from %d to %d\n",
info->mins[0],
info->mins[1],
info->mins[2],
@ -706,7 +706,7 @@ qboolean AddSurfaceToRawLightmap( int num, rawLightmap_t *lm ){
(int) sampleSize );
}
else if ( debugSampleSize == 0 ){
Sys_FPrintf( SYS_VRB,"WARNING: surface at (%6.0f %6.0f %6.0f) (%6.0f %6.0f %6.0f) too large for desired samplesize/lightmapsize/lightmapscale combination, increased samplesize from %d to %d\n",
Sys_FPrintf( SYS_WRN | SYS_VRBflag, "WARNING: surface at (%6.0f %6.0f %6.0f) (%6.0f %6.0f %6.0f) too large for desired samplesize/lightmapsize/lightmapscale combination, increased samplesize from %d to %d\n",
info->mins[0],
info->mins[1],
info->mins[2],
@ -795,7 +795,7 @@ qboolean AddSurfaceToRawLightmap( int num, rawLightmap_t *lm ){
verts[ i ].lightmap[ 0 ][ 1 ] = t * superSample;
if ( s > (float) lm->w || t > (float) lm->h ) {
Sys_FPrintf( SYS_VRB, "WARNING: Lightmap texture coords out of range: S %1.4f > %3d || T %1.4f > %3d\n",
Sys_FPrintf( SYS_WRN | SYS_VRBflag, "WARNING: Lightmap texture coords out of range: S %1.4f > %3d || T %1.4f > %3d\n",
s, lm->w, t, lm->h );
}
}
@ -1220,7 +1220,7 @@ void SetupSurfaceLightmaps( void ){
}
if ( debugSampleSize < -1 ){
Sys_FPrintf( SYS_VRB, "+%d similar occurrences;\t-debugsamplesize to show ones\n", -debugSampleSize - 1 );
Sys_FPrintf( SYS_WRN | SYS_VRBflag, "+%d similar occurrences;\t-debugsamplesize to show ones\n", -debugSampleSize - 1 );
}
/* allocate vertex luxel storage */

View File

@ -571,7 +571,7 @@ void SetBrushContents( brush_t *b ){
/* ydnar: getting rid of this stupid warning */
//% if( mixed )
//% Sys_FPrintf( SYS_VRB,"Entity %i, Brush %i: mixed face contentFlags\n", b->entitynum, b->brushnum );
//% Sys_FPrintf( SYS_WRN | SYS_VRBflag, "Entity %i, Brush %i: mixed face contentFlags\n", b->entitynum, b->brushnum );
/* check for detail & structural */
if ( ( compileFlags & C_DETAIL ) && ( compileFlags & C_STRUCTURAL ) ) {

View File

@ -320,7 +320,7 @@ void InsertModel( const char *name, int skin, int frame, m4x4_t transform, remap
/* create transform matrix for normals */
memcpy( nTransform, transform, sizeof( m4x4_t ) );
if ( m4x4_invert( nTransform ) ) {
Sys_FPrintf( SYS_VRB, "WARNING: Can't invert model transform matrix, using transpose instead\n" );
Sys_FPrintf( SYS_WRN | SYS_VRBflag, "WARNING: Can't invert model transform matrix, using transpose instead\n" );
}
m4x4_transpose( nTransform );

View File

@ -674,7 +674,7 @@ int FloodEntities( tree_t *tree ){
headnode = tree->headnode;
Sys_FPrintf( SYS_VRB,"--- FloodEntities ---\n" );
Sys_FPrintf( SYS_VRB, "--- FloodEntities ---\n" );
inside = qfalse;
tree->outside_node.occupied = 0;
@ -764,11 +764,11 @@ int FloodEntities( tree_t *tree ){
Sys_FPrintf( SYS_VRB, "%9d flooded leafs\n", c_floodedleafs );
if ( !inside ) {
Sys_FPrintf( SYS_VRB, "no entities in open -- no filling\n" );
Sys_FPrintf( SYS_WRN | SYS_VRBflag, "no entities in open -- no filling\n" );
return FLOODENTITIES_EMPTY;
}
if ( tree->outside_node.occupied ) {
Sys_FPrintf( SYS_VRB, "entity reached from outside -- leak detected\n" );
Sys_FPrintf( SYS_WRN | SYS_VRBflag, "entity reached from outside -- leak detected\n" );
return FLOODENTITIES_LEAKED;
}
@ -946,7 +946,7 @@ void FloodSkyboxArea_r( node_t *node ){
*/
void FloodAreas( tree_t *tree ){
Sys_FPrintf( SYS_VRB,"--- FloodAreas ---\n" );
Sys_FPrintf( SYS_VRB, "--- FloodAreas ---\n" );
FindAreas_r( tree->headnode );
/* ydnar: flood all skybox nodes */
@ -1002,9 +1002,9 @@ void FillOutside( node_t *headnode ){
c_outside = 0;
c_inside = 0;
c_solid = 0;
Sys_FPrintf( SYS_VRB,"--- FillOutside ---\n" );
Sys_FPrintf( SYS_VRB, "--- FillOutside ---\n" );
FillOutside_r( headnode );
Sys_FPrintf( SYS_VRB,"%9d solid leafs\n", c_solid );
Sys_FPrintf( SYS_VRB, "%9d solid leafs\n", c_solid );
Sys_Printf( "%9d leafs filled\n", c_outside );
Sys_FPrintf( SYS_VRB, "%9d inside leafs\n", c_inside );
}

View File

@ -57,10 +57,10 @@ int num_solidfaces;
void WriteFloat( FILE *f, vec_t v ){
if ( fabs( v - Q_rint( v ) ) < 0.001 ) {
fprintf( f,"%i ",(int)Q_rint( v ) );
fprintf( f, "%i ", (int)Q_rint( v ) );
}
else{
fprintf( f,"%f ",v );
fprintf( f, "%f ", v );
}
}
@ -140,10 +140,10 @@ void WritePortalFile_r( node_t *node ){
WindingPlane( w, normal, &dist );
if ( DotProduct( p->plane.normal, normal ) < 0.99 ) { // backwards...
fprintf( pf,"%i %i %i ",w->numpoints, p->nodes[1]->cluster, p->nodes[0]->cluster );
fprintf( pf, "%i %i %i ", w->numpoints, p->nodes[1]->cluster, p->nodes[0]->cluster );
}
else{
fprintf( pf,"%i %i %i ",w->numpoints, p->nodes[0]->cluster, p->nodes[1]->cluster );
fprintf( pf, "%i %i %i ", w->numpoints, p->nodes[0]->cluster, p->nodes[1]->cluster );
}
flags = 0;
@ -163,13 +163,13 @@ void WritePortalFile_r( node_t *node ){
/* write the winding */
for ( i = 0 ; i < w->numpoints ; i++ )
{
fprintf( pf,"(" );
fprintf( pf, "(" );
WriteFloat( pf, w->p[i][0] );
WriteFloat( pf, w->p[i][1] );
WriteFloat( pf, w->p[i][2] );
fprintf( pf,") " );
fprintf( pf, ") " );
}
fprintf( pf,"\n" );
fprintf( pf, "\n" );
}
}
@ -244,29 +244,29 @@ void WriteFaceFile_r( node_t *node ){
// write out to the file
if ( p->nodes[0] == node ) {
fprintf( pf,"%i %i ",w->numpoints, p->nodes[0]->cluster );
fprintf( pf, "%i %i ", w->numpoints, p->nodes[0]->cluster );
for ( i = 0 ; i < w->numpoints ; i++ )
{
fprintf( pf,"(" );
fprintf( pf, "(" );
WriteFloat( pf, w->p[i][0] );
WriteFloat( pf, w->p[i][1] );
WriteFloat( pf, w->p[i][2] );
fprintf( pf,") " );
fprintf( pf, ") " );
}
fprintf( pf,"\n" );
fprintf( pf, "\n" );
}
else
{
fprintf( pf,"%i %i ",w->numpoints, p->nodes[1]->cluster );
fprintf( pf, "%i %i ", w->numpoints, p->nodes[1]->cluster );
for ( i = w->numpoints - 1; i >= 0; i-- )
{
fprintf( pf,"(" );
fprintf( pf, "(" );
WriteFloat( pf, w->p[i][0] );
WriteFloat( pf, w->p[i][1] );
WriteFloat( pf, w->p[i][2] );
fprintf( pf,") " );
fprintf( pf, ") " );
}
fprintf( pf,"\n" );
fprintf( pf, "\n" );
}
}
}
@ -354,7 +354,7 @@ void NumberClusters( tree_t *tree ) {
num_visportals = 0;
num_solidfaces = 0;
Sys_FPrintf( SYS_VRB,"--- NumberClusters ---\n" );
Sys_FPrintf( SYS_VRB, "--- NumberClusters ---\n" );
// set the cluster field in every leaf and count the total number of portals
NumberLeafs_r( tree->headnode, -1 );
@ -374,7 +374,7 @@ void NumberClusters( tree_t *tree ) {
void WritePortalFile( tree_t *tree ){
char filename[1024];
Sys_FPrintf( SYS_VRB,"--- WritePortalFile ---\n" );
Sys_FPrintf( SYS_VRB, "--- WritePortalFile ---\n" );
// write the file
sprintf( filename, "%s.prt", source );

View File

@ -536,7 +536,7 @@ qboolean FixBrokenSurface( mapDrawSurface_t *ds ){
VectorSubtract( dv1->xyz, dv2->xyz, avg.xyz );
dist = VectorLength( avg.xyz );
if ( dist < DEGENERATE_EPSILON ) {
Sys_FPrintf( SYS_VRB, "WARNING: Degenerate T-junction edge found, fixing...\n" );
Sys_FPrintf( SYS_WRN | SYS_VRBflag, "WARNING: Degenerate T-junction edge found, fixing...\n" );
/* create an average drawvert */
/* ydnar 2002-01-26: added nearest-integer welding preference */

View File

@ -204,13 +204,13 @@ void ClusterMerge( int leafnum ){
numvis = LeafVectorFromPortalVector( portalvector, uncompressed );
// if (uncompressed[leafnum>>3] & (1<<(leafnum&7)))
// Sys_Warning ("Leaf portals saw into leaf\n");
// Sys_Warning( "Leaf portals saw into leaf\n" );
// uncompressed[leafnum>>3] |= (1<<(leafnum&7));
numvis++; // count the leaf itself
//Sys_FPrintf (SYS_VRB,"cluster %4i : %4i visible\n", leafnum, numvis);
//Sys_FPrintf( SYS_VRB, "cluster %4i : %4i visible\n", leafnum, numvis );
++clustersizehistogram[numvis];
memcpy( bspVisBytes + VIS_HEADER_SIZE + leafnum * leafbytes, uncompressed, leafbytes );
@ -859,17 +859,17 @@ void WritePortals( char *filename ){
// if (!p->hint)
// continue;
w = p->winding;
fprintf( pf,"%i %i %i ",w->numpoints, 0, 0 );
fprintf( pf, "%i %i %i ",w->numpoints, 0, 0 );
fprintf( pf, "%d ", p->hint );
for ( i = 0 ; i < w->numpoints ; i++ )
{
fprintf( pf,"(" );
fprintf( pf, "(" );
WriteFloat( pf, w->points[i][0] );
WriteFloat( pf, w->points[i][1] );
WriteFloat( pf, w->points[i][2] );
fprintf( pf,") " );
fprintf( pf, ") " );
}
fprintf( pf,"\n" );
fprintf( pf, "\n" );
}
/*
@ -909,7 +909,7 @@ void LoadPortals( char *name ){
int leafnums[2];
visPlane_t plane;
if ( !strcmp( name,"-" ) ) {
if ( !strcmp( name, "-" ) ) {
f = stdin;
}
else
@ -920,7 +920,7 @@ void LoadPortals( char *name ){
}
}
if ( fscanf( f,"%79s\n%i\n%i\n%i\n",magic, &portalclusters, &numportals, &numfaces ) != 4 ) {
if ( fscanf( f, "%79s\n%i\n%i\n%i\n", magic, &portalclusters, &numportals, &numfaces ) != 4 ) {
Error( "LoadPortals: failed to read header" );
}
if ( strcmp( magic,PORTALFILE ) ) {
@ -1138,11 +1138,11 @@ int VisMain( int argc, char **argv ){
Sys_Printf( "passageOnly = true\n" );
passageVisOnly = qtrue;
}
else if ( !strcmp( argv[i],"-nosort" ) ) {
else if ( !strcmp( argv[i], "-nosort" ) ) {
Sys_Printf( "nosort = true\n" );
nosort = qtrue;
}
else if ( !strcmp( argv[i],"-saveprt" ) ) {
else if ( !strcmp( argv[i], "-saveprt" ) ) {
Sys_Printf( "saveprt = true\n" );
saveprt = qtrue;
}
@ -1150,10 +1150,10 @@ int VisMain( int argc, char **argv ){
debugCluster = qtrue;
Sys_Printf( "Extra verbous mode enabled\n" );
}
else if ( !strcmp( argv[i],"-tmpin" ) ) {
else if ( !strcmp( argv[i], "-tmpin" ) ) {
strcpy( inbase, "/tmp" );
}
else if ( !strcmp( argv[i],"-tmpout" ) ) {
else if ( !strcmp( argv[i], "-tmpout" ) ) {
strcpy( outbase, "/tmp" );
}

View File

@ -686,7 +686,7 @@ void PortalFlow( int portalnum ){
c_can = CountBits( p->portalvis, numportals * 2 );
Sys_FPrintf( SYS_VRB,"portal:%4i mightsee:%4i cansee:%4i (%i chains)\n",
Sys_FPrintf( SYS_VRB, "portal:%4i mightsee:%4i cansee:%4i (%i chains)\n",
(int)( p - portals ), c_might, c_can, data.c_chains );
}
@ -812,8 +812,8 @@ void PassageFlow( int portalnum ){
/*
c_can = CountBits (p->portalvis, numportals*2);
Sys_FPrintf (SYS_VRB,"portal:%4i mightsee:%4i cansee:%4i (%i chains)\n",
(int)(p - portals), c_might, c_can, data.c_chains);
Sys_FPrintf( SYS_VRB, "portal:%4i mightsee:%4i cansee:%4i (%i chains)\n",
(int)(p - portals), c_might, c_can, data.c_chains );
*/
}
@ -1076,8 +1076,8 @@ void PassagePortalFlow( int portalnum ){
/*
c_can = CountBits (p->portalvis, numportals*2);
Sys_FPrintf (SYS_VRB,"portal:%4i mightsee:%4i cansee:%4i (%i chains)\n",
(int)(p - portals), c_might, c_can, data.c_chains);
Sys_FPrintf( SYS_VRB, "portal:%4i mightsee:%4i cansee:%4i (%i chains)\n",
(int)(p - portals), c_might, c_can, data.c_chains );
*/
}