From a78573e0e9d7a7d13519dc03d5f00f9e87bedaa1 Mon Sep 17 00:00:00 2001 From: Rudolf Polzer Date: Tue, 24 Sep 2013 12:45:12 +0200 Subject: [PATCH] HAHA. Fix a bug that prevented ANY non-sRGB builds with the current default build menu. For ages now. Also addd some attempt to track down a bounce issue. --- tools/quake3/q3map2/light.c | 15 ++++++++++++--- tools/quake3/q3map2/light_bounce.c | 5 +++++ 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/tools/quake3/q3map2/light.c b/tools/quake3/q3map2/light.c index ffcd832a..a0965979 100644 --- a/tools/quake3/q3map2/light.c +++ b/tools/quake3/q3map2/light.c @@ -2343,12 +2343,21 @@ int LightMain( int argc, char **argv ){ Sys_Printf( "Colors are linear\n" ); } - else if ( !strcmp( argv[ i ], "-nosRGB" ) ) { + else if ( !strcmp( argv[ i ], "-sRGB" ) ) { lightmapsRGB = qtrue; - Sys_Printf( "Lighting is linear\n" ); + Sys_Printf( "Lighting is in sRGB\n" ); texturesRGB = qtrue; - Sys_Printf( "Textures are linear\n" ); + Sys_Printf( "Textures are in sRGB\n" ); colorsRGB = qtrue; + Sys_Printf( "Colors are in sRGB\n" ); + } + + else if ( !strcmp( argv[ i ], "-nosRGB" ) ) { + lightmapsRGB = qfalse; + Sys_Printf( "Lighting is linear\n" ); + texturesRGB = qfalse; + Sys_Printf( "Textures are linear\n" ); + colorsRGB = qfalse; Sys_Printf( "Colors are linear\n" ); } diff --git a/tools/quake3/q3map2/light_bounce.c b/tools/quake3/q3map2/light_bounce.c index f72653ab..d91744f0 100644 --- a/tools/quake3/q3map2/light_bounce.c +++ b/tools/quake3/q3map2/light_bounce.c @@ -551,6 +551,8 @@ static void RadSubdivideDiffuseLight( int lightmapNum, bspDrawSurface_t *ds, raw /* bouncing light? */ if ( !bouncing ) { + Sys_Printf( "BUG: RadSubdivideDiffuseLight !bouncing shouldn't happen\n" ); + /* handle first-pass lights in normal q3a style */ value = si->value; light->photons = value * area * areaScale; @@ -616,6 +618,9 @@ static void RadSubdivideDiffuseLight( int lightmapNum, bspDrawSurface_t *ds, raw light->dist = DotProduct( light->origin, normal ); } + if (light->photons < 0 || light->add < 0 || light->color[0] < 0 || light->color[1] < 0 || light->color[2] < 0) + Sys_Printf( "BUG: RadSubdivideDiffuseLight created a darkbulb\n" ); + /* emit light from both sides? */ if ( si->compileFlags & C_FOG || si->twoSided ) { light->flags |= LIGHT_TWOSIDED; -- 2.39.2