Nuke V_CheckGamma, moving its sole contribution to VID_UpdateGamma in vid.c

This commit is contained in:
Bill Currie 2001-05-24 15:48:39 +00:00
parent d87d374fcf
commit a3518d44ed
7 changed files with 7 additions and 57 deletions

View file

@ -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

View file

@ -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 ();

View file

@ -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)
{

View file

@ -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;

View file

@ -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 ();

View file

@ -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)
{

View file

@ -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;