properly support -keeplights option. Current implementation never worked.
authorRudolf Polzer <divverent@alientrap.org>
Thu, 1 Dec 2011 15:47:35 +0000 (16:47 +0100)
committerRudolf Polzer <divverent@alientrap.org>
Thu, 1 Dec 2011 15:47:35 +0000 (16:47 +0100)
tools/quake3/q3map2/bsp.c
tools/quake3/q3map2/light.c
tools/quake3/q3map2/writebsp.c

index f9fe9025fbc6633b5e1fe661bbde50d7fa56a607..e1b1e2fdc9c8ba19cf9906c124d34c4864e2a121 100644 (file)
@@ -702,6 +702,11 @@ int BSPMain( int argc, char **argv )
                        Sys_Printf( "Disabling water\n" );
                        nowater = qtrue;
                }
+               else if( !strcmp( argv[ i ], "-keeplights" ))
+               {
+                       keepLights = qtrue;
+                       Sys_Printf( "Leaving light entities on map after compile\n" );
+               }
                else if( !strcmp( argv[ i ],  "-nodetail" ) )
                {
                        Sys_Printf( "Ignoring detail brushes\n") ;
index c7f1e722de59bd121d8b9054f09610b2513476f9..f4a735ca9dab7911ff064621e8d6295e16d7c8fe 100644 (file)
@@ -2105,12 +2105,6 @@ int LightMain( int argc, char **argv )
        else
                Sys_Printf( " shader lightstyles hack: enabled\n" );
 
-       keepLights = game->keepLights;
-       if (keepLights == qtrue)
-               Sys_Printf( " keep lights: enabled\n" );
-       else
-               Sys_Printf( " keep lights: disabled\n" );
-
        patchShadows = game->patchShadows;
        if (patchShadows == qtrue)
                Sys_Printf( " patch shadows: enabled\n" );
@@ -2730,11 +2724,6 @@ int LightMain( int argc, char **argv )
                        noStyles = qfalse;
                        Sys_Printf( "Enabling lightstyles\n" );
                }
-               else if( !strcmp( argv[ i ], "-keeplights" ))
-               {
-                       keepLights = qtrue;
-                       Sys_Printf( "Leaving light entities on map after compile\n" );
-               }
                else if( !strcmp( argv[ i ], "-cpma" ) )
                {
                        cpmaHack = qtrue;
index 2e6e67a0e73d06857089a7477d63c186229812c2..106e618f23ae88158f8562106820783dca90bc78 100644 (file)
@@ -287,6 +287,10 @@ void SetLightStyles( void )
        char            lightTargets[ MAX_SWITCHED_LIGHTS ][ 64 ];
        int                     lightStyles[ MAX_SWITCHED_LIGHTS ];
 
+       /* -keeplights option: force lights to be kept and ignore what the map file says */
+       if (keepLights)
+               SetKeyValue(&entities[0], "_keepLights", "1");
+
        /* ydnar: determine if we keep lights in the bsp */
        if (KeyExists(&entities[ 0 ], "_keepLights") == qtrue)
        {