mirror of
https://git.code.sf.net/p/quake/nuq
synced 2024-11-22 04:01:11 +00:00
bring over Deek's palette shift removal from newtree. I think I got everything.
This commit is contained in:
parent
582d2a1cba
commit
f386c3f79c
1 changed files with 9 additions and 56 deletions
|
@ -90,30 +90,24 @@ void V_UpdatePalette (void)
|
|||
{
|
||||
int i, j;
|
||||
qboolean new;
|
||||
byte *basepal, *newpal;
|
||||
byte pal[768];
|
||||
float r,g,b,a;
|
||||
int ir, ig, ib;
|
||||
qboolean force;
|
||||
|
||||
V_CalcPowerupCshift ();
|
||||
|
||||
new = false;
|
||||
|
||||
for (i=0 ; i<NUM_CSHIFTS ; i++)
|
||||
{
|
||||
if (cl.cshifts[i].percent != cl.prev_cshifts[i].percent)
|
||||
{
|
||||
for (i=0 ; i<NUM_CSHIFTS ; i++) {
|
||||
if (cl.cshifts[i].percent != cl.prev_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++) {
|
||||
if (cl.cshifts[i].destcolor[j] != cl.prev_cshifts[i].destcolor[j]) {
|
||||
new = true;
|
||||
cl.prev_cshifts[i].destcolor[j] = cl.cshifts[i].destcolor[j];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// drop the damage value
|
||||
cl.cshifts[CSHIFT_DAMAGE].percent -= host_frametime*150;
|
||||
|
@ -130,47 +124,6 @@ void V_UpdatePalette (void)
|
|||
return;
|
||||
|
||||
V_CalcBlend ();
|
||||
|
||||
a = v_blend[3];
|
||||
r = 255*v_blend[0]*a;
|
||||
g = 255*v_blend[1]*a;
|
||||
b = 255*v_blend[2]*a;
|
||||
|
||||
a = 1-a;
|
||||
for (i=0 ; i<256 ; i++)
|
||||
{
|
||||
ir = i*a + r;
|
||||
ig = i*a + g;
|
||||
ib = i*a + b;
|
||||
if (ir > 255)
|
||||
ir = 255;
|
||||
if (ig > 255)
|
||||
ig = 255;
|
||||
if (ib > 255)
|
||||
ib = 255;
|
||||
|
||||
ramps[0][i] = gammatable[ir];
|
||||
ramps[1][i] = gammatable[ig];
|
||||
ramps[2][i] = gammatable[ib];
|
||||
}
|
||||
|
||||
basepal = host_basepal;
|
||||
newpal = pal;
|
||||
|
||||
for (i=0 ; i<256 ; i++)
|
||||
{
|
||||
ir = basepal[0];
|
||||
ig = basepal[1];
|
||||
ib = basepal[2];
|
||||
basepal += 3;
|
||||
|
||||
newpal[0] = ramps[0][ir];
|
||||
newpal[1] = ramps[1][ig];
|
||||
newpal[2] = ramps[2][ib];
|
||||
newpal += 3;
|
||||
}
|
||||
|
||||
VID_ShiftPalette (pal);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in a new issue