]> de.git.xonotic.org Git - xonotic/netradiant.git/blobdiff - tools/quake3/q3map2/light.c
Merge branch 'dpkdir' into 'master'
[xonotic/netradiant.git] / tools / quake3 / q3map2 / light.c
index a408e35a60f8cb120deac63af01a250c833812b7..78e3c817ea7dd3541872b82b5f2e293e29b179a2 100644 (file)
@@ -1910,14 +1910,14 @@ void LightWorld( const char *BSPFilePath, qboolean fastAllocate ){
 
        /* find the optional minimum lighting values */
        GetVectorForKey( &entities[ 0 ], "_color", color );
+       if ( VectorLength( color ) == 0.0f ) {
+               VectorSet( color, 1.0, 1.0, 1.0 );
+       }
        if ( colorsRGB ) {
                color[0] = Image_LinearFloatFromsRGBFloat( color[0] );
                color[1] = Image_LinearFloatFromsRGBFloat( color[1] );
                color[2] = Image_LinearFloatFromsRGBFloat( color[2] );
        }
-       if ( VectorLength( color ) == 0.0f ) {
-               VectorSet( color, 1.0, 1.0, 1.0 );
-       }
 
        /* ambient */
        f = FloatForKey( &entities[ 0 ], "_ambient" );
@@ -2054,7 +2054,7 @@ void LightWorld( const char *BSPFilePath, qboolean fastAllocate ){
                SetupEnvelopes( qfalse, fastbounce );
                if ( numLights == 0 ) {
                        Sys_Printf( "No diffuse light to calculate, ending radiosity.\n" );
-                       break;
+                       return;
                }
 
                /* add to lightgrid */
@@ -2097,6 +2097,8 @@ void LightWorld( const char *BSPFilePath, qboolean fastAllocate ){
                bounce--;
                b++;
        }
+       /* ydnar: store off lightmaps */
+       StoreSurfaceLightmaps( fastAllocate );
 }
 
 
@@ -2992,9 +2994,6 @@ int LightMain( int argc, char **argv ){
        /* light the world */
        LightWorld( BSPFilePath, fastAllocate );
 
-       /* ydnar: store off lightmaps */
-       StoreSurfaceLightmaps( fastAllocate );
-
        /* write out the bsp */
        UnparseEntities();
        Sys_Printf( "Writing %s\n", BSPFilePath );