]> de.git.xonotic.org Git - xonotic/netradiant.git/commitdiff
less spammy vis output, more useful
authordivverent <divverent@61c419a2-8eb2-4b30-bcec-8cead039b335>
Thu, 23 Apr 2009 18:52:56 +0000 (18:52 +0000)
committerdivverent <divverent@61c419a2-8eb2-4b30-bcec-8cead039b335>
Thu, 23 Apr 2009 18:52:56 +0000 (18:52 +0000)
git-svn-id: svn://svn.icculus.org/netradiant/trunk@326 61c419a2-8eb2-4b30-bcec-8cead039b335

tools/quake3/q3map2/main.c
tools/quake3/q3map2/vis.c

index 02d2fb630b4cfea39d3bb4c4802e9f606b5463db..b113247bd4205a5776c1d373d5abf46321b67df3 100644 (file)
@@ -811,8 +811,11 @@ int main( int argc, char **argv )
                /* verbose */
                else if( !strcmp( argv[ i ], "-v" ) )
                {
-                       verbose = qtrue;
-                       argv[ i ] = NULL;
+                       if(!verbose)
+                       {
+                               verbose = qtrue;
+                               argv[ i ] = NULL;
+                       }
                }
                
                /* force */
index 0e30b83928e7f49e1fc6c09b161f6674661edb18..e9d36c4748fdec1ddd01082b08bb8c309176566c 100644 (file)
@@ -310,7 +310,7 @@ CalcVis
 */
 void CalcVis (void)
 {
-       int                     i;
+       int                     i, minvis, maxvis;
        const char      *value;
        double mu, sigma, totalvis, totalvis2;
        
@@ -361,13 +361,20 @@ void CalcVis (void)
        
        totalvis = 0;
        totalvis2 = 0;
+       minvis = -1;
+       maxvis = -1;
        for(i = 0; i < MAX_MAP_LEAFS; ++i)
                if(clustersizehistogram[i])
                {
-                       Sys_FPrintf(SYS_VRB, "%4i clusters have exactly %4i visible clusters\n", clustersizehistogram[i], i);
+                       if(debugCluster)
+                               Sys_FPrintf(SYS_VRB, "%4i clusters have exactly %4i visible clusters\n", clustersizehistogram[i], i);
+                       /* cast is to prevent integer overflow */
                        totalvis  += ((double) i)                * ((double) clustersizehistogram[i]);
                        totalvis2 += ((double) i) * ((double) i) * ((double) clustersizehistogram[i]);
-                       /* cast is to prevent integer overflow */
+
+                       if(minvis < 0)
+                               minvis = i;
+                       maxvis = i;
                }
        
        mu = totalvis / portalclusters;
@@ -375,7 +382,10 @@ void CalcVis (void)
        
   Sys_Printf( "Total clusters: %i\n", portalclusters );
   Sys_Printf( "Total visible clusters: %.0f\n", totalvis );
-  Sys_Printf( "Average clusters visible: %.2f sdev=%.2f\n", mu, sigma);
+  Sys_Printf( "Average clusters visible: %.2f (%.3f %%/total)\n", mu, mu / portalclusters * 100.0);
+  Sys_Printf( "  Standard deviation: %.2f (%.3f %%/total, %.3f %%/avg)\n", sigma, sigma / portalclusters * 100.0, sigma / mu * 100.0);
+  Sys_Printf( "  Minimum: %i (%.3f %%/total, %.3f %%/avg)\n", minvis, minvis / (double) portalclusters * 100.0, minvis / mu * 100.0);
+  Sys_Printf( "  Maximum: %i (%.3f %%/total, %.3f %%/avg)\n", maxvis, maxvis / (double) portalclusters * 100.0, maxvis / mu * 100.0);
 }
 
 /*
@@ -1077,6 +1087,9 @@ int VisMain (int argc, char **argv)
                } else if (!strcmp (argv[i],"-saveprt")) {
                        Sys_Printf ("saveprt = true\n");
                        saveprt = qtrue;
+               } else if( !strcmp( argv[ i ], "-v" ) ) {
+                       debugCluster = qtrue;
+                       Sys_Printf( "Extra verbous mode enabled\n" );
                } else if (!strcmp (argv[i],"-tmpin")) {
                        strcpy (inbase, "/tmp");
                } else if (!strcmp (argv[i],"-tmpout")) {