From: divverent Date: Wed, 25 Feb 2009 14:36:20 +0000 (+0000) Subject: -lightmapdir option X-Git-Tag: svn-r421~223 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=cf6c8123ddb53e065d96951871ac957c462c2445;p=xonotic%2Fnetradiant.git -lightmapdir option git-svn-id: svn://svn.icculus.org/netradiant/trunk@197 61c419a2-8eb2-4b30-bcec-8cead039b335 --- diff --git a/tools/quake3/q3map2/light.c b/tools/quake3/q3map2/light.c index 49aaebfe..811d6a7e 100644 --- a/tools/quake3/q3map2/light.c +++ b/tools/quake3/q3map2/light.c @@ -2027,6 +2027,15 @@ int LightMain( int argc, char **argv ) } } + else if( !strcmp( argv[ i ], "-lightmapdir" ) ) + { + lmCustomDir = argv[i + 1]; + i++; + Sys_Printf( "Lightmap directory set to %s\n", lmCustomDir ); + externalLightmaps = qtrue; + Sys_Printf( "Storing all lightmaps externally\n" ); + } + /* ydnar: add this to suppress warnings */ else if( !strcmp( argv[ i ], "-custinfoparms") ) { diff --git a/tools/quake3/q3map2/lightmaps_ydnar.c b/tools/quake3/q3map2/lightmaps_ydnar.c index 9e41af4f..57375b60 100644 --- a/tools/quake3/q3map2/lightmaps_ydnar.c +++ b/tools/quake3/q3map2/lightmaps_ydnar.c @@ -2278,8 +2278,15 @@ void StoreSurfaceLightmaps( void ) Sys_Printf( "--- StoreSurfaceLightmaps ---\n"); /* setup */ - strcpy( dirname, source ); - StripExtension( dirname ); + if(lmCustomDir) + { + strcpy( dirname, lmCustomDir ); + } + else + { + strcpy( dirname, source ); + StripExtension( dirname ); + } memset( rgbGenValues, 0, sizeof( rgbGenValues ) ); memset( alphaGenValues, 0, sizeof( alphaGenValues ) ); diff --git a/tools/quake3/q3map2/q3map2.h b/tools/quake3/q3map2/q3map2.h index 4819ff30..29e1c791 100644 --- a/tools/quake3/q3map2/q3map2.h +++ b/tools/quake3/q3map2/q3map2.h @@ -2118,6 +2118,7 @@ Q_EXTERN qboolean noCollapse Q_ASSIGN( qfalse ); Q_EXTERN qboolean exportLightmaps Q_ASSIGN( qfalse ); Q_EXTERN qboolean externalLightmaps Q_ASSIGN( qfalse ); Q_EXTERN int lmCustomSize Q_ASSIGN( LIGHTMAP_WIDTH ); +Q_EXTERN char * lmCustomDir Q_ASSIGN( NULL ); Q_EXTERN qboolean dirty Q_ASSIGN( qfalse ); Q_EXTERN qboolean dirtDebug Q_ASSIGN( qfalse );