From: Thomas Debesse <dev@illwieckz.net>
Date: Sun, 22 Sep 2019 08:48:48 +0000 (+0200)
Subject: q3map2/bsp: introduce -fastmeta option
X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=a94ac2b91bb5be4efbd78a78fe007b8e37f0b118;p=xonotic%2Fnetradiant.git

q3map2/bsp: introduce -fastmeta option

set lightmap and surface verts and indexes values like quake3, known to be fast

equivalent to:
	-maxlightmapverts 64 -maxsurfaceverts 999 -maxsurfaceindexes 6000
---

diff --git a/tools/quake3/q3map2/bsp.c b/tools/quake3/q3map2/bsp.c
index 0c1a6bd4..b3c28002 100644
--- a/tools/quake3/q3map2/bsp.c
+++ b/tools/quake3/q3map2/bsp.c
@@ -828,6 +828,14 @@ int BSPMain( int argc, char **argv ){
 			i++;
 			Sys_Printf( "Distance epsilon set to %f\n", distanceEpsilon );
 		}
+		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 ) {
diff --git a/tools/quake3/q3map2/help.c b/tools/quake3/q3map2/help.c
index 7c05b326..82284743 100644
--- a/tools/quake3/q3map2/help.c
+++ b/tools/quake3/q3map2/help.c
@@ -97,6 +97,7 @@ void HelpBsp()
 		{"-deep", "Use detail brushes in the BSP tree, but at lowest priority (should give more fps)"},
 		{"-de <F>", "Distance epsilon for plane snapping etc."},
 		{"-fakemap", "Write fakemap.map containing all world brushes"},
+		{"-fastmeta", "Use small lightmap/surface verts/number maximum numbers (like Q3A), to be used with `-meta`"},
 		{"-flares", "Turn on support for flares"},
 		{"-flat", "Enable flat shading (good for combining with -celshader)"},
 		{"-fulldetail", "Treat detail brushes as structural ones"},