X-Git-Url: https://git.xonotic.org/?a=blobdiff_plain;f=tools%2Fquake3%2Fq3map2%2Fbsp.c;h=35fdd5b7256a72afc7c84020cb5abf30f38ea2cd;hb=e876e8ef487eeb9123f4906373622ffe3b6ea9d4;hp=bbab3f25ee101fa57b3db1955a4b2330a4421649;hpb=f034b8003de1bcbc86b3fb7c44026ebc84055cff;p=xonotic%2Fnetradiant.git diff --git a/tools/quake3/q3map2/bsp.c b/tools/quake3/q3map2/bsp.c index bbab3f25..35fdd5b7 100644 --- a/tools/quake3/q3map2/bsp.c +++ b/tools/quake3/q3map2/bsp.c @@ -44,7 +44,6 @@ ------------------------------------------------------------------------------- */ - /* ProcessAdvertisements() copies advertisement info into the BSP structures @@ -320,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 ); @@ -388,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 ); @@ -713,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 ); @@ -950,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" ); @@ -972,13 +987,11 @@ int BSPMain( int argc, char **argv ){ colorsRGB = qfalse; Sys_Printf( "Colors are linear\n" ); } - else if ( !strcmp( argv[ i ], "-altsplit" ) ) - { + else if ( !strcmp( argv[ i ], "-altsplit" ) ) { Sys_Printf( "Alternate BSP splitting (by 27) enabled\n" ); bspAlternateSplitWeights = qtrue; } - else if ( !strcmp( argv[ i ], "-deep" ) ) - { + else if ( !strcmp( argv[ i ], "-deep" ) ) { Sys_Printf( "Deep BSP tree generation enabled\n" ); deepBSP = qtrue; } @@ -1013,8 +1026,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 ] ); } }