]> de.git.xonotic.org Git - xonotic/netradiant.git/blobdiff - tools/quake3/q3map2/light.c
q3map2/light: rename -fastallocate to -fastlightmapsearch
[xonotic/netradiant.git] / tools / quake3 / q3map2 / light.c
index 0f55316498019126637409ffb2b268ddb0da8a0b..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,25 +2099,28 @@ void LightWorld( const char *BSPFilePath, qboolean fastAllocate ){
                b++;
        }
        /* ydnar: store off lightmaps */
-       StoreSurfaceLightmaps( fastAllocate );
+       StoreSurfaceLightmaps( fastLightmapSearch );
 }
 
 
 
-#ifdef SMOKINGUNS
-//added by spoon to get back the changed surfaceflags
-void LoadSurfaceFlags(char *filename){
+/*
+   LoadSurfaceFlags()
+   added by spoon to get back the changed surfaceflags
+   from tex file
+*/
+
+void LoadSurfaceFlags( char *filename ) {
        int i;
 
-       for(i=0; i<numBSPShaders;i++){
-               shaderInfo_t    *si;
+       for( i = 0; i < numBSPShaders; i++ ) {
+               shaderInfo_t *si;
 
                si = ShaderInfoForShader( bspShaders[i].shader );
 
-               bspShaders[i].surfaceFlags = si->surfaceFlags;
+               bspShaders[ i ].surfaceFlags = si->surfaceFlags;
        }
 }
-#endif
 
 
 
@@ -2136,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" );
@@ -2657,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" ) ) {
@@ -3019,7 +3028,7 @@ int LightMain( int argc, char **argv ){
        SetupTraceNodes();
 
        /* light the world */
-       LightWorld( BSPFilePath, fastAllocate );
+       LightWorld( BSPFilePath, fastLightmapSearch );
 
        /* write out the bsp */
        UnparseEntities();