From cf6c8123ddb53e065d96951871ac957c462c2445 Mon Sep 17 00:00:00 2001 From: divverent Date: Wed, 25 Feb 2009 14:36:20 +0000 Subject: [PATCH] -lightmapdir option git-svn-id: svn://svn.icculus.org/netradiant/trunk@197 61c419a2-8eb2-4b30-bcec-8cead039b335 --- tools/quake3/q3map2/light.c | 9 +++++++++ tools/quake3/q3map2/lightmaps_ydnar.c | 11 +++++++++-- tools/quake3/q3map2/q3map2.h | 1 + 3 files changed, 19 insertions(+), 2 deletions(-) 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 ); -- 2.39.2