DarkPlaces
Game engine based on the Quake 1 engine by id Software, developed by LadyHavoc
 
sbar.h File Reference
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define SBAR_HEIGHT   24
 

Functions

void Sbar_DeathmatchOverlay (void)
 
void Sbar_Draw (void)
 called every frame by screen
 
int Sbar_GetSortedPlayerIndex (int index)
 
void Sbar_Init (void)
 
void Sbar_ShowFPS (void)
 
void Sbar_ShowFPS_Update (void)
 
void Sbar_SortFrags (void)
 

Variables

cvar_t cl_deathscoreboard
 
int sb_lines
 scan lines to draw
 
struct cvar_s sbar_alpha_bg
 
struct cvar_s sbar_alpha_fg
 

Macro Definition Documentation

◆ SBAR_HEIGHT

#define SBAR_HEIGHT   24

Definition at line 24 of file sbar.h.

Referenced by Sbar_Draw(), and Sbar_DrawFace().

Function Documentation

◆ Sbar_DeathmatchOverlay()

void Sbar_DeathmatchOverlay ( void )

Definition at line 1866 of file sbar.c.

1867{
1868 int i, y, xmin, xmax, ymin, ymax;
1869 char vabuf[1024];
1870
1871 // request new ping times every two second
1873 {
1876 {
1878 MSG_WriteString(&cls.netcon->message, "pings");
1879 }
1881 {
1882 // these servers usually lack the pings command and so a less efficient "ping" command must be sent, which on modern DP servers will also reply with a pingplreport command after the ping listing
1883 static int ping_anyway_counter = 0;
1885 {
1886 Con_DPrintf("want to send ping, but still waiting for other reply\n");
1887 if(++ping_anyway_counter >= 5)
1889 }
1891 {
1892 ping_anyway_counter = 0;
1893 cl.parsingtextexpectingpingforscores = 1; // hide the output of the next ping report
1895 MSG_WriteString(&cls.netcon->message, "ping");
1896 }
1897 }
1898 else
1899 {
1900 // newer server definitely has pings command, so use it for more efficiency, avoids ping reports spamming the console if they are misparsed, and saves a little bandwidth
1902 MSG_WriteString(&cls.netcon->message, "pings");
1903 }
1904 }
1905
1906 // scores
1907 Sbar_SortFrags ();
1908
1909 ymin = 8;
1910 ymax = 40 + 8 + (Sbar_IsTeammatch() ? (teamlines * 8 + 5): 0) + scoreboardlines * 8 - 1;
1911
1913 xmin = (int) (vid_conwidth.integer - (26 + 15) * 8 * FONT_SBAR->maxwidth) / 2; // 26 characters until name, then we assume 15 character names (they can be longer but usually aren't)
1914 else
1915 xmin = (int) (vid_conwidth.integer - (16 + 25) * 8 * FONT_SBAR->maxwidth) / 2; // 16 characters until name, then we assume 25 character names (they can be longer but usually aren't)
1916 xmax = vid_conwidth.integer - xmin;
1917
1919 DrawQ_Pic (xmin - 8, ymin - 8, 0, xmax-xmin+1 + 2*8, ymax-ymin+1 + 2*8, 0, 0, 0, sbar_alpha_bg.value, 0);
1920
1922
1923 // draw the text
1924 y = 40;
1926 {
1927 DrawQ_String(xmin, y, va(vabuf, sizeof(vabuf), "ping pl%% time frags team name"), 0, 8, 8, 1, 1, 1, 1 * sbar_alpha_fg.value, 0, NULL, false, FONT_SBAR );
1928 }
1929 else
1930 {
1931 DrawQ_String(xmin, y, va(vabuf, sizeof(vabuf), "ping pl%% frags name"), 0, 8, 8, 1, 1, 1, 1 * sbar_alpha_fg.value, 0, NULL, false, FONT_SBAR );
1932 }
1933 y += 8;
1934
1935 if (Sbar_IsTeammatch ())
1936 {
1937 // show team scores first
1938 for (i = 0;i < teamlines && y < vid_conheight.integer;i++)
1939 y += (int)Sbar_PrintScoreboardItem((teams + teamsort[i]), xmin, y);
1940 y += 5;
1941 }
1942
1943 for (i = 0;i < scoreboardlines && y < vid_conheight.integer;i++)
1945}
client_state_t cl
Definition cl_main.c:117
client_static_t cls
Definition cl_main.c:116
cvar_t vid_conheight
Definition cl_screen.c:57
cvar_t vid_conwidth
Definition cl_screen.c:56
gamemode_t gamemode
Definition com_game.c:26
#define IS_OLDNEXUIZ_DERIVED(g)
Definition com_game.h:73
void MSG_WriteString(sizebuf_t *sb, const char *s)
Definition com_msg.c:173
void MSG_WriteByte(sizebuf_t *sb, int c)
Definition com_msg.c:130
@ PROTOCOL_DARKPLACES2
various changes
Definition common.h:140
@ PROTOCOL_DARKPLACES4
various changes
Definition common.h:138
@ PROTOCOL_NEHAHRABJP2
same as NEHAHRABJP but with 16bit soundindex
Definition common.h:147
@ PROTOCOL_DARKPLACES3
uses EntityFrame4 entity snapshot encoder/decoder which is broken, this attempted to do partial snaps...
Definition common.h:139
@ PROTOCOL_NEHAHRABJP
same as QUAKEDP but with 16bit modelindex
Definition common.h:146
@ PROTOCOL_DARKPLACES5
uses EntityFrame5 entity snapshot encoder/decoder which is based on a Tribes networking article at ht...
Definition common.h:137
@ PROTOCOL_QUAKEDP
darkplaces extended quake protocol (used by TomazQuake and others), backwards compatible as long as n...
Definition common.h:142
@ PROTOCOL_DARKPLACES6
various changes
Definition common.h:136
@ PROTOCOL_QUAKE
quake (aka netquake/normalquake/nq) protocol
Definition common.h:144
@ PROTOCOL_NEHAHRABJP3
same as NEHAHRABJP2 but with some changes
Definition common.h:148
@ PROTOCOL_NEHAHRAMOVIE
Nehahra movie protocol, a big nasty hack dating back to early days of the Quake Standards Group (but ...
Definition common.h:143
@ PROTOCOL_QUAKEWORLD
quakeworld protocol
Definition common.h:145
@ PROTOCOL_DARKPLACES1
uses EntityFrame entity snapshot encoder/decoder which is a QuakeWorld-like entity snapshot delta com...
Definition common.h:141
void Con_DPrintf(const char *fmt,...)
A Con_Printf that only shows up if the "developer" cvar is set.
Definition console.c:1544
void DrawQ_Pic(float x, float y, cachepic_t *pic, float width, float height, float red, float green, float blue, float alpha, int flags)
Definition gl_draw.c:797
int Draw_GetPicWidth(cachepic_t *pic)
Definition gl_draw.c:197
#define FONT_SBAR
Definition draw.h:130
static int(ZEXPORT *qz_inflate)(z_stream *strm
GLint GLenum GLint GLint y
Definition glquake.h:651
host_static_t host
Definition host.c:41
#define qw_clc_stringcmd
Definition protocol.h:957
#define clc_stringcmd
Definition protocol.h:291
int i
static int teamlines
Definition sbar.c:553
static scoreboard_t teams[MAX_SCOREBOARD]
Definition sbar.c:551
static int scoreboardlines
Definition sbar.c:544
static int teamsort[MAX_SCOREBOARD]
Definition sbar.c:552
static int Sbar_IsTeammatch(void)
Definition sbar.c:531
cachepic_t * sb_ranking
Definition sbar.c:83
cvar_t sbar_alpha_fg
Definition sbar.c:101
void Sbar_SortFrags(void)
Definition sbar.c:554
cvar_t sbar_alpha_bg
Definition sbar.c:100
static float Sbar_PrintScoreboardItem(scoreboard_t *s, float x, float y)
Definition sbar.c:1796
static int fragsort[MAX_SCOREBOARD]
Definition sbar.c:543
int parsingtextexpectingpingforscores
Definition client.h:955
scoreboard_t * scores
Definition client.h:945
double last_ping_request
Definition client.h:1036
netconn_t * netcon
Definition client.h:630
protocolversion_t protocol
Definition client.h:617
float value
Definition cvar.h:74
int integer
Definition cvar.h:73
double realtime
the accumulated mainloop time since application started (with filtering), without any slowmo or clamp...
Definition host.h:46
sizebuf_t message
writing buffer to send to peer as the next reliable message can be added to at any time,...
Definition netconn.h:161

References cl, clc_stringcmd, cls, Con_DPrintf(), Draw_GetPicWidth(), DrawQ_Pic(), DrawQ_String(), FONT_SBAR, fragsort, gamemode, host, i, int(), cvar_t::integer, IS_OLDNEXUIZ_DERIVED, client_state_t::last_ping_request, netconn_t::message, MSG_WriteByte(), MSG_WriteString(), client_static_t::netcon, NULL, client_state_t::parsingtextexpectingpingforscores, client_static_t::protocol, PROTOCOL_DARKPLACES1, PROTOCOL_DARKPLACES2, PROTOCOL_DARKPLACES3, PROTOCOL_DARKPLACES4, PROTOCOL_DARKPLACES5, PROTOCOL_DARKPLACES6, PROTOCOL_NEHAHRABJP, PROTOCOL_NEHAHRABJP2, PROTOCOL_NEHAHRABJP3, PROTOCOL_NEHAHRAMOVIE, PROTOCOL_QUAKE, PROTOCOL_QUAKEDP, PROTOCOL_QUAKEWORLD, qw_clc_stringcmd, host_static_t::realtime, sb_ranking, sbar_alpha_bg, sbar_alpha_fg, Sbar_IsTeammatch(), Sbar_PrintScoreboardItem(), Sbar_SortFrags(), scoreboardlines, client_state_t::scores, teamlines, teams, teamsort, va(), cvar_t::value, vid_conheight, vid_conwidth, and y.

Referenced by CL_VM_DrawHud(), Sbar_DrawScoreboard(), and Sbar_IntermissionOverlay().

◆ Sbar_Draw()

void Sbar_Draw ( void )

called every frame by screen

Definition at line 1372 of file sbar.c.

1373{
1374 cachepic_t *pic;
1375 char vabuf[1024];
1376
1377 if(cl.csqc_vidvars.drawenginesbar) //[515]: csqc drawsbar
1378 {
1379 if (sb_showscores)
1381 else if (cl.intermission == 1)
1382 {
1383 if(IS_OLDNEXUIZ_DERIVED(gamemode)) // display full scoreboard (that is, show scores + map name)
1384 {
1386 return;
1387 }
1389 }
1390 else if (cl.intermission == 2)
1392 else if (gamemode == GAME_DELUXEQUAKE)
1393 {
1394 }
1396 {
1398 {
1399 sbar_x = (vid_conwidth.integer - 640)/2;
1403 }
1404 else if (sb_lines && sbar_hudselector.integer == 1)
1405 {
1406 int i;
1407 float fade;
1408 int redflag, blueflag;
1409 float x;
1410
1411 sbar_x = (vid_conwidth.integer - 320)/2;
1412 sbar_y = vid_conheight.integer - 24 - 16;
1413
1414 // calculate intensity to draw weapons bar at
1415 fade = 3.2 - 2 * (cl.time - cl.weapontime);
1416 fade = bound(0.7, fade, 1);
1417 for (i = 0; i < 8;i++)
1418 if (cl.stats[STAT_ITEMS] & (1 << i))
1419 Sbar_DrawWeapon(i + 1, fade, (i + 2 == cl.stats[STAT_ACTIVEWEAPON]));
1420 if((cl.stats[STAT_ITEMS] & (1<<12)))
1421 Sbar_DrawWeapon(0, fade, (cl.stats[STAT_ACTIVEWEAPON] == 1));
1422
1423 // flag icons
1424 redflag = ((cl.stats[STAT_ITEMS]>>15) & 3);
1425 blueflag = ((cl.stats[STAT_ITEMS]>>17) & 3);
1427 if (redflag == 3 && blueflag == 3)
1428 {
1429 // The Impossible Combination[tm]
1430 // Can only happen in Key Hunt mode...
1431 Sbar_DrawPic ((int) x, (int) ((vid_conheight.integer - sbar_y) - (sbar_flagstatus_pos.value + 128)), sb_items[14]);
1432 }
1433 else
1434 {
1435 if (redflag)
1436 Sbar_DrawPic ((int) x, (int) ((vid_conheight.integer - sbar_y) - (sbar_flagstatus_pos.value + 64)), sb_items[redflag+10]);
1437 if (blueflag)
1438 Sbar_DrawPic ((int) x, (int) ((vid_conheight.integer - sbar_y) - (sbar_flagstatus_pos.value + 128)), sb_items[blueflag+14]);
1439 }
1440
1441 // armor
1442 if (cl.stats[STAT_ARMOR] > 0)
1443 {
1444 Sbar_DrawStretchPic (72, 0, sb_armor[0], sbar_alpha_fg.value, 24, 24);
1445 if(cl.stats[STAT_ARMOR] > 200)
1446 Sbar_DrawXNum(0,0,cl.stats[STAT_ARMOR],3,24,0,1,0,1,0);
1447 else if(cl.stats[STAT_ARMOR] > 100)
1448 Sbar_DrawXNum(0,0,cl.stats[STAT_ARMOR],3,24,0.2,1,0.2,1,0);
1449 else if(cl.stats[STAT_ARMOR] > 50)
1450 Sbar_DrawXNum(0,0,cl.stats[STAT_ARMOR],3,24,0.6,0.7,0.8,1,0);
1451 else if(cl.stats[STAT_ARMOR] > 25)
1452 Sbar_DrawXNum(0,0,cl.stats[STAT_ARMOR],3,24,1,1,0.2,1,0);
1453 else
1454 Sbar_DrawXNum(0,0,cl.stats[STAT_ARMOR],3,24,0.7,0,0,1,0);
1455 }
1456
1457 // health
1458 if (cl.stats[STAT_HEALTH] != 0)
1459 {
1461 if(cl.stats[STAT_HEALTH] > 200)
1462 Sbar_DrawXNum(112,0,cl.stats[STAT_HEALTH],3,24,0,1,0,1,0);
1463 else if(cl.stats[STAT_HEALTH] > 100)
1464 Sbar_DrawXNum(112,0,cl.stats[STAT_HEALTH],3,24,0.2,1,0.2,1,0);
1465 else if(cl.stats[STAT_HEALTH] > 50)
1466 Sbar_DrawXNum(112,0,cl.stats[STAT_HEALTH],3,24,0.6,0.7,0.8,1,0);
1467 else if(cl.stats[STAT_HEALTH] > 25)
1468 Sbar_DrawXNum(112,0,cl.stats[STAT_HEALTH],3,24,1,1,0.2,1,0);
1469 else
1470 Sbar_DrawXNum(112,0,cl.stats[STAT_HEALTH],3,24,0.7,0,0,1,0);
1471 }
1472
1473 // ammo
1475 {
1477 Sbar_DrawStretchPic (296, 0, sb_ammo[0], sbar_alpha_fg.value, 24, 24);
1478 else if (cl.stats[STAT_ITEMS] & NEX_IT_BULLETS)
1479 Sbar_DrawStretchPic (296, 0, sb_ammo[1], sbar_alpha_fg.value, 24, 24);
1480 else if (cl.stats[STAT_ITEMS] & NEX_IT_ROCKETS)
1481 Sbar_DrawStretchPic (296, 0, sb_ammo[2], sbar_alpha_fg.value, 24, 24);
1482 else if (cl.stats[STAT_ITEMS] & NEX_IT_CELLS)
1483 Sbar_DrawStretchPic (296, 0, sb_ammo[3], sbar_alpha_fg.value, 24, 24);
1484 if(cl.stats[STAT_AMMO] > 10)
1485 Sbar_DrawXNum(224, 0, cl.stats[STAT_AMMO], 3, 24, 0.6,0.7,0.8,1,0);
1486 else
1487 Sbar_DrawXNum(224, 0, cl.stats[STAT_AMMO], 3, 24, 0.7,0,0,1,0);
1488 }
1489
1490 if (sbar_x + 320 + 160 <= vid_conwidth.integer)
1492 if (sbar_x > 0)
1493 Sbar_Score(16);
1494 // The margin can be at most 8 to support 640x480 console size:
1495 // 320 + 2 * (144 + 16) = 640
1496 }
1497 else if (sb_lines)
1498 {
1499 int i;
1500 float fade;
1501 int redflag, blueflag;
1502 float x;
1503
1504 sbar_x = (vid_conwidth.integer - 640)/2;
1506
1507 // calculate intensity to draw weapons bar at
1508 fade = 3 - 2 * (cl.time - cl.weapontime);
1509 if (fade > 0)
1510 {
1511 fade = min(fade, 1);
1512 for (i = 0; i < 8;i++)
1513 if (cl.stats[STAT_ITEMS] & (1 << i))
1514 Sbar_DrawWeapon(i + 1, fade, (i + 2 == cl.stats[STAT_ACTIVEWEAPON]));
1515
1516 if((cl.stats[STAT_ITEMS] & (1<<12)))
1517 Sbar_DrawWeapon(0, fade, (cl.stats[STAT_ACTIVEWEAPON] == 1));
1518 }
1519
1520 //if (!cl.islocalgame)
1521 // Sbar_DrawFrags ();
1522
1523 if (sb_lines > 24)
1525 else
1527
1528 // flag icons
1529 redflag = ((cl.stats[STAT_ITEMS]>>15) & 3);
1530 blueflag = ((cl.stats[STAT_ITEMS]>>17) & 3);
1532 if (redflag == 3 && blueflag == 3)
1533 {
1534 // The Impossible Combination[tm]
1535 // Can only happen in Key Hunt mode...
1536 Sbar_DrawPic ((int) x, -179, sb_items[14]);
1537 }
1538 else
1539 {
1540 if (redflag)
1541 Sbar_DrawPic ((int) x, -117, sb_items[redflag+10]);
1542 if (blueflag)
1543 Sbar_DrawPic ((int) x, -177, sb_items[blueflag+14]);
1544 }
1545
1546 // armor
1547 Sbar_DrawXNum ((340-3*24), 12, cl.stats[STAT_ARMOR], 3, 24, 0.6,0.7,0.8,1,0);
1548
1549 // health
1550 if(cl.stats[STAT_HEALTH] > 100)
1551 Sbar_DrawXNum((154-3*24),12,cl.stats[STAT_HEALTH],3,24,1,1,1,1,0);
1552 else if(cl.stats[STAT_HEALTH] <= 25 && cl.time - (int)cl.time > 0.5)
1553 Sbar_DrawXNum((154-3*24),12,cl.stats[STAT_HEALTH],3,24,0.7,0,0,1,0);
1554 else
1555 Sbar_DrawXNum((154-3*24),12,cl.stats[STAT_HEALTH],3,24,0.6,0.7,0.8,1,0);
1556
1557 // AK dont draw ammo for the laser
1558 if(cl.stats[STAT_ACTIVEWEAPON] != 12)
1559 {
1561 Sbar_DrawPic (519, 0, sb_ammo[0]);
1562 else if (cl.stats[STAT_ITEMS] & NEX_IT_BULLETS)
1563 Sbar_DrawPic (519, 0, sb_ammo[1]);
1564 else if (cl.stats[STAT_ITEMS] & NEX_IT_ROCKETS)
1565 Sbar_DrawPic (519, 0, sb_ammo[2]);
1566 else if (cl.stats[STAT_ITEMS] & NEX_IT_CELLS)
1567 Sbar_DrawPic (519, 0, sb_ammo[3]);
1568
1569 if(cl.stats[STAT_AMMO] <= 10)
1570 Sbar_DrawXNum ((519-3*24), 12, cl.stats[STAT_AMMO], 3, 24, 0.7, 0,0,1,0);
1571 else
1572 Sbar_DrawXNum ((519-3*24), 12, cl.stats[STAT_AMMO], 3, 24, 0.6, 0.7,0.8,1,0);
1573
1574 }
1575
1576 if (sb_lines > 24)
1578
1579 if (sbar_x + 600 + 160 <= vid_conwidth.integer)
1581
1582 if (sbar_x > 0)
1583 Sbar_Score(-16);
1584 // Because:
1585 // Mini scoreboard uses 12*4 per other team, that is, 144
1586 // pixels when there are four teams...
1587 // Nexuiz by default sets vid_conwidth to 800... makes
1588 // sbar_x == 80...
1589 // so we need to shift it by 64 pixels to the right to fit
1590 // BUT: then it overlaps with the image that gets drawn
1591 // for viewsize 100! Therefore, just account for 3 teams,
1592 // that is, 96 pixels mini scoreboard size, needing 16 pixels
1593 // to the right!
1594 }
1595 }
1596 else if (gamemode == GAME_ZYMOTIC)
1597 {
1598#if 1
1599 float scale = 64.0f / 256.0f;
1600 float kickoffset[3];
1601 VectorClear(kickoffset);
1602 if (v_dmg_time > 0)
1603 {
1604 kickoffset[0] = (v_dmg_time/v_kicktime.value*v_dmg_roll) * 10 * scale;
1605 kickoffset[1] = (v_dmg_time/v_kicktime.value*v_dmg_pitch) * 10 * scale;
1606 }
1607 sbar_x = (int)((vid_conwidth.integer - 256 * scale)/2 + kickoffset[0]);
1608 sbar_y = (int)((vid_conheight.integer - 256 * scale)/2 + kickoffset[1]);
1609 // left1 16, 48 : 126 -66
1610 // left2 16, 128 : 196 -66
1611 // right 176, 48 : 196 -136
1612 Sbar_DrawGauge(sbar_x + 16 * scale, sbar_y + 48 * scale, zymsb_crosshair_left1, 64*scale, 80*scale, 78*scale, -66*scale, cl.stats[STAT_AMMO] * (1.0 / 200.0), cl.stats[STAT_SHELLS] * (1.0 / 200.0), 0.8f,0.8f,0.0f,1.0f, 0.8f,0.5f,0.0f,1.0f, 0.3f,0.3f,0.3f,1.0f, DRAWFLAG_NORMAL);
1613 Sbar_DrawGauge(sbar_x + 16 * scale, sbar_y + 128 * scale, zymsb_crosshair_left2, 64*scale, 80*scale, 68*scale, -66*scale, cl.stats[STAT_NAILS] * (1.0 / 200.0), cl.stats[STAT_ROCKETS] * (1.0 / 200.0), 0.8f,0.8f,0.0f,1.0f, 0.8f,0.5f,0.0f,1.0f, 0.3f,0.3f,0.3f,1.0f, DRAWFLAG_NORMAL);
1614 Sbar_DrawGauge(sbar_x + 176 * scale, sbar_y + 48 * scale, zymsb_crosshair_right, 64*scale, 160*scale, 148*scale, -136*scale, cl.stats[STAT_ARMOR] * (1.0 / 300.0), cl.stats[STAT_HEALTH] * (1.0 / 300.0), 0.0f,0.5f,1.0f,1.0f, 1.0f,0.0f,0.0f,1.0f, 0.3f,0.3f,0.3f,1.0f, DRAWFLAG_NORMAL);
1615 DrawQ_Pic(sbar_x + 120 * scale, sbar_y + 120 * scale, zymsb_crosshair_center, 16 * scale, 16 * scale, 1, 1, 1, 1, DRAWFLAG_NORMAL);
1616#else
1617 float scale = 128.0f / 256.0f;
1618 float healthstart, healthheight, healthstarttc, healthendtc;
1619 float shieldstart, shieldheight, shieldstarttc, shieldendtc;
1620 float ammostart, ammoheight, ammostarttc, ammoendtc;
1621 float clipstart, clipheight, clipstarttc, clipendtc;
1622 float kickoffset[3], offset;
1623 VectorClear(kickoffset);
1624 if (v_dmg_time > 0)
1625 {
1626 kickoffset[0] = (v_dmg_time/v_kicktime.value*v_dmg_roll) * 10 * scale;
1627 kickoffset[1] = (v_dmg_time/v_kicktime.value*v_dmg_pitch) * 10 * scale;
1628 }
1629 sbar_x = (vid_conwidth.integer - 256 * scale)/2 + kickoffset[0];
1630 sbar_y = (vid_conheight.integer - 256 * scale)/2 + kickoffset[1];
1631 offset = 0; // TODO: offset should be controlled by recoil (question: how to detect firing?)
1632 DrawQ_SuperPic(sbar_x + 120 * scale, sbar_y + ( 88 - offset) * scale, zymsb_crosshair_line, 16 * scale, 36 * scale, 0,0, 1,1,1,1, 1,0, 1,1,1,1, 0,1, 1,1,1,1, 1,1, 1,1,1,1, 0);
1633 DrawQ_SuperPic(sbar_x + (132 + offset) * scale, sbar_y + 120 * scale, zymsb_crosshair_line, 36 * scale, 16 * scale, 0,1, 1,1,1,1, 0,0, 1,1,1,1, 1,1, 1,1,1,1, 1,0, 1,1,1,1, 0);
1634 DrawQ_SuperPic(sbar_x + 120 * scale, sbar_y + (132 + offset) * scale, zymsb_crosshair_line, 16 * scale, 36 * scale, 1,1, 1,1,1,1, 0,1, 1,1,1,1, 1,0, 1,1,1,1, 0,0, 1,1,1,1, 0);
1635 DrawQ_SuperPic(sbar_x + ( 88 - offset) * scale, sbar_y + 120 * scale, zymsb_crosshair_line, 36 * scale, 16 * scale, 1,0, 1,1,1,1, 1,1, 1,1,1,1, 0,0, 1,1,1,1, 0,1, 1,1,1,1, 0);
1636 healthheight = cl.stats[STAT_HEALTH] * (152.0f / 300.0f);
1637 shieldheight = cl.stats[STAT_ARMOR] * (152.0f / 300.0f);
1638 healthstart = 204 - healthheight;
1639 shieldstart = healthstart - shieldheight;
1640 healthstarttc = healthstart * (1.0f / 256.0f);
1641 healthendtc = (healthstart + healthheight) * (1.0f / 256.0f);
1642 shieldstarttc = shieldstart * (1.0f / 256.0f);
1643 shieldendtc = (shieldstart + shieldheight) * (1.0f / 256.0f);
1644 ammoheight = cl.stats[STAT_SHELLS] * (62.0f / 200.0f);
1645 ammostart = 114 - ammoheight;
1646 ammostarttc = ammostart * (1.0f / 256.0f);
1647 ammoendtc = (ammostart + ammoheight) * (1.0f / 256.0f);
1648 clipheight = cl.stats[STAT_AMMO] * (122.0f / 200.0f);
1649 clipstart = 190 - clipheight;
1650 clipstarttc = clipstart * (1.0f / 256.0f);
1651 clipendtc = (clipstart + clipheight) * (1.0f / 256.0f);
1652 if (healthheight > 0) DrawQ_SuperPic(sbar_x + 0 * scale, sbar_y + healthstart * scale, zymsb_crosshair_health, 256 * scale, healthheight * scale, 0,healthstarttc, 1.0f,0.0f,0.0f,1.0f, 1,healthstarttc, 1.0f,0.0f,0.0f,1.0f, 0,healthendtc, 1.0f,0.0f,0.0f,1.0f, 1,healthendtc, 1.0f,0.0f,0.0f,1.0f, DRAWFLAG_NORMAL);
1653 if (shieldheight > 0) DrawQ_SuperPic(sbar_x + 0 * scale, sbar_y + shieldstart * scale, zymsb_crosshair_health, 256 * scale, shieldheight * scale, 0,shieldstarttc, 0.0f,0.5f,1.0f,1.0f, 1,shieldstarttc, 0.0f,0.5f,1.0f,1.0f, 0,shieldendtc, 0.0f,0.5f,1.0f,1.0f, 1,shieldendtc, 0.0f,0.5f,1.0f,1.0f, DRAWFLAG_NORMAL);
1654 if (ammoheight > 0) DrawQ_SuperPic(sbar_x + 0 * scale, sbar_y + ammostart * scale, zymsb_crosshair_ammo, 256 * scale, ammoheight * scale, 0,ammostarttc, 0.8f,0.8f,0.0f,1.0f, 1,ammostarttc, 0.8f,0.8f,0.0f,1.0f, 0,ammoendtc, 0.8f,0.8f,0.0f,1.0f, 1,ammoendtc, 0.8f,0.8f,0.0f,1.0f, DRAWFLAG_NORMAL);
1655 if (clipheight > 0) DrawQ_SuperPic(sbar_x + 0 * scale, sbar_y + clipstart * scale, zymsb_crosshair_clip, 256 * scale, clipheight * scale, 0,clipstarttc, 1.0f,1.0f,0.0f,1.0f, 1,clipstarttc, 1.0f,1.0f,0.0f,1.0f, 0,clipendtc, 1.0f,1.0f,0.0f,1.0f, 1,clipendtc, 1.0f,1.0f,0.0f,1.0f, DRAWFLAG_NORMAL);
1656 DrawQ_Pic(sbar_x + 0 * scale, sbar_y + 0 * scale, zymsb_crosshair_background, 256 * scale, 256 * scale, 1, 1, 1, 1, DRAWFLAG_NORMAL);
1657 DrawQ_Pic(sbar_x + 120 * scale, sbar_y + 120 * scale, zymsb_crosshair_center, 16 * scale, 16 * scale, 1, 1, 1, 1, DRAWFLAG_NORMAL);
1658#endif
1659 }
1660 else // Quake and others
1661 {
1662 sbar_x = (vid_conwidth.integer - 320)/2;
1664 // LadyHavoc: changed to draw the deathmatch overlays in any multiplayer mode
1665 //if (cl.gametype == GAME_DEATHMATCH && gamemode != GAME_TRANSFUSION)
1666
1667 if (sb_lines > 24)
1668 {
1672 Sbar_DrawFrags ();
1673 }
1674
1676 {
1680 }
1681 else if (sb_lines)
1682 {
1684
1685 // keys (hipnotic only)
1686 //MED 01/04/97 moved keys here so they would not be overwritten
1688 {
1689 if (cl.stats[STAT_ITEMS] & IT_KEY1)
1690 Sbar_DrawPic (209, 3, sb_items[0]);
1691 if (cl.stats[STAT_ITEMS] & IT_KEY2)
1692 Sbar_DrawPic (209, 12, sb_items[1]);
1693 }
1694 // armor
1696 {
1698 {
1699 Sbar_DrawNum (24, 0, 666, 3, 1);
1700 Sbar_DrawPic (0, 0, sb_disc);
1701 }
1702 else
1703 {
1704 if (gamemode == GAME_ROGUE)
1705 {
1706 Sbar_DrawNum (24, 0, cl.stats[STAT_ARMOR], 3, cl.stats[STAT_ARMOR] <= 25);
1708 Sbar_DrawPic (0, 0, sb_armor[2]);
1709 else if (cl.stats[STAT_ITEMS] & RIT_ARMOR2)
1710 Sbar_DrawPic (0, 0, sb_armor[1]);
1711 else if (cl.stats[STAT_ITEMS] & RIT_ARMOR1)
1712 Sbar_DrawPic (0, 0, sb_armor[0]);
1713 }
1714 else
1715 {
1716 Sbar_DrawNum (24, 0, cl.stats[STAT_ARMOR], 3, cl.stats[STAT_ARMOR] <= 25);
1718 Sbar_DrawPic (0, 0, sb_armor[2]);
1719 else if (cl.stats[STAT_ITEMS] & IT_ARMOR2)
1720 Sbar_DrawPic (0, 0, sb_armor[1]);
1721 else if (cl.stats[STAT_ITEMS] & IT_ARMOR1)
1722 Sbar_DrawPic (0, 0, sb_armor[0]);
1723 }
1724 }
1725 }
1726
1727 // face
1728 Sbar_DrawFace ();
1729
1730 // health
1731 Sbar_DrawNum (136, 0, cl.stats[STAT_HEALTH], 3, cl.stats[STAT_HEALTH] <= 25);
1732
1733 // ammo icon
1734 if (gamemode == GAME_ROGUE)
1735 {
1737 Sbar_DrawPic (224, 0, sb_ammo[0]);
1738 else if (cl.stats[STAT_ITEMS] & RIT_NAILS)
1739 Sbar_DrawPic (224, 0, sb_ammo[1]);
1740 else if (cl.stats[STAT_ITEMS] & RIT_ROCKETS)
1741 Sbar_DrawPic (224, 0, sb_ammo[2]);
1742 else if (cl.stats[STAT_ITEMS] & RIT_CELLS)
1743 Sbar_DrawPic (224, 0, sb_ammo[3]);
1744 else if (cl.stats[STAT_ITEMS] & RIT_LAVA_NAILS)
1745 Sbar_DrawPic (224, 0, rsb_ammo[0]);
1746 else if (cl.stats[STAT_ITEMS] & RIT_PLASMA_AMMO)
1747 Sbar_DrawPic (224, 0, rsb_ammo[1]);
1749 Sbar_DrawPic (224, 0, rsb_ammo[2]);
1750 }
1751 else
1752 {
1754 Sbar_DrawPic (224, 0, sb_ammo[0]);
1755 else if (cl.stats[STAT_ITEMS] & IT_NAILS)
1756 Sbar_DrawPic (224, 0, sb_ammo[1]);
1757 else if (cl.stats[STAT_ITEMS] & IT_ROCKETS)
1758 Sbar_DrawPic (224, 0, sb_ammo[2]);
1759 else if (cl.stats[STAT_ITEMS] & IT_CELLS)
1760 Sbar_DrawPic (224, 0, sb_ammo[3]);
1761 }
1762
1763 Sbar_DrawNum (248, 0, cl.stats[STAT_AMMO], 3, cl.stats[STAT_AMMO] <= 10);
1764
1765 // LadyHavoc: changed to draw the deathmatch overlays in any multiplayer mode
1766 if ((!cl.islocalgame || cl.gametype != GAME_COOP))
1767 {
1770 else
1772 Sbar_Score(24);
1773 }
1774 }
1775 }
1776 }
1777
1779 {
1780 pic = Draw_CachePic (va(vabuf, sizeof(vabuf), "gfx/crosshair%i", crosshair.integer));
1782 }
1783
1784 if (cl_prydoncursor.integer > 0)
1785 DrawQ_Pic((cl.cmd.cursor_screen[0] + 1) * 0.5 * vid_conwidth.integer, (cl.cmd.cursor_screen[1] + 1) * 0.5 * vid_conheight.integer, Draw_CachePic (va(vabuf, sizeof(vabuf), "gfx/prydoncursor%03i", cl_prydoncursor.integer)), 0, 0, 1, 1, 1, 1, 0);
1786}
cvar_t cl_prydoncursor
Definition cl_main.c:92
cvar_t r_letterbox
Definition cl_screen.c:79
@ GAME_QUOTH
Definition com_game.h:31
@ GAME_ROGUE
Definition com_game.h:30
@ GAME_TRANSFUSION
Definition com_game.h:35
@ GAME_GOODVSBAD2
Definition com_game.h:36
@ GAME_ZYMOTIC
Definition com_game.h:39
@ GAME_DELUXEQUAKE
Definition com_game.h:45
@ GAME_HIPNOTIC
Definition com_game.h:29
char * va(char *buf, size_t buflen, const char *format,...)
Definition common.c:972
const float DRAWFLAG_NORMAL
const float DRAWFLAG_MODULATE
float scale
cachepic_t * Draw_CachePic(const char *path)
Definition gl_draw.c:185
void DrawQ_SuperPic(float x, float y, cachepic_t *pic, float width, float height, float s1, float t1, float r1, float g1, float b1, float a1, float s2, float t2, float r2, float g2, float b2, float a2, float s3, float t3, float r3, float g3, float b3, float a3, float s4, float t4, float r4, float g4, float b4, float a4, int flags)
Definition gl_draw.c:1380
int Draw_GetPicHeight(cachepic_t *pic)
Definition gl_draw.c:204
GLint GLenum GLint x
Definition glquake.h:651
GLuint GLuint GLintptr offset
Definition glquake.h:632
#define min(A, B)
Definition mathlib.h:37
#define VectorClear(a)
Definition mathlib.h:97
#define bound(min, num, max)
Definition mathlib.h:34
#define GAME_COOP
Definition protocol.h:203
#define STAT_HEALTH
Definition qstats.h:8
#define STAT_SHELLS
Definition qstats.h:14
#define STAT_NAILS
Definition qstats.h:15
#define STAT_ACTIVEWEAPON
Definition qstats.h:18
#define STAT_ARMOR
Definition qstats.h:12
#define STAT_AMMO
Definition qstats.h:11
#define STAT_ITEMS
FTE, DP.
Definition qstats.h:23
#define STAT_ROCKETS
Definition qstats.h:16
#define IT_NAILS
Definition quakedef.h:47
#define IT_KEY1
Definition quakedef.h:55
#define IT_SHELLS
Definition quakedef.h:46
#define IT_ARMOR3
Definition quakedef.h:53
#define RIT_CELLS
Definition quakedef.h:94
#define IT_ROCKETS
Definition quakedef.h:48
#define RIT_PLASMA_AMMO
Definition quakedef.h:105
#define NEX_IT_CELLS
Definition quakedef.h:81
#define RIT_ARMOR3
Definition quakedef.h:103
#define IT_INVULNERABILITY
Definition quakedef.h:58
#define IT_ARMOR2
Definition quakedef.h:52
#define NEX_IT_SHELLS
Definition quakedef.h:78
#define RIT_ARMOR1
Definition quakedef.h:101
#define NEX_IT_BULLETS
Definition quakedef.h:79
#define RIT_NAILS
Definition quakedef.h:92
#define IT_ARMOR1
Definition quakedef.h:51
#define IT_KEY2
Definition quakedef.h:56
#define NEX_IT_ROCKETS
Definition quakedef.h:80
#define RIT_LAVA_NAILS
Definition quakedef.h:104
#define IT_CELLS
Definition quakedef.h:49
#define RIT_ARMOR2
Definition quakedef.h:102
#define RIT_MULTI_ROCKETS
Definition quakedef.h:106
#define RIT_SHELLS
Definition quakedef.h:91
#define RIT_ROCKETS
Definition quakedef.h:93
static void Sbar_IntermissionOverlay(void)
Definition sbar.c:2205
static void Sbar_DrawXNum(int x, int y, int num, int digits, int lettersize, float r, float g, float b, float a, int flags)
Definition sbar.c:496
float v_dmg_time
Definition view.c:147
cachepic_t * sb_health
Definition sbar.c:49
qbool sb_showscores
Definition sbar.c:56
cvar_t sbar_flagstatus_right
Definition sbar.c:106
cachepic_t * rsb_ammo[3]
Definition sbar.c:63
cachepic_t * sb_sbar
Definition sbar.c:33
cachepic_t * sb_armor[3]
Definition sbar.c:43
int sbar_x
Definition sbar.c:414
cachepic_t * zymsb_crosshair_line
Definition sbar.c:74
cvar_t cl_deathscoreboard
Definition sbar.c:110
cachepic_t * sb_disc
Definition sbar.c:27
cvar_t sbar_hudselector
Definition sbar.c:102
int sbar_y
Definition sbar.c:414
cachepic_t * zymsb_crosshair_left2
Definition sbar.c:80
cachepic_t * zymsb_crosshair_ammo
Definition sbar.c:76
static void Sbar_DrawAlphaPic(int x, int y, cachepic_t *pic, float alpha)
Definition sbar.c:431
cachepic_t * zymsb_crosshair_background
Definition sbar.c:78
void Sbar_Score(int margin)
Definition sbar.c:2059
static void Sbar_MiniDeathmatchOverlay(int x, int y)
Definition sbar.c:1953
cachepic_t * zymsb_crosshair_health
Definition sbar.c:75
static void Sbar_DrawStretchPic(int x, int y, cachepic_t *pic, float alpha, float overridewidth, float overrideheight)
Definition sbar.c:421
static void Sbar_DrawPic(int x, int y, cachepic_t *pic)
Definition sbar.c:426
cachepic_t * zymsb_crosshair_center
Definition sbar.c:73
static void Sbar_DrawInventory(void)
Definition sbar.c:783
static void Sbar_DrawNum(int x, int y, int num, int digits, int color)
Definition sbar.c:464
cachepic_t * zymsb_crosshair_clip
Definition sbar.c:77
int sb_lines
scan lines to draw
Definition sbar.c:58
static void Sbar_DrawWeapon(int nr, float fade, int active)
Definition sbar.c:755
cvar_t crosshair_color_green
Definition sbar.c:113
cachepic_t * sb_ammo[4]
Definition sbar.c:41
static void Sbar_DrawFrags(void)
Definition sbar.c:934
cvar_t crosshair_color_alpha
Definition sbar.c:115
cachepic_t * sb_sbar_overlay
Definition sbar.c:37
static void Sbar_DrawFace(void)
Definition sbar.c:983
static void Sbar_FinaleOverlay(void)
Definition sbar.c:2263
static void Sbar_DrawGauge(float x, float y, cachepic_t *pic, float width, float height, float rangey, float rangeheight, float c1, float c2, float c1r, float c1g, float c1b, float c1a, float c2r, float c2g, float c2b, float c2a, float c3r, float c3g, float c3b, float c3a, int drawflags)
Definition sbar.c:1344
cvar_t sbar_flagstatus_pos
Definition sbar.c:107
cachepic_t * sb_scorebar
Definition sbar.c:34
cachepic_t * zymsb_crosshair_left1
Definition sbar.c:79
float v_dmg_pitch
Definition sbar.c:1369
cachepic_t * sb_items[32]
Definition sbar.c:44
cvar_t crosshair_color_blue
Definition sbar.c:114
cachepic_t * sb_sbar_minimal
Definition sbar.c:36
cvar_t v_kicktime
Definition view.c:84
float v_dmg_roll
Definition sbar.c:1369
cvar_t crosshair_color_red
Definition sbar.c:112
cvar_t crosshair_size
Definition sbar.c:116
cachepic_t * zymsb_crosshair_right
Definition sbar.c:81
static void Sbar_DrawScoreboard(void)
Definition sbar.c:743
#define SBAR_HEIGHT
Definition sbar.h:24
struct cvar_s crosshair
Definition view.c:121
float weapontime
Definition client.h:767
int intermission
Definition client.h:856
int islocalgame
Definition client.h:746
double time
Definition client.h:868
int stats[MAX_CL_STATS]
Definition client.h:758
usercmd_t cmd
Definition client.h:752
csqc_vidvars_t csqc_vidvars
Definition client.h:834
qbool drawenginesbar
Definition client.h:707
qbool drawcrosshair
Definition client.h:708
vec3_t cursor_screen
Definition protocol.h:384

References bound, cl, cl_deathscoreboard, cl_prydoncursor, client_state_t::cmd, crosshair, crosshair_color_alpha, crosshair_color_blue, crosshair_color_green, crosshair_color_red, crosshair_size, client_state_t::csqc_vidvars, usercmd_t::cursor_screen, Draw_CachePic(), Draw_GetPicHeight(), Draw_GetPicWidth(), csqc_vidvars_t::drawcrosshair, csqc_vidvars_t::drawenginesbar, DRAWFLAG_MODULATE, DRAWFLAG_NORMAL, DrawQ_Pic(), DrawQ_SuperPic(), GAME_COOP, GAME_DELUXEQUAKE, GAME_GOODVSBAD2, GAME_HIPNOTIC, GAME_QUOTH, GAME_ROGUE, GAME_TRANSFUSION, GAME_ZYMOTIC, gamemode, client_state_t::gametype, i, int(), cvar_t::integer, client_state_t::intermission, IS_OLDNEXUIZ_DERIVED, client_state_t::islocalgame, IT_ARMOR1, IT_ARMOR2, IT_ARMOR3, IT_CELLS, IT_INVULNERABILITY, IT_KEY1, IT_KEY2, IT_NAILS, IT_ROCKETS, IT_SHELLS, min, NEX_IT_BULLETS, NEX_IT_CELLS, NEX_IT_ROCKETS, NEX_IT_SHELLS, offset, r_letterbox, RIT_ARMOR1, RIT_ARMOR2, RIT_ARMOR3, RIT_CELLS, RIT_LAVA_NAILS, RIT_MULTI_ROCKETS, RIT_NAILS, RIT_PLASMA_AMMO, RIT_ROCKETS, RIT_SHELLS, rsb_ammo, sb_ammo, sb_armor, sb_disc, sb_health, sb_items, sb_lines, sb_sbar, sb_sbar_minimal, sb_sbar_overlay, sb_scorebar, sb_showscores, sbar_alpha_bg, sbar_alpha_fg, Sbar_DrawAlphaPic(), Sbar_DrawFace(), Sbar_DrawFrags(), Sbar_DrawGauge(), Sbar_DrawInventory(), Sbar_DrawNum(), Sbar_DrawPic(), Sbar_DrawScoreboard(), Sbar_DrawStretchPic(), Sbar_DrawWeapon(), Sbar_DrawXNum(), Sbar_FinaleOverlay(), sbar_flagstatus_pos, sbar_flagstatus_right, SBAR_HEIGHT, sbar_hudselector, Sbar_IntermissionOverlay(), Sbar_MiniDeathmatchOverlay(), Sbar_Score(), sbar_x, sbar_y, scale, STAT_ACTIVEWEAPON, STAT_AMMO, STAT_ARMOR, STAT_HEALTH, STAT_ITEMS, STAT_NAILS, STAT_ROCKETS, STAT_SHELLS, client_state_t::stats, client_state_t::time, v_dmg_pitch, v_dmg_roll, v_dmg_time, v_kicktime, va(), cvar_t::value, VectorClear, vid_conheight, vid_conwidth, client_state_t::weapontime, x, zymsb_crosshair_ammo, zymsb_crosshair_background, zymsb_crosshair_center, zymsb_crosshair_clip, zymsb_crosshair_health, zymsb_crosshair_left1, zymsb_crosshair_left2, zymsb_crosshair_line, and zymsb_crosshair_right.

Referenced by SCR_DrawScreen().

◆ Sbar_GetSortedPlayerIndex()

int Sbar_GetSortedPlayerIndex ( int index)

Definition at line 546 of file sbar.c.

547{
548 return index >= 0 && index < scoreboardlines ? fragsort[index] : -1;
549}
GLuint index
Definition glquake.h:629

References fragsort, index, and scoreboardlines.

Referenced by VM_CL_getplayerkey().

◆ Sbar_Init()

void Sbar_Init ( void )

Definition at line 359 of file sbar.c.

360{
361 Cmd_AddCommand(CF_CLIENT, "+showscores", Sbar_ShowScores_f, "show scoreboard");
362 Cmd_AddCommand(CF_CLIENT, "-showscores", Sbar_DontShowScores_f, "hide scoreboard");
374
375 Cvar_RegisterVirtual(&cl_showfps, "showfps");
376 Cvar_RegisterVirtual(&cl_showsound, "showsound");
377 Cvar_RegisterVirtual(&cl_showblur, "showblur");
378 Cvar_RegisterVirtual(&cl_showspeed, "showspeed");
379 Cvar_RegisterVirtual(&cl_showtopspeed, "showtopspeed");
380 Cvar_RegisterVirtual(&cl_showtime, "showtime");
381 Cvar_RegisterVirtual(&cl_showtime_format, "showtime_format");
382 Cvar_RegisterVirtual(&cl_showdate, "showdate");
383 Cvar_RegisterVirtual(&cl_showdate_format, "showdate_format");
384 Cvar_RegisterVirtual(&cl_showtex, "showtex");
385
394 // This cvar is found in Fitzquake-derived engines and FTEQW and is read by the Alkaline 1.2 and Arcane Dimensions 1.80 CSQC
395 Cvar_RegisterVirtual(&sbar_alpha_bg, "scr_sbaralpha");
396
402
403 Cvar_RegisterVariable(&sbar_flagstatus_right); // (GAME_NEXUZI ONLY)
404 Cvar_RegisterVariable(&sbar_flagstatus_pos); // (GAME_NEXUIZ ONLY)
405
407}
void Cmd_AddCommand(unsigned flags, const char *cmd_name, xcommand_t function, const char *description)
called by the init functions of other parts of the program to register commands and functions to call...
Definition cmd.c:1661
#define CF_CLIENT
cvar/command that only the client can change/execute
Definition cmd.h:48
void Cvar_RegisterVariable(cvar_t *variable)
registers a cvar that already has the name, string, and optionally the archive elements set.
Definition cvar.c:599
void Cvar_RegisterVirtual(cvar_t *variable, const char *name)
Definition cvar.c:513
#define NULL
Definition qtypes.h:12
void R_RegisterModule(const char *name, void(*start)(void), void(*shutdown)(void), void(*newmap)(void), void(*devicelost)(void), void(*devicerestored)(void))
Definition r_modules.c:25
static void Sbar_ShowScores_f(cmd_state_t *cmd)
Definition sbar.c:131
cvar_t cl_showfps
Definition sbar.c:88
cvar_t cl_showspeed
Definition sbar.c:91
cvar_t cl_showtime_format
Definition sbar.c:95
cvar_t cl_showsound
Definition sbar.c:89
static void sbar_shutdown(void)
Definition sbar.c:351
cvar_t sbar_scorerank
Definition sbar.c:103
cvar_t sbar_miniscoreboard_size
Definition sbar.c:105
cvar_t cl_showtex
Definition sbar.c:98
cvar_t cl_showtime
Definition sbar.c:94
cvar_t cl_showblur
Definition sbar.c:90
cvar_t cl_showtopspeed
Definition sbar.c:93
static void sbar_start(void)
Definition sbar.c:152
cvar_t sbar_info_pos
Definition sbar.c:108
cvar_t cl_showdate
Definition sbar.c:96
cvar_t cl_showspeed_factor
Definition sbar.c:92
cvar_t sbar_gametime
Definition sbar.c:104
static void sbar_newmap(void)
Definition sbar.c:355
static void Sbar_DontShowScores_f(cmd_state_t *cmd)
Definition sbar.c:146
cvar_t cl_showdate_format
Definition sbar.c:97

◆ Sbar_ShowFPS()

void Sbar_ShowFPS ( void )

Definition at line 1099 of file sbar.c.

1100{
1101 float fps_x, fps_y, fps_scalex, fps_scaley, fps_strings = 0;
1102 char soundstring[32];
1103 char fpsstring[32];
1104 char timestring[32];
1105 char datestring[32];
1106 char timedemostring1[32];
1107 char timedemostring2[32];
1108 char speedstring[32];
1109 char blurstring[32];
1110 char topspeedstring[48];
1111 char texstring[MAX_QPATH];
1112 char entstring[32];
1113 qbool red = false;
1114 soundstring[0] = 0;
1115 fpsstring[0] = 0;
1116 timedemostring1[0] = 0;
1117 timedemostring2[0] = 0;
1118 timestring[0] = 0;
1119 datestring[0] = 0;
1120 speedstring[0] = 0;
1121 blurstring[0] = 0;
1122 topspeedstring[0] = 0;
1123 texstring[0] = 0;
1124 entstring[0] = 0;
1125 if (cl_showfps.integer)
1126 {
1127 red = (showfps_framerate < 1.0f);
1128 if(cl_showfps.integer == 2)
1129 dpsnprintf(fpsstring, sizeof(fpsstring), "%7.3f mspf", (1000.0 / showfps_framerate));
1130 else if (red)
1131 dpsnprintf(fpsstring, sizeof(fpsstring), "%4i spf", (int)(1.0 / showfps_framerate + 0.5));
1132 else
1133 dpsnprintf(fpsstring, sizeof(fpsstring), "%4i fps", (int)(showfps_framerate + 0.5));
1134 fps_strings++;
1135 if (cls.timedemo)
1136 {
1137 dpsnprintf(timedemostring1, sizeof(timedemostring1), "frame%4i %f", cls.td_frames, host.realtime - cls.td_starttime);
1138 dpsnprintf(timedemostring2, sizeof(timedemostring2), "%i seconds %3.0f/%3.0f/%3.0f fps", cls.td_onesecondavgcount, cls.td_onesecondminfps, cls.td_onesecondavgfps / max(1, cls.td_onesecondavgcount), cls.td_onesecondmaxfps);
1139 fps_strings++;
1140 fps_strings++;
1141 }
1142 }
1143 if (cl_showtime.integer)
1144 {
1145 Sys_TimeString(timestring, sizeof(timestring), cl_showtime_format.string);
1146 fps_strings++;
1147 }
1148 if (cl_showdate.integer)
1149 {
1150 Sys_TimeString(datestring, sizeof(datestring), cl_showdate_format.string);
1151 fps_strings++;
1152 }
1153 if (cl_showblur.integer)
1154 {
1155 dpsnprintf(blurstring, sizeof(blurstring), "%3i%% blur", (int)(cl.motionbluralpha * 100));
1156 fps_strings++;
1157 }
1159 {
1160 dpsnprintf(soundstring, sizeof(soundstring), "%4i/4%i at %3ims", cls.soundstats.mixedsounds, cls.soundstats.totalsounds, cls.soundstats.latency_milliseconds);
1161 fps_strings++;
1162 }
1164 {
1165 double speed, speedxy, f;
1166 const char *unit;
1170 {
1172 dpsnprintf(speedstring, sizeof(speedstring), "%.0f (%.0f) %s", f*speed, f*speedxy, unit);
1173 fps_strings++;
1174 }
1176 {
1177 qbool topspeed_latched = false, topspeedxy_latched = false;
1179 if (speed >= topspeed || current_time - top_time > 3)
1180 {
1181 topspeed = speed;
1182 time(&top_time);
1183 }
1184 else
1185 topspeed_latched = true;
1186 if (speedxy >= topspeedxy || current_time - topxy_time > 3)
1187 {
1188 topspeedxy = speedxy;
1189 time(&topxy_time);
1190 }
1191 else
1192 topspeedxy_latched = true;
1193 dpsnprintf(topspeedstring, sizeof(topspeedstring), "%s%.0f%s (%s%.0f%s) %s",
1194 topspeed_latched ? "^1" : "^xf88", f*topspeed, "^xf88",
1195 topspeedxy_latched ? "^1" : "^xf88", f*topspeedxy, "^xf88",
1196 unit);
1198 fps_strings++;
1199 }
1200 }
1201 if (cl_showtex.integer)
1202 {
1203 vec3_t org;
1204 vec3_t dest;
1205 vec3_t temp;
1206 trace_t svtrace, cltrace;
1207 int hitnetentity = -1;
1208
1210 VectorSet(temp, 65536, 0, 0);
1212 // clear the traces as we may or may not fill them out, and mark them with an invalid fraction so we know if we did
1213 memset(&svtrace, 0, sizeof(svtrace));
1214 memset(&cltrace, 0, sizeof(cltrace));
1215 svtrace.fraction = 2.0;
1216 cltrace.fraction = 2.0;
1217 // ray hits models (even animated ones) and ignores translucent materials
1218 if (sv.active)
1220 cltrace = CL_TraceLine(org, dest, MOVE_HITMODEL, NULL, SUPERCONTENTS_SOLID, 0, MATERIALFLAGMASK_TRANSLUCENT, collision_extendmovelength.value, true, false, &hitnetentity, true, true);
1221 if (cltrace.hittexture)
1222 dp_strlcpy(texstring, cltrace.hittexture->name, sizeof(texstring));
1223 else
1224 dp_strlcpy(texstring, "(no texture hit)", sizeof(texstring));
1225 fps_strings++;
1226 if (svtrace.fraction < cltrace.fraction)
1227 {
1228 if (svtrace.ent != NULL)
1229 {
1230 prvm_prog_t *prog = SVVM_prog;
1231 dpsnprintf(entstring, sizeof(entstring), "server entity %i", (int)PRVM_EDICT_TO_PROG(svtrace.ent));
1232 }
1233 else
1234 dp_strlcpy(entstring, "(no entity hit)", sizeof(entstring));
1235 }
1236 else
1237 {
1238 if (cltrace.ent != NULL)
1239 {
1240 prvm_prog_t *prog = CLVM_prog;
1241 dpsnprintf(entstring, sizeof(entstring), "client entity %i", (int)PRVM_EDICT_TO_PROG(cltrace.ent));
1242 }
1243 else if (hitnetentity > 0)
1244 dpsnprintf(entstring, sizeof(entstring), "network entity %i", hitnetentity);
1245 else if (hitnetentity == 0)
1246 dp_strlcpy(entstring, "world entity", sizeof(entstring));
1247 else
1248 dp_strlcpy(entstring, "(no entity hit)", sizeof(entstring));
1249 }
1250 fps_strings++;
1251 }
1252 if (fps_strings)
1253 {
1254 fps_scalex = 12;
1255 fps_scaley = 12;
1256 //fps_y = vid_conheight.integer - sb_lines; // yes this may draw over the sbar
1257 //fps_y = bound(0, fps_y, vid_conheight.integer - fps_strings*fps_scaley);
1258 fps_y = vid_conheight.integer - sbar_info_pos.integer - fps_strings*fps_scaley;
1259 if (soundstring[0])
1260 {
1261 fps_x = vid_conwidth.integer - DrawQ_TextWidth(soundstring, 0, fps_scalex, fps_scaley, true, FONT_INFOBAR);
1262 DrawQ_Fill(fps_x, fps_y, vid_conwidth.integer - fps_x, fps_scaley, 0, 0, 0, 0.5, 0);
1263 DrawQ_String(fps_x, fps_y, soundstring, 0, fps_scalex, fps_scaley, 1, 1, 1, 1, 0, NULL, true, FONT_INFOBAR);
1264 fps_y += fps_scaley;
1265 }
1266 if (fpsstring[0])
1267 {
1268 r_draw2d_force = true;
1269 fps_x = vid_conwidth.integer - DrawQ_TextWidth(fpsstring, 0, fps_scalex, fps_scaley, true, FONT_INFOBAR);
1270 DrawQ_Fill(fps_x, fps_y, vid_conwidth.integer - fps_x, fps_scaley, 0, 0, 0, 0.5, 0);
1271 if (red)
1272 DrawQ_String(fps_x, fps_y, fpsstring, 0, fps_scalex, fps_scaley, 1, 0, 0, 1, 0, NULL, true, FONT_INFOBAR);
1273 else
1274 DrawQ_String(fps_x, fps_y, fpsstring, 0, fps_scalex, fps_scaley, 1, 1, 1, 1, 0, NULL, true, FONT_INFOBAR);
1275 fps_y += fps_scaley;
1276 r_draw2d_force = false;
1277 }
1278 if (timedemostring1[0])
1279 {
1280 fps_x = vid_conwidth.integer - DrawQ_TextWidth(timedemostring1, 0, fps_scalex, fps_scaley, true, FONT_INFOBAR);
1281 DrawQ_Fill(fps_x, fps_y, vid_conwidth.integer - fps_x, fps_scaley, 0, 0, 0, 0.5, 0);
1282 DrawQ_String(fps_x, fps_y, timedemostring1, 0, fps_scalex, fps_scaley, 1, 1, 1, 1, 0, NULL, true, FONT_INFOBAR);
1283 fps_y += fps_scaley;
1284 }
1285 if (timedemostring2[0])
1286 {
1287 fps_x = vid_conwidth.integer - DrawQ_TextWidth(timedemostring2, 0, fps_scalex, fps_scaley, true, FONT_INFOBAR);
1288 DrawQ_Fill(fps_x, fps_y, vid_conwidth.integer - fps_x, fps_scaley, 0, 0, 0, 0.5, 0);
1289 DrawQ_String(fps_x, fps_y, timedemostring2, 0, fps_scalex, fps_scaley, 1, 1, 1, 1, 0, NULL, true, FONT_INFOBAR);
1290 fps_y += fps_scaley;
1291 }
1292 if (timestring[0])
1293 {
1294 fps_x = vid_conwidth.integer - DrawQ_TextWidth(timestring, 0, fps_scalex, fps_scaley, true, FONT_INFOBAR);
1295 DrawQ_Fill(fps_x, fps_y, vid_conwidth.integer - fps_x, fps_scaley, 0, 0, 0, 0.5, 0);
1296 DrawQ_String(fps_x, fps_y, timestring, 0, fps_scalex, fps_scaley, 1, 1, 1, 1, 0, NULL, true, FONT_INFOBAR);
1297 fps_y += fps_scaley;
1298 }
1299 if (datestring[0])
1300 {
1301 fps_x = vid_conwidth.integer - DrawQ_TextWidth(datestring, 0, fps_scalex, fps_scaley, true, FONT_INFOBAR);
1302 DrawQ_Fill(fps_x, fps_y, vid_conwidth.integer - fps_x, fps_scaley, 0, 0, 0, 0.5, 0);
1303 DrawQ_String(fps_x, fps_y, datestring, 0, fps_scalex, fps_scaley, 1, 1, 1, 1, 0, NULL, true, FONT_INFOBAR);
1304 fps_y += fps_scaley;
1305 }
1306 if (speedstring[0])
1307 {
1308 fps_x = vid_conwidth.integer - DrawQ_TextWidth(speedstring, 0, fps_scalex, fps_scaley, true, FONT_INFOBAR);
1309 DrawQ_Fill(fps_x, fps_y, vid_conwidth.integer - fps_x, fps_scaley, 0, 0, 0, 0.5, 0);
1310 DrawQ_String(fps_x, fps_y, speedstring, 0, fps_scalex, fps_scaley, 1, 1, 1, 1, 0, NULL, true, FONT_INFOBAR);
1311 fps_y += fps_scaley;
1312 }
1313 if (topspeedstring[0])
1314 {
1315 fps_x = vid_conwidth.integer - DrawQ_TextWidth(topspeedstring, 0, fps_scalex, fps_scaley, false, FONT_INFOBAR);
1316 DrawQ_Fill(fps_x, fps_y, vid_conwidth.integer - fps_x, fps_scaley, 0, 0, 0, 0.5, 0);
1317 DrawQ_String(fps_x, fps_y, topspeedstring, 0, fps_scalex, fps_scaley, 1, 1, 1, 1, 0, NULL, false, FONT_INFOBAR);
1318 fps_y += fps_scaley;
1319 }
1320 if (blurstring[0])
1321 {
1322 fps_x = vid_conwidth.integer - DrawQ_TextWidth(blurstring, 0, fps_scalex, fps_scaley, true, FONT_INFOBAR);
1323 DrawQ_Fill(fps_x, fps_y, vid_conwidth.integer - fps_x, fps_scaley, 0, 0, 0, 0.5, 0);
1324 DrawQ_String(fps_x, fps_y, blurstring, 0, fps_scalex, fps_scaley, 1, 1, 1, 1, 0, NULL, true, FONT_INFOBAR);
1325 fps_y += fps_scaley;
1326 }
1327 if (texstring[0])
1328 {
1329 fps_x = vid_conwidth.integer - DrawQ_TextWidth(texstring, 0, fps_scalex, fps_scaley, true, FONT_INFOBAR);
1330 DrawQ_Fill(fps_x, fps_y, vid_conwidth.integer - fps_x, fps_scaley, 0, 0, 0, 0.5, 0);
1331 DrawQ_String(fps_x, fps_y, texstring, 0, fps_scalex, fps_scaley, 1, 1, 1, 1, 0, NULL, true, FONT_INFOBAR);
1332 fps_y += fps_scaley;
1333 }
1334 if (entstring[0])
1335 {
1336 fps_x = vid_conwidth.integer - DrawQ_TextWidth(entstring, 0, fps_scalex, fps_scaley, true, FONT_INFOBAR);
1337 DrawQ_Fill(fps_x, fps_y, vid_conwidth.integer - fps_x, fps_scaley, 0, 0, 0, 0.5, 0);
1338 DrawQ_String(fps_x, fps_y, entstring, 0, fps_scalex, fps_scaley, 1, 1, 1, 1, 0, NULL, true, FONT_INFOBAR);
1339 fps_y += fps_scaley;
1340 }
1341 }
1342}
#define SUPERCONTENTS_SOLID
Definition bspfile.h:196
trace_t CL_TraceLine(const vec3_t start, const vec3_t end, int type, prvm_edict_t *passedict, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask, float extend, qbool hitnetworkbrushmodels, qbool hitnetworkplayers, int *hitnetworkentity, qbool hitcsqcentities, qbool hitsurfaces)
cvar_t collision_extendmovelength
Definition collision.c:14
int dpsnprintf(char *buffer, size_t buffersize, const char *format,...)
Returns the number of printed characters, excluding the final '\0' or returns -1 if the buffer isn't ...
Definition common.c:997
#define dp_strlcpy(dst, src, dsize)
Definition common.h:303
float time
void DrawQ_Fill(float x, float y, float width, float height, float red, float green, float blue, float alpha, int flags)
Definition gl_draw.c:847
float DrawQ_String(float x, float y, const char *text, size_t maxlen, float scalex, float scaley, float basered, float basegreen, float baseblue, float basealpha, int flags, int *outcolor, qbool ignorecolorcodes, const dp_font_t *fnt)
Definition gl_draw.c:1320
#define FONT_INFOBAR
Definition draw.h:134
float DrawQ_TextWidth(const char *text, size_t maxlen, float w, float h, qbool ignorecolorcodes, const dp_font_t *fnt)
Definition gl_draw.c:1330
qbool r_draw2d_force
Definition gl_draw.c:795
r_refdef_t r_refdef
Definition gl_rmain.c:57
#define max(A, B)
Definition mathlib.h:38
#define VectorLength(a)
Definition mathlib.h:109
#define VectorSet(vec, x, y, z)
Definition mathlib.h:96
void Matrix4x4_Transform(const matrix4x4_t *in, const float v[3], float out[3])
Definition matrixlib.c:1657
void Matrix4x4_OriginFromMatrix(const matrix4x4_t *in, float *out)
Definition matrixlib.c:1792
float sqrt(float f)
#define MATERIALFLAGMASK_TRANSLUCENT
#define CLVM_prog
Definition progsvm.h:767
#define PRVM_EDICT_TO_PROG(e)
Definition progsvm.h:875
#define SVVM_prog
Definition progsvm.h:766
#define MAX_QPATH
max length of a quake game pathname
Definition qdefs.h:169
vec_t vec3_t[3]
Definition qtypes.h:71
bool qbool
Definition qtypes.h:9
double topspeedxy
Definition sbar.c:1043
double topspeed
Definition sbar.c:1042
time_t topxy_time
Definition sbar.c:1046
time_t current_time
Definition sbar.c:1044
static void get_showspeed_unit(int unitnumber, double *conversion_factor, const char **unit)
Definition sbar.c:1048
static double showfps_framerate
Definition sbar.c:1079
time_t top_time
Definition sbar.c:1045
server_t sv
local server
Definition sv_main.c:223
trace_t SV_TraceLine(const vec3_t start, const vec3_t end, int type, prvm_edict_t *passedict, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask, float extend)
Definition sv_phys.c:256
float f
int latency_milliseconds
Definition client.h:558
vec3_t movement_velocity
Definition client.h:810
float motionbluralpha
Definition client.h:882
cl_soundstats_t soundstats
Definition client.h:607
qbool timedemo
Definition client.h:589
double td_onesecondavgfps
Definition client.h:601
double td_onesecondmaxfps
Definition client.h:600
int td_onesecondavgcount
Definition client.h:602
double td_starttime
Definition client.h:594
double td_onesecondminfps
Definition client.h:599
const char * string
Definition cvar.h:71
r_refdef_view_t view
Definition render.h:406
matrix4x4_t matrix
Definition render.h:266
qbool active
false if only a net client
Definition server.h:66
void * ent
Definition collision.h:47
const struct texture_s * hittexture
Definition collision.h:62
double fraction
Definition collision.h:40
size_t Sys_TimeString(char buf[], size_t bufsize, const char *timeformat)
Definition sys_shared.c:45
#define MOVE_HITMODEL
Definition world.h:32

References server_t::active, cl, cl_showblur, cl_showdate, cl_showdate_format, cl_showfps, cl_showsound, cl_showspeed, cl_showtex, cl_showtime, cl_showtime_format, cl_showtopspeed, CL_TraceLine(), cls, CLVM_prog, collision_extendmovelength, current_time, dp_strlcpy, dpsnprintf(), DrawQ_Fill(), DrawQ_String(), DrawQ_TextWidth(), trace_t::ent, f, FONT_INFOBAR, trace_t::fraction, get_showspeed_unit(), trace_t::hittexture, host, cvar_t::integer, cl_soundstats_t::latency_milliseconds, MATERIALFLAGMASK_TRANSLUCENT, r_refdef_view_t::matrix, Matrix4x4_OriginFromMatrix(), Matrix4x4_Transform(), max, MAX_QPATH, cl_soundstats_t::mixedsounds, client_state_t::motionbluralpha, MOVE_HITMODEL, client_state_t::movement_velocity, NULL, PRVM_EDICT_TO_PROG, r_draw2d_force, r_refdef, host_static_t::realtime, sbar_info_pos, showfps_framerate, client_static_t::soundstats, sqrt(), cvar_t::string, SUPERCONTENTS_SOLID, sv, SV_TraceLine(), SVVM_prog, Sys_TimeString(), client_static_t::td_frames, client_static_t::td_onesecondavgcount, client_static_t::td_onesecondavgfps, client_static_t::td_onesecondmaxfps, client_static_t::td_onesecondminfps, client_static_t::td_starttime, time, client_static_t::timedemo, top_time, topspeed, topspeedxy, topxy_time, cl_soundstats_t::totalsounds, cvar_t::value, VectorLength, VectorSet, vid_conheight, vid_conwidth, and r_refdef_t::view.

Referenced by SCR_DrawScreen().

◆ Sbar_ShowFPS_Update()

void Sbar_ShowFPS_Update ( void )

Definition at line 1082 of file sbar.c.

1083{
1084 double interval = 1;
1085 double newtime;
1086 newtime = host.realtime;
1087 if (newtime >= showfps_nexttime)
1088 {
1090 if (showfps_nexttime < newtime - interval * 1.5)
1091 showfps_nexttime = newtime;
1092 showfps_lasttime = newtime;
1093 showfps_nexttime += interval;
1095 }
1097}
static int showfps_framecount
Definition sbar.c:1080
static double showfps_nexttime
Definition sbar.c:1078
static double showfps_lasttime
Definition sbar.c:1078

References host, host_static_t::realtime, showfps_framecount, showfps_framerate, showfps_lasttime, and showfps_nexttime.

Referenced by CL_UpdateScreen().

◆ Sbar_SortFrags()

void Sbar_SortFrags ( void )

Definition at line 554 of file sbar.c.

555{
556 int i, j, k, color;
557
558 // sort by frags
559 scoreboardlines = 0;
560 for (i=0 ; i<cl.maxclients ; i++)
561 {
562 if (cl.scores[i].name[0])
563 {
566 }
567 }
568
569 for (i=0 ; i<scoreboardlines ; i++)
570 for (j=0 ; j<scoreboardlines-1-i ; j++)
571 if (cl.scores[fragsort[j]].frags < cl.scores[fragsort[j+1]].frags)
572 {
573 k = fragsort[j];
574 fragsort[j] = fragsort[j+1];
575 fragsort[j+1] = k;
576 }
577
578 teamlines = 0;
579 if (Sbar_IsTeammatch ())
580 {
581 // now sort players by teams.
582 for (i=0 ; i<scoreboardlines ; i++)
583 {
584 for (j=0 ; j<scoreboardlines-1-i ; j++)
585 {
587 {
588 k = fragsort[j];
589 fragsort[j] = fragsort[j+1];
590 fragsort[j+1] = k;
591 }
592 }
593 }
594
595 // calculate team scores
596 color = -1;
597 for (i=0 ; i<scoreboardlines ; i++)
598 {
599 if (color != (cl.scores[fragsort[i]].colors & 15))
600 {
601 const char* teamname;
602
603 color = cl.scores[fragsort[i]].colors & 15;
604 teamlines++;
605
606 switch (color)
607 {
608 case 4:
609 teamname = "^1Red Team";
610 break;
611 case 13:
612 teamname = "^4Blue Team";
613 break;
614 case 9:
615 teamname = "^6Pink Team";
616 break;
617 case 12:
618 teamname = "^3Yellow Team";
619 break;
620 default:
621 teamname = "Total Team Score";
622 break;
623 }
624 dp_strlcpy(teams[teamlines-1].name, teamname, sizeof(teams[teamlines-1].name));
625
626 teams[teamlines-1].frags = 0;
627 teams[teamlines-1].colors = color + 16 * color;
628 }
629
630 if (cl.scores[fragsort[i]].frags != -666)
631 {
632 // do not add spedcators
633 // (ugly hack for nexuiz)
635 }
636 }
637
638 // now sort teams by scores.
639 for (i=0 ; i<teamlines ; i++)
640 teamsort[i] = i;
641 for (i=0 ; i<teamlines ; i++)
642 {
643 for (j=0 ; j<teamlines-1-i ; j++)
644 {
645 if (teams[teamsort[j]].frags < teams[teamsort[j+1]].frags)
646 {
647 k = teamsort[j];
648 teamsort[j] = teamsort[j+1];
649 teamsort[j+1] = k;
650 }
651 }
652 }
653 }
654}
vector color
const GLchar * name
Definition glquake.h:601
float frags
Definition progsdefs.qc:138
char name[MAX_SCOREBOARDNAME]
Definition client.h:489

References cl, color, scoreboard_t::colors, dp_strlcpy, frags, scoreboard_t::frags, fragsort, i, client_state_t::maxclients, name, scoreboard_t::name, Sbar_IsTeammatch(), scoreboardlines, client_state_t::scores, teamlines, teams, and teamsort.

Referenced by Sbar_DeathmatchOverlay(), Sbar_DrawFrags(), Sbar_MiniDeathmatchOverlay(), Sbar_Score(), and VM_CL_getplayerkey().

Variable Documentation

◆ cl_deathscoreboard

cvar_t cl_deathscoreboard
extern

Definition at line 110 of file sbar.c.

110{CF_CLIENT, "cl_deathscoreboard", "1", "shows scoreboard (+showscores) while dead"};

Referenced by CL_VM_DrawHud(), Sbar_Draw(), and Sbar_Init().

◆ sb_lines

int sb_lines
extern

scan lines to draw

Definition at line 58 of file sbar.c.

◆ sbar_alpha_bg

struct cvar_s sbar_alpha_bg
extern

Definition at line 100 of file sbar.c.

100{CF_CLIENT | CF_ARCHIVE, "sbar_alpha_bg", "0.4", "opacity value of the statusbar background image"};
#define CF_ARCHIVE
cvar should have its set value saved to config.cfg and persist across sessions
Definition cmd.h:53

Referenced by Sbar_DeathmatchOverlay(), Sbar_Draw(), Sbar_DrawInventory(), and Sbar_Init().

◆ sbar_alpha_fg

struct cvar_s sbar_alpha_fg
extern