#include "quakedef.h"
-//int sb_updates; // if >= vid.numpages, no update needed
-
#define STAT_MINUS 10 // num frame for '-' stats digit
qpic_t *sb_nums[2][11];
qpic_t *sb_colon, *sb_slash;
if (sb_showscores)
return;
sb_showscores = true;
-// sb_updates = 0;
}
/*
void Sbar_DontShowScores (void)
{
sb_showscores = false;
-// sb_updates = 0;
}
-/*
-===============
-Sbar_Changed
-===============
-*/
-//void Sbar_Changed (void)
-//{
-// sb_updates = 0; // update next frame
-//}
-
/*
===============
Sbar_Init
Draw_Pic (x + ((vid.width - 320)>>1), y + (vid.height-SBAR_HEIGHT), pic);
}
-/*
-=============
-Sbar_DrawTransPic
-=============
-*/
-void Sbar_DrawTransPic (int x, int y, qpic_t *pic)
+void Draw_AlphaPic (int x, int y, qpic_t *pic, float alpha);
+void Sbar_DrawAlphaPic (int x, int y, qpic_t *pic, float alpha)
{
if (cl.gametype == GAME_DEATHMATCH)
- Draw_TransPic (x /*+ ((vid.width - 320)>>1)*/, y + (vid.height-SBAR_HEIGHT), pic);
+ Draw_AlphaPic (x /* + ((vid.width - 320)>>1)*/, y + (vid.height-SBAR_HEIGHT), pic, alpha);
else
- Draw_TransPic (x + ((vid.width - 320)>>1), y + (vid.height-SBAR_HEIGHT), pic);
+ Draw_AlphaPic (x + ((vid.width - 320)>>1), y + (vid.height-SBAR_HEIGHT), pic, alpha);
}
/*
else
frame = *ptr -'0';
- Sbar_DrawTransPic (x,y,sb_nums[color][frame]);
+ Sbar_DrawPic (x,y,sb_nums[color][frame]);
x += 24;
ptr++;
}
}
}
-int Sbar_ColorForMap (int m)
-{
- return m < 128 ? m + 8 : m + 8;
-}
-
/*
===============
Sbar_UpdateScoreboard
top = s->colors & 0xf0;
bottom = (s->colors & 15) <<4;
- scoreboardtop[i] = Sbar_ColorForMap (top);
- scoreboardbottom[i] = Sbar_ColorForMap (bottom);
+ scoreboardtop[i] = top + 8;
+ scoreboardbottom[i] = bottom + 8;
}
}
Sbar_SoloScoreboard ();
if (cl.gametype == GAME_DEATHMATCH)
Sbar_DeathmatchOverlay ();
-#if 0
- int i, j, c;
- int x, y;
- int l;
- int top, bottom;
- scoreboard_t *s;
-
- if (cl.gametype != GAME_DEATHMATCH)
- {
- Sbar_SoloScoreboard ();
- return;
- }
-
- Sbar_UpdateScoreboard ();
-
- l = scoreboardlines <= 6 ? scoreboardlines : 6;
-
- for (i=0 ; i<l ; i++)
- {
- x = 20*(i&1);
- y = i/2 * 8;
-
- s = &cl.scores[fragsort[i]];
- if (!s->name[0])
- continue;
-
- // draw background
- top = s->colors & 0xf0;
- bottom = (s->colors & 15)<<4;
- top = Sbar_ColorForMap (top);
- bottom = Sbar_ColorForMap (bottom);
-
- Draw_Fill ( x*8+10 + ((vid.width - 320)>>1), y + vid.height - SBAR_HEIGHT, 28, 4, top);
- Draw_Fill ( x*8+10 + ((vid.width - 320)>>1), y+4 + vid.height - SBAR_HEIGHT, 28, 4, bottom);
-
- // draw text
- for (j=0 ; j<20 ; j++)
- {
- c = scoreboardtext[i][j];
- if (c == 0 || c == ' ')
- continue;
- Sbar_DrawCharacter ( (x+j)*8, y, c);
- }
- }
-#endif
}
//=============================================================================
if (rogue)
{
if ( cl.stats[STAT_ACTIVEWEAPON] >= RIT_LAVA_NAILGUN )
- Sbar_DrawPic (0, -24, rsb_invbar[0]);
+ Sbar_DrawAlphaPic (0, -24, rsb_invbar[0], 0.4);
else
- Sbar_DrawPic (0, -24, rsb_invbar[1]);
+ Sbar_DrawAlphaPic (0, -24, rsb_invbar[1], 0.4);
}
else
- {
- Sbar_DrawPic (0, -24, sb_ibar);
- }
+ Sbar_DrawAlphaPic (0, -24, sb_ibar, 0.4);
-// weapons
+ // weapons
for (i=0 ; i<7 ; i++)
{
if (cl.items & (IT_SHOTGUN<<i) )
else
flashon = (flashon%5) + 2;
- Sbar_DrawPic (i*24, -16, sb_weapons[flashon][i]);
-
-// if (flashon > 1)
-// sb_updates = 0; // force update to remove flash
+ Sbar_DrawAlphaPic (i*24, -16, sb_weapons[flashon][i], 0.4);
}
}
-// MED 01/04/97
-// hipnotic weapons
- if (hipnotic)
- {
- int grenadeflashing=0;
- for (i=0 ; i<4 ; i++)
- {
- if (cl.items & (1<<hipweapons[i]) )
- {
- time = cl.item_gettime[hipweapons[i]];
- flashon = (int)((cl.time - time)*10);
- if (flashon >= 10)
- {
- if ( cl.stats[STAT_ACTIVEWEAPON] == (1<<hipweapons[i]) )
- flashon = 1;
- else
- flashon = 0;
- }
- else
- flashon = (flashon%5) + 2;
-
- // check grenade launcher
- if (i==2)
- {
- if (cl.items & HIT_PROXIMITY_GUN)
- {
- if (flashon)
- {
- grenadeflashing = 1;
- Sbar_DrawPic (96, -16, hsb_weapons[flashon][2]);
- }
- }
- }
- else if (i==3)
- {
- if (cl.items & (IT_SHOTGUN<<4))
- {
- if (flashon && !grenadeflashing)
- {
- Sbar_DrawPic (96, -16, hsb_weapons[flashon][3]);
- }
- else if (!grenadeflashing)
- {
- Sbar_DrawPic (96, -16, hsb_weapons[0][3]);
- }
- }
- else
- Sbar_DrawPic (96, -16, hsb_weapons[flashon][4]);
- }
- else
- Sbar_DrawPic (176 + (i*24), -16, hsb_weapons[flashon][i]);
-// if (flashon > 1)
-// sb_updates = 0; // force update to remove flash
- }
- }
- }
-
- if (rogue)
+ // MED 01/04/97
+ // hipnotic weapons
+ if (hipnotic)
{
- // check for powered up weapon.
- if ( cl.stats[STAT_ACTIVEWEAPON] >= RIT_LAVA_NAILGUN )
+ int grenadeflashing=0;
+ for (i=0 ; i<4 ; i++)
{
- for (i=0;i<5;i++)
+ if (cl.items & (1<<hipweapons[i]) )
{
- if (cl.stats[STAT_ACTIVEWEAPON] == (RIT_LAVA_NAILGUN << i))
+ time = cl.item_gettime[hipweapons[i]];
+ flashon = (int)((cl.time - time)*10);
+ if (flashon >= 10)
{
- Sbar_DrawPic ((i+2)*24, -16, rsb_weapons[i]);
+ if ( cl.stats[STAT_ACTIVEWEAPON] == (1<<hipweapons[i]) )
+ flashon = 1;
+ else
+ flashon = 0;
+ }
+ else
+ flashon = (flashon%5) + 2;
+
+ // check grenade launcher
+ if (i==2)
+ {
+ if (cl.items & HIT_PROXIMITY_GUN)
+ {
+ if (flashon)
+ {
+ grenadeflashing = 1;
+ Sbar_DrawPic (96, -16, hsb_weapons[flashon][2]);
+ }
+ }
+ }
+ else if (i==3)
+ {
+ if (cl.items & (IT_SHOTGUN<<4))
+ {
+ if (!grenadeflashing)
+ Sbar_DrawPic (96, -16, hsb_weapons[flashon][3]);
+ }
+ else
+ Sbar_DrawPic (96, -16, hsb_weapons[flashon][4]);
}
+ else
+ Sbar_DrawPic (176 + (i*24), -16, hsb_weapons[flashon][i]);
}
}
}
-// ammo counts
+ if (rogue)
+ {
+ // check for powered up weapon.
+ if ( cl.stats[STAT_ACTIVEWEAPON] >= RIT_LAVA_NAILGUN )
+ for (i=0;i<5;i++)
+ if (cl.stats[STAT_ACTIVEWEAPON] == (RIT_LAVA_NAILGUN << i))
+ Sbar_DrawPic ((i+2)*24, -16, rsb_weapons[i]);
+ }
+
+ // ammo counts
for (i=0 ; i<4 ; i++)
{
sprintf (num, "%3i",cl.stats[STAT_SHELLS+i] );
}
flashon = 0;
- // items
- for (i=0 ; i<6 ; i++)
- if (cl.items & (1<<(17+i)))
- {
- time = cl.item_gettime[17+i];
- if (time && time > cl.time - 2 && flashon )
- { // flash frame
-// sb_updates = 0;
- }
- else
- {
- //MED 01/04/97 changed keys
- if (!hipnotic || (i>1))
- {
- Sbar_DrawPic (192 + i*16, -16, sb_items[i]);
- }
- }
-// if (time && time > cl.time - 2)
-// sb_updates = 0;
- }
- //MED 01/04/97 added hipnotic items
- // hipnotic items
- if (hipnotic)
- {
- for (i=0 ; i<2 ; i++)
- if (cl.items & (1<<(24+i)))
- {
- time = cl.item_gettime[24+i];
- if (time && time > cl.time - 2 && flashon )
- { // flash frame
-// sb_updates = 0;
- }
- else
- {
- Sbar_DrawPic (288 + i*16, -16, hsb_items[i]);
- }
-// if (time && time > cl.time - 2)
-// sb_updates = 0;
- }
- }
+ // items
+ for (i=0 ; i<6 ; i++)
+ if (cl.items & (1<<(17+i)))
+ {
+ time = cl.item_gettime[17+i];
+ if (time && time > cl.time - 2 && flashon )
+ { // flash frame
+ }
+ else
+ //MED 01/04/97 changed keys
+ if (!hipnotic || (i>1))
+ Sbar_DrawPic (192 + i*16, -16, sb_items[i]);
+ }
+ //MED 01/04/97 added hipnotic items
+ // hipnotic items
+ if (hipnotic)
+ {
+ for (i=0 ; i<2 ; i++)
+ if (cl.items & (1<<(24+i)))
+ {
+ time = cl.item_gettime[24+i];
+ if (!time || time <= cl.time - 2 || !flashon)
+ Sbar_DrawPic (288 + i*16, -16, hsb_items[i]);
+ }
+ }
if (rogue)
{
- // new rogue items
+ // new rogue items
for (i=0 ; i<2 ; i++)
- {
if (cl.items & (1<<(29+i)))
{
time = cl.item_gettime[29+i];
-
- if (time && time > cl.time - 2 && flashon )
- { // flash frame
-// sb_updates = 0;
- }
- else
- {
+ if (!time || time <= cl.time - 2 || !flashon)
Sbar_DrawPic (288 + i*16, -16, rsb_items[i]);
- }
-
-// if (time && time > cl.time - 2)
-// sb_updates = 0;
}
- }
}
else
{
- // sigils
+ // sigils
for (i=0 ; i<4 ; i++)
{
if (cl.items & (1<<(28+i)))
{
time = cl.item_gettime[28+i];
- if (time && time > cl.time - 2 && flashon )
- { // flash frame
-// sb_updates = 0;
- }
- else
+ if (!time || time <= cl.time - 2 || !flashon)
Sbar_DrawPic (320-32 + i*8, -16, sb_sigil[i]);
-// if (time && time > cl.time - 2)
-// sb_updates = 0;
}
}
}
continue;
// draw background
- top = s->colors & 0xf0;
- bottom = (s->colors & 15)<<4;
- top = Sbar_ColorForMap (top);
- bottom = Sbar_ColorForMap (bottom);
+ top = (s->colors & 0xf0) + 8;
+ bottom = ((s->colors & 15)<<4) + 8;
Draw_Fill (xofs + x*8 + 10, y, 28, 4, top);
Draw_Fill (xofs + x*8 + 10, y+4, 28, 3, bottom);
s = &cl.scores[cl.viewentity - 1];
// draw background
- top = s->colors & 0xf0;
- bottom = (s->colors & 15)<<4;
- top = Sbar_ColorForMap (top);
- bottom = Sbar_ColorForMap (bottom);
+ top = (s->colors & 0xf0) + 8;
+ bottom = ((s->colors & 15)<<4) + 8;
if (cl.gametype == GAME_DEATHMATCH)
xofs = 113;
if (scr_con_current == vid.height)
return; // console is full screen
- // LordHavoc: always redraw
- //if (sb_updates >= vid.numpages)
- // return;
-
scr_copyeverything = 1;
// sb_updates++;
if (sb_showscores || cl.stats[STAT_HEALTH] <= 0)
{
- Sbar_DrawPic (0, 0, sb_scorebar);
+ Sbar_DrawAlphaPic (0, 0, sb_scorebar, 0.4);
Sbar_DrawScoreboard ();
// sb_updates = 0;
}
else if (sb_lines)
{
- Sbar_DrawPic (0, 0, sb_sbar);
+ Sbar_DrawAlphaPic (0, 0, sb_sbar, 0.4);
// keys (hipnotic only)
//MED 01/04/97 moved keys here so they would not be overwritten
else
frame = *ptr -'0';
- Draw_TransPic (x,y,sb_nums[color][frame]);
+ Draw_Pic (x,y,sb_nums[color][frame]);
x += 24;
ptr++;
}
continue;
// draw background
- top = s->colors & 0xf0;
- bottom = (s->colors & 15)<<4;
- top = Sbar_ColorForMap (top);
- bottom = Sbar_ColorForMap (bottom);
+ top = (s->colors & 0xf0) + 8;
+ bottom = ((s->colors & 15)<<4) + 8;
Draw_Fill ( x, y+1, 88, 3, top);
Draw_Fill ( x, y+4, 88, 3, bottom);
fph = total ? (int) ((float) s->frags * 3600.0 / total) : 0;
if (fph < -999) fph = -999;
if (fph > 9999) fph = 9999;
-
+
// put it together
sprintf (num, "%c %4i:%4i %3i:%i%i %s", k == cl.viewentity - 1 ? 12 : ' ', (int) s->frags, fph, minutes, tens, units, s->name);
Draw_String(x - 8, y, num, 0);
continue;
// draw background
- top = Sbar_ColorForMap (s->colors & 0xf0);
- bottom = Sbar_ColorForMap ((s->colors & 15)<<4);
+ top = (s->colors & 0xf0) + 8;
+ bottom = ((s->colors & 15)<<4) + 8;
Draw_Fill ( x, y+1, 72, 3, top);
Draw_Fill ( x, y+4, 72, 3, bottom);
Draw_Pic (64, 24, pic);
pic = Draw_CachePic ("gfx/inter.lmp");
- Draw_TransPic (0, 56, pic);
+ Draw_Pic (0, 56, pic);
// time
dig = cl.completed_time/60;
Sbar_IntermissionNumber (160, 64, dig, 3, 0);
num = cl.completed_time - dig*60;
- Draw_TransPic (234,64,sb_colon);
- Draw_TransPic (246,64,sb_nums[0][num/10]);
- Draw_TransPic (266,64,sb_nums[0][num%10]);
+ Draw_Pic (234,64,sb_colon);
+ Draw_Pic (246,64,sb_nums[0][num/10]);
+ Draw_Pic (266,64,sb_nums[0][num%10]);
Sbar_IntermissionNumber (160, 104, cl.stats[STAT_SECRETS], 3, 0);
- Draw_TransPic (232,104,sb_slash);
+ Draw_Pic (232,104,sb_slash);
Sbar_IntermissionNumber (240, 104, cl.stats[STAT_TOTALSECRETS], 3, 0);
Sbar_IntermissionNumber (160, 144, cl.stats[STAT_MONSTERS], 3, 0);
- Draw_TransPic (232,144,sb_slash);
+ Draw_Pic (232,144,sb_slash);
Sbar_IntermissionNumber (240, 144, cl.stats[STAT_TOTALMONSTERS], 3, 0);
}
scr_copyeverything = 1;
pic = Draw_CachePic ("gfx/finale.lmp");
- Draw_TransPic ( (vid.width-pic->width)/2, 16, pic);
+ Draw_Pic ( (vid.width-pic->width)/2, 16, pic);
}