}
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
}
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)
{
}
}
-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];
}
}
#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
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);
}
}