From: divverent Date: Thu, 20 Oct 2011 17:40:30 +0000 (+0000) Subject: rename the function X-Git-Tag: xonotic-v0.6.0~163^2~110 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=ff3467b646bfe97304d9ae4170ae405cd1eff6a2;p=xonotic%2Fdarkplaces.git rename the function git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11447 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/gl_rsurf.c b/gl_rsurf.c index aad5344b..8d9ad756 100644 --- a/gl_rsurf.c +++ b/gl_rsurf.c @@ -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 67c931a4..5bc83a00 100644 --- 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 04d33378..823ca397 100644 --- 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 diff --git a/model_brush.c b/model_brush.c index 08867119..8bfee829 100644 --- a/model_brush.c +++ b/model_brush.c @@ -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); } }