sbar now works exactly like it does in stable, HUD and all for both UQ and

for QW.  sbar.c is STILL a mess and will continue to be such until I can
check at runtime for QW/UQ..  When that happens the merge can move MUCH
faster for everybody (so somebody do it!  hehe)
This commit is contained in:
Joseph Carter 2000-01-27 07:54:49 +00:00
parent 335a822d3f
commit d38c50700e

View file

@ -69,11 +69,9 @@ qpic_t *hsb_items[2];
#endif #endif
#ifdef QUAKEWORLD #ifdef QUAKEWORLD
void Sbar_DeathmatchOverlay (int start);
void Sbar_TeamOverlay (void); void Sbar_TeamOverlay (void);
#else
void Sbar_DeathmatchOverlay (void);
#endif #endif
void Sbar_DeathmatchOverlay (int start);
void Sbar_MiniDeathmatchOverlay (void); void Sbar_MiniDeathmatchOverlay (void);
#ifdef QUAKEWORLD #ifdef QUAKEWORLD
@ -328,14 +326,14 @@ Sbar_DrawPic
*/ */
void Sbar_DrawPic (int x, int y, qpic_t *pic) void Sbar_DrawPic (int x, int y, qpic_t *pic)
{ {
#ifdef QUAKEWORLD #ifndef QUAKEWORLD
Draw_Pic (x, y + (vid.height-SBAR_HEIGHT), pic); if ((cl_sbar.value && !cl.gametype == GAME_DEATHMATCH)
#else && (hipnotic || rogue))
if (cl.gametype == GAME_DEATHMATCH) Draw_Pic (x + ((vid.width - 320)>>1),
Draw_Pic (x, y + (vid.height-SBAR_HEIGHT), pic); y + (vid.height-SBAR_HEIGHT), pic);
else else
Draw_Pic (x + ((vid.width - 320)>>1), y + (vid.height-SBAR_HEIGHT), pic); #endif
#endif // QUAKEWORLD Draw_Pic (x, y + (vid.height-SBAR_HEIGHT), pic);
} }
/* /*
@ -344,17 +342,19 @@ Sbar_DrawSubPic
============= =============
JACK: Draws a portion of the picture in the status bar. JACK: Draws a portion of the picture in the status bar.
*/ */
void Sbar_DrawSubPic(int x, int y, qpic_t *pic,
void Sbar_DrawSubPic(int x, int y, qpic_t *pic, int srcx, int srcy, int width, int height) int srcx, int srcy, int width, int height)
{ {
#ifdef QUAKEWORLD #ifndef QUAKEWORLD
Draw_SubPic (x, y + (vid.height-SBAR_HEIGHT), pic, srcx, srcy, width, height); if ((cl_sbar.value && !cl.gametype == GAME_DEATHMATCH)
#else && (hipnotic || rogue))
if (cl.gametype == GAME_DEATHMATCH) Draw_SubPic (x + ((vid.width - 320)>>1),
Draw_SubPic (x, y + (vid.height-SBAR_HEIGHT), pic, srcx, srcy, width, height); y + (vid.height-SBAR_HEIGHT),
pic, srcx, srcy, width, height);
else else
Draw_SubPic (x + ((vid.width - 320)>>1), y + (vid.height-SBAR_HEIGHT), pic, srcx, srcy, width, height); #endif
#endif // QUAKEWORLD Draw_SubPic (x, y + (vid.height-SBAR_HEIGHT),
pic, srcx, srcy, width, height);
} }
@ -365,14 +365,14 @@ Sbar_DrawTransPic
*/ */
void Sbar_DrawTransPic (int x, int y, qpic_t *pic) void Sbar_DrawTransPic (int x, int y, qpic_t *pic)
{ {
#ifdef QUAKEWORLD #ifndef QUAKEWORLD
Draw_TransPic (x, y + (vid.height-SBAR_HEIGHT), pic); if ((cl_sbar.value && !cl.gametype == GAME_DEATHMATCH)
#else && (hipnotic || rogue))
if (cl.gametype == GAME_DEATHMATCH) Draw_TransPic (x + ((vid.width - 320)>>1),
Draw_TransPic (x, y + (vid.height-SBAR_HEIGHT), pic); y + (vid.height-SBAR_HEIGHT), pic);
else else
Draw_TransPic (x + ((vid.width - 320)>>1), y + (vid.height-SBAR_HEIGHT), pic); #endif
#endif // QUAKEWORLD Draw_TransPic (x, y + (vid.height-SBAR_HEIGHT), pic);
} }
/* /*
@ -384,14 +384,14 @@ Draws one solid graphics character
*/ */
void Sbar_DrawCharacter (int x, int y, int num) void Sbar_DrawCharacter (int x, int y, int num)
{ {
#ifdef QUAKEWORLD #ifndef QUAKEWORLD
Draw_Character (x + 4, y + (vid.height-SBAR_HEIGHT), num); if ((cl_sbar.value && !cl.gametype == GAME_DEATHMATCH)
#else && (hipnotic || rogue))
if (cl.gametype == GAME_DEATHMATCH) Draw_Character (x + ((vid.width - 320)>>1) + 4,
Draw_Character (x + 4, y + (vid.height-SBAR_HEIGHT), num); y + (vid.height-SBAR_HEIGHT), num);
else else
Draw_Character (x + ((vid.width - 320)>>1) + 4, y + (vid.height-SBAR_HEIGHT), num); #endif
#endif // QUAKEWORLD Draw_Character (x + 4, y + (vid.height-SBAR_HEIGHT), num);
} }
/* /*
@ -401,14 +401,14 @@ Sbar_DrawString
*/ */
void Sbar_DrawString (int x, int y, char *str) void Sbar_DrawString (int x, int y, char *str)
{ {
#ifdef QUAKEWORLD #ifndef QUAKEWORLD
Draw_String (x, y + (vid.height-SBAR_HEIGHT), str); if ((cl_sbar.value && !cl.gametype == GAME_DEATHMATCH)
#else && (hipnotic || rogue))
if (cl.gametype == GAME_DEATHMATCH) Draw_String (x + ((vid.width - 320)>>1),
Draw_String (x, y + (vid.height-SBAR_HEIGHT), str); y + (vid.height-SBAR_HEIGHT), str);
else else
Draw_String (x + ((vid.width - 320)>>1), y + (vid.height-SBAR_HEIGHT), str); #endif
#endif // QUAKEWORLD Draw_String (x, y + (vid.height-SBAR_HEIGHT), str);
} }
/* /*
@ -685,7 +685,7 @@ void Sbar_DrawScoreboard (void)
#ifndef QUAKEWORLD #ifndef QUAKEWORLD
Sbar_SoloScoreboard (); Sbar_SoloScoreboard ();
if (cl.gametype == GAME_DEATHMATCH) if (cl.gametype == GAME_DEATHMATCH)
Sbar_DeathmatchOverlay (); Sbar_DeathmatchOverlay (0);
#endif // !QUAKEWORLD #endif // !QUAKEWORLD
} }
@ -699,28 +699,33 @@ Sbar_DrawInventory
void Sbar_DrawInventory (void) void Sbar_DrawInventory (void)
{ {
int i; int i;
char num[6]; char num[6];
float time; float time;
int flashon; int flashon;
#ifdef QUAKEWORLD
qboolean headsup; qboolean headsup;
qboolean hudswap; qboolean hudswap;
headsup = !(cl_sbar.value || scr_viewsize.value<100); headsup = !(cl_sbar.value || scr_viewsize.value<100);
hudswap = cl_hudswap.value; // Get that nasty float out :) hudswap = cl_hudswap.value; // Get that nasty float out :)
if (!headsup) #ifndef QUAKEWORLD
Sbar_DrawPic (0, -24, sb_ibar); if (hipnotic)
#else headsup = false;
if (rogue) { if (rogue) {
headsup = false;
if ( cl.stats[STAT_ACTIVEWEAPON] >= RIT_LAVA_NAILGUN ) if ( cl.stats[STAT_ACTIVEWEAPON] >= RIT_LAVA_NAILGUN )
Sbar_DrawPic (0, -24, rsb_invbar[0]); Sbar_DrawPic (0, -24, rsb_invbar[0]);
else else
Sbar_DrawPic (0, -24, rsb_invbar[1]); Sbar_DrawPic (0, -24, rsb_invbar[1]);
} else { } else {
Sbar_DrawPic (0, -24, sb_ibar); if (!headsup)
Sbar_DrawPic (0, -24, sb_ibar);
} }
#endif #else
if (!headsup)
Sbar_DrawPic (0, -24, sb_ibar);
#endif // !QUAKEWORLD
// weapons // weapons
for (i=0 ; i<7 ; i++) for (i=0 ; i<7 ; i++)
{ {
@ -738,14 +743,12 @@ void Sbar_DrawInventory (void)
else else
flashon = (flashon%5) + 2; flashon = (flashon%5) + 2;
#ifdef QUAKEWORLD
if (headsup) { if (headsup) {
if (i || vid.height>200) if (i || vid.height>200)
Sbar_DrawSubPic ((hudswap) ? 0 : (vid.width-24),-68-(7-i)*16 , sb_weapons[flashon][i],0,0,24,16); Sbar_DrawSubPic ((hudswap) ? 0 : (vid.width-24),-68-(7-i)*16 , sb_weapons[flashon][i],0,0,24,16);
} else } else
#endif // QUAKEWORLD Sbar_DrawPic (i*24, -16, sb_weapons[flashon][i]);
Sbar_DrawPic (i*24, -16, sb_weapons[flashon][i]);
if (flashon > 1) if (flashon > 1)
sb_updates = 0; // force update to remove flash sb_updates = 0; // force update to remove flash
@ -812,7 +815,6 @@ void Sbar_DrawInventory (void)
for (i=0 ; i<4 ; i++) for (i=0 ; i<4 ; i++)
{ {
snprintf(num, sizeof(num), "%3i",cl.stats[STAT_SHELLS+i] ); snprintf(num, sizeof(num), "%3i",cl.stats[STAT_SHELLS+i] );
#ifdef QUAKEWORLD
if (headsup) { if (headsup) {
Sbar_DrawSubPic((hudswap) ? 0 : (vid.width-42), -24 - (4-i)*11, sb_ibar, 3+(i*48), 0, 42, 11); Sbar_DrawSubPic((hudswap) ? 0 : (vid.width-42), -24 - (4-i)*11, sb_ibar, 3+(i*48), 0, 42, 11);
if (num[0] != ' ') if (num[0] != ' ')
@ -822,16 +824,13 @@ void Sbar_DrawInventory (void)
if (num[2] != ' ') if (num[2] != ' ')
Sbar_DrawCharacter ( (hudswap) ? 19 : (vid.width-23), -24 - (4-i)*11, 18 + num[2] - '0'); Sbar_DrawCharacter ( (hudswap) ? 19 : (vid.width-23), -24 - (4-i)*11, 18 + num[2] - '0');
} else { } else {
#endif // QUAKEWORLD if (num[0] != ' ')
if (num[0] != ' ') Sbar_DrawCharacter ( (6*i+1)*8 - 2, -24, 18 + num[0] - '0');
Sbar_DrawCharacter ( (6*i+1)*8 - 2, -24, 18 + num[0] - '0'); if (num[1] != ' ')
if (num[1] != ' ') Sbar_DrawCharacter ( (6*i+2)*8 - 2, -24, 18 + num[1] - '0');
Sbar_DrawCharacter ( (6*i+2)*8 - 2, -24, 18 + num[1] - '0'); if (num[2] != ' ')
if (num[2] != ' ') Sbar_DrawCharacter ( (6*i+3)*8 - 2, -24, 18 + num[2] - '0');
Sbar_DrawCharacter ( (6*i+3)*8 - 2, -24, 18 + num[2] - '0');
#ifdef QUAKEWORLD
} }
#endif // QUAKEWORLD
} }
flashon = 0; flashon = 0;
@ -1201,6 +1200,9 @@ void Sbar_Draw (void)
if (scr_con_current == vid.height) if (scr_con_current == vid.height)
return; // console is full screen return; // console is full screen
if (!headsup && sb_lines && vid.width > 320)
Draw_TileClear (0, vid.height - sb_lines, vid.width, sb_lines);
#ifndef QUAKEWORLD #ifndef QUAKEWORLD
if (sb_lines > 24) if (sb_lines > 24)
{ {
@ -1739,7 +1741,7 @@ void Sbar_MiniDeathmatchOverlay (void)
} }
#else #else
void Sbar_DeathmatchOverlay (void) void Sbar_DeathmatchOverlay (int start)
{ {
qpic_t *pic; qpic_t *pic;
int i, k, l; int i, k, l;
@ -1939,7 +1941,7 @@ void Sbar_IntermissionOverlay (void)
Sbar_DeathmatchOverlay (0); Sbar_DeathmatchOverlay (0);
#else #else
if (cl.gametype == GAME_DEATHMATCH) { if (cl.gametype == GAME_DEATHMATCH) {
Sbar_DeathmatchOverlay (); Sbar_DeathmatchOverlay (0);
return; return;
} }