]> de.git.xonotic.org Git - xonotic/netradiant.git/commitdiff
already apply some safe changes:
authordivverent <divverent@61c419a2-8eb2-4b30-bcec-8cead039b335>
Sat, 28 Mar 2009 21:48:25 +0000 (21:48 +0000)
committerdivverent <divverent@61c419a2-8eb2-4b30-bcec-8cead039b335>
Sat, 28 Mar 2009 21:48:25 +0000 (21:48 +0000)
emitmetastats
_ls

git-svn-id: svn://svn.icculus.org/netradiant/trunk@235 61c419a2-8eb2-4b30-bcec-8cead039b335

tools/quake3/q3map2/bsp.c
tools/quake3/q3map2/map.c
tools/quake3/q3map2/model.c
tools/quake3/q3map2/patch.c
tools/quake3/q3map2/q3map2.h
tools/quake3/q3map2/q3map2_fsr_newfiles/q3map2_fsr_svn158.patch
tools/quake3/q3map2/surface_meta.c

index 5bf40c33d7277069adea961ebe4798586b9069be..a908809c5f9ed021edac71577d7ec6a5e5cf3192 100644 (file)
@@ -264,7 +264,6 @@ void ProcessWorldModel( void )
        char            level[ 2 ], shader[ 1024 ];
        const char      *value;
        
-       
        /* sets integer blockSize from worldspawn "_blocksize" key if it exists */
        value = ValueForKey( &entities[ 0 ], "_blocksize" );
        if( value[ 0 ] == '\0' )
@@ -601,6 +600,9 @@ void ProcessModels( void )
        
        /* write fogs */
        EmitFogs();
+
+       /* vortex: emit meta stats */
+       EmitMetaStats();
 }
 
 
index b986b18dccddf97cab3f6ba646b6753e5886c904..1440131e9d7e3b8ed0db720a6787ada549ed6e4b 100644 (file)
@@ -1553,14 +1553,18 @@ static qboolean ParseMapEntity( qboolean onlyLights )
        /* get explicit shadow flags */
        GetEntityShadowFlags( mapEnt, NULL, &castShadows, &recvShadows );
        
+       /* vortex: added _ls key (short name of lightmapscale) */
        /* ydnar: get lightmap scaling value for this entity */
        if( strcmp( "", ValueForKey( mapEnt, "lightmapscale" ) ) ||
-               strcmp( "", ValueForKey( mapEnt, "_lightmapscale" ) ) )
+               strcmp( "", ValueForKey( mapEnt, "_lightmapscale" ) ) || 
+               strcmp( "", ValueForKey( mapEnt, "_ls" ) ) )
        {
                /* get lightmap scale from entity */
                lightmapScale = FloatForKey( mapEnt, "lightmapscale" );
                if( lightmapScale <= 0.0f )
                        lightmapScale = FloatForKey( mapEnt, "_lightmapscale" );
+               if( lightmapScale <= 0.0f )
+                       lightmapScale = FloatForKey( mapEnt, "_ls" );
                if( lightmapScale > 0.0f )
                        Sys_Printf( "Entity %d (%s) has lightmap scale of %.4f\n", mapEnt->mapEntityNum, classname, lightmapScale );
        }
index 82bf307baa79506a674fd3459a040b58079f1626..58fb1849bb0d79723f4254ca5e88ebc2ae873cf9 100644 (file)
@@ -268,7 +268,7 @@ void InsertModel( char *name, int frame, m4x4_t transform, remap_t *remap, shade
                        continue;
                
                /* fix the surface's normals */
-               PicoFixSurfaceNormals( surface );
+               PicoFixSurfaceNormals( surface ); /* why did vortex comment this out? FIXME */
                
                /* allocate a surface (ydnar: gs mods) */
                ds = AllocDrawSurface( SURFACE_TRIANGLES );
@@ -610,7 +610,10 @@ void AddTriangleModels( entity_t *e )
        }
        
        /* get lightmap scale */
+       /* vortex: added _ls key (short name of lightmapscale) */
        baseLightmapScale = FloatForKey( e, "_lightmapscale" );
+       if( baseLightmapScale <= 0.0f )
+               baseLightmapScale = FloatForKey( e, "_ls" );
        if( baseLightmapScale <= 0.0f )
                baseLightmapScale = 0.0f;
        
@@ -732,7 +735,10 @@ void AddTriangleModels( entity_t *e )
                        celShader = *globalCelShader ? ShaderInfoForShader(globalCelShader) : NULL;
                
                /* get lightmap scale */
+               /* vortex: added _ls key (short name of lightmapscale) */
                lightmapScale = FloatForKey( e2, "_lightmapscale" );
+               if( lightmapScale <= 0.0f )
+                       lightmapScale = FloatForKey( e2, "_ls" );
                if( lightmapScale <= 0.0f )
                        lightmapScale = baseLightmapScale;
                
index 58b8ea207940edf63e281570eeecced407e05187..9cd707e224284fb3f2770bafb4e07e0847c77f07 100644 (file)
@@ -227,7 +227,6 @@ void ParsePatch( qboolean onlyLights )
        float                   longestCurve;
        int                             maxIterations;
        
-       
        MatchToken( "{" );
        
        /* get texture */
index 9ecfbfe0f881e5e453761a1b0a8f015dc9e022b9..f0cf4899d0ee181bff99b0b934d63f1c94e2bf5a 100644 (file)
@@ -1639,6 +1639,7 @@ void                                              MakeEntityMetaTriangles( entity_t *e );
 void                                           FixMetaTJunctions( void );
 void                                           SmoothMetaTriangles( void );
 void                                           MergeMetaTriangles( void );
+void                                           EmitMetaStats(); // vortex: print meta statistics even in no-verbose mode
 
 
 /* surface_extra.c */
index 2a41f7064765d07fdb8b0c87230d2e8071ddcc41..4e5dcf3b0bbafdcc27590f761e43baf4b9b416ca 100644 (file)
@@ -1,65 +1,3 @@
-Index: brush.c\r
-===================================================================\r
---- brush.c    (revision 158)\r
-+++ brush.c    (working copy)\r
-@@ -78,7 +78,7 @@\r
-       
-       
-       /* count brushes */
--      for( brushes; brushes != NULL; brushes = brushes->next )
-+      for( ; brushes != NULL; brushes = brushes->next )
-               c++;
-       return c;
- }
-@@ -122,7 +122,7 @@\r
-       
-       
-       /* error check */
--      if( *((int*) b) == 0xFEFEFEFE )
-+      if( *((unsigned int*) b) == 0xFEFEFEFE )
-       {
-               Sys_FPrintf( SYS_VRB, "WARNING: Attempt to free an already freed brush!\n" );
-               return;
-@@ -135,7 +135,7 @@\r
-       
-       /* ydnar: overwrite it */
-       memset( b, 0xFE, (int) &(((brush_t*) 0)->sides[ b->numsides ]) );
--      *((int*) b) = 0xFEFEFEFE;
-+      *((unsigned int*) b) = 0xFEFEFEFE;
-       
-       /* free it */
-       free( b );
-@@ -156,7 +156,7 @@\r
-       
-       
-       /* walk brush list */
--      for( brushes; brushes != NULL; brushes = next )
-+      for( ; brushes != NULL; brushes = next )
-       {
-               next = brushes->next;
-               FreeBrush( brushes );
-Index: bsp.c\r
-===================================================================\r
---- bsp.c      (revision 158)\r
-+++ bsp.c      (working copy)\r
-@@ -194,7 +194,6 @@\r
-       char            level[ 2 ], shader[ 1024 ];
-       const char      *value;
-       
--      
-       /* sets integer blockSize from worldspawn "_blocksize" key if it exists */
-       value = ValueForKey( &entities[ 0 ], "_blocksize" );
-       if( value[ 0 ] == '\0' )
-@@ -531,6 +530,9 @@\r
-       
-       /* write fogs */
-       EmitFogs();
-+
-+      /* vortex: emit meta stats */
-+      EmitMetaStats();
- }
 Index: bspfile_abstract.c\r
 ===================================================================\r
 --- bspfile_abstract.c (revision 158)\r
@@ -119,19 +57,6 @@ Index: bspfile_abstract.c
 +      }
  }
  
-Index: facebsp.c\r
-===================================================================\r
---- facebsp.c  (revision 158)\r
-+++ facebsp.c  (working copy)\r
-@@ -180,7 +180,7 @@\r
-       
-       c = 0;
--      for( list; list != NULL; list = list->next )
-+      for( ; list != NULL; list = list->next )
-               c++;
-       return c;
- }
 Index: game_ef.h\r
 ===================================================================\r
 --- game_ef.h  (revision 158)\r
@@ -2763,121 +2688,6 @@ Index: main.c
        
        /* check if we have enough options left to attempt something */
        if( argc < 2 )
-Index: map.c\r
-===================================================================\r
---- map.c      (revision 158)\r
-+++ map.c      (working copy)\r
-@@ -1515,14 +1515,18 @@\r
-       /* get explicit shadow flags */
-       GetEntityShadowFlags( mapEnt, NULL, &castShadows, &recvShadows );
-       
-+      /* vortex: added _ls key (short name of lightmapscale) */
-       /* ydnar: get lightmap scaling value for this entity */
-       if( strcmp( "", ValueForKey( mapEnt, "lightmapscale" ) ) ||
--              strcmp( "", ValueForKey( mapEnt, "_lightmapscale" ) ) )
-+              strcmp( "", ValueForKey( mapEnt, "_lightmapscale" ) ) || 
-+              strcmp( "", ValueForKey( mapEnt, "_ls" ) ) )
-       {
-               /* get lightmap scale from entity */
-               lightmapScale = FloatForKey( mapEnt, "lightmapscale" );
-               if( lightmapScale <= 0.0f )
-                       lightmapScale = FloatForKey( mapEnt, "_lightmapscale" );
-+              if( lightmapScale <= 0.0f )
-+                      lightmapScale = FloatForKey( mapEnt, "_ls" );
-               if( lightmapScale > 0.0f )
-                       Sys_Printf( "Entity %d (%s) has lightmap scale of %.4f\n", mapEnt->mapEntityNum, classname, lightmapScale );
-       }
-Index: mesh.c\r
-===================================================================\r
---- mesh.c     (revision 158)\r
-+++ mesh.c     (working copy)\r
-@@ -563,7 +563,7 @@\r
-       }
-       
-       /* keep chopping */
--      for( iterations; iterations > 0; iterations-- )
-+      for( ; iterations > 0; iterations-- )
-       {
-               /* horizontal subdivisions */
-               for( j = 0; j + 2 < out.width; j += 4 )
-Index: model.c\r
-===================================================================\r
---- model.c    (revision 158)\r
-+++ model.c    (working copy)\r
-@@ -266,7 +266,7 @@\r
-                       continue;
-               
-               /* fix the surface's normals */
--              PicoFixSurfaceNormals( surface );
-+              //PicoFixSurfaceNormals( surface );
-               
-               /* allocate a surface (ydnar: gs mods) */
-               ds = AllocDrawSurface( SURFACE_TRIANGLES );
-@@ -521,7 +521,15 @@\r
-                                               else
-                                                       free( buildBrush );
-                                       }
-+                                      else
-+                                      {
-+                                              Sys_Printf( "WARNING: Model %s unable to generate brush - Case 1.\n", name );  
-+                                      }
-                               }
-+                              else
-+                              {
-+                                      Sys_Printf( "WARNING: Model %s unable to generate brush - Case 2.\n", name );  
-+                              }  
-                       }
-               }
-       }
-@@ -566,8 +574,11 @@\r
-       }
-       
-       /* get lightmap scale */
-+      /* vortex: added _ls key (short name of lightmapscale) */
-       baseLightmapScale = FloatForKey( e, "_lightmapscale" );
-       if( baseLightmapScale <= 0.0f )
-+              baseLightmapScale = FloatForKey( e, "_ls" );
-+      if( baseLightmapScale <= 0.0f )
-               baseLightmapScale = 0.0f;
-       
-       /* walk the entity list */
-@@ -688,8 +699,11 @@\r
-                       celShader = NULL;
-               
-               /* get lightmap scale */
-+              /* vortex: added _ls key (short name of lightmapscale) */
-               lightmapScale = FloatForKey( e2, "_lightmapscale" );
-               if( lightmapScale <= 0.0f )
-+                      lightmapScale = FloatForKey( e2, "_ls" );
-+              if( lightmapScale <= 0.0f )
-                       lightmapScale = baseLightmapScale;
-               
-               /* insert the model */
-Index: patch.c\r
-===================================================================\r
---- patch.c    (revision 158)\r
-+++ patch.c    (working copy)\r
-@@ -227,7 +227,6 @@\r
-       float                   longestCurve;
-       int                             maxIterations;
-       
--      
-       MatchToken( "{" );
-       
-       /* get texture */
-Index: path_init.c\r
-===================================================================\r
---- path_init.c        (revision 158)\r
-+++ path_init.c        (working copy)\r
-@@ -383,7 +383,7 @@\r
-       /* remove processed arguments */
-       for( i = 0, j = 0, k = 0; i < *argc && j < *argc; i++, j++ )
-       {
--              for( j; j < *argc && argv[ j ] == NULL; j++ );
-+              for( ; j < *argc && argv[ j ] == NULL; j++ );
-               argv[ i ] = argv[ j ];
-               if( argv[ i ] != NULL )
-                       k++;
 Index: q3map2.h\r
 ===================================================================\r
 --- q3map2.h   (revision 158)\r
@@ -3038,14 +2848,6 @@ Index: q3map2.h
  
  
  /* surface_fur.c */
-@@ -1627,6 +1654,7 @@\r
- void                                          FixMetaTJunctions( void );
- void                                          SmoothMetaTriangles( void );
- void                                          MergeMetaTriangles( void );
-+void                                          EmitMetaStats(); // vortex: print meta statistics even in no-verbose mode
- /* surface_extra.c */
 @@ -1704,6 +1732,12 @@\r
  float                                         DirtForSample( trace_t *trace );
  void                                          DirtyRawLightmap( int num );
@@ -3484,29 +3286,6 @@ Index: surface_meta.c
        subdivided = SubdivideMesh2( src, iterations ); //%     ds->maxIterations
        
        /* fit it to the curve and remove colinear verts on rows/columns */
-@@ -599,7 +617,22 @@\r
- }
-+/*
-+EmitMetaStatictics
-+vortex: prints meta statistics in general output
-+*/
-+void EmitMetaStats()
-+{
-+      Sys_Printf( "--- EmitMetaStats ---\n" );
-+      Sys_Printf( "%9d total meta surfaces\n", numMetaSurfaces );
-+      Sys_Printf( "%9d stripped surfaces\n", numStripSurfaces );
-+      Sys_Printf( "%9d fanned surfaces\n", numFanSurfaces );
-+      Sys_Printf( "%9d patch meta surfaces\n", numPatchMetaSurfaces );
-+      Sys_Printf( "%9d meta verts\n", numMetaVerts );
-+      Sys_Printf( "%9d meta triangles\n", numMetaTriangles );
-+}
-+
- /*
- MakeEntityMetaTriangles()
- builds meta triangles from brush faces (tristrips and fans)
 @@ -652,12 +685,12 @@\r
                                break;
                        
index 9191ac146ed8ca47d76dea44716a4316134754fd..8d3d64562bca72b784b9728b483a4b535476ae9e 100644 (file)
@@ -597,8 +597,23 @@ void StripFaceSurface( mapDrawSurface_t *ds )
        /* classify it */
        ClassifySurfaces( 1, ds );
 }
+/*
+EmitMetaStatictics
+vortex: prints meta statistics in general output
+*/
 
-
+void EmitMetaStats()
+{
+       Sys_Printf( "--- EmitMetaStats ---\n" );
+       Sys_Printf( "%9d total meta surfaces\n", numMetaSurfaces );
+       Sys_Printf( "%9d stripped surfaces\n", numStripSurfaces );
+       Sys_Printf( "%9d fanned surfaces\n", numFanSurfaces );
+       Sys_Printf( "%9d patch meta surfaces\n", numPatchMetaSurfaces );
+       Sys_Printf( "%9d meta verts\n", numMetaVerts );
+       Sys_Printf( "%9d meta triangles\n", numMetaTriangles );
+}
 
 /*
 MakeEntityMetaTriangles()