]> git.xonotic.org Git - xonotic/netradiant.git/commitdiff
new option -rawlightmapsizelimit to limit the size of RAW lightmaps (so you can use...
authordivverent <divverent@61c419a2-8eb2-4b30-bcec-8cead039b335>
Fri, 22 May 2009 14:14:09 +0000 (14:14 +0000)
committerdivverent <divverent@61c419a2-8eb2-4b30-bcec-8cead039b335>
Fri, 22 May 2009 14:14:09 +0000 (14:14 +0000)
git-svn-id: svn://svn.icculus.org/netradiant/trunk@372 61c419a2-8eb2-4b30-bcec-8cead039b335

tools/quake3/q3map2/light.c
tools/quake3/q3map2/lightmaps_ydnar.c
tools/quake3/q3map2/q3map2.h

index 1517ba962eef050a059ee19300662f8ed6a0c2af..35f7f720d78d6cfbd27eba51cb8f1f5fd1f7e993 100644 (file)
@@ -2122,6 +2122,14 @@ int LightMain( int argc, char **argv )
                        }
                }
                
+               else if( !strcmp( argv[ i ], "-rawlightmapsizelimit" ) )
+               {
+                       lmLimitSize = atoi( argv[ i + 1 ] );
+                       
+                       i++;
+                       Sys_Printf( "Raw lightmap size limit set to %d x %d pixels\n", lmLimitSize, lmLimitSize );
+               }
+               
                else if( !strcmp( argv[ i ], "-lightmapdir" ) )
                {
                        lmCustomDir = argv[i + 1];
index 3c1eed65c84d05f0027f95e9da655dcefdda2707..252188e915952b05012051a90bf35ecb5ca21e14 100644 (file)
@@ -678,14 +678,14 @@ qboolean AddSurfaceToRawLightmap( int num, rawLightmap_t *lm )
                size[ i ] = (maxs[ i ] - mins[ i ]) / sampleSize + 1.0f;
                
                /* hack (god this sucks) */
-               if( size[ i ] > lm->customWidth || size[ i ] > lm->customHeight )
+               if( size[ i ] > lm->customWidth || size[ i ] > lm->customHeight  || size[i] > lmLimitSize)
                {
                        i = -1;
                        sampleSize += 1.0f;
                }
        }
 
-       if(sampleSize != lm->sampleSize)
+       if(sampleSize != lm->sampleSize && lmLimitSize == 0)
        {
                Sys_FPrintf(SYS_VRB,"WARNING: surface at (%6.0f %6.0f %6.0f) (%6.0f %6.0f %6.0f) too large for desired samplesize/lightmapsize/lightmapscale combination, increased samplesize from %d to %d\n",
                        info->mins[0],
index cf8eefd6e7bdecbd8e64d4ad9894be6e536c0a7a..1a63487f532066814bdb6fe114019bf3084ed9a0 100644 (file)
@@ -2184,6 +2184,7 @@ 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 int                           lmLimitSize Q_ASSIGN( 0 );
 
 Q_EXTERN qboolean                      dirty Q_ASSIGN( qfalse );
 Q_EXTERN qboolean                      dirtDebug Q_ASSIGN( qfalse );