]> git.xonotic.org Git - xonotic/netradiant.git/blobdiff - tools/quake3/q3map2/bsp.c
q3map2/bsp: introduce -fastmeta option
[xonotic/netradiant.git] / tools / quake3 / q3map2 / bsp.c
index bbab3f25ee101fa57b3db1955a4b2330a4421649..b3c28002aaf5c91c4df3e6d41142d7a08d4a22ed 100644 (file)
@@ -346,7 +346,7 @@ void ProcessWorldModel( const char *portalFilePath, const char *lineFilePath ){
                Sys_FPrintf( SYS_NOXML, "**********************\n" );
                polyline = LeakFile( tree, lineFilePath );
                leaknode = xmlNewNode( NULL, (xmlChar*)"message" );
-               xmlNodeSetContent( leaknode, (xmlChar*)"MAP LEAKED\n" );
+               xmlNodeAddContent( leaknode, (xmlChar*)"MAP LEAKED\n" );
                xmlAddChild( leaknode, polyline );
                level[0] = (int) '0' + SYS_ERR;
                level[1] = 0;
@@ -709,6 +709,11 @@ int BSPMain( int argc, char **argv ){
        portalFilePath[0] = 0;
        surfaceFilePath[0] = 0;
 
+       if ( argc >= 2 && !strcmp( argv[ 1 ], "-bsp" ) ) {
+               Sys_Printf( "-bsp argument unnecessary\n" );
+               argv++;
+               argc--;
+       }
 
        /* note it */
        Sys_Printf( "--- BSP ---\n" );
@@ -823,7 +828,37 @@ int BSPMain( int argc, char **argv ){
                        i++;
                        Sys_Printf( "Distance epsilon set to %f\n", distanceEpsilon );
                }
-               else if ( !strcmp( argv[ i ],  "-mv" ) ) {
+               else if ( !strcmp( argv[ i ], "-fastmeta" ) ) {
+                       maxLMSurfaceVerts = 64;
+                       maxSurfaceVerts = 999;
+                       maxSurfaceIndexes = 6000;
+                       Sys_Printf( "Maximum per-surface vertex count set to %d\n", maxSurfaceVerts );
+                       Sys_Printf( "Maximum per-surface index count set to %d\n", maxSurfaceIndexes );
+                       Sys_Printf( "Maximum lightmapped surface vertex count set to %d\n", maxLMSurfaceVerts );
+               }
+               else if ( !strcmp( argv[ i ], "-maxsurfacevertices" ) ) {
+                       maxSurfaceVerts = atoi( argv[ i + 1 ] );
+                       if ( maxSurfaceVerts < 3 ) {
+                               maxSurfaceVerts = 3;
+                       }
+                       i++;
+                       Sys_Printf( "Maximum per-surface vertex count set to %d\n", maxSurfaceVerts );
+               }
+               else if ( !strcmp( argv[ i ], "-maxsurfaceindexes" ) || !strcmp( argv[ i ], "-mi" ) ) {
+                       maxSurfaceIndexes = atoi( argv[ i + 1 ] );
+                       if ( maxSurfaceIndexes < 3 ) {
+                               maxSurfaceIndexes = 3;
+                       }
+                       i++;
+
+                       if ( !strcmp( argv[ i ], "-mi" ) ) {
+                               Sys_Printf( "The -mi argument is deprecated, use \"-maxsurfaceindexes\" instead\n" );
+                       }
+                       else {
+                               Sys_Printf( "Maximum per-surface index count set to %d\n", maxSurfaceIndexes );
+                       }
+               }
+               else if ( !strcmp( argv[ i ], "-maxlightmapvertices" ) || !strcmp( argv[ i ], "-mv" ) ) {
                        maxLMSurfaceVerts = atoi( argv[ i + 1 ] );
                        if ( maxLMSurfaceVerts < 3 ) {
                                maxLMSurfaceVerts = 3;
@@ -832,15 +867,13 @@ int BSPMain( int argc, char **argv ){
                                maxSurfaceVerts = maxLMSurfaceVerts;
                        }
                        i++;
-                       Sys_Printf( "Maximum lightmapped surface vertex count set to %d\n", maxLMSurfaceVerts );
-               }
-               else if ( !strcmp( argv[ i ],  "-mi" ) ) {
-                       maxSurfaceIndexes = atoi( argv[ i + 1 ] );
-                       if ( maxSurfaceIndexes < 3 ) {
-                               maxSurfaceIndexes = 3;
+
+                       if ( !strcmp( argv[ i ], "-mv" ) ) {
+                               Sys_Printf( "The -mv argument is deprecated, use \"-maxlightmapvertices\" instead\n" );
+                       }
+                       else {
+                               Sys_Printf( "Maximum lightmapped surface vertex count set to %d\n", maxLMSurfaceVerts );
                        }
-                       i++;
-                       Sys_Printf( "Maximum per-surface index count set to %d\n", maxSurfaceIndexes );
                }
                else if ( !strcmp( argv[ i ], "-np" ) ) {
                        npDegrees = atof( argv[ i + 1 ] );
@@ -1010,9 +1043,6 @@ int BSPMain( int argc, char **argv ){
                        i++;
                        Sys_Printf( "Use %s as surface file\n", surfaceFilePath );
                }
-               else if ( !strcmp( argv[ i ], "-bsp" ) ) {
-                       Sys_Printf( "-bsp argument unnecessary\n" );
-               }
                else{
                        Sys_FPrintf( SYS_WRN, "WARNING: Unknown option \"%s\"\n", argv[ i ] );
                }