]> git.xonotic.org Git - xonotic/netradiant.git/commitdiff
q3map2/light: rename -fastallocate to -fastlightmapsearch
authorThomas Debesse <dev@illwieckz.net>
Sun, 22 Sep 2019 00:24:08 +0000 (02:24 +0200)
committerThomas Debesse <dev@illwieckz.net>
Sun, 13 Oct 2019 02:19:57 +0000 (04:19 +0200)
tools/quake3/q3map2/help.c
tools/quake3/q3map2/light.c
tools/quake3/q3map2/lightmaps_ydnar.c
tools/quake3/q3map2/q3map2.h

index 1c99d3c417b605af6ff97f614e59a2a866832117..28690061e8aa8efb538729b79b6866cbf7aef979 100644 (file)
@@ -207,10 +207,11 @@ void HelpLight()
                {"-extravisnudge", "Broken feature to nudge the luxel origin to a better vis cluster"},
                {"-extrawide", "Deprecated alias for `-super 2 -filter`"},
                {"-extra", "Deprecated alias for `-super 2`"},
-               {"-fastallocate", "Use `-fastallocate` to trade lightmap size against allocation time (useful with hi res lightmaps on large maps: reduce allocation time from days to minutes for only some extra bytes)"},
+               {"-fastallocate", "Deprecated alias for `-fastlightmapsearch`"},
                {"-fastbounce", "Use `-fast` style lighting for radiosity"},
                {"-faster", "Use a faster falloff curve for lighting; also implies `-fast`"},
                {"-fastgrid", "Use `-fast` style lighting for the light grid"},
+               {"-fastlightmapsearch", "Use `-fastlightmapsearch` to trade lightmap size against packing time (useful with hi res lightmaps on large maps: reduce allocation time from days to minutes for only some extra bytes)"},
                {"-fast", "Ignore tiny light contributions"},
                {"-fill", "Fill lightmap colors from surrounding pixels to improve JPEG compression"},
                {"-filter", "Lightmap filtering"},
index 6b60e7372c972b06e28a6e83ce18e551becd7a03..dd906c1ca89f369291a351ad65a2f6459aeb2601 100644 (file)
@@ -1890,7 +1890,7 @@ void SetupGrid( void ){
    does what it says...
  */
 
-void LightWorld( const char *BSPFilePath, qboolean fastAllocate ){
+void LightWorld( const char *BSPFilePath, qboolean fastLightmapSearch ){
        vec3_t color;
        float f;
        int b, bt;
@@ -2034,7 +2034,7 @@ void LightWorld( const char *BSPFilePath, qboolean fastAllocate ){
        while ( bounce > 0 )
        {
                /* store off the bsp between bounces */
-               StoreSurfaceLightmaps( fastAllocate );
+               StoreSurfaceLightmaps( fastLightmapSearch );
                UnparseEntities();
                Sys_Printf( "Writing %s\n", BSPFilePath );
                WriteBSPFile( BSPFilePath );
@@ -2099,7 +2099,7 @@ void LightWorld( const char *BSPFilePath, qboolean fastAllocate ){
                b++;
        }
        /* ydnar: store off lightmaps */
-       StoreSurfaceLightmaps( fastAllocate );
+       StoreSurfaceLightmaps( fastLightmapSearch );
 }
 
 
@@ -2139,7 +2139,7 @@ int LightMain( int argc, char **argv ){
        const char  *value;
        int lightmapMergeSize = 0;
        qboolean lightSamplesInsist = qfalse;
-       qboolean fastAllocate = qfalse;
+       qboolean fastLightmapSearch = qfalse;
 
        /* note it */
        Sys_Printf( "--- Light ---\n" );
@@ -2660,9 +2660,15 @@ int LightMain( int argc, char **argv ){
                        Sys_Printf( "Faster mode enabled\n" );
                }
 
-               else if ( !strcmp( argv[ i ], "-fastallocate" ) ) {
-                       fastAllocate = qtrue;
-                       Sys_Printf( "Fast allocation mode enabled\n" );
+               else if ( !strcmp( argv[ i ], "-fastlightmapsearch" ) || !strcmp( argv[ i ], "-fastallocate") ) {
+                       fastLightmapSearch = qtrue;
+
+                       if ( !strcmp( argv[ i ], "-fastallocate" ) ) {
+                               Sys_Printf( "The -fastallocate argument is deprecated, use \"-fastlightmapsearch\" instead\n" );
+                       }
+                       else {
+                               Sys_Printf( "Fast lightmap search enabled\n" );
+                       }
                }
 
                else if ( !strcmp( argv[ i ], "-fastgrid" ) ) {
@@ -3022,7 +3028,7 @@ int LightMain( int argc, char **argv ){
        SetupTraceNodes();
 
        /* light the world */
-       LightWorld( BSPFilePath, fastAllocate );
+       LightWorld( BSPFilePath, fastLightmapSearch );
 
        /* write out the bsp */
        UnparseEntities();
index fc8dcced9867d56966b946c462e07ef40640d313..d169c21f6d6df3693f103cc80c38999a8fbdf40b 100644 (file)
@@ -1975,7 +1975,7 @@ static void SetupOutLightmap( rawLightmap_t *lm, outLightmap_t *olm ){
  */
 
 #define LIGHTMAP_RESERVE_COUNT 1
-static void FindOutLightmaps( rawLightmap_t *lm, qboolean fastAllocate ){
+static void FindOutLightmaps( rawLightmap_t *lm, qboolean fastLightmapSearch ){
        int i, j, k, lightmapNum, xMax, yMax, x = -1, y = -1, sx, sy, ox, oy, offset;
        outLightmap_t       *olm;
        surfaceInfo_t       *info;
@@ -2095,7 +2095,7 @@ static void FindOutLightmaps( rawLightmap_t *lm, qboolean fastAllocate ){
                                }
 
                                /* if fast allocation, skip lightmap files that are more than 90% complete */
-                               if ( fastAllocate == qtrue ) {
+                               if ( fastLightmapSearch == qtrue ) {
                                        if (olm->freeLuxels < (olm->customWidth * olm->customHeight) / 10) {
                                                continue;
                                        }
@@ -2119,7 +2119,7 @@ static void FindOutLightmaps( rawLightmap_t *lm, qboolean fastAllocate ){
                                }
 
                                /* if fast allocation, do not test allocation on every pixels, especially for large lightmaps */
-                               if ( fastAllocate == qtrue ) {
+                               if ( fastLightmapSearch == qtrue ) {
                                        xIncrement = MAX(1, lm->w / 15);
                                        yIncrement = MAX(1, lm->h / 15);
                                }
@@ -2462,7 +2462,7 @@ void FillOutLightmap( outLightmap_t *olm ){
    stores the surface lightmaps into the bsp as byte rgb triplets
  */
 
-void StoreSurfaceLightmaps( qboolean fastAllocate ){
+void StoreSurfaceLightmaps( qboolean fastLightmapSearch ){
        int i, j, k, x, y, lx, ly, sx, sy, *cluster, mappedSamples;
        int style, size, lightmapNum, lightmapNum2;
        float               *normal, *luxel, *bspLuxel, *bspLuxel2, *radLuxel, samples, occludedSamples;
@@ -3080,7 +3080,7 @@ void StoreSurfaceLightmaps( qboolean fastAllocate ){
        for ( i = 0; i < numRawLightmaps; i++ )
        {
                lm = &rawLightmaps[ sortLightmaps[ i ] ];
-               FindOutLightmaps( lm, fastAllocate );
+               FindOutLightmaps( lm, fastLightmapSearch );
        }
 
        /* set output numbers in twinned lightmaps */
index 38ee560a6bf4c4610c6ac7b86ab68185c533b16a..4220725d85417a6edbfe4fc813d0ec234e4265b4 100644 (file)
@@ -1858,7 +1858,7 @@ int                         ImportLightmapsMain( int argc, char **argv );
 
 void                        SetupSurfaceLightmaps( void );
 void                        StitchSurfaceLightmaps( void );
-void                        StoreSurfaceLightmaps( qboolean fastAllocate );
+void                        StoreSurfaceLightmaps( qboolean fastLightmapSearch );
 
 
 /* exportents.c */