]> de.git.xonotic.org Git - xonotic/netradiant.git/blobdiff - tools/quake3/q3map2/bsp.c
Merge branch 'NateEag-master-patch-12920' into 'master'
[xonotic/netradiant.git] / tools / quake3 / q3map2 / bsp.c
index dff448507055cfcf8c0cd1d40f87337e7f4383da..7e504a6a2f8fee3bba0f43d6a84622989716a2fc 100644 (file)
@@ -716,14 +716,17 @@ int BSPMain( int argc, char **argv ){
        portalFilePath[0] = 0;
        surfaceFilePath[0] = 0;
 
+       if ( argc >= 2 && !strcmp( argv[ 1 ], "-bsp" ) ) {
+               argv++;
+               argc--;
+       }
 
        /* note it */
        Sys_Printf( "--- BSP ---\n" );
 
        doingBSP = qtrue;
        SetDrawSurfacesBuffer();
-       mapDrawSurfs = safe_malloc( sizeof( mapDrawSurface_t ) * MAX_MAP_DRAW_SURFS );
-       memset( mapDrawSurfs, 0, sizeof( mapDrawSurface_t ) * MAX_MAP_DRAW_SURFS );
+       mapDrawSurfs = safe_malloc0( sizeof( mapDrawSurface_t ) * MAX_MAP_DRAW_SURFS );
        numMapDrawSurfs = 0;
 
        tempSource[ 0 ] = '\0';
@@ -831,7 +834,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;
@@ -840,15 +873,13 @@ int BSPMain( int argc, char **argv ){
                                maxSurfaceVerts = maxLMSurfaceVerts;
                        }
                        i++;
+
+                       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 );
                }
-               else if ( !strcmp( argv[ i ],  "-mi" ) ) {
-                       maxSurfaceIndexes = atoi( argv[ i + 1 ] );
-                       if ( maxSurfaceIndexes < 3 ) {
-                               maxSurfaceIndexes = 3;
-                       }
-                       i++;
-                       Sys_Printf( "Maximum per-surface index count set to %d\n", maxSurfaceIndexes );
                }
                else if ( !strcmp( argv[ i ], "-np" ) ) {
                        npDegrees = atof( argv[ i + 1 ] );
@@ -1004,30 +1035,35 @@ int BSPMain( int argc, char **argv ){
                else if ( !strcmp( argv[ i ], "-bspfile" ) )
                {
                        strcpy( BSPFilePath, argv[i + 1] );
+                       argv[ i ] = NULL;
                        i++;
+                       argv[ i ] = NULL;
                        Sys_Printf( "Use %s as bsp file\n", BSPFilePath );
                }
                else if ( !strcmp( argv[ i ], "-linfile" ) )
                {
                        strcpy( lineFilePath, argv[i + 1] );
+                       argv[ i ] = NULL;
                        i++;
+                       argv[ i ] = NULL;
                        Sys_Printf( "Use %s as line file\n", lineFilePath );
                }
                else if ( !strcmp( argv[ i ], "-prtfile" ) )
                {
                        strcpy( portalFilePath, argv[i + 1] );
+                       argv[ i ] = NULL;
                        i++;
+                       argv[ i ] = NULL;
                        Sys_Printf( "Use %s as portal file\n", portalFilePath );
                }
                else if ( !strcmp( argv[ i ], "-srffile" ) )
                {
                        strcpy( surfaceFilePath, argv[i + 1] );
+                       argv[ i ] = NULL;
                        i++;
+                       argv[ i ] = NULL;
                        Sys_Printf( "Use %s as surface file\n", surfaceFilePath );
                }
-               else if ( !strcmp( argv[ i ], "-bsp" ) ) {
-                       Sys_Printf( "-bsp argument unnecessary\n" );
-               }
                else if ( !strcmp( argv[ i ], "-noob" ) ) {
                        Sys_Printf( "No oBs!\n" );
                        noob = qtrue;