mirror of
https://git.code.sf.net/p/quake/newtree
synced 2025-02-01 12:20:54 +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) {
|
||||
full = true;
|
||||
size = 100.0;
|
||||
} else
|
||||
} else {
|
||||
size = scr_viewsize->value;
|
||||
}
|
||||
if (cl.intermission)
|
||||
{
|
||||
full = true;
|
||||
|
|
|
@ -126,39 +126,33 @@ V_UpdatePalette
|
|||
|
||||
void V_UpdatePalette (void)
|
||||
{
|
||||
int i, j;
|
||||
int i, j;
|
||||
qboolean new;
|
||||
byte *basepal, *newpal;
|
||||
byte pal[768];
|
||||
float r,g,b,a;
|
||||
int ir, ig, ib;
|
||||
qboolean force;
|
||||
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
|
||||
// drop the damage value
|
||||
cl.cshifts[CSHIFT_DAMAGE].percent -= host_frametime*150;
|
||||
if (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;
|
||||
if (cl.cshifts[CSHIFT_BONUS].percent <= 0)
|
||||
cl.cshifts[CSHIFT_BONUS].percent = 0;
|
||||
|
@ -168,42 +162,6 @@ void V_UpdatePalette (void)
|
|||
return;
|
||||
|
||||
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)
|
||||
{
|
||||
m = (m < 0) ? 0 : ((m > 13) ? 13 : m);
|
||||
|
||||
m *= 16;
|
||||
return m < 128 ? m + 8 : m + 8;
|
||||
return (bound (0, m, 13) * 16) + 8;
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue