home *** CD-ROM | disk | FTP | other *** search
/ Enigma Amiga Life 113 / EnigmaAmiga113CD.iso / software / sviluppo / quakeworld_src / client / sbar.c < prev    next >
Encoding:
C/C++ Source or Header  |  2000-06-17  |  29.3 KB  |  1,331 lines

  1. /*
  2. Copyright (C) 1996-1997 Id Software, Inc.
  3.  
  4. This program is free software; you can redistribute it and/or
  5. modify it under the terms of the GNU General Public License
  6. as published by the Free Software Foundation; either version 2
  7. of the License, or (at your option) any later version.
  8.  
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
  12.  
  13. See the GNU General Public License for more details.
  14.  
  15. You should have received a copy of the GNU General Public License
  16. along with this program; if not, write to the Free Software
  17. Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  18.  
  19. */
  20. // sbar.c -- status bar code
  21.  
  22. #include "quakedef.h"
  23.  
  24.  
  25. int     sb_updates;   // if >= vid.numpages, no update needed
  26.  
  27. #define STAT_MINUS    10  // num frame for '-' stats digit
  28. qpic_t    *sb_nums[2][11];
  29. qpic_t    *sb_colon, *sb_slash;
  30. qpic_t    *sb_ibar;
  31. qpic_t    *sb_sbar;
  32. qpic_t    *sb_scorebar;
  33.  
  34. qpic_t    *sb_weapons[7][8];  // 0 is active, 1 is owned, 2-5 are flashes
  35. qpic_t    *sb_ammo[4];
  36. qpic_t    *sb_sigil[4];
  37. qpic_t    *sb_armor[3];
  38. qpic_t    *sb_items[32];
  39.  
  40. qpic_t  *sb_faces[7][2];    // 0 is gibbed, 1 is dead, 2-6 are alive
  41.               // 0 is static, 1 is temporary animation
  42. qpic_t  *sb_face_invis;
  43. qpic_t  *sb_face_quad;
  44. qpic_t  *sb_face_invuln;
  45. qpic_t  *sb_face_invis_invuln;
  46.  
  47. qboolean  sb_showscores;
  48. qboolean  sb_showteamscores;
  49.  
  50. int     sb_lines;     // scan lines to draw
  51.  
  52. void Sbar_DeathmatchOverlay (int start);
  53. void Sbar_TeamOverlay (void);
  54. void Sbar_MiniDeathmatchOverlay (void);
  55.  
  56. static qboolean largegame = false;
  57.  
  58. /*
  59. ===============
  60. Sbar_ShowTeamScores
  61.  
  62. Tab key down
  63. ===============
  64. */
  65. void Sbar_ShowTeamScores (void)
  66. {
  67.   if (sb_showteamscores)
  68.     return;
  69.  
  70.   sb_showteamscores = true;
  71.   sb_updates = 0;
  72. }
  73.  
  74. /*
  75. ===============
  76. Sbar_DontShowTeamScores
  77.  
  78. Tab key up
  79. ===============
  80. */
  81. void Sbar_DontShowTeamScores (void)
  82. {
  83.   sb_showteamscores = false;
  84.   sb_updates = 0;
  85. }
  86.  
  87. /*
  88. ===============
  89. Sbar_ShowScores
  90.  
  91. Tab key down
  92. ===============
  93. */
  94. void Sbar_ShowScores (void)
  95. {
  96.   if (sb_showscores)
  97.     return;
  98.  
  99.   sb_showscores = true;
  100.   sb_updates = 0;
  101. }
  102.  
  103. /*
  104. ===============
  105. Sbar_DontShowScores
  106.  
  107. Tab key up
  108. ===============
  109. */
  110. void Sbar_DontShowScores (void)
  111. {
  112.   sb_showscores = false;
  113.   sb_updates = 0;
  114. }
  115.  
  116. /*
  117. ===============
  118. Sbar_Changed
  119. ===============
  120. */
  121. void Sbar_Changed (void)
  122. {
  123.   sb_updates = 0; // update next frame
  124. }
  125.  
  126. /*
  127. ===============
  128. Sbar_Init
  129. ===============
  130. */
  131. void Sbar_Init (void)
  132. {
  133.   int   i;
  134.  
  135.   for (i=0 ; i<10 ; i++)
  136.   {
  137.     sb_nums[0][i] = Draw_PicFromWad (va("num_%i",i));
  138.     sb_nums[1][i] = Draw_PicFromWad (va("anum_%i",i));
  139.   }
  140.  
  141.   sb_nums[0][10] = Draw_PicFromWad ("num_minus");
  142.   sb_nums[1][10] = Draw_PicFromWad ("anum_minus");
  143.  
  144.   sb_colon = Draw_PicFromWad ("num_colon");
  145.   sb_slash = Draw_PicFromWad ("num_slash");
  146.  
  147.   sb_weapons[0][0] = Draw_PicFromWad ("inv_shotgun");
  148.   sb_weapons[0][1] = Draw_PicFromWad ("inv_sshotgun");
  149.   sb_weapons[0][2] = Draw_PicFromWad ("inv_nailgun");
  150.   sb_weapons[0][3] = Draw_PicFromWad ("inv_snailgun");
  151.   sb_weapons[0][4] = Draw_PicFromWad ("inv_rlaunch");
  152.   sb_weapons[0][5] = Draw_PicFromWad ("inv_srlaunch");
  153.   sb_weapons[0][6] = Draw_PicFromWad ("inv_lightng");
  154.   
  155.   sb_weapons[1][0] = Draw_PicFromWad ("inv2_shotgun");
  156.   sb_weapons[1][1] = Draw_PicFromWad ("inv2_sshotgun");
  157.   sb_weapons[1][2] = Draw_PicFromWad ("inv2_nailgun");
  158.   sb_weapons[1][3] = Draw_PicFromWad ("inv2_snailgun");
  159.   sb_weapons[1][4] = Draw_PicFromWad ("inv2_rlaunch");
  160.   sb_weapons[1][5] = Draw_PicFromWad ("inv2_srlaunch");
  161.   sb_weapons[1][6] = Draw_PicFromWad ("inv2_lightng");
  162.   
  163.   for (i=0 ; i<5 ; i++)
  164.   {
  165.     sb_weapons[2+i][0] = Draw_PicFromWad (va("inva%i_shotgun",i+1));
  166.     sb_weapons[2+i][1] = Draw_PicFromWad (va("inva%i_sshotgun",i+1));
  167.     sb_weapons[2+i][2] = Draw_PicFromWad (va("inva%i_nailgun",i+1));
  168.     sb_weapons[2+i][3] = Draw_PicFromWad (va("inva%i_snailgun",i+1));
  169.     sb_weapons[2+i][4] = Draw_PicFromWad (va("inva%i_rlaunch",i+1));
  170.     sb_weapons[2+i][5] = Draw_PicFromWad (va("inva%i_srlaunch",i+1));
  171.     sb_weapons[2+i][6] = Draw_PicFromWad (va("inva%i_lightng",i+1));
  172.   }
  173.  
  174.   sb_ammo[0] = Draw_PicFromWad ("sb_shells");
  175.   sb_ammo[1] = Draw_PicFromWad ("sb_nails");
  176.   sb_ammo[2] = Draw_PicFromWad ("sb_rocket");
  177.   sb_ammo[3] = Draw_PicFromWad ("sb_cells");
  178.  
  179.   sb_armor[0] = Draw_PicFromWad ("sb_armor1");
  180.   sb_armor[1] = Draw_PicFromWad ("sb_armor2");
  181.   sb_armor[2] = Draw_PicFromWad ("sb_armor3");
  182.  
  183.   sb_items[0] = Draw_PicFromWad ("sb_key1");
  184.   sb_items[1] = Draw_PicFromWad ("sb_key2");
  185.   sb_items[2] = Draw_PicFromWad ("sb_invis");
  186.   sb_items[3] = Draw_PicFromWad ("sb_invuln");
  187.   sb_items[4] = Draw_PicFromWad ("sb_suit");
  188.   sb_items[5] = Draw_PicFromWad ("sb_quad");
  189.  
  190.   sb_sigil[0] = Draw_PicFromWad ("sb_sigil1");
  191.   sb_sigil[1] = Draw_PicFromWad ("sb_sigil2");
  192.   sb_sigil[2] = Draw_PicFromWad ("sb_sigil3");
  193.   sb_sigil[3] = Draw_PicFromWad ("sb_sigil4");
  194.  
  195.   sb_faces[4][0] = Draw_PicFromWad ("face1");
  196.   sb_faces[4][1] = Draw_PicFromWad ("face_p1");
  197.   sb_faces[3][0] = Draw_PicFromWad ("face2");
  198.   sb_faces[3][1] = Draw_PicFromWad ("face_p2");
  199.   sb_faces[2][0] = Draw_PicFromWad ("face3");
  200.   sb_faces[2][1] = Draw_PicFromWad ("face_p3");
  201.   sb_faces[1][0] = Draw_PicFromWad ("face4");
  202.   sb_faces[1][1] = Draw_PicFromWad ("face_p4");
  203.   sb_faces[0][0] = Draw_PicFromWad ("face5");
  204.   sb_faces[0][1] = Draw_PicFromWad ("face_p5");
  205.  
  206.   sb_face_invis = Draw_PicFromWad ("face_invis");
  207.   sb_face_invuln = Draw_PicFromWad ("face_invul2");
  208.   sb_face_invis_invuln = Draw_PicFromWad ("face_inv2");
  209.   sb_face_quad = Draw_PicFromWad ("face_quad");
  210.  
  211.   Cmd_AddCommand ("+showscores", Sbar_ShowScores);
  212.   Cmd_AddCommand ("-showscores", Sbar_DontShowScores);
  213.     
  214.   Cmd_AddCommand ("+showteamscores", Sbar_ShowTeamScores);
  215.   Cmd_AddCommand ("-showteamscores", Sbar_DontShowTeamScores);
  216.     
  217.   sb_sbar = Draw_PicFromWad ("sbar");
  218.   sb_ibar = Draw_PicFromWad ("ibar");
  219.   sb_scorebar = Draw_PicFromWad ("scorebar");
  220. }
  221.  
  222.  
  223. //=============================================================================
  224.  
  225. // drawing routines are reletive to the status bar location
  226.  
  227. /*
  228. =============
  229. Sbar_DrawPic
  230. =============
  231. */
  232. void Sbar_DrawPic (int x, int y, qpic_t *pic)
  233. {
  234.   Draw_Pic (x /* + ((vid.width - 320)>>1) */, y + (vid.height-SBAR_HEIGHT), pic);
  235. }
  236.  
  237. /*
  238. =============
  239. Sbar_DrawSubPic
  240. =============
  241. JACK: Draws a portion of the picture in the status bar.
  242. */
  243.  
  244. void Sbar_DrawSubPic(int x, int y, qpic_t *pic, int srcx, int srcy, int width, int height) 
  245. {
  246.   Draw_SubPic (x, y+(vid.height-SBAR_HEIGHT), pic, srcx, srcy, width, height);
  247. }
  248.  
  249.  
  250. /*
  251. =============
  252. Sbar_DrawTransPic
  253. =============
  254. */
  255. void Sbar_DrawTransPic (int x, int y, qpic_t *pic)
  256. {
  257.   Draw_TransPic (x /*+ ((vid.width - 320)>>1) */, y + (vid.height-SBAR_HEIGHT), pic);
  258. }
  259.  
  260. /*
  261. ================
  262. Sbar_DrawCharacter
  263.  
  264. Draws one solid graphics character
  265. ================
  266. */
  267. void Sbar_DrawCharacter (int x, int y, int num)
  268. {
  269.   Draw_Character ( x /*+ ((vid.width - 320)>>1) */ + 4, y + vid.height-SBAR_HEIGHT, num);
  270. }
  271.  
  272. /*
  273. ================
  274. Sbar_DrawString
  275. ================
  276. */
  277. void Sbar_DrawString (int x, int y, char *str)
  278. {
  279.   Draw_String (x /*+ ((vid.width - 320)>>1) */, y+ vid.height-SBAR_HEIGHT, str);
  280. }
  281.  
  282. /*
  283. =============
  284. Sbar_itoa
  285. =============
  286. */
  287. int Sbar_itoa (int num, char *buf)
  288. {
  289.   char  *str;
  290.   int   pow10;
  291.   int   dig;
  292.   
  293.   str = buf;
  294.   
  295.   if (num < 0)
  296.   {
  297.     *str++ = '-';
  298.     num = -num;
  299.   }
  300.   
  301.   for (pow10 = 10 ; num >= pow10 ; pow10 *= 10)
  302.   ;
  303.   
  304.   do
  305.   {
  306.     pow10 /= 10;
  307.     dig = num/pow10;
  308.     *str++ = '0'+dig;
  309.     num -= dig*pow10;
  310.   } while (pow10 != 1);
  311.   
  312.   *str = 0;
  313.   
  314.   return str-buf;
  315. }
  316.  
  317.  
  318. /*
  319. =============
  320. Sbar_DrawNum
  321. =============
  322. */
  323. void Sbar_DrawNum (int x, int y, int num, int digits, int color)
  324. {
  325.   char      str[12];
  326.   char      *ptr;
  327.   int       l, frame;
  328.  
  329.   l = Sbar_itoa (num, str);
  330.   ptr = str;
  331.   if (l > digits)
  332.     ptr += (l-digits);
  333.   if (l < digits)
  334.     x += (digits-l)*24;
  335.  
  336.   while (*ptr)
  337.   {
  338.     if (*ptr == '-')
  339.       frame = STAT_MINUS;
  340.     else
  341.       frame = *ptr -'0';
  342.  
  343.     Sbar_DrawTransPic (x,y,sb_nums[color][frame]);
  344.     x += 24;
  345.     ptr++;
  346.   }
  347. }
  348.  
  349. //=============================================================================
  350.  
  351. //ZOID: this should be MAX_CLIENTS, not MAX_SCOREBOARD!!
  352. //int   fragsort[MAX_SCOREBOARD];
  353. int   fragsort[MAX_CLIENTS];
  354. int   scoreboardlines;
  355. typedef struct {
  356.   char team[16+1];
  357.   int frags;
  358.   int players;
  359.   int plow, phigh, ptotal;
  360. } team_t;
  361. team_t teams[MAX_CLIENTS];
  362. int teamsort[MAX_CLIENTS];
  363. int scoreboardteams;
  364.  
  365. /*
  366. ===============
  367. Sbar_SortFrags
  368. ===============
  369. */
  370. void Sbar_SortFrags (qboolean includespec)
  371. {
  372.   int   i, j, k;
  373.     
  374. // sort by frags
  375.   scoreboardlines = 0;
  376.   for (i=0 ; i<MAX_CLIENTS ; i++)
  377.   {
  378.     if (cl.players[i].name[0] &&
  379.       (!cl.players[i].spectator || includespec))
  380.     {
  381.       fragsort[scoreboardlines] = i;
  382.       scoreboardlines++;
  383.       if (cl.players[i].spectator)
  384.         cl.players[i].frags = -999;
  385.     }
  386.   }
  387.     
  388.   for (i=0 ; i<scoreboardlines ; i++)
  389.     for (j=0 ; j<scoreboardlines-1-i ; j++)
  390.       if (cl.players[fragsort[j]].frags < cl.players[fragsort[j+1]].frags)
  391.       {
  392.         k = fragsort[j];
  393.         fragsort[j] = fragsort[j+1];
  394.         fragsort[j+1] = k;
  395.       }
  396. }
  397.  
  398. void Sbar_SortTeams (void)
  399. {
  400.   int       i, j, k;
  401.   player_info_t *s;
  402.   int       teamplay;
  403.   char t[16+1];
  404.  
  405. // request new ping times every two second
  406.   scoreboardteams = 0;
  407.  
  408.   teamplay = atoi(Info_ValueForKey(cl.serverinfo, "teamplay"));
  409.   if (!teamplay)
  410.     return;
  411.  
  412. // sort the teams
  413.   memset(teams, 0, sizeof(teams));
  414.   for (i = 0; i < MAX_CLIENTS; i++)
  415.     teams[i].plow = 999;
  416.  
  417.   for (i = 0; i < MAX_CLIENTS; i++) {
  418.     s = &cl.players[i];
  419.     if (!s->name[0])
  420.       continue;
  421.     if (s->spectator)
  422.       continue;
  423.  
  424.     // find his team in the list
  425.     t[16] = 0;
  426.     strncpy(t, Info_ValueForKey(s->userinfo, "team"), 16);
  427.     if (!t || !t[0])
  428.       continue; // not on team
  429.     for (j = 0; j < scoreboardteams; j++)
  430.       if (!strcmp(teams[j].team, t)) {
  431.         teams[j].frags += s->frags;
  432.         teams[j].players++;
  433.         goto addpinginfo;
  434.       }
  435.     if (j == scoreboardteams) { // must add him
  436.       j = scoreboardteams++;
  437.       strcpy(teams[j].team, t);
  438.       teams[j].frags = s->frags;
  439.       teams[j].players = 1;
  440. addpinginfo:
  441.       if (teams[j].plow > s->ping)
  442.         teams[j].plow = s->ping;
  443.       if (teams[j].phigh < s->ping)
  444.         teams[j].phigh = s->ping;
  445.       teams[j].ptotal += s->ping;
  446.     }
  447.   }
  448.  
  449.   // sort
  450.   for (i = 0; i < scoreboardteams; i++)
  451.     teamsort[i] = i;
  452.  
  453.   // good 'ol bubble sort
  454.   for (i = 0; i < scoreboardteams - 1; i++)
  455.     for (j = i + 1; j < scoreboardteams; j++)
  456.       if (teams[teamsort[i]].frags < teams[teamsort[j]].frags) {
  457.         k = teamsort[i];
  458.         teamsort[i] = teamsort[j];
  459.         teamsort[j] = k;
  460.       }
  461. }
  462.  
  463. int Sbar_ColorForMap (int m)
  464. {
  465.   m = (m < 0) ? 0 : ((m > 13) ? 13 : m);
  466.  
  467.   m *= 16;
  468.   return m < 128 ? m + 8 : m + 8;
  469. }
  470.  
  471.  
  472. /*
  473. ===============
  474. Sbar_SoloScoreboard
  475. ===============
  476. */
  477. void Sbar_SoloScoreboard (void)
  478. {
  479.   char  str[80];
  480.   int   minutes, seconds, tens, units;
  481.  
  482.   Sbar_DrawPic (0, 0, sb_scorebar);
  483.  
  484.   // time
  485.   minutes = cl.time / 60;
  486.   seconds = cl.time - 60*minutes;
  487.   tens = seconds / 10;
  488.   units = seconds - 10*tens;
  489.   sprintf (str,"Time :%3i:%i%i", minutes, tens, units);
  490.   Sbar_DrawString (184, 4, str);
  491. }
  492.  
  493. //=============================================================================
  494.  
  495. /*
  496. ===============
  497. Sbar_DrawInventory
  498. ===============
  499. */
  500. void Sbar_DrawInventory (void)
  501.   int   i;
  502.   char  num[6];
  503.   float time;
  504.   int   flashon;
  505.   qboolean  headsup;
  506.   qboolean    hudswap;
  507.  
  508.   headsup = !(cl_sbar.value || scr_viewsize.value<100);
  509.   hudswap = cl_hudswap.value; // Get that nasty float out :)
  510.  
  511.   if (!headsup)
  512.     Sbar_DrawPic (0, -24, sb_ibar);
  513. // weapons
  514.   for (i=0 ; i<7 ; i++)
  515.   {
  516.     if (cl.stats[STAT_ITEMS] & (IT_SHOTGUN<<i) )
  517.     {
  518.       time = cl.item_gettime[i];
  519.       flashon = (int)((cl.time - time)*10);
  520.       if (flashon < 0)
  521.         flashon = 0;
  522.       if (flashon >= 10)
  523.       {
  524.         if ( cl.stats[STAT_ACTIVEWEAPON] == (IT_SHOTGUN<<i)  )
  525.           flashon = 1;
  526.         else
  527.           flashon = 0;
  528.       }
  529.       else
  530.         flashon = (flashon%5) + 2;
  531.  
  532.       if (headsup) {
  533.         if (i || vid.height>200)
  534.           Sbar_DrawSubPic ((hudswap) ? 0 : (vid.width-24),-68-(7-i)*16 , sb_weapons[flashon][i],0,0,24,16);
  535.       
  536.       } else 
  537.       Sbar_DrawPic (i*24, -16, sb_weapons[flashon][i]);
  538. //      Sbar_DrawSubPic (0,0,20,20,i*24, -16, sb_weapons[flashon][i]);
  539.  
  540.       if (flashon > 1)
  541.         sb_updates = 0;   // force update to remove flash
  542.     }
  543.   }
  544.  
  545. // ammo counts
  546.   for (i=0 ; i<4 ; i++)
  547.   {
  548.     sprintf (num, "%3i",cl.stats[STAT_SHELLS+i] );
  549.     if (headsup) {
  550. //      Sbar_DrawSubPic(3, -24, sb_ibar, 3, 0, 42,11);
  551.       Sbar_DrawSubPic((hudswap) ? 0 : (vid.width-42), -24 - (4-i)*11, sb_ibar, 3+(i*48), 0, 42, 11);
  552.       if (num[0] != ' ')
  553.         Sbar_DrawCharacter ( (hudswap) ? 3 : (vid.width-39), -24 - (4-i)*11, 18 + num[0] - '0');
  554.       if (num[1] != ' ')
  555.         Sbar_DrawCharacter ( (hudswap) ? 11 : (vid.width-31), -24 - (4-i)*11, 18 + num[1] - '0');
  556.       if (num[2] != ' ')
  557.         Sbar_DrawCharacter ( (hudswap) ? 19 : (vid.width-23), -24 - (4-i)*11, 18 + num[2] - '0');
  558.     } else {
  559.     if (num[0] != ' ')
  560.       Sbar_DrawCharacter ( (6*i+1)*8 - 2, -24, 18 + num[0] - '0');
  561.     if (num[1] != ' ')
  562.       Sbar_DrawCharacter ( (6*i+2)*8 - 2, -24, 18 + num[1] - '0');
  563.     if (num[2] != ' ')
  564.       Sbar_DrawCharacter ( (6*i+3)*8 - 2, -24, 18 + num[2] - '0');
  565.   }
  566.   }
  567.   
  568.   flashon = 0;
  569. // items
  570.   for (i=0 ; i<6 ; i++)
  571.     if (cl.stats[STAT_ITEMS] & (1<<(17+i)))
  572.     {
  573.       time = cl.item_gettime[17+i];
  574.       if (time && time > cl.time - 2 && flashon )
  575.       { // flash frame
  576.         sb_updates = 0;
  577.       }
  578.       else
  579.         Sbar_DrawPic (192 + i*16, -16, sb_items[i]);    
  580.       if (time && time > cl.time - 2)
  581.         sb_updates = 0;
  582.     }
  583.  
  584. // sigils
  585.   for (i=0 ; i<4 ; i++)
  586.     if (cl.stats[STAT_ITEMS] & (1<<(28+i)))
  587.     {
  588.       time = cl.item_gettime[28+i];
  589.       if (time && time > cl.time - 2 && flashon )
  590.       { // flash frame
  591.         sb_updates = 0;
  592.       }
  593.       else
  594.         Sbar_DrawPic (320-32 + i*8, -16, sb_sigil[i]);    
  595.       if (time && time > cl.time - 2)
  596.         sb_updates = 0;
  597.     }
  598. }
  599.  
  600. //=============================================================================
  601.  
  602. /*
  603. ===============
  604. Sbar_DrawFrags
  605. ===============
  606. */
  607. void Sbar_DrawFrags (void)
  608.   int       i, k, l;
  609.   int       top, bottom;
  610.   int       x, y, f;
  611.   char      num[12];
  612.   player_info_t *s;
  613.   
  614.   Sbar_SortFrags (false);
  615.  
  616. // draw the text
  617.   l = scoreboardlines <= 4 ? scoreboardlines : 4;
  618.   
  619.   x = 23;
  620. //  xofs = (vid.width - 320)>>1;
  621.   y = vid.height - SBAR_HEIGHT - 23;
  622.  
  623.   for (i=0 ; i<l ; i++)
  624.   {
  625.     k = fragsort[i];
  626.     s = &cl.players[k];
  627.     if (!s->name[0])
  628.       continue;
  629.     if (s->spectator)
  630.       continue;
  631.  
  632.   // draw background
  633.     top = s->topcolor;
  634.     bottom = s->bottomcolor;
  635.     top = (top < 0) ? 0 : ((top > 13) ? 13 : top);
  636.     bottom = (bottom < 0) ? 0 : ((bottom > 13) ? 13 : bottom);
  637.  
  638.     top = Sbar_ColorForMap (top);
  639.     bottom = Sbar_ColorForMap (bottom);
  640.   
  641. //    Draw_Fill (xofs + x*8 + 10, y, 28, 4, top);
  642. //    Draw_Fill (xofs + x*8 + 10, y+4, 28, 3, bottom);
  643.     Draw_Fill (x*8 + 10, y, 28, 4, top);
  644.     Draw_Fill (x*8 + 10, y+4, 28, 3, bottom);
  645.  
  646.   // draw number
  647.     f = s->frags;
  648.     sprintf (num, "%3i",f);
  649.     
  650.     Sbar_DrawCharacter ( (x+1)*8 , -24, num[0]);
  651.     Sbar_DrawCharacter ( (x+2)*8 , -24, num[1]);
  652.     Sbar_DrawCharacter ( (x+3)*8 , -24, num[2]);
  653.  
  654.     if (k == cl.playernum)
  655.     {
  656.       Sbar_DrawCharacter (x*8+2, -24, 16);
  657.       Sbar_DrawCharacter ( (x+4)*8-4, -24, 17);
  658.     }
  659.     x+=4;
  660.   }
  661. }
  662.  
  663. //=============================================================================
  664.  
  665.  
  666. /*
  667. ===============
  668. Sbar_DrawFace
  669. ===============
  670. */
  671. void Sbar_DrawFace (void)
  672. {
  673.   int   f, anim;
  674.  
  675.   if ( (cl.stats[STAT_ITEMS] & (IT_INVISIBILITY | IT_INVULNERABILITY) )
  676.   == (IT_INVISIBILITY | IT_INVULNERABILITY) )
  677.   {
  678.     Sbar_DrawPic (112, 0, sb_face_invis_invuln);
  679.     return;
  680.   }
  681.   if (cl.stats[STAT_ITEMS] & IT_QUAD) 
  682.   {
  683.     Sbar_DrawPic (112, 0, sb_face_quad );
  684.     return;
  685.   }
  686.   if (cl.stats[STAT_ITEMS] & IT_INVISIBILITY) 
  687.   {
  688.     Sbar_DrawPic (112, 0, sb_face_invis );
  689.     return;
  690.   }
  691.   if (cl.stats[STAT_ITEMS] & IT_INVULNERABILITY) 
  692.   {
  693.     Sbar_DrawPic (112, 0, sb_face_invuln);
  694.     return;
  695.   }
  696.  
  697.   if (cl.stats[STAT_HEALTH] >= 100)
  698.     f = 4;
  699.   else
  700.     f = cl.stats[STAT_HEALTH] / 20;
  701.   
  702.   if (cl.time <= cl.faceanimtime)
  703.   {
  704.     anim = 1;
  705.     sb_updates = 0;   // make sure the anim gets drawn over
  706.   }
  707.   else
  708.     anim = 0;
  709.   Sbar_DrawPic (112, 0, sb_faces[f][anim]);
  710. }
  711.  
  712. /*
  713. =============
  714. Sbar_DrawNormal
  715. =============
  716. */
  717. void Sbar_DrawNormal (void)
  718. {
  719.   if (cl_sbar.value || scr_viewsize.value<100)
  720.   Sbar_DrawPic (0, 0, sb_sbar);
  721.  
  722. // armor
  723.   if (cl.stats[STAT_ITEMS] & IT_INVULNERABILITY)
  724.   {
  725.     Sbar_DrawNum (24, 0, 666, 3, 1);
  726.     Sbar_DrawPic (0, 0, draw_disc);
  727.   }
  728.   else
  729.   {
  730.     Sbar_DrawNum (24, 0, cl.stats[STAT_ARMOR], 3
  731.     , cl.stats[STAT_ARMOR] <= 25);
  732.     if (cl.stats[STAT_ITEMS] & IT_ARMOR3)
  733.       Sbar_DrawPic (0, 0, sb_armor[2]);
  734.     else if (cl.stats[STAT_ITEMS] & IT_ARMOR2)
  735.       Sbar_DrawPic (0, 0, sb_armor[1]);
  736.     else if (cl.stats[STAT_ITEMS] & IT_ARMOR1)
  737.       Sbar_DrawPic (0, 0, sb_armor[0]);
  738.   }
  739.   
  740. // face
  741.   Sbar_DrawFace ();
  742.   
  743. // health
  744.   Sbar_DrawNum (136, 0, cl.stats[STAT_HEALTH], 3
  745.   , cl.stats[STAT_HEALTH] <= 25);
  746.  
  747. // ammo icon
  748.   if (cl.stats[STAT_ITEMS] & IT_SHELLS)
  749.     Sbar_DrawPic (224, 0, sb_ammo[0]);
  750.   else if (cl.stats[STAT_ITEMS] & IT_NAILS)
  751.     Sbar_DrawPic (224, 0, sb_ammo[1]);
  752.   else if (cl.stats[STAT_ITEMS] & IT_ROCKETS)
  753.     Sbar_DrawPic (224, 0, sb_ammo[2]);
  754.   else if (cl.stats[STAT_ITEMS] & IT_CELLS)
  755.     Sbar_DrawPic (224, 0, sb_ammo[3]);
  756.   
  757.   Sbar_DrawNum (248, 0, cl.stats[STAT_AMMO], 3
  758.   , cl.stats[STAT_AMMO] <= 10);
  759. }
  760.  
  761. /*
  762. ===============
  763. Sbar_Draw
  764. ===============
  765. */
  766. void Sbar_Draw (void)
  767. {
  768.   qboolean headsup;
  769.   char st[512];
  770.  
  771.   headsup = !(cl_sbar.value || scr_viewsize.value<100);
  772.   if ((sb_updates >= vid.numpages) && !headsup)
  773.     return;
  774.  
  775.   if (scr_con_current == vid.height)
  776.     return;   // console is full screen
  777.  
  778.   scr_copyeverything = 1;
  779. //  scr_fullupdate = 0;
  780.  
  781.   sb_updates++;
  782.     
  783. // top line
  784.   if (sb_lines > 24)
  785.   {
  786.     if (!cl.spectator || autocam == CAM_TRACK)
  787.       Sbar_DrawInventory ();
  788.     if (!headsup || vid.width<512)
  789.       Sbar_DrawFrags ();
  790.   } 
  791.  
  792. // main area
  793.   if (sb_lines > 0)
  794.   {
  795.     if (cl.spectator) {
  796.       if (autocam != CAM_TRACK) {
  797.         Sbar_DrawPic (0, 0, sb_scorebar);
  798.         Sbar_DrawString (160-7*8,4, "SPECTATOR MODE");
  799.         Sbar_DrawString(160-14*8+4, 12, "Press [ATTACK] for AutoCamera");
  800.       } else {
  801.         if (sb_showscores || cl.stats[STAT_HEALTH] <= 0)
  802.           Sbar_SoloScoreboard ();
  803.         else
  804.           Sbar_DrawNormal ();
  805.  
  806. //          Sbar_DrawString (160-14*8+4,4, "SPECTATOR MODE - TRACK CAMERA");
  807.         sprintf(st, "Tracking %-.13s, [JUMP] for next",
  808.             cl.players[spec_track].name);
  809.         Sbar_DrawString(0, -8, st);
  810.       }
  811.     } else if (sb_showscores || cl.stats[STAT_HEALTH] <= 0)
  812.       Sbar_SoloScoreboard ();
  813.     else
  814.       Sbar_DrawNormal ();
  815.   }
  816.  
  817. // main screen deathmatch rankings
  818.   // if we're dead show team scores in team games
  819.   if (cl.stats[STAT_HEALTH] <= 0 && !cl.spectator)
  820.     if (atoi(Info_ValueForKey(cl.serverinfo, "teamplay")) > 0 &&
  821.       !sb_showscores)
  822.       Sbar_TeamOverlay();
  823.     else
  824.       Sbar_DeathmatchOverlay (0);
  825.   else if (sb_showscores)
  826.     Sbar_DeathmatchOverlay (0);
  827.   else if (sb_showteamscores)
  828.     Sbar_TeamOverlay();
  829.  
  830. #ifdef GLQUAKE
  831.   if (sb_showscores || sb_showteamscores || 
  832.     cl.stats[STAT_HEALTH] <= 0)
  833.     sb_updates = 0;
  834.   // clear unused areas in gl
  835. #if 0
  836.   {
  837.     int x = (vid.width - 320)>>1;
  838.  
  839.     // left
  840.     if (x > 0) {
  841.       Draw_TileClear (0, vid.height - sb_lines, x, sb_lines);
  842.       Draw_TileClear (x+320, vid.height - sb_lines, vid.width - x+320, sb_lines);
  843.     }
  844.   }
  845. #endif
  846.   if (vid.width > 320 && !headsup)
  847.     Draw_TileClear (320, vid.height - sb_lines, vid.width - 320, sb_lines);
  848. #endif
  849.  
  850.   if (sb_lines > 0)
  851.     Sbar_MiniDeathmatchOverlay ();
  852. }
  853.  
  854. //=============================================================================
  855.  
  856. /*
  857. ==================
  858. Sbar_IntermissionNumber
  859.  
  860. ==================
  861. */
  862. void Sbar_IntermissionNumber (int x, int y, int num, int digits, int color)
  863. {
  864.   char      str[12];
  865.   char      *ptr;
  866.   int       l, frame;
  867.  
  868.   l = Sbar_itoa (num, str);
  869.   ptr = str;
  870.   if (l > digits)
  871.     ptr += (l-digits);
  872.   if (l < digits)
  873.     x += (digits-l)*24;
  874.  
  875.   while (*ptr)
  876.   {
  877.     if (*ptr == '-')
  878.       frame = STAT_MINUS;
  879.     else
  880.       frame = *ptr -'0';
  881.  
  882.     Draw_TransPic (x,y,sb_nums[color][frame]);
  883.     x += 24;
  884.     ptr++;
  885.   }
  886. }
  887.  
  888. /*
  889. ==================
  890. Sbar_TeamOverlay
  891.  
  892. team frags
  893. added by Zoid
  894. ==================
  895. */
  896. void Sbar_TeamOverlay (void)
  897. {
  898.   qpic_t      *pic;
  899.   int       i, k, l;
  900.   int       x, y;
  901.   char      num[12];
  902.   int       teamplay;
  903.   char      team[5];
  904.   team_t *tm;
  905.   int plow, phigh, pavg;
  906.  
  907. // request new ping times every two second
  908.   teamplay = atoi(Info_ValueForKey(cl.serverinfo, "teamplay"));
  909.  
  910.   if (!teamplay) {
  911.     Sbar_DeathmatchOverlay(0);
  912.     return;
  913.   }
  914.  
  915.   scr_copyeverything = 1;
  916.   scr_fullupdate = 0;
  917.  
  918.   pic = Draw_CachePic ("gfx/ranking.lmp");
  919.   Draw_Pic (160-pic->width/2, 0, pic);
  920.  
  921.   y = 24;
  922.   x = 36;
  923.   Draw_String(x, y, "low/avg/high team total players");
  924.   y += 8;
  925. //  Draw_String(x, y, "------------ ---- ----- -------");
  926.   Draw_String(x, y, "\x1d\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1f \x1d\x1e\x1e\x1f \x1d\x1e\x1e\x1e\x1f \x1d\x1e\x1e\x1e\x1e\x1e\x1f");
  927.   y += 8;
  928.  
  929. // sort the teams
  930.   Sbar_SortTeams();
  931.  
  932. // draw the text
  933.   l = scoreboardlines;
  934.  
  935.   for (i=0 ; i < scoreboardteams && y <= vid.height-10 ; i++)
  936.   {
  937.     k = teamsort[i];
  938.     tm = teams + k;
  939.  
  940.   // draw pings
  941.     plow = tm->plow;
  942.     if (plow < 0 || plow > 999)
  943.       plow = 999;
  944.     phigh = tm->phigh;
  945.     if (phigh < 0 || phigh > 999)
  946.       phigh = 999;
  947.     if (!tm->players)
  948.       pavg = 999;
  949.     else
  950.       pavg = tm->ptotal / tm->players;
  951.     if (pavg < 0 || pavg > 999)
  952.       pavg = 999;
  953.  
  954.     sprintf (num, "%3i/%3i/%3i", plow, pavg, phigh);
  955.     Draw_String ( x, y, num);
  956.  
  957.   // draw team
  958.     team[4] = 0;
  959.     strncpy (team, tm->team, 4);
  960.     Draw_String (x + 104, y, team);
  961.  
  962.   // draw total
  963.     sprintf (num, "%5i", tm->frags);
  964.     Draw_String (x + 104 + 40, y, num);
  965.     
  966.   // draw players
  967.     sprintf (num, "%5i", tm->players);
  968.     Draw_String (x + 104 + 88, y, num);
  969.     
  970.     if (!strncmp(Info_ValueForKey(cl.players[cl.playernum].userinfo,
  971.       "team"), tm->team, 16)) {
  972.       Draw_Character ( x + 104 - 8, y, 16);
  973.       Draw_Character ( x + 104 + 32, y, 17);
  974.     }
  975.     
  976.     y += 8;
  977.   }
  978.   y += 8;
  979.   Sbar_DeathmatchOverlay(y);
  980. }
  981.  
  982. /*
  983. ==================
  984. Sbar_DeathmatchOverlay
  985.  
  986. ping time frags name
  987. ==================
  988. */
  989. void Sbar_DeathmatchOverlay (int start)
  990. {
  991.   qpic_t      *pic;
  992.   int       i, k, l;
  993.   int       top, bottom;
  994.   int       x, y, f;
  995.   char      num[12];
  996.   player_info_t *s;
  997.   int       total;
  998.   int       minutes;
  999.   int       p;
  1000.   int       teamplay;
  1001.   char      team[5];
  1002.   int       skip = 10;
  1003.  
  1004.   if (largegame)
  1005.     skip = 8;
  1006.  
  1007. // request new ping times every two second
  1008.   if (realtime - cl.last_ping_request > 2)
  1009.   {
  1010.     cl.last_ping_request = realtime;
  1011.     MSG_WriteByte (&cls.netchan.message, clc_stringcmd);
  1012.     SZ_Print (&cls.netchan.message, "pings");
  1013.   }
  1014.  
  1015.   teamplay = atoi(Info_ValueForKey(cl.serverinfo, "teamplay"));
  1016.  
  1017.   scr_copyeverything = 1;
  1018.   scr_fullupdate = 0;
  1019.  
  1020.   if (!start) {
  1021.     pic = Draw_CachePic ("gfx/ranking.lmp");
  1022.     Draw_Pic (160-pic->width/2, 0, pic);
  1023.   }
  1024.  
  1025. // scores 
  1026.   Sbar_SortFrags (true);
  1027.  
  1028. // draw the text
  1029.   l = scoreboardlines;
  1030.  
  1031.   if (start)
  1032.     y = start;
  1033.   else
  1034.     y = 24;
  1035.   if (teamplay)
  1036.   {
  1037.     x = 4;
  1038. //                            0    40 64   104   152  192 
  1039.     Draw_String ( x , y, "ping pl time frags team name");
  1040.     y += 8;
  1041. //    Draw_String ( x , y, "---- -- ---- ----- ---- ----------------");
  1042.     Draw_String ( x , y, "\x1d\x1e\x1e\x1f \x1d\x1f \x1d\x1e\x1e\x1f \x1d\x1e\x1e\x1e\x1f \x1d\x1e\x1e\x1f \x1d\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1f");
  1043.     y += 8;
  1044.   }
  1045.   else
  1046.   {
  1047.     x = 16;
  1048. //                            0    40 64   104   152
  1049.     Draw_String ( x , y, "ping pl time frags name");
  1050.     y += 8;
  1051. //    Draw_String ( x , y, "---- -- ---- ----- ----------------");
  1052.     Draw_String ( x , y, "\x1d\x1e\x1e\x1f \x1d\x1f \x1d\x1e\x1e\x1f \x1d\x1e\x1e\x1e\x1f \x1d\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1f");
  1053.     y += 8;
  1054.   }
  1055.  
  1056.   for (i=0 ; i<l && y <= vid.height-10 ; i++)
  1057.   {
  1058.     k = fragsort[i];
  1059.     s = &cl.players[k];
  1060.     if (!s->name[0])
  1061.       continue;
  1062.  
  1063.     // draw ping
  1064.     p = s->ping;
  1065.     if (p < 0 || p > 999)
  1066.       p = 999;
  1067.     sprintf (num, "%4i", p);
  1068.     Draw_String ( x, y, num);
  1069.  
  1070.     // draw pl
  1071.     p = s->pl;
  1072.     sprintf (num, "%3i", p);
  1073.     if (p > 25)
  1074.       Draw_Alt_String ( x+32, y, num);
  1075.     else
  1076.       Draw_String ( x+32, y, num);
  1077.  
  1078.     if (s->spectator)
  1079.     {
  1080.       Draw_String (x+40, y, "(spectator)");
  1081.       // draw name
  1082.       if (teamplay)
  1083.         Draw_String (x+152+40, y, s->name);
  1084.       else
  1085.         Draw_String (x+152, y, s->name);
  1086.       y += skip;
  1087.       continue;
  1088.     }
  1089.  
  1090.  
  1091.     // draw time
  1092.     if (cl.intermission)
  1093.       total = cl.completed_time - s->entertime;
  1094.     else
  1095.       total = realtime - s->entertime;
  1096.     minutes = (int)total/60;
  1097.     sprintf (num, "%4i", minutes);
  1098.     Draw_String ( x+64 , y, num);
  1099.  
  1100.     // draw background
  1101.     top = s->topcolor;
  1102.     bottom = s->bottomcolor;
  1103.     top = Sbar_ColorForMap (top);
  1104.     bottom = Sbar_ColorForMap (bottom);
  1105.   
  1106.     if (largegame)
  1107.       Draw_Fill ( x+104, y+1, 40, 3, top);
  1108.     else
  1109.       Draw_Fill ( x+104, y, 40, 4, top);
  1110.     Draw_Fill ( x+104, y+4, 40, 4, bottom);
  1111.  
  1112.   // draw number
  1113.     f = s->frags;
  1114.     sprintf (num, "%3i",f);
  1115.     
  1116.     Draw_Character ( x+112 , y, num[0]);
  1117.     Draw_Character ( x+120 , y, num[1]);
  1118.     Draw_Character ( x+128 , y, num[2]);
  1119.  
  1120.     if (k == cl.playernum)
  1121.     {
  1122.       Draw_Character ( x + 104, y, 16);
  1123.       Draw_Character ( x + 136, y, 17);
  1124.     }
  1125.     
  1126.     // team
  1127.     if (teamplay)
  1128.     {
  1129.       team[4] = 0;
  1130.       strncpy (team, Info_ValueForKey(s->userinfo, "team"), 4);
  1131.       Draw_String (x+152, y, team);
  1132.     }
  1133.  
  1134.     // draw name
  1135.     if (teamplay)
  1136.       Draw_String (x+152+40, y, s->name);
  1137.     else
  1138.       Draw_String (x+152, y, s->name);
  1139.     
  1140.     y += skip;
  1141.   }
  1142.  
  1143.   if (y >= vid.height-10) // we ran over the screen size, squish
  1144.     largegame = true;
  1145. }
  1146.  
  1147. /*
  1148. ==================
  1149. Sbar_MiniDeathmatchOverlay
  1150.  
  1151. frags name
  1152. frags team name
  1153. displayed to right of status bar if there's room
  1154. ==================
  1155. */
  1156. void Sbar_MiniDeathmatchOverlay (void)
  1157. {
  1158.   int       i, k;
  1159.   int       top, bottom;
  1160.   int       x, y, f;
  1161.   char      num[12];
  1162.   player_info_t *s;
  1163.   int       teamplay;
  1164.   char      team[5];
  1165.   int       numlines;
  1166.   char      name[16+1];
  1167.   team_t      *tm;
  1168.  
  1169.   if (vid.width < 512 || !sb_lines)
  1170.     return; // not enuff room
  1171.  
  1172.   teamplay = atoi(Info_ValueForKey(cl.serverinfo, "teamplay"));
  1173.  
  1174.   scr_copyeverything = 1;
  1175.   scr_fullupdate = 0;
  1176.  
  1177. // scores 
  1178.   Sbar_SortFrags (false);
  1179.   if (vid.width >= 640)
  1180.     Sbar_SortTeams();
  1181.  
  1182.   if (!scoreboardlines)
  1183.     return; // no one there?
  1184.  
  1185. // draw the text
  1186.   y = vid.height - sb_lines - 1;
  1187.   numlines = sb_lines/8;
  1188.   if (numlines < 3)
  1189.     return; // not enough room
  1190.  
  1191.   // find us
  1192.   for (i=0 ; i < scoreboardlines; i++)
  1193.     if (fragsort[i] == cl.playernum)
  1194.       break;
  1195.  
  1196.   if (i == scoreboardlines) // we're not there, we are probably a spectator, just display top
  1197.     i = 0;
  1198.   else // figure out start
  1199.     i = i - numlines/2;
  1200.  
  1201.   if (i > scoreboardlines - numlines)
  1202.     i = scoreboardlines - numlines;
  1203.   if (i < 0)
  1204.     i = 0;
  1205.  
  1206.   x = 324;
  1207.  
  1208.   for (/* */ ; i < scoreboardlines && y < vid.height - 8 + 1; i++)
  1209.   {
  1210.     k = fragsort[i];
  1211.     s = &cl.players[k];
  1212.     if (!s->name[0])
  1213.       continue;
  1214.  
  1215.   // draw ping
  1216.     top = s->topcolor;
  1217.     bottom = s->bottomcolor;
  1218.     top = Sbar_ColorForMap (top);
  1219.     bottom = Sbar_ColorForMap (bottom);
  1220.   
  1221.     Draw_Fill ( x, y+1, 40, 3, top);
  1222.     Draw_Fill ( x, y+4, 40, 4, bottom);
  1223.  
  1224.   // draw number
  1225.     f = s->frags;
  1226.     sprintf (num, "%3i",f);
  1227.     
  1228.     Draw_Character ( x+8 , y, num[0]);
  1229.     Draw_Character ( x+16, y, num[1]);
  1230.     Draw_Character ( x+24, y, num[2]);
  1231.  
  1232.     if (k == cl.playernum)
  1233.     {
  1234.       Draw_Character ( x, y, 16);
  1235.       Draw_Character ( x + 32, y, 17);
  1236.     }
  1237.     
  1238.   // team
  1239.     if (teamplay)
  1240.     {
  1241.       team[4] = 0;
  1242.       strncpy (team, Info_ValueForKey(s->userinfo, "team"), 4);
  1243.       Draw_String (x+48, y, team);
  1244.     }
  1245.  
  1246.   // draw name
  1247.     name[16] = 0;
  1248.     strncpy(name, s->name, 16);
  1249.     if (teamplay)
  1250.       Draw_String (x+48+40, y, name);
  1251.     else
  1252.       Draw_String (x+48, y, name);
  1253.     y += 8;
  1254.   }
  1255.  
  1256.   // draw teams if room
  1257.   if (vid.width < 640 || !teamplay)
  1258.     return;
  1259.  
  1260.   // draw seperator
  1261.   x += 208;
  1262.   for (y = vid.height - sb_lines; y < vid.height - 6; y += 2)
  1263.     Draw_Character(x, y, 14);
  1264.  
  1265.   x += 16;
  1266.  
  1267.   y = vid.height - sb_lines;
  1268.   for (i=0 ; i < scoreboardteams && y <= vid.height; i++)
  1269.   {
  1270.     k = teamsort[i];
  1271.     tm = teams + k;
  1272.  
  1273.   // draw pings
  1274.     team[4] = 0;
  1275.     strncpy (team, tm->team, 4);
  1276.     Draw_String (x, y, team);
  1277.  
  1278.   // draw total
  1279.     sprintf (num, "%5i", tm->frags);
  1280.     Draw_String (x + 40, y, num);
  1281.     
  1282.     if (!strncmp(Info_ValueForKey(cl.players[cl.playernum].userinfo,
  1283.       "team"), tm->team, 16)) {
  1284.       Draw_Character ( x - 8, y, 16);
  1285.       Draw_Character ( x + 32, y, 17);
  1286.     }
  1287.     
  1288.     y += 8;
  1289.   }
  1290.  
  1291. }
  1292.  
  1293.  
  1294. /*
  1295. ==================
  1296. Sbar_IntermissionOverlay
  1297.  
  1298. ==================
  1299. */
  1300. void Sbar_IntermissionOverlay (void)
  1301. {
  1302.   scr_copyeverything = 1;
  1303.   scr_fullupdate = 0;
  1304.  
  1305.   if (atoi(Info_ValueForKey(cl.serverinfo, "teamplay")) > 0 && !sb_showscores)
  1306.     Sbar_TeamOverlay ();
  1307.   else
  1308.     Sbar_DeathmatchOverlay (0);
  1309. }
  1310.  
  1311.  
  1312. /*
  1313. ==================
  1314. Sbar_FinaleOverlay
  1315.  
  1316. ==================
  1317. */
  1318. void Sbar_FinaleOverlay (void)
  1319. {
  1320.   qpic_t  *pic;
  1321.  
  1322.   scr_copyeverything = 1;
  1323.  
  1324.   pic = Draw_CachePic ("gfx/finale.lmp");
  1325.   Draw_TransPic ( (vid.width-pic->width)/2, 16, pic);
  1326. }
  1327.  
  1328.  
  1329.