]> de.git.xonotic.org Git - xonotic/netradiant.git/blobdiff - tools/quake3/q3map2/bsp.c
Merge commit 'ed4c8c204443726e852a4c8927b3f8d2571cc522' into garux-merge
[xonotic/netradiant.git] / tools / quake3 / q3map2 / bsp.c
index 4b181c1756ac09338e6d8e311bfa1c4c99d25251..dff448507055cfcf8c0cd1d40f87337e7f4383da 100644 (file)
@@ -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 );
@@ -345,7 +349,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;
@@ -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 );
@@ -631,6 +637,8 @@ void ProcessModels( const char *portalFilePath, const char *lineFilePath ){
        /* restore -v setting */
        verbose = oldVerbose;
 
+       Sys_FPrintf( SYS_VRB, "%9i bspModels in total\n", numBSPModels );
+
        /* write fogs */
        EmitFogs();
 
@@ -712,6 +720,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 +958,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,8 +1028,13 @@ int BSPMain( int argc, char **argv ){
                else if ( !strcmp( argv[ i ], "-bsp" ) ) {
                        Sys_Printf( "-bsp argument unnecessary\n" );
                }
-               else{
-                       Sys_FPrintf( SYS_WRN, "WARNING: Unknown option \"%s\"\n", argv[ i ] );
+               else if ( !strcmp( argv[ i ], "-noob" ) ) {
+                       Sys_Printf( "No oBs!\n" );
+                       noob = qtrue;
+               }
+               else
+               {
+                       Sys_Printf( "WARNING: Unknown option \"%s\"\n", argv[ i ] );
                }
        }