]> de.git.xonotic.org Git - xonotic/netradiant.git/blobdiff - tools/quake3/q3map2/light_bounce.c
support -sRGBcolor for flares
[xonotic/netradiant.git] / tools / quake3 / q3map2 / light_bounce.c
index 6d7c54fc6d49aee5f525b47bbf7c989c7c5267d8..d78c6dee872d9c15cd438099fbd952aa91955cba 100644 (file)
@@ -233,6 +233,14 @@ qboolean RadSampleImage( byte *pixels, int width, int height, float st[ 2 ], flo
        pixels += (y * width * 4) + (x * 4);
        VectorCopy( pixels, color );
        color[ 3 ] = pixels[ 3 ];
+
+       if(texturesRGB)
+       {
+               color[0] = Image_LinearFloatFromsRGBFloat(color[0] * (1.0 / 255.0)) * 255.0;
+               color[1] = Image_LinearFloatFromsRGBFloat(color[1] * (1.0 / 255.0)) * 255.0;
+               color[2] = Image_LinearFloatFromsRGBFloat(color[2] * (1.0 / 255.0)) * 255.0;
+       }
+
        return qtrue;
 }
 
@@ -414,7 +422,7 @@ subdivides a radiosity winding until it is smaller than subdivide, then generate
 static void RadSubdivideDiffuseLight( int lightmapNum, bspDrawSurface_t *ds, rawLightmap_t *lm, shaderInfo_t *si,
        float scale, float subdivide, qboolean original, radWinding_t *rw, clipWork_t *cw )
 {
-       int                             i, style;
+       int                             i, style = 0;
        float                   dist, area, value;
        vec3_t                  mins, maxs, normal, d1, d2, cross, color, gradient;
        light_t                 *light, *splash;
@@ -539,7 +547,7 @@ static void RadSubdivideDiffuseLight( int lightmapNum, bspDrawSurface_t *ds, raw
        light->falloffTolerance = falloffTolerance;
        
        /* bouncing light? */
-       if( bouncing == qfalse )
+       if( !bouncing )
        {
                /* handle first-pass lights in normal q3a style */
                value = si->value;
@@ -626,14 +634,12 @@ void RadLightForTriangles( int num, int lightmapNum, rawLightmap_t *lm, shaderIn
 {
        int                                     i, j, k, v;
        bspDrawSurface_t        *ds;
-       surfaceInfo_t           *info;
        float                           *radVertexLuxel;
        radWinding_t            rw;
        
        
        /* get surface */
        ds = &bspDrawSurfaces[ num ];
-       info = &surfaceInfos[ num ];
        
        /* each triangle is a potential emitter */
        rw.numVerts = 3;