From a3518d44ed56d319798787e7f7a077d48fe3d98f Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Thu, 24 May 2001 15:48:39 +0000 Subject: [PATCH] Nuke V_CheckGamma, moving its sole contribution to VID_UpdateGamma in vid.c --- libs/video/targets/vid.c | 2 ++ nq/source/gl_view.c | 6 +----- nq/source/r_view.c | 20 +------------------- nq/source/sw_view.c | 6 +----- qw/source/gl_view.c | 6 +----- qw/source/r_view.c | 18 ------------------ qw/source/sw_view.c | 6 +----- 7 files changed, 7 insertions(+), 57 deletions(-) diff --git a/libs/video/targets/vid.c b/libs/video/targets/vid.c index 7366715aa..252186def 100644 --- a/libs/video/targets/vid.c +++ b/libs/video/targets/vid.c @@ -143,6 +143,8 @@ VID_UpdateGamma (cvar_t *vid_gamma) if (vid_gamma->flags & CVAR_ROM) // System gamma unavailable return; + vid.recalc_refdef = 1; // force a surface cache flush + if (vid_gamma_avail && vid_system_gamma->int_val) { // Have system, use it Con_DPrintf ("Setting hardware gamma to %g\n", gamma); VID_BuildGammaTable (1.0); // hardware gamma wants a linear palette diff --git a/nq/source/gl_view.c b/nq/source/gl_view.c index 878f4a23d..9e9ab56fc 100644 --- a/nq/source/gl_view.c +++ b/nq/source/gl_view.c @@ -49,8 +49,6 @@ extern double host_frametime; extern byte gammatable[256]; -extern qboolean V_CheckGamma (void); - extern cvar_t *cl_cshift_powerup; byte ramps[3][256]; @@ -139,7 +137,6 @@ V_UpdatePalette (void) { int i, j; qboolean new; - qboolean force; V_CalcPowerupCshift (); @@ -168,8 +165,7 @@ V_UpdatePalette (void) if (cl.cshifts[CSHIFT_BONUS].percent < 0) cl.cshifts[CSHIFT_BONUS].percent = 0; - force = V_CheckGamma (); - if (!new && !force) + if (!new) return; V_CalcBlend (); diff --git a/nq/source/r_view.c b/nq/source/r_view.c index bee3b99c5..4ec63cffa 100644 --- a/nq/source/r_view.c +++ b/nq/source/r_view.c @@ -221,28 +221,10 @@ V_DriftPitch (void) /* - PALETTE FLASHES + PALETTE FLASHES */ -qboolean -V_CheckGamma (void) -{ - static float oldgamma; - - if (vid_gamma) { // might get called before vid_gamma gets set - if (oldgamma == vid_gamma->value) - return false; - - oldgamma = vid_gamma->value; - } - - vid.recalc_refdef = 1; // force a surface cache flush - - return true; -} - - void V_ParseDamage (void) { diff --git a/nq/source/sw_view.c b/nq/source/sw_view.c index 604c16665..59b310005 100644 --- a/nq/source/sw_view.c +++ b/nq/source/sw_view.c @@ -42,8 +42,6 @@ extern cvar_t *cl_cshift_powerup; extern byte gammatable[256]; -qboolean V_CheckGamma (void); - extern void V_CalcGlowCshift (void); @@ -65,7 +63,6 @@ V_UpdatePalette (void) byte *basepal, *newpal; byte pal[768]; int r, g, b; - qboolean force; V_CalcPowerupCshift (); @@ -94,8 +91,7 @@ V_UpdatePalette (void) if (cl.cshifts[CSHIFT_BONUS].percent < 0) cl.cshifts[CSHIFT_BONUS].percent = 0; - force = V_CheckGamma (); - if (!new && !force) + if (!new) return; basepal = vid_basepal; diff --git a/qw/source/gl_view.c b/qw/source/gl_view.c index 2df1e7f55..663330dce 100644 --- a/qw/source/gl_view.c +++ b/qw/source/gl_view.c @@ -50,8 +50,6 @@ extern double host_frametime; extern byte gammatable[256]; -extern qboolean V_CheckGamma (void); - extern cvar_t *cl_cshift_powerup; byte ramps[3][256]; @@ -141,7 +139,6 @@ V_UpdatePalette (void) { int i, j; qboolean new; - qboolean force; V_CalcPowerupCshift (); @@ -170,8 +167,7 @@ V_UpdatePalette (void) if (cl.cshifts[CSHIFT_BONUS].percent < 0) cl.cshifts[CSHIFT_BONUS].percent = 0; - force = V_CheckGamma (); - if (!new && !force) + if (!new) return; V_CalcBlend (); diff --git a/qw/source/r_view.c b/qw/source/r_view.c index 1f7d6ae6e..1280123a8 100644 --- a/qw/source/r_view.c +++ b/qw/source/r_view.c @@ -257,24 +257,6 @@ V_DriftPitch (void) */ -qboolean -V_CheckGamma (void) -{ - static float oldgamma; - - if (vid_gamma) { // might get called before vid_gamma gets set - if (oldgamma == vid_gamma->value) - return false; - - oldgamma = vid_gamma->value; - } - - vid.recalc_refdef = 1; // force a surface cache flush - - return true; -} - - void V_ParseDamage (void) { diff --git a/qw/source/sw_view.c b/qw/source/sw_view.c index 024ad1b3e..b546ac58d 100644 --- a/qw/source/sw_view.c +++ b/qw/source/sw_view.c @@ -43,8 +43,6 @@ extern cvar_t *cl_cshift_powerup; extern byte gammatable[256]; -qboolean V_CheckGamma (void); - extern void V_CalcGlowCshift (void); @@ -67,7 +65,6 @@ V_UpdatePalette (void) byte *basepal, *newpal; byte pal[768]; int r, g, b; - qboolean force; V_CalcPowerupCshift (); @@ -96,8 +93,7 @@ V_UpdatePalette (void) if (cl.cshifts[CSHIFT_BONUS].percent < 0) cl.cshifts[CSHIFT_BONUS].percent = 0; - force = V_CheckGamma (); - if (!new && !force) + if (!new) return; basepal = vid_basepal;