]> de.git.xonotic.org Git - xonotic/netradiant.git/commitdiff
-randomsamples: special handling of -samples 1, 2, 3, 4 as quality presets (to be...
authorRudolf Polzer <divverent@alientrap.org>
Thu, 21 Oct 2010 18:35:35 +0000 (20:35 +0200)
committerRudolf Polzer <divverent@alientrap.org>
Thu, 21 Oct 2010 18:35:35 +0000 (20:35 +0200)
tools/quake3/q3map2/light.c

index 59ceab8e42d9872c3588e5e9985a87a43154c252..b531089017809d8d9b02bf3c2513f48848e5f121 100644 (file)
@@ -2050,6 +2050,7 @@ int LightMain( int argc, char **argv )
        char            mapSource[ 1024 ];
        const char      *value;
        int lightmapMergeSize = 0;
+       qboolean        lightSamplesInsist = qfalse;
        
        
        /* note it */
@@ -2255,6 +2256,8 @@ int LightMain( int argc, char **argv )
                
                else if( !strcmp( argv[ i ], "-samples" ) )
                {
+                       if(*argv[i+1] == '+')
+                               lightSamplesInsist = qtrue;
                        lightSamples = atoi( argv[ i + 1 ] );
                        if( lightSamples < 1 )
                                lightSamples = 1;
@@ -2757,6 +2760,29 @@ int LightMain( int argc, char **argv )
 
        }
 
+       /* fix up samples count */
+       if(lightRandomSamples)
+       {
+               if(!lightSamplesInsist)
+               {
+                       /* approximately match -samples in quality */
+                       switch(lightSamples)
+                       {
+                               /* somewhat okay */
+                               case 1:
+                               case 2: lightSamples = 16; break;
+
+                               /* good */
+                               case 3: lightSamples = 64; break;
+
+                               /* perfect */
+                               case 4: lightSamples = 256; break;
+
+                               default: break;
+                       }
+               }
+       }
+
        /* fix up lightmap search power */
        if(lightmapMergeSize)
        {