private void SetColorMappings()
{
float g = idE.CvarSystem.GetFloat("r_gamma");
float b = idE.CvarSystem.GetFloat("r_brightness");
int f, j, inf;
for(int i = 0; i < 256; i++)
{
j = (int) (i * b);
if(j > 255)
{
j = 255;
}
if(g == 1)
{
inf = (j << 8) | j;
}
else
{
inf = (int) (0xffff * idMath.Pow(j / 255.0f, 1.0f / g) + 0.5f);
}
if(inf < 0)
{
inf = 0;
}
if(inf > 0xffff)
{
inf = 0xffff;
}
_gammaTable[i] = (ushort) inf;
}
SetGamma(_gammaTable, _gammaTable, _gammaTable);
}