]> de.git.xonotic.org Git - xonotic/netradiant.git/blobdiff - tools/quake3/q3map2/bsp.c
new options:
[xonotic/netradiant.git] / tools / quake3 / q3map2 / bsp.c
index 2b29ff5ec6a34f5ecebb482faf371fd26b8e2253..03c040747b29ad7d8bc8848f38db0b1de0e54eaa 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();
 }
 
 
@@ -614,18 +616,34 @@ void OnlyEnts( void )
 {
        char out[ 1024 ];
 
+       char save_cmdline[1024], save_version[1024];
+       const char *p;
        
        /* note it */
        Sys_Printf( "--- OnlyEnts ---\n" );
        
        sprintf( out, "%s.bsp", source );
        LoadBSPFile( out );
+
+       ParseEntities();
+       p = ValueForKey(&entities[0], "_q3map2_cmdline");
+       strncpy(save_cmdline, p, sizeof(save_cmdline));
+       save_cmdline[sizeof(save_cmdline)-1] = 0;
+       p = ValueForKey(&entities[0], "_q3map2_version");
+       strncpy(save_version, p, sizeof(save_version));
+       save_version[sizeof(save_version)-1] = 0;
+
        numEntities = 0;
 
        LoadShaderInfo();
        LoadMapFile( name, qfalse );
        SetModelNumbers();
        SetLightStyles();
+
+       if(*save_cmdline)
+               SetKeyValue(&entities[0], "_q3map2_cmdline", save_cmdline);
+       if(*save_version)
+               SetKeyValue(&entities[0], "_q3map2_version", save_version);
        
        numBSPEntities = numEntities;
        UnparseEntities();
@@ -656,6 +674,7 @@ int BSPMain( int argc, char **argv )
        numMapDrawSurfs = 0;
        
        tempSource[ 0 ] = '\0';
+       globalCelShader[0] = 0;
        
        /* set standard game flags */
        maxSurfaceVerts = game->maxSurfaceVerts;
@@ -820,6 +839,15 @@ int BSPMain( int argc, char **argv )
                        Sys_Printf( "Flatshading enabled\n" );
                        flat = qtrue;
                }
+               else if( !strcmp( argv[ i ], "-celshader" ) )
+               {
+                       ++i;
+                       if(argv[i][0])
+                               sprintf( globalCelShader, "textures/%s", argv[ i ] );
+                       else
+                               *globalCelShader = 0;
+                       Sys_Printf( "Global cel shader set to \"%s\"\n", globalCelShader );
+               }
                else if( !strcmp( argv[ i ], "-meta" ) )
                {
                        Sys_Printf( "Creating meta surfaces from brush faces\n" );
@@ -860,6 +888,16 @@ int BSPMain( int argc, char **argv )
                        Sys_Printf( "Debug portal surfaces enabled\n" );
                        debugPortals = qtrue;
                }
+               else if( !strcmp( argv[ i ], "-altsplit" ) )
+               {
+                       Sys_Printf( "Alternate BSP splitting (by 27) enabled\n" );
+                       bspAlternateSplitWeights = qtrue;
+               }
+               else if( !strcmp( argv[ i ], "-deep" ) )
+               {
+                       Sys_Printf( "Deep BSP tree generation enabled\n" );
+                       deepBSP = qtrue;
+               }
                else if( !strcmp( argv[ i ], "-bsp" ) )
                        Sys_Printf( "-bsp argument unnecessary\n" );
                else
@@ -913,6 +951,9 @@ int BSPMain( int argc, char **argv )
        else
                LoadMapFile( name, qfalse );
        
+       /* div0: inject command line parameters */
+       InjectCommandLine(argv, 1, argc - 1);
+       
        /* ydnar: decal setup */
        ProcessDecals();