From 769d2ac75bc092a5d1eb2cee192726305ba4e4a2 Mon Sep 17 00:00:00 2001 From: Ozkan Sezer Date: Sun, 30 Sep 2012 14:03:15 +0000 Subject: [PATCH] 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 --- Quake/gl_vidsdl.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/Quake/gl_vidsdl.c b/Quake/gl_vidsdl.c index 8fd2faee..bd0f30ff 100644 --- a/Quake/gl_vidsdl.c +++ b/Quake/gl_vidsdl.c @@ -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]; }