simplify VID_Gamma_f: the oldgamma stuff is already handled by the cvar

system itself.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@751 af15c1b1-3010-417e-b628-4374ebc0bcbd
This commit is contained in:
Ozkan Sezer 2012-09-30 14:03:15 +00:00
parent 53c55f6bd3
commit 769d2ac75b

View file

@ -196,18 +196,12 @@ VID_Gamma_f -- callback when the cvar changes
*/
static void VID_Gamma_f (cvar_t *var)
{
static float oldgamma;
int i;
if (vid_gamma.value == oldgamma)
return;
oldgamma = vid_gamma.value;
for (i = 0; i < 256; i++)
{
vid_gamma_red[i] =
CLAMP(0, (int) (255 * pow ((i+0.5)/255.5, vid_gamma.value) + 0.5), 255) << 8;
CLAMP(0, (int) (255 * pow((i + 0.5)/255.5, var->value) + 0.5), 255) << 8;
vid_gamma_green[i] = vid_gamma_red[i];
vid_gamma_blue[i] = vid_gamma_red[i];
}