rename the function
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 20 Oct 2011 17:40:30 +0000 (17:40 +0000)
committerdivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 20 Oct 2011 17:40:30 +0000 (17:40 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11447 d7cf8633-e32d-0410-b094-e92efae38249

gl_rsurf.c
image.c
image.h
model_brush.c

index aad5344..8d9ad75 100644 (file)
@@ -123,7 +123,7 @@ void R_BuildLightMap (const entity_render_t *ent, msurface_t *surface)
        }
 
        if(vid_sRGB.integer && !vid.sRGBcapable3D)
-               Image_MakesRGBColorsFromLinear(templight, templight, size);
+               Image_MakesRGBColorsFromLinear_Lightmap(templight, templight, size);
        R_UpdateTexture(surface->lightmaptexture, templight, surface->lightmapinfo->lightmaporigin[0], surface->lightmapinfo->lightmaporigin[1], 0, smax, tmax, 1);
 
        // update the surface's deluxemap if it has one
diff --git a/image.c b/image.c
index 67c931a..5bc83a0 100644 (file)
--- a/image.c
+++ b/image.c
@@ -797,7 +797,7 @@ void Image_StripImageExtension (const char *in, char *out, size_t size_out)
 }
 
 static unsigned char image_linearfromsrgb[256];
-static unsigned char image_srgbfromlinear[256];
+static unsigned char image_srgbfromlinear_lightmap[256];
 
 void Image_MakeLinearColorsFromsRGB(unsigned char *pout, const unsigned char *pin, int numpixels)
 {
@@ -815,18 +815,18 @@ void Image_MakeLinearColorsFromsRGB(unsigned char *pout, const unsigned char *pi
        }
 }
 
-void Image_MakesRGBColorsFromLinear(unsigned char *pout, const unsigned char *pin, int numpixels)
+void Image_MakesRGBColorsFromLinear_Lightmap(unsigned char *pout, const unsigned char *pin, int numpixels)
 {
        int i;
        // this math from http://www.opengl.org/registry/specs/EXT/texture_sRGB.txt
-       if (!image_srgbfromlinear[255])
+       if (!image_srgbfromlinear_lightmap[255])
                for (i = 0;i < 256;i++)
-                       image_srgbfromlinear[i] = (unsigned char)bound(0, Image_sRGBFloatFromLinear(i*2) * 128.0f, 255);
+                       image_srgbfromlinear_lightmap[i] = (unsigned char)bound(0, Image_sRGBFloatFromLinear(i*2) * 128.0f, 255);
        for (i = 0;i < numpixels;i++)
        {
-               pout[i*4+0] = image_srgbfromlinear[pin[i*4+0]];
-               pout[i*4+1] = image_srgbfromlinear[pin[i*4+1]];
-               pout[i*4+2] = image_srgbfromlinear[pin[i*4+2]];
+               pout[i*4+0] = image_srgbfromlinear_lightmap[pin[i*4+0]];
+               pout[i*4+1] = image_srgbfromlinear_lightmap[pin[i*4+1]];
+               pout[i*4+2] = image_srgbfromlinear_lightmap[pin[i*4+2]];
                pout[i*4+3] = pin[i*4+3];
        }
 }
diff --git a/image.h b/image.h
index 04d3337..823ca39 100644 (file)
--- a/image.h
+++ b/image.h
@@ -53,7 +53,7 @@ extern cvar_t r_fixtrans_auto;
 #define Image_sRGBFloatFromLinear(c) (((c) < 1) ? (c) * 0.05046875f : 1.055f * (float)pow((c)*(1.0f/256.0f), 1.0f/2.4f) - 0.055f)
 
 void Image_MakeLinearColorsFromsRGB(unsigned char *pout, const unsigned char *pin, int numpixels);
-void Image_MakesRGBColorsFromLinear(unsigned char *pout, const unsigned char *pin, int numpixels);
+void Image_MakesRGBColorsFromLinear_Lightmap(unsigned char *pout, const unsigned char *pin, int numpixels);
 
 #endif
 
index 0886711..8bfee82 100644 (file)
@@ -5012,7 +5012,7 @@ static void Mod_Q3BSP_LoadLightmaps(lump_t *l, lump_t *faceslump)
                        else
                        {
                                if(vid_sRGB.integer && !vid.sRGBcapable3D)
-                                       Image_MakesRGBColorsFromLinear(mergedpixels, mergedpixels, mergedwidth * mergedheight);
+                                       Image_MakesRGBColorsFromLinear_Lightmap(mergedpixels, mergedpixels, mergedwidth * mergedheight);
                                loadmodel->brushq3.data_lightmaps [lightmapindex] = R_LoadTexture2D(loadmodel->texturepool, va("lightmap%04i", lightmapindex), mergedwidth, mergedheight, mergedpixels, TEXTYPE_BGRA, TEXF_FORCELINEAR | (gl_texturecompression_q3bsplightmaps.integer ? TEXF_COMPRESS : 0), -1, NULL);
                        }
                }