mirror of
https://git.code.sf.net/p/quake/newtree
synced 2025-02-01 20:30:57 +00:00
gl_screen.c: Whitespace
sbar.c: Simplify Sbar_ColorForMap() gl_view.c: Remove palette shifting code -- we don't do that any more in GL, we alpha blend the screen. Bad to do it twice, plus it messes up texture loads.
This commit is contained in:
parent
677b7de94d
commit
59f6bdf231
3 changed files with 12 additions and 56 deletions
|
@ -328,8 +328,9 @@ static void SCR_CalcRefdef (void)
|
||||||
if (scr_viewsize->value >= 100.0) {
|
if (scr_viewsize->value >= 100.0) {
|
||||||
full = true;
|
full = true;
|
||||||
size = 100.0;
|
size = 100.0;
|
||||||
} else
|
} else {
|
||||||
size = scr_viewsize->value;
|
size = scr_viewsize->value;
|
||||||
|
}
|
||||||
if (cl.intermission)
|
if (cl.intermission)
|
||||||
{
|
{
|
||||||
full = true;
|
full = true;
|
||||||
|
|
|
@ -126,39 +126,33 @@ V_UpdatePalette
|
||||||
|
|
||||||
void V_UpdatePalette (void)
|
void V_UpdatePalette (void)
|
||||||
{
|
{
|
||||||
int i, j;
|
int i, j;
|
||||||
qboolean new;
|
qboolean new;
|
||||||
byte *basepal, *newpal;
|
qboolean force;
|
||||||
byte pal[768];
|
|
||||||
float r,g,b,a;
|
|
||||||
int ir, ig, ib;
|
|
||||||
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;
|
new = true;
|
||||||
cl.prev_cshifts[i].percent = cl.cshifts[i].percent;
|
cl.prev_cshifts[i].percent = cl.cshifts[i].percent;
|
||||||
}
|
}
|
||||||
for (j=0 ; j<3 ; j++)
|
for (j = 0; j < 3; j++) {
|
||||||
if (cl.cshifts[i].destcolor[j] != cl.prev_cshifts[i].destcolor[j])
|
if (cl.cshifts[i].destcolor[j] != cl.prev_cshifts[i].destcolor[j]) {
|
||||||
{
|
|
||||||
new = true;
|
new = true;
|
||||||
cl.prev_cshifts[i].destcolor[j] = cl.cshifts[i].destcolor[j];
|
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
|
// drop the bonus value
|
||||||
cl.cshifts[CSHIFT_BONUS].percent -= host_frametime*100;
|
cl.cshifts[CSHIFT_BONUS].percent -= host_frametime*100;
|
||||||
if (cl.cshifts[CSHIFT_BONUS].percent <= 0)
|
if (cl.cshifts[CSHIFT_BONUS].percent <= 0)
|
||||||
cl.cshifts[CSHIFT_BONUS].percent = 0;
|
cl.cshifts[CSHIFT_BONUS].percent = 0;
|
||||||
|
@ -168,42 +162,6 @@ void V_UpdatePalette (void)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
V_CalcBlend ();
|
V_CalcBlend ();
|
||||||
|
|
||||||
//Con_Printf("b: %4.2f %4.2f %4.2f %4.6f\n", v_blend[0], v_blend[1], v_blend[2], v_blend[3]);
|
|
||||||
|
|
||||||
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 = min(i*a + r, 255);
|
|
||||||
ig = min(i*a + g, 255);
|
|
||||||
ib = min(i*a + b, 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);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -483,10 +483,7 @@ addpinginfo:
|
||||||
|
|
||||||
int Sbar_ColorForMap (int m)
|
int Sbar_ColorForMap (int m)
|
||||||
{
|
{
|
||||||
m = (m < 0) ? 0 : ((m > 13) ? 13 : m);
|
return (bound (0, m, 13) * 16) + 8;
|
||||||
|
|
||||||
m *= 16;
|
|
||||||
return m < 128 ? m + 8 : m + 8;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue