]> git.xonotic.org Git - xonotic/netradiant.git/blobdiff - tools/quake3/q3map2/bsp.c
Merge commit 'f73cc19a6166fc04269f953c980175779f81b9b0' into garux-merge
[xonotic/netradiant.git] / tools / quake3 / q3map2 / bsp.c
index 4ac39f36ded15067c8476df765a8c61965a46ab7..35fdd5b7256a72afc7c84020cb5abf30f38ea2cd 100644 (file)
@@ -193,7 +193,7 @@ static void SetCloneModelNumbers( void ){
                                /* get the model num */
                                value3 = ValueForKey( &entities[ j ], "model" );
                                if ( value3[ 0 ] == '\0' ) {
-                                       Sys_Printf( "WARNING: Cloned entity %s referenced entity without model\n", value2 );
+                                       Sys_FPrintf( SYS_WRN, "WARNING: Cloned entity %s referenced entity without model\n", value2 );
                                        continue;
                                }
                                models = atoi( &value2[ 1 ] );
@@ -319,6 +319,10 @@ void ProcessWorldModel( const char *portalFilePath, const char *lineFilePath ){
        /* check for patches with adjacent edges that need to lod together */
        PatchMapDrawSurfs( e );
 
+       if ( debugClip ) {
+               AddTriangleModels( e );
+       }
+
        /* build an initial bsp tree using all of the sides of all of the structural brushes */
        faces = MakeStructuralBSPFaceList( entities[ 0 ].brushes );
        tree = FaceBSP( faces );
@@ -387,7 +391,9 @@ void ProcessWorldModel( const char *portalFilePath, const char *lineFilePath ){
        FloodAreas( tree );
 
        /* create drawsurfs for triangle models */
-       AddTriangleModels( e );
+       if ( !debugClip ) {
+               AddTriangleModels( e );
+       }
 
        /* create drawsurfs for surface models */
        AddEntitySurfaceModels( e );
@@ -712,6 +718,7 @@ int BSPMain( int argc, char **argv ){
        /* 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 );
@@ -949,6 +956,15 @@ int BSPMain( int argc, char **argv ){
                        Sys_Printf( "Debug portal surfaces enabled\n" );
                        debugPortals = qtrue;
                }
+               else if ( !strcmp( argv[ i ], "-debugclip" ) ) {
+                       Sys_Printf( "Debug model clip enabled\n" );
+                       debugClip = qtrue;
+               }
+               else if ( !strcmp( argv[ i ],  "-clipdepth" ) ) {
+                       clipDepthGlobal = atof( argv[ i + 1 ] );
+                       i++;
+                       Sys_Printf( "Model autoclip thickness set to %.3f\n", clipDepthGlobal );
+               }
                else if ( !strcmp( argv[ i ], "-sRGBtex" ) ) {
                        texturesRGB = qtrue;
                        Sys_Printf( "Textures are in sRGB\n" );
@@ -1010,6 +1026,10 @@ int BSPMain( int argc, char **argv ){
                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;
+               }
                else
                {
                        Sys_Printf( "WARNING: Unknown option \"%s\"\n", argv[ i ] );