-randomsamples: special handling of -samples 1, 2, 3, 4 as quality presets (to be more consistent with typical -samples use)

This commit is contained in:
Rudolf Polzer 2010-10-21 20:35:35 +02:00
parent 5ec6743f09
commit 10dfced6cb

View 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)
{