]> de.git.xonotic.org Git - xonotic/netradiant.git/commitdiff
Merge branch 'matthiaskrgr/no_store_on_no_bnc' into 'master' xonotic-v0.8.2
authorMario <zacjardine@y7mail.com>
Sun, 12 Mar 2017 22:47:19 +0000 (22:47 +0000)
committerMario <zacjardine@y7mail.com>
Sun, 12 Mar 2017 22:47:19 +0000 (22:47 +0000)
q3map2: don't store lightmap if the last bounce computation ran empty.

See merge request !9

tools/quake3/q3map2/light.c

index 2571d4d2080cfefb656cd13b5e8e0964f4121fc8..78e3c817ea7dd3541872b82b5f2e293e29b179a2 100644 (file)
@@ -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 );