]> git.xonotic.org Git - xonotic/netradiant.git/blobdiff - tools/quake3/q3map2/light.c
Merge commit '7ca7a54fe6db387a22ea979e62ecbbb30f6d6d30' into garux-merge
[xonotic/netradiant.git] / tools / quake3 / q3map2 / light.c
index 78e3c817ea7dd3541872b82b5f2e293e29b179a2..0d98744d942ef2cdb99af8beef044b0af2a38a08 100644 (file)
@@ -442,7 +442,7 @@ void CreateEntityLights( void ){
                        /* get target */
                        e2 = FindTargetEntity( target );
                        if ( e2 == NULL ) {
-                               Sys_Printf( "WARNING: light at (%i %i %i) has missing target\n",
+                               Sys_FPrintf( SYS_WRN, "WARNING: light at (%i %i %i) has missing target\n",
                                                        (int) light->origin[ 0 ], (int) light->origin[ 1 ], (int) light->origin[ 2 ] );
                                light->photons *= pointScale;
                        }
@@ -1159,7 +1159,7 @@ int LightContributionToSample( trace_t *trace ){
                /* return to sender */
                return 1;
        }
-       else{
+       else {
                Error( "Light of undefined type!" );
        }
 
@@ -1913,6 +1913,7 @@ void LightWorld( const char *BSPFilePath, qboolean fastAllocate ){
        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] );
@@ -2120,7 +2121,6 @@ int LightMain( int argc, char **argv ){
        qboolean lightSamplesInsist = qfalse;
        qboolean fastAllocate = qfalse;
 
-
        /* note it */
        Sys_Printf( "--- Light ---\n" );
        Sys_Printf( "--- ProcessGameSpecific ---\n" );
@@ -2254,6 +2254,18 @@ int LightMain( int argc, char **argv ){
                        i++;
                }
 
+               else if ( !strcmp( argv[ i ], "-vertexscale" ) ) {
+                       f = atof( argv[ i + 1 ] );
+                       vertexglobalscale *= f;
+                       Sys_Printf( "Vertexlight scaled by %f to %f\n", f, vertexglobalscale );
+                       i++;
+               }
+
+               else if ( !strcmp( argv[ i ], "-nolm" ) ) {
+                       nolm = qtrue;
+                       Sys_Printf( "No lightmaps yo\n" );
+               }
+
                else if ( !strcmp( argv[ i ], "-bouncescale" ) ) {
                        f = atof( argv[ i + 1 ] );
                        bounceScale *= f;
@@ -2486,6 +2498,7 @@ int LightMain( int argc, char **argv ){
                        }
                        i++;
                }
+
                else if ( !strcmp( argv[ i ], "-deluxe" ) || !strcmp( argv[ i ], "-deluxemap" ) ) {
                        deluxemap = qtrue;
                        Sys_Printf( "Generating deluxemaps for average light direction\n" );
@@ -2515,7 +2528,7 @@ int LightMain( int argc, char **argv ){
 
                        /* must be a power of 2 and greater than 2 */
                        if ( ( ( lmCustomSize - 1 ) & lmCustomSize ) || lmCustomSize < 2 ) {
-                               Sys_Printf( "WARNING: Lightmap size must be a power of 2, greater or equal to 2 pixels.\n" );
+                               Sys_FPrintf( SYS_WRN, "WARNING: Lightmap size must be a power of 2, greater or equal to 2 pixels.\n" );
                                lmCustomSize = game->lightmapSize;
                        }
                        i++;
@@ -2755,8 +2768,15 @@ int LightMain( int argc, char **argv ){
                        Sys_Printf( "Lightmaps sample scale set to %d\n", sampleScale );
                }
                else if ( !strcmp( argv[ i ], "-novertex" ) ) {
-                       noVertexLighting = qtrue;
-                       Sys_Printf( "Disabling vertex lighting\n" );
+                       noVertexLighting = 1;
+                       if ( ( atof( argv[ i + 1 ] ) != 0 ) && ( atof( argv[ i + 1 ] )) < 1 ) {
+                               noVertexLighting = ( atof( argv[ i + 1 ] ) );
+                               i++;
+                               Sys_Printf( "Setting vertex lighting globally to %d\n", noVertexLighting );
+                       }
+                       else{
+                               Sys_Printf( "Disabling vertex lighting\n" );
+                       }
                }
                else if ( !strcmp( argv[ i ], "-nogrid" ) ) {
                        noGridLighting = qtrue;
@@ -2778,6 +2798,14 @@ int LightMain( int argc, char **argv ){
                        loMem = qtrue;
                        Sys_Printf( "Enabling low-memory (potentially slower) lighting mode\n" );
                }
+               else if ( !strcmp( argv[ i ], "-lightsubdiv" ) ) {
+                       defaultLightSubdivide = atoi( argv[ i + 1 ] );
+                       if ( defaultLightSubdivide < 1 ) {
+                               defaultLightSubdivide = 1;
+                       }
+                       i++;
+                       Sys_Printf( "Default light subdivision set to %d\n", defaultLightSubdivide );
+               }
                else if ( !strcmp( argv[ i ], "-lightanglehl" ) ) {
                        if ( ( atoi( argv[ i + 1 ] ) != 0 ) != lightAngleHL ) {
                                lightAngleHL = ( atoi( argv[ i + 1 ] ) != 0 );
@@ -2787,6 +2815,7 @@ int LightMain( int argc, char **argv ){
                                else{
                                        Sys_Printf( "Disabling half lambert light angle attenuation\n" );
                                }
+                               i++;
                        }
                }
                else if ( !strcmp( argv[ i ], "-nostyle" ) || !strcmp( argv[ i ], "-nostyles" ) ) {
@@ -2832,7 +2861,7 @@ int LightMain( int argc, char **argv ){
                                Sys_Printf( "Enabling randomized dirtmapping\n" );
                        }
                        else{
-                               Sys_Printf( "Enabling ordered dir mapping\n" );
+                               Sys_Printf( "Enabling ordered dirtmapping\n" );
                        }
                        i++;
                }
@@ -2885,7 +2914,7 @@ int LightMain( int argc, char **argv ){
                /* unhandled args */
                else
                {
-                       Sys_Printf( "WARNING: Unknown argument \"%s\"\n", argv[ i ] );
+                       Sys_FPrintf( SYS_WRN, "WARNING: Unknown argument \"%s\"\n", argv[ i ] );
                }
 
        }