]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
rename the function
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 20 Oct 2011 17:40:30 +0000 (17:40 +0000)
committerRudolf Polzer <divverent@xonotic.org>
Fri, 21 Oct 2011 10:05:44 +0000 (12:05 +0200)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11447 d7cf8633-e32d-0410-b094-e92efae38249
::stable-branch::merge=ff3467b646bfe97304d9ae4170ae405cd1eff6a2

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

index aad5344bf2eb22830e75e95a855c42112164c537..8d9ad7563558e12714c61a7878d922feb638f5c2 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 67c931a4d8a3e213acd7c9185fdda9034ebc7c5f..5bc83a0089b11ddf1f11c1afb222828fb339008a 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 04d33378ff1be29f4a6610dc2b97b37103c2d91f..823ca397e783f5187a09710752a09ef17d9c4db2 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 088671193e612439db269020e0823808c857afc1..8bfee8298d354631332ab90ba3d9d4cf7b8dc9dc 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);
                        }
                }