gl_screen.c: Minor tweaks, contrast gets clamped to 0.1-1 instead of 0.2-1

view.h: Add brightness, contrast cvars as extern
menu.c: Change brightness scroller to use the brightness cvar, add
contrast scroller.
r_view, sw_view.c: Add brightness/contrast cvars to software, and make
them work.
This commit is contained in:
Jeff Teunissen 2000-09-20 04:06:12 +00:00
parent 3396ca6fde
commit a3e19d5cc2
5 changed files with 163 additions and 179 deletions

View file

@ -33,7 +33,8 @@
#include "mathlib.h" #include "mathlib.h"
#include "cvar.h" #include "cvar.h"
extern cvar_t *v_gamma; extern cvar_t *brightness;
extern cvar_t *contrast;
extern cvar_t *lcd_x; extern cvar_t *lcd_x;
void V_Init (void); void V_Init (void);

View file

@ -1264,20 +1264,19 @@ void SCR_UpdateScreen (void)
glEnd (); glEnd ();
} }
glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
contrast->value = bound(0.2, contrast->value, 1.0); contrast->value = bound(0.1, contrast->value, 1.0);
if ((gl_polyblend->value && v_blend[3]) || contrast->value < 1) if ((gl_polyblend->value && v_blend[3]) || contrast->value < 1)
{ {
glBegin (GL_QUADS); glBegin (GL_QUADS);
if (contrast->value < 1) if (contrast->value < 1) {
{ glColor4f (1, 1, 1, (1 - contrast->value));
glColor4f (1, 1, 1, 1-contrast->value);
glVertex2f (0,0); glVertex2f (0,0);
glVertex2f (vid.width, 0); glVertex2f (vid.width, 0);
glVertex2f (vid.width, vid.height); glVertex2f (vid.width, vid.height);
glVertex2f (0, vid.height); glVertex2f (0, vid.height);
} }
if (gl_polyblend->value && v_blend[3])
{ if (gl_polyblend->value && v_blend[3]) {
glColor4fv (v_blend); glColor4fv (v_blend);
glVertex2f (0,0); glVertex2f (0,0);
glVertex2f (vid.width, 0); glVertex2f (vid.width, 0);

View file

@ -386,7 +386,7 @@ void M_Main_Key (int key)
//============================================================================= //=============================================================================
/* OPTIONS MENU */ /* OPTIONS MENU */
#define OPTIONS_ITEMS 16 #define OPTIONS_ITEMS 17
#define SLIDER_RANGE 10 #define SLIDER_RANGE 10
@ -406,60 +406,60 @@ void M_AdjustSliders (int dir)
switch (options_cursor) { switch (options_cursor) {
case 3: // screen size case 3: // screen size
Cvar_SetValue(scr_viewsize, bound(30, (int)scr_viewsize->value + (dir * 10), 120)); Cvar_SetValue (scr_viewsize, bound (30, (int)scr_viewsize->value + (dir * 10), 120));
break; break;
case 4: // gamma case 4: // Brightness
Cvar_SetValue(v_gamma, bound(0.5, v_gamma->value - (dir * 0.05), 1)); Cvar_SetValue (brightness, bound (1, brightness->value + (dir * 0.25), 5));
break; break;
case 5: // mouse speed case 5: // Contrast
Cvar_SetValue(sensitivity, bound(1, sensitivity->value + dir, 25)); Cvar_SetValue (contrast, bound (0.0, contrast->value + (dir * 0.05), 1));
break; break;
case 6: // music volume case 6: // mouse speed
Cvar_SetValue(bgmvolume, Cvar_SetValue (sensitivity, bound (1, sensitivity->value + dir, 25));
break;
case 7: // music volume
#ifdef _WIN32 #ifdef _WIN32
bound(0, bgmvolume->value + dir, 1)); Cvar_SetValue (bgmvolume, bound (0, bgmvolume->value + dir, 1));
#else #else
bound(0, bgmvolume->value + (dir * 0.1), 1)); Cvar_SetValue (bgmvolume, bound (0, bgmvolume->value + (dir * 0.1), 1));
#endif #endif
break; break;
case 7: // sfx volume case 8: // sfx volume
Cvar_SetValue(volume, bound(0, volume->value + (dir * 0.1), 1)); Cvar_SetValue (volume, bound (0, volume->value + (dir * 0.1), 1));
break; break;
case 8: // allways run case 9: // allways run
if (cl_forwardspeed->value > 200) { if (cl_forwardspeed->value > 200) {
Cvar_SetValue(cl_forwardspeed, 200); Cvar_SetValue (cl_forwardspeed, 200);
Cvar_SetValue(cl_backspeed, 200); Cvar_SetValue (cl_backspeed, 200);
} else { } else {
Cvar_SetValue(cl_forwardspeed, 400); Cvar_SetValue (cl_forwardspeed, 400);
Cvar_SetValue(cl_backspeed, 400); Cvar_SetValue (cl_backspeed, 400);
} }
break; break;
case 9: // invert mouse case 10: // invert mouse
Cvar_SetValue(m_pitch, -m_pitch->value); Cvar_SetValue (m_pitch, -m_pitch->value);
break; break;
case 10: // lookspring case 11: // lookspring
Cvar_SetValue(lookspring, !lookspring->value); Cvar_SetValue (lookspring, !lookspring->value);
break; break;
case 11: // lookstrafe case 12: // lookstrafe
Cvar_SetValue(lookstrafe, !lookstrafe->value); Cvar_SetValue (lookstrafe, !lookstrafe->value);
break; break;
case 12: // Use old-style sbar case 13: // Use old-style sbar
Cvar_SetValue(cl_sbar, !cl_sbar->value); Cvar_SetValue (cl_sbar, !cl_sbar->value);
break; break;
case 13: // HUD on left side case 14: // HUD on left side
Cvar_SetValue (cl_hudswap, !cl_hudswap->value); Cvar_SetValue (cl_hudswap, !cl_hudswap->value);
break; break;
case 15: // _windowed_mouse case 16: // _windowed_mouse
if (_windowed_mouse->value) { Cvar_SetValue (_windowed_mouse, !_windowed_mouse->value);
Cvar_SetValue (_windowed_mouse, !_windowed_mouse->value);
}
break; break;
} }
} }
@ -512,49 +512,52 @@ void M_Options_Draw (void)
M_DrawSlider (220, 56, r); M_DrawSlider (220, 56, r);
M_Print (16, 64, " Brightness"); M_Print (16, 64, " Brightness");
r = (1.0 - v_gamma->value) / 0.5; r = (brightness->value - 1) / 4;
M_DrawSlider (220, 64, r); M_DrawSlider (220, 64, r);
M_Print (16, 72, " Mouse Speed"); M_Print (16, 72, " Contrast");
r = (sensitivity->value - 1)/10; r = contrast->value;
M_DrawSlider (220, 72, r); M_DrawSlider (220, 72, r);
M_Print (16, 80, " CD Music Volume"); M_Print (16, 80, " Mouse Speed");
r = bgmvolume->value; r = (sensitivity->value - 1) / 24;
M_DrawSlider (220, 80, r); M_DrawSlider (220, 80, r);
M_Print (16, 88, " Sound Volume"); M_Print (16, 88, " CD Music Volume");
r = volume->value; r = bgmvolume->value;
M_DrawSlider (220, 88, r); M_DrawSlider (220, 88, r);
M_Print (16, 96, " Always Run"); M_Print (16, 96, " Sound Volume");
M_DrawCheckbox (220, 96, cl_forwardspeed->value > 200); r = volume->value;
M_DrawSlider (220, 96, r);
M_Print (16, 104, " Invert Mouse"); M_Print (16, 104, " Always Run");
M_DrawCheckbox (220, 104, m_pitch->value < 0); M_DrawCheckbox (220, 104, cl_forwardspeed->value > 200);
M_Print (16, 112, " Lookspring"); M_Print (16, 112, " Invert Mouse");
M_DrawCheckbox (220, 112, lookspring->value); M_DrawCheckbox (220, 112, m_pitch->value < 0);
M_Print (16, 120, " Lookstrafe"); M_Print (16, 120, " Lookspring");
M_DrawCheckbox (220, 120, lookstrafe->value); M_DrawCheckbox (220, 120, lookspring->value);
M_Print (16, 128, " Use old status bar"); M_Print (16, 128, " Lookstrafe");
M_DrawCheckbox (220, 128, cl_sbar->value); M_DrawCheckbox (220, 128, lookstrafe->value);
M_Print (16, 136, " HUD on left side"); M_Print (16, 136, " Use old status bar");
M_DrawCheckbox (220, 136, cl_hudswap->value); M_DrawCheckbox (220, 136, cl_sbar->value);
M_Print (16, 144, " HUD on left side");
M_DrawCheckbox (220, 144, cl_hudswap->value);
if (vid_menudrawfn) if (vid_menudrawfn)
M_Print (16, 144, " Video Options"); M_Print (16, 152, " Video Options");
#ifdef _WIN32 #ifdef _WIN32
if (modestate == MS_WINDOWED) if (modestate == MS_WINDOWED) {
{
#endif #endif
if (_windowed_mouse) { if (_windowed_mouse) {
M_Print (16, 152, " Use Mouse"); M_Print (16, 160, " Use Mouse");
M_DrawCheckbox (220, 152, _windowed_mouse->value); M_DrawCheckbox (220, 160, _windowed_mouse->value);
} }
#ifdef _WIN32 #ifdef _WIN32
} }
@ -602,27 +605,23 @@ void M_Options_Key (int k)
options_cursor--; options_cursor--;
if (options_cursor < 0) if (options_cursor < 0)
options_cursor = OPTIONS_ITEMS-1; options_cursor = OPTIONS_ITEMS-1;
if (options_cursor == 15 && (!(_windowed_mouse)
#ifdef _WIN32 #ifdef _WIN32
|| (modestate != MS_WINDOWED) if (options_cursor == 16 && (!(_windowed_mouse) || (modestate != MS_WINDOWED)))
#endif
)) // bleh
options_cursor--; options_cursor--;
if (options_cursor == 14 && !(vid_menudrawfn)) #endif
if (options_cursor == 15 && !(vid_menudrawfn))
options_cursor--; options_cursor--;
break; break;
case K_DOWNARROW: case K_DOWNARROW:
S_LocalSound ("misc/menu1.wav"); S_LocalSound ("misc/menu1.wav");
options_cursor++; options_cursor++;
if (options_cursor == 14 && !(vid_menudrawfn)) if (options_cursor == 15 && !(vid_menudrawfn))
options_cursor++; options_cursor++;
if (options_cursor == 15 && (!(_windowed_mouse)
#ifdef _WIN32 #ifdef _WIN32
|| (modestate != MS_WINDOWED) if (options_cursor == 16 && (!(_windowed_mouse) || (modestate != MS_WINDOWED))) // ARGH!!!!!
#endif
)) // ARGH!!!!!
options_cursor++; options_cursor++;
#endif
if (options_cursor >= OPTIONS_ITEMS) if (options_cursor >= OPTIONS_ITEMS)
options_cursor = 0; options_cursor = 0;
break; break;

View file

@ -81,8 +81,6 @@ cvar_t *cl_crossy;
cvar_t *v_contentblend; cvar_t *v_contentblend;
cvar_t *gl_cshiftpercent;
float v_dmg_time, v_dmg_roll, v_dmg_pitch; float v_dmg_time, v_dmg_roll, v_dmg_pitch;
extern int in_forward, in_forward2, in_back; extern int in_forward, in_forward2, in_back;
@ -262,10 +260,6 @@ void V_DriftPitch (void)
} }
} }
/* /*
============================================================================== ==============================================================================
@ -274,30 +268,39 @@ void V_DriftPitch (void)
============================================================================== ==============================================================================
*/ */
cvar_t *gl_cshiftpercent;
cshift_t cshift_empty = { {130,80,50}, 0 }; cshift_t cshift_empty = { {130,80,50}, 0 };
cshift_t cshift_water = { {130,80,50}, 128 }; cshift_t cshift_water = { {130,80,50}, 128 };
cshift_t cshift_slime = { {0,25,5}, 150 }; cshift_t cshift_slime = { {0,25,5}, 150 };
cshift_t cshift_lava = { {255,80,0}, 150 }; cshift_t cshift_lava = { {255,80,0}, 150 };
cvar_t *v_gamma; cvar_t *brightness;
cvar_t *contrast;
byte gammatable[256]; // palette is sent through this byte gammatable[256]; // palette is sent through this
void BuildGammaTable (float g) void BuildGammaTable (float b, float c)
{ {
int i, inf; int i, j, inf = 0;
if (g == 1.0) if ((b == 1.0) && (c == 1.0)) {
{ for (i = 0; i < 256; i++)
for (i=0 ; i<256 ; i++)
gammatable[i] = i; gammatable[i] = i;
return; return;
} }
for (i=0 ; i<256 ; i++) for (i=0 ; i<256 ; i++) {
{ if (!(i == 128)) {
inf = 255 * pow ( (i+0.5)/255.5, g) + 0.5; if (i < 128) {
j = i + (int) ((128 - i) * (1 - c));
} else {
j = i + (int) ((i - 128) * (1 - c));
}
} else {
j = i;
}
inf = (j * b); // gamma is brightness now, and positive
inf = bound(0, inf, 255); inf = bound(0, inf, 255);
gammatable[i] = inf; gammatable[i] = inf;
} }
@ -310,13 +313,15 @@ V_CheckGamma
*/ */
qboolean V_CheckGamma (void) qboolean V_CheckGamma (void)
{ {
static float oldgammavalue; static float oldbrightness;
static float oldcontrast;
if (v_gamma->value == oldgammavalue) if ((brightness->value == oldbrightness) && contrast->value == oldcontrast)
return false; return false;
oldgammavalue = v_gamma->value; oldbrightness = brightness->value;
oldcontrast = contrast->value;
BuildGammaTable (v_gamma->value); BuildGammaTable (brightness->value, contrast->value);
vid.recalc_refdef = 1; // force a surface cache flush vid.recalc_refdef = 1; // force a surface cache flush
return true; return true;
@ -355,20 +360,15 @@ void V_ParseDamage (void)
if (cl.cshifts[CSHIFT_DAMAGE].percent > 150) if (cl.cshifts[CSHIFT_DAMAGE].percent > 150)
cl.cshifts[CSHIFT_DAMAGE].percent = 150; cl.cshifts[CSHIFT_DAMAGE].percent = 150;
if (armor > blood) if (armor > blood) {
{
cl.cshifts[CSHIFT_DAMAGE].destcolor[0] = 200; cl.cshifts[CSHIFT_DAMAGE].destcolor[0] = 200;
cl.cshifts[CSHIFT_DAMAGE].destcolor[1] = 100; cl.cshifts[CSHIFT_DAMAGE].destcolor[1] = 100;
cl.cshifts[CSHIFT_DAMAGE].destcolor[2] = 100; cl.cshifts[CSHIFT_DAMAGE].destcolor[2] = 100;
} } else if (armor) {
else if (armor)
{
cl.cshifts[CSHIFT_DAMAGE].destcolor[0] = 220; cl.cshifts[CSHIFT_DAMAGE].destcolor[0] = 220;
cl.cshifts[CSHIFT_DAMAGE].destcolor[1] = 50; cl.cshifts[CSHIFT_DAMAGE].destcolor[1] = 50;
cl.cshifts[CSHIFT_DAMAGE].destcolor[2] = 50; cl.cshifts[CSHIFT_DAMAGE].destcolor[2] = 50;
} } else {
else
{
cl.cshifts[CSHIFT_DAMAGE].destcolor[0] = 255; cl.cshifts[CSHIFT_DAMAGE].destcolor[0] = 255;
cl.cshifts[CSHIFT_DAMAGE].destcolor[1] = 0; cl.cshifts[CSHIFT_DAMAGE].destcolor[1] = 0;
cl.cshifts[CSHIFT_DAMAGE].destcolor[2] = 0; cl.cshifts[CSHIFT_DAMAGE].destcolor[2] = 0;
@ -435,8 +435,7 @@ void V_SetContentsColor (int contents)
return; return;
} }
switch (contents) switch (contents) {
{
case CONTENTS_EMPTY: case CONTENTS_EMPTY:
cl.cshifts[CSHIFT_CONTENTS] = cshift_empty; cl.cshifts[CSHIFT_CONTENTS] = cshift_empty;
break; break;
@ -459,35 +458,27 @@ V_CalcPowerupCshift
*/ */
void V_CalcPowerupCshift (void) void V_CalcPowerupCshift (void)
{ {
if (cl.stats[STAT_ITEMS] & IT_QUAD) if (cl.stats[STAT_ITEMS] & IT_QUAD) {
{
cl.cshifts[CSHIFT_POWERUP].destcolor[0] = 0; cl.cshifts[CSHIFT_POWERUP].destcolor[0] = 0;
cl.cshifts[CSHIFT_POWERUP].destcolor[1] = 0; cl.cshifts[CSHIFT_POWERUP].destcolor[1] = 0;
cl.cshifts[CSHIFT_POWERUP].destcolor[2] = 255; cl.cshifts[CSHIFT_POWERUP].destcolor[2] = 255;
cl.cshifts[CSHIFT_POWERUP].percent = 30; cl.cshifts[CSHIFT_POWERUP].percent = 30;
} } else if (cl.stats[STAT_ITEMS] & IT_SUIT) {
else if (cl.stats[STAT_ITEMS] & IT_SUIT)
{
cl.cshifts[CSHIFT_POWERUP].destcolor[0] = 0; cl.cshifts[CSHIFT_POWERUP].destcolor[0] = 0;
cl.cshifts[CSHIFT_POWERUP].destcolor[1] = 255; cl.cshifts[CSHIFT_POWERUP].destcolor[1] = 255;
cl.cshifts[CSHIFT_POWERUP].destcolor[2] = 0; cl.cshifts[CSHIFT_POWERUP].destcolor[2] = 0;
cl.cshifts[CSHIFT_POWERUP].percent = 20; cl.cshifts[CSHIFT_POWERUP].percent = 20;
} } else if (cl.stats[STAT_ITEMS] & IT_INVISIBILITY) {
else if (cl.stats[STAT_ITEMS] & IT_INVISIBILITY)
{
cl.cshifts[CSHIFT_POWERUP].destcolor[0] = 100; cl.cshifts[CSHIFT_POWERUP].destcolor[0] = 100;
cl.cshifts[CSHIFT_POWERUP].destcolor[1] = 100; cl.cshifts[CSHIFT_POWERUP].destcolor[1] = 100;
cl.cshifts[CSHIFT_POWERUP].destcolor[2] = 100; cl.cshifts[CSHIFT_POWERUP].destcolor[2] = 100;
cl.cshifts[CSHIFT_POWERUP].percent = 100; cl.cshifts[CSHIFT_POWERUP].percent = 100;
} } else if (cl.stats[STAT_ITEMS] & IT_INVULNERABILITY) {
else if (cl.stats[STAT_ITEMS] & IT_INVULNERABILITY)
{
cl.cshifts[CSHIFT_POWERUP].destcolor[0] = 255; cl.cshifts[CSHIFT_POWERUP].destcolor[0] = 255;
cl.cshifts[CSHIFT_POWERUP].destcolor[1] = 255; cl.cshifts[CSHIFT_POWERUP].destcolor[1] = 255;
cl.cshifts[CSHIFT_POWERUP].destcolor[2] = 0; cl.cshifts[CSHIFT_POWERUP].destcolor[2] = 0;
cl.cshifts[CSHIFT_POWERUP].percent = 30; cl.cshifts[CSHIFT_POWERUP].percent = 30;
} } else
else
cl.cshifts[CSHIFT_POWERUP].percent = 0; cl.cshifts[CSHIFT_POWERUP].percent = 0;
} }
@ -522,15 +513,10 @@ void CalcGunAngle (void)
pitch = -r_refdef.viewangles[PITCH]; pitch = -r_refdef.viewangles[PITCH];
yaw = angledelta(yaw - r_refdef.viewangles[YAW]) * 0.4; yaw = angledelta(yaw - r_refdef.viewangles[YAW]) * 0.4;
if (yaw > 10) yaw = bound (-10, yaw, 10);
yaw = 10;
if (yaw < -10)
yaw = -10;
pitch = angledelta(-pitch - r_refdef.viewangles[PITCH]) * 0.4; pitch = angledelta(-pitch - r_refdef.viewangles[PITCH]) * 0.4;
if (pitch > 10) pitch = bound (-10, pitch, 10);
pitch = 10;
if (pitch < -10)
pitch = -10;
move = host_frametime*20; move = host_frametime*20;
if (yaw > oldyaw) if (yaw > oldyaw)
{ {
@ -861,6 +847,7 @@ void V_Init (void)
gl_cshiftpercent = Cvar_Get("gl_cshiftpercent", "100", CVAR_NONE, "None"); gl_cshiftpercent = Cvar_Get("gl_cshiftpercent", "100", CVAR_NONE, "None");
BuildGammaTable (1.0); // no gamma yet BuildGammaTable (1.0, 1.0); // no gamma yet
v_gamma = Cvar_Get("gamma", "1", CVAR_ARCHIVE, "None"); brightness = Cvar_Get("brightness", "1", CVAR_ARCHIVE, "None");
contrast = Cvar_Get("contrast", "1", CVAR_ARCHIVE, "None");
} }

View file

@ -31,8 +31,10 @@
#endif #endif
#include "quakedef.h" #include "quakedef.h"
#include "r_local.h" #include "r_local.h"
#include "sys.h"
extern byte gammatable[256]; extern byte gammatable[256];
extern cvar_t *contrast;
void V_CalcPowerupCshift (void); void V_CalcPowerupCshift (void);
qboolean V_CheckGamma (void); qboolean V_CheckGamma (void);
@ -44,67 +46,63 @@ V_UpdatePalette
*/ */
void V_UpdatePalette (void) void V_UpdatePalette (void)
{ {
int i, j; int i, j;
qboolean new; qboolean new;
byte *basepal, *newpal; byte *basepal, *newpal;
byte pal[768]; byte pal[768];
int r,g,b; int r,g,b;
qboolean force; qboolean force;
V_CalcPowerupCshift (); V_CalcPowerupCshift ();
new = false; new = false;
for (i=0 ; i<NUM_CSHIFTS ; i++) for (i=0; i < NUM_CSHIFTS; i++) {
{ if (cl.cshifts[i].percent != cl.prev_cshifts[i].percent) {
if (cl.cshifts[i].percent != cl.prev_cshifts[i].percent) new = true;
{ cl.prev_cshifts[i].percent = cl.cshifts[i].percent;
new = true; }
cl.prev_cshifts[i].percent = cl.cshifts[i].percent; for (j = 0; j < 3; j++) {
} if (cl.cshifts[i].destcolor[j] != cl.prev_cshifts[i].destcolor[j]) {
for (j=0 ; j<3 ; j++) new = true;
if (cl.cshifts[i].destcolor[j] != cl.prev_cshifts[i].destcolor[j]) cl.prev_cshifts[i].destcolor[j] = cl.cshifts[i].destcolor[j];
{ }
new = true; }
cl.prev_cshifts[i].destcolor[j] = cl.cshifts[i].destcolor[j]; }
}
}
// drop the damage value // drop the damage value
cl.cshifts[CSHIFT_DAMAGE].percent -= host_frametime*150; cl.cshifts[CSHIFT_DAMAGE].percent -= host_frametime*150;
if (cl.cshifts[CSHIFT_DAMAGE].percent <= 0) if (cl.cshifts[CSHIFT_DAMAGE].percent <= 0)
cl.cshifts[CSHIFT_DAMAGE].percent = 0; cl.cshifts[CSHIFT_DAMAGE].percent = 0;
// drop the bonus value
cl.cshifts[CSHIFT_BONUS].percent -= host_frametime*100;
if (cl.cshifts[CSHIFT_BONUS].percent <= 0)
cl.cshifts[CSHIFT_BONUS].percent = 0;
force = V_CheckGamma (); // drop the bonus value
if (!new && !force) cl.cshifts[CSHIFT_BONUS].percent -= host_frametime*100;
return; if (cl.cshifts[CSHIFT_BONUS].percent <= 0)
cl.cshifts[CSHIFT_BONUS].percent = 0;
basepal = host_basepal; force = V_CheckGamma ();
newpal = pal; if (!new && !force)
return;
for (i=0 ; i<256 ; i++) basepal = host_basepal;
{ newpal = pal;
r = basepal[0];
g = basepal[1];
b = basepal[2];
basepal += 3;
for (j=0 ; j<NUM_CSHIFTS ; j++) for (i=0 ; i<256 ; i++) {
{ r = basepal[0];
r += (cl.cshifts[j].percent*(cl.cshifts[j].destcolor[0]-r))>>8; g = basepal[1];
g += (cl.cshifts[j].percent*(cl.cshifts[j].destcolor[1]-g))>>8; b = basepal[2];
b += (cl.cshifts[j].percent*(cl.cshifts[j].destcolor[2]-b))>>8; basepal += 3;
}
newpal[0] = gammatable[r]; for (j=0 ; j<NUM_CSHIFTS ; j++) {
newpal[1] = gammatable[g]; r += (cl.cshifts[j].percent*(cl.cshifts[j].destcolor[0]-r))>>8;
newpal[2] = gammatable[b]; g += (cl.cshifts[j].percent*(cl.cshifts[j].destcolor[1]-g))>>8;
newpal += 3; b += (cl.cshifts[j].percent*(cl.cshifts[j].destcolor[2]-b))>>8;
} }
VID_ShiftPalette (pal); newpal[0] = gammatable[r];
newpal[1] = gammatable[g];
newpal[2] = gammatable[b];
newpal += 3;
}
VID_ShiftPalette (pal);
} }