From 5dc0244ef92a4b8012d69268fd79f236bb78f8e7 Mon Sep 17 00:00:00 2001 From: Garux Date: Mon, 13 Jan 2020 00:39:55 +0300 Subject: [PATCH] remove unused statistic variables --- tools/quake3/common/polylib.c | 39 --------------------------------- tools/quake3/q3map2/brush.c | 6 ----- tools/quake3/q3map2/lightmaps.c | 6 ----- tools/quake3/q3map2/portals.c | 15 ------------- tools/quake3/q3map2/q3map2.h | 12 ---------- tools/quake3/q3map2/visflow.c | 12 ---------- 6 files changed, 90 deletions(-) diff --git a/tools/quake3/common/polylib.c b/tools/quake3/common/polylib.c index a4d80094..04881ac1 100644 --- a/tools/quake3/common/polylib.c +++ b/tools/quake3/common/polylib.c @@ -29,15 +29,6 @@ #include "qfiles.h" -extern int numthreads; - -// counters are only bumped when running single threaded, -// because they are an awefull coherence problem -int c_active_windings; -int c_peak_windings; -int c_winding_allocs; -int c_winding_points; - #define BOGUS_RANGE WORLD_SIZE void pw( winding_t *w ){ @@ -56,15 +47,6 @@ winding_t *AllocWinding( int points ){ if ( points >= MAX_POINTS_ON_WINDING ) { Error( "AllocWinding failed: MAX_POINTS_ON_WINDING exceeded" ); } - - if ( numthreads == 1 ) { - c_winding_allocs++; - c_winding_points += points; - c_active_windings++; - if ( c_active_windings > c_peak_windings ) { - c_peak_windings = c_active_windings; - } - } return safe_calloc( offsetof( winding_t, p[points] ) ); } @@ -77,16 +59,6 @@ winding_accu_t *AllocWindingAccu( int points ){ if ( points >= MAX_POINTS_ON_WINDING ) { Error( "AllocWindingAccu failed: MAX_POINTS_ON_WINDING exceeded" ); } - - if ( numthreads == 1 ) { - // At the time of this writing, these statistics were not used in any way. - c_winding_allocs++; - c_winding_points += points; - c_active_windings++; - if ( c_active_windings > c_peak_windings ) { - c_peak_windings = c_active_windings; - } - } return safe_calloc( offsetof( winding_accu_t, p[points] ) ); } @@ -105,9 +77,6 @@ void FreeWinding( winding_t *w ){ } *(unsigned *)w = 0xdeaddead; - if ( numthreads == 1 ) { - c_active_windings--; - } free( w ); } @@ -126,9 +95,6 @@ void FreeWindingAccu( winding_accu_t *w ){ } *( (unsigned *) w ) = 0xdeaddead; - if ( numthreads == 1 ) { - c_active_windings--; - } free( w ); } @@ -137,8 +103,6 @@ void FreeWindingAccu( winding_accu_t *w ){ RemoveColinearPoints ============ */ -int c_removed; - void RemoveColinearPoints( winding_t *w ){ int i, j, k; vec3_t v1, v2; @@ -164,9 +128,6 @@ void RemoveColinearPoints( winding_t *w ){ return; } - if ( numthreads == 1 ) { - c_removed += w->numpoints - nump; - } w->numpoints = nump; memcpy( w->p, p, nump * sizeof( p[0] ) ); } diff --git a/tools/quake3/q3map2/brush.c b/tools/quake3/q3map2/brush.c index 40bd4188..b71f49ba 100644 --- a/tools/quake3/q3map2/brush.c +++ b/tools/quake3/q3map2/brush.c @@ -90,9 +90,6 @@ int CountBrushList( brush_t *brushes ){ */ brush_t *AllocBrush( int numSides ){ - if ( numthreads == 1 ) { - numActiveBrushes++; - } return safe_calloc( offsetof( brush_t, sides[numSides] ) ); } @@ -125,9 +122,6 @@ void FreeBrush( brush_t *b ){ /* free it */ free( b ); - if ( numthreads == 1 ) { - numActiveBrushes--; - } } diff --git a/tools/quake3/q3map2/lightmaps.c b/tools/quake3/q3map2/lightmaps.c index 34213d10..d0893973 100644 --- a/tools/quake3/q3map2/lightmaps.c +++ b/tools/quake3/q3map2/lightmaps.c @@ -36,15 +36,9 @@ int allocatedSurfsOnShader; int allocated[ LIGHTMAP_WIDTH ]; -int numLightmaps = 1; -int c_exactLightmap = 0; -int c_planarPatch = 0; -int c_nonplanarLightmap = 0; - void PrepareNewLightmap( void ) { memset( allocated, 0, sizeof( allocated ) ); - numLightmaps++; } /* diff --git a/tools/quake3/q3map2/portals.c b/tools/quake3/q3map2/portals.c index deabb505..7280d0c5 100644 --- a/tools/quake3/q3map2/portals.c +++ b/tools/quake3/q3map2/portals.c @@ -42,24 +42,12 @@ extern qboolean FixWinding( winding_t *w ); -int c_active_portals; -int c_peak_portals; -int c_boundary; -int c_boundary_sides; - /* =========== AllocPortal =========== */ portal_t *AllocPortal( void ){ - if ( numthreads == 1 ) { - c_active_portals++; - } - if ( c_active_portals > c_peak_portals ) { - c_peak_portals = c_active_portals; - } - return safe_calloc( sizeof( portal_t ) ); } @@ -67,9 +55,6 @@ void FreePortal( portal_t *p ){ if ( p->winding ) { FreeWinding( p->winding ); } - if ( numthreads == 1 ) { - c_active_portals--; - } free( p ); } diff --git a/tools/quake3/q3map2/q3map2.h b/tools/quake3/q3map2/q3map2.h index df670625..fadfefe7 100644 --- a/tools/quake3/q3map2/q3map2.h +++ b/tools/quake3/q3map2/q3map2.h @@ -2131,7 +2131,6 @@ Q_EXTERN fog_t mapFogs[ MAX_MAP_FOGS ]; Q_EXTERN entity_t *mapEnt; Q_EXTERN brush_t *buildBrush; -Q_EXTERN int numActiveBrushes; Q_EXTERN brushType_t g_brushType; Q_EXTERN int numStrippedLights Q_ASSIGN( 0 ); @@ -2212,9 +2211,6 @@ Q_EXTERN leaf_t *faceleafs; Q_EXTERN int numfaces; -Q_EXTERN int c_portaltest, c_portalpass, c_portalcheck; -Q_EXTERN int c_chains; - Q_EXTERN byte *vismap, *vismap_p, *vismap_end; Q_EXTERN int testlevel; @@ -2384,9 +2380,6 @@ Q_EXTERN int totalTraces; Q_EXTERN FILE *dumpFile; -Q_EXTERN int c_visible, c_occluded; -Q_EXTERN int c_subsampled; /* ydnar */ - Q_EXTERN int defaultLightSubdivide Q_ASSIGN( 999 ); Q_EXTERN vec3_t ambientColor; @@ -2399,11 +2392,6 @@ Q_EXTERN vec3_t *surfaceOrigin; Q_EXTERN vec3_t sunDirection; Q_EXTERN vec3_t sunLight; -/* tracing */ -Q_EXTERN int c_totalTrace; -Q_EXTERN int c_cullTrace, c_testTrace; -Q_EXTERN int c_testFacets; - /* ydnar: light optimization */ Q_EXTERN float subdivideThreshold Q_ASSIGN( DEFAULT_SUBDIVIDE_THRESHOLD ); diff --git a/tools/quake3/q3map2/visflow.c b/tools/quake3/q3map2/visflow.c index f4aa0097..d344f9ef 100644 --- a/tools/quake3/q3map2/visflow.c +++ b/tools/quake3/q3map2/visflow.c @@ -71,11 +71,6 @@ int CountBits( byte *bits, int numbits ){ return c; } -int c_fullskip; - -int c_chop, c_nochop; - -int active; void CheckStack( leaf_t *leaf, threaddata_t *thread ){ pstack_t *p, *p2; @@ -508,8 +503,6 @@ void RecursiveLeafFlow( int leafnum, threaddata_t *thread, pstack_t *prevstack ) VectorSubtract( vec3_origin, p->plane.normal, backplane.normal ); backplane.dist = -p->plane.dist; -// c_portalcheck++; - stack.portal = p; stack.next = NULL; stack.freewindings[0] = 1; @@ -899,8 +892,6 @@ void RecursivePassagePortalFlow( vportal_t *portal, threaddata_t *thread, pstack VectorSubtract( vec3_origin, p->plane.normal, backplane.normal ); backplane.dist = -p->plane.dist; -// c_portalcheck++; - stack.portal = p; stack.next = NULL; stack.freewindings[0] = 1; @@ -1525,7 +1516,6 @@ void PassageMemory( void ){ =============================================================================== */ -int c_flood, c_vis; /* @@ -1668,7 +1658,6 @@ void BasePortalVis( int portalnum ){ p->nummightsee = CountBits( p->portalflood, numportals * 2 ); // Sys_Printf ("portal %i: %i mightsee\n", portalnum, p->nummightsee); - c_flood += p->nummightsee; } @@ -1754,5 +1743,4 @@ void BetterPortalVis( int portalnum ){ // build leaf vis information p->nummightsee = CountBits( p->portalvis, numportals * 2 ); - c_vis += p->nummightsee; }