void SCR_DrawDebugGraph(void) { int a, x, y, w, i, h; float v; int color; /* draw the graph */ w = scr_vrect.width; x = scr_vrect.x; y = scr_vrect.y + scr_vrect.height; Draw_Fill(x, y - scr_graphheight->value, w, scr_graphheight->value, 8); for (a = 0; a < w; a++) { i = (current - 1 - a + 1024) & 1023; v = values[i].value; color = values[i].color; v = v * scr_graphscale->value + scr_graphshift->value; if (v < 0) { v += scr_graphheight->value * (1 + (int)(-v / scr_graphheight->value)); } h = (int)v % (int)scr_graphheight->value; Draw_Fill(x + w - 1 - a, y - h, 1, h, color); } }
/* ============== SCR_DrawBAT Crow_bar ============== */ void SCR_DrawBAT (void) { extern cvar_t show_bat; int x, y, i; char stA[80],stB[80]; if (!show_bat.value) return; if (!scePowerIsBatteryExist()) { // Don't report anything. return; } const int level = scePowerGetBatteryLifePercent(); const bool charging = scePowerGetBatteryChargingStatus(); // Is the level not sensible? if ((level < 0) || (level > 100)) { // Hopefully it will be sensible soon. return; } sprintf(stA, "Battery %d%%\n",level); sprintf(stB, "Battery %d%% (charging)\n",level); if(!charging) x = vid.width - strlen(stA) * 16 - 70; else x = vid.width - strlen(stB) * 16 - 70; y = 2 ; //vid.height - (sb_lines * (vid.height/240) )- 16; if(show_bat.value == 2) { if(!charging) Draw_String(x, y, stA); else Draw_String(x, y, stB); } else { if(charging) { Draw_Fill (240, y, level, 5, 12+((int)(realtime*8)&120)); } else Draw_Fill (240, y, level, 5, level); } }
/* =============== Sbar_DrawFrags =============== */ void Sbar_DrawFrags(void) { int i, k, l; int top, bottom; int x, y, f; char num[12]; player_info_t *s; Sbar_SortFrags(false); // draw the text l = scoreboardlines <= 4 ? scoreboardlines : 4; x = 23; // xofs = (vid.width - 320)>>1; y = vid.height - SBAR_HEIGHT - 23; for (i = 0; i < l; i++) { k = fragsort[i]; s = &cl.players[k]; if (!s->name[0]) continue; if (s->spectator) continue; // draw background top = Sbar_ColorForMap(s->topcolor); bottom = Sbar_ColorForMap(s->bottomcolor); // Draw_Fill (xofs + x*8 + 10, y, 28, 4, top); // Draw_Fill (xofs + x*8 + 10, y+4, 28, 3, bottom); Draw_Fill(x * 8 + 10, y, 28, 4, top); Draw_Fill(x * 8 + 10, y + 4, 28, 3, bottom); // draw number f = s->frags; sprintf(num, "%3i", f); Sbar_DrawCharacter((x + 1) * 8, -24, num[0]); Sbar_DrawCharacter((x + 2) * 8, -24, num[1]); Sbar_DrawCharacter((x + 3) * 8, -24, num[2]); if (k == cl.playernum) { Sbar_DrawCharacter(x * 8 + 2, -24, 16); Sbar_DrawCharacter((x + 4) * 8 - 4, -24, 17); } x += 4; } }
void Menu_DrawStatusBar(const char *string) { if (string) { int l = strlen(string); int maxcol = VID_WIDTH / 8; int col = maxcol / 2 - l / 2; Draw_Fill(0, VID_HEIGHT - 8, VID_WIDTH, 8, 4); Menu_DrawString(col * 8, VID_HEIGHT - 8, string, 255); } else { Draw_Fill(0, VID_HEIGHT - 8, VID_WIDTH, 8, 0); } }
/* ================== SCR_DrawConsole ================== */ void SCR_DrawConsole (void) { Con_CheckResize (); if (cls.state == ca_disconnected || cls.state == ca_connecting) { // forced full screen console Con_DrawConsole (1.0); return; } if (cls.state != ca_active || !cl.refresh_prepped) { // connected, but can't render Con_DrawConsole (0.5); Draw_Fill (0, viddef.height/2, viddef.width, viddef.height/2, 0, 1.0); return; } if (scr_con_current) { Con_DrawConsole (scr_con_current); } // mattx86: we want the console notify lines always visible, even with the console down. //else //{ //if (cls.key_dest == key_game || cls.key_dest == key_message) Con_DrawNotify (); // only draw notify in game //} }
void SCR_DrawConsole(void) { Con_CheckResize(); if ((cls.state == ca_disconnected) || (cls.state == ca_connecting)) { /* forced full screen console */ Con_DrawConsole(1.0); return; } if ((cls.state != ca_active) || !cl.refresh_prepped) { /* connected, but can't render */ Con_DrawConsole(0.5); Draw_Fill(0, viddef.height / 2, viddef.width, viddef.height / 2, 0); return; } if (scr_con_current) { Con_DrawConsole(scr_con_current); } else { if ((cls.key_dest == key_game) || (cls.key_dest == key_message)) { Con_DrawNotify(); /* only draw notify in game */ } } }
/* ============== SCR_DrawWebPercent ============== */ void SCR_DrawWebPercent (void) { int x; char buff[20]; char *ch; snprintf (buff, sizeof(buff), "download: %2.1f%%", (float)(cls.download.percent*100)); x = vid.width - (16*8); //64; // 16 x 3 = 48 ... we need 16 x 4 = 64 Draw_Fill (0, 20, vid.width, 2, 0); Draw_Fill (0, 0, vid.width, 20, 98); Draw_Fill (0, 8, (int)((vid.width - (18*8)) * cls.download.percent), 8, 8); ch = buff; while (*ch) { Draw_Character(x, 8, (*ch)+128); x += 8; ch++; } }
void D_ViewChanged (void) { int i; scale_for_mip = xscale; if (yscale > xscale) scale_for_mip = yscale; d_zrowbytes = vid.width * 2; d_zwidth = vid.width; d_pix_min = r_refdef.vrect.width / 320; if (d_pix_min < 1) d_pix_min = 1; d_pix_max = (int)((float)r_refdef.vrect.width / (320.0 / 4.0) + 0.5); d_pix_shift = 8 - (int)((float)r_refdef.vrect.width / 320.0 + 0.5); if (d_pix_max < 1) d_pix_max = 1; d_vrectx = r_refdef.vrect.x; d_vrecty = r_refdef.vrect.y; d_vrectright_particle = r_refdef.vrectright - d_pix_max; d_vrectbottom_particle = r_refdef.vrectbottom - d_pix_max; for (i=0 ; i<vid.height; i++) { d_scantable[i] = i*r_screenwidth; zspantable[i] = d_pzbuffer + i*d_zwidth; } /* ** clear Z-buffer and color-buffers if we're doing the gallery */ if ( r_newrefdef.rdflags & RDF_NOWORLDMODEL ) { memset( d_pzbuffer, 0xff, vid.width * vid.height * sizeof( d_pzbuffer[0] ) ); Draw_Fill( r_newrefdef.x, r_newrefdef.y, r_newrefdef.width, r_newrefdef.height,( int ) sw_clearcolor->value & 0xff ); } alias_colormap = vid.colormap; D_Patch (); }
void MenuList_Draw( menulist_s *l ) { const char **n; int y = 0; Menu_DrawStringR2LDark( l->generic.x + l->generic.parent->x + LCOLUMN_OFFSET, l->generic.y + l->generic.parent->y, l->generic.name ); n = l->itemnames; Draw_Fill( l->generic.x - 112 + l->generic.parent->x, l->generic.parent->y + l->generic.y + l->curvalue*10 + 10, 128, 10, 16 ); while ( *n ) { Menu_DrawStringR2LDark( l->generic.x + l->generic.parent->x + LCOLUMN_OFFSET, l->generic.y + l->generic.parent->y + y + 10, *n ); n++; y += 10; } }
/* ============== SCR_DrawDevStats ============== */ void SCR_DrawDevStats (void) { char str[40]; int y = 25-9; //9=number of lines to print int x = 0; //margin if (!devstats.value) return; GL_SetCanvas (CANVAS_BOTTOMLEFT); Draw_Fill (x, y*8, 19*8, 9*8, 0, 0.5); //dark rectangle sprintf (str, "devstats |Curr Peak"); Draw_String (x, (y++)*8-x, str); sprintf (str, "---------+---------"); Draw_String (x, (y++)*8-x, str); sprintf (str, "Edicts |%4i %4i", dev_stats.edicts, dev_peakstats.edicts); Draw_String (x, (y++)*8-x, str); sprintf (str, "Packet |%4i %4i", dev_stats.packetsize, dev_peakstats.packetsize); Draw_String (x, (y++)*8-x, str); sprintf (str, "Visedicts|%4i %4i", dev_stats.visedicts, dev_peakstats.visedicts); Draw_String (x, (y++)*8-x, str); sprintf (str, "Efrags |%4i %4i", dev_stats.efrags, dev_peakstats.efrags); Draw_String (x, (y++)*8-x, str); sprintf (str, "Dlights |%4i %4i", dev_stats.dlights, dev_peakstats.dlights); Draw_String (x, (y++)*8-x, str); sprintf (str, "Beams |%4i %4i", dev_stats.beams, dev_peakstats.beams); Draw_String (x, (y++)*8-x, str); sprintf (str, "Tempents |%4i %4i", dev_stats.tempents, dev_peakstats.tempents); Draw_String (x, (y++)*8-x, str); }
/* ============== SCR_DrawLoading ============== */ void SCR_DrawLoading (void) { int size, count, offset; qpic_t *pic; if (!scr_drawloading && loading_stage == 0) return; pic = Draw_CachePic ("gfx/menu/loading.lmp"); offset = (vid.width - pic->width)/2; Draw_TransPic (offset , 0, pic); if (loading_stage == 0) return; if (total_loading_size) size = current_loading_size * 106 / total_loading_size; else size = 0; if (loading_stage == 1) count = size; else count = 106; Draw_Fill (offset+42, 87, count, 1, 136); Draw_Fill (offset+42, 87+1, count, 4, 138); Draw_Fill (offset+42, 87+5, count, 1, 136); if (loading_stage == 2) count = size; else count = 0; Draw_Fill (offset+42, 97, count, 1, 168); Draw_Fill (offset+42, 97+1, count, 4, 170); Draw_Fill (offset+42, 97+5, count, 1, 168); }
/* =============== Sbar_Draw =============== */ void Sbar_Draw (void) { if (scr_con_current == vid.height) return; // console is full screen // mankrip - svc_letterbox - start if (cl.letterbox) { if (cl.letterbox == 1) // hack to ensure the whole screen will be black Draw_Fill(0, vid.height/2, vid.width, 1, 0); return; } // mankrip - svc_letterbox - end // Manoel Kasimier - crosshair - start if (crosshair.value) { if (crosshair.value < 0 || crosshair.value > 5) crosshair.value = 0; Crosshair_Start(cl_crossx.value + scr_vrect.x + scr_vrect.width/2 - 6*(vid.width/MIN_VID_WIDTH), cl_crossy.value + scr_vrect.y + scr_vrect.height/2 - 6*(vid.width/MIN_VID_WIDTH)); // Manoel Kasimier - crosshair } // Manoel Kasimier - crosshair - end scr_copyeverything = 1; // mankrip - begin Sbar_SizeScreen (); if ( (sb_showscores || sbar.value > 0) && sbar.value < 4) { if (sbar_show_bg.value) Draw_TileClear (scr_vrect.x, vid.height - sb_lines, scr_vrect.width, sb_lines); #if 0 else { Draw_Fill (0, vid.height - sb_lines - screen_bottom, scr_vrect.x, sb_lines, 0); // left Draw_Fill (scr_vrect.x+scr_vrect.width, vid.height - sb_lines - screen_bottom, vid.width-(scr_vrect.x+scr_vrect.width), sb_lines, 0); // right Draw_Fill (scr_vrect.x, scr_vrect.y+scr_vrect.height, scr_vrect.width, vid.height-(scr_vrect.y+scr_vrect.height)-screen_bottom, 0); // bottom } #endif if (sbar.value > 1 || sb_showscores) // inventory bar { if (sbar.value > 2 || sb_showscores) // score bar { if (sbar_show_bg.value) Sbar_DrawTransPic (0, -48, sb_scorebar); Sbar_SoloScoreboard (0, -48, 0); } if (sbar_show_bg.value) { if (rogue) { if ( cl.stats[STAT_ACTIVEWEAPON] >= RIT_LAVA_NAILGUN ) Sbar_DrawTransPic (0, -24, rsb_invbar[0]); else Sbar_DrawTransPic (0, -24, rsb_invbar[1]); } else Sbar_DrawTransPic (0, -24, sb_ibar); } Sbar_DrawAmmoList (0, -24, 0); // 0, -24, 0 Sbar_DrawWeaponList (0, -16, 0); // 0, -16, 0 if (rogue) Sbar_DrawKeys (192, -16); // 192, -16 else Sbar_DrawKeys (192, -16); // 192, -16 if (rogue || hipnotic) Sbar_DrawPowerUps (224, -16); // 224, -16 else Sbar_DrawPowerUps (224, -16); // 224, -16 if (rogue) Sbar_DrawPowerups_Rogue (288, -16); // 288, -16 else if (hipnotic) Sbar_DrawPowerups_Hipnotic (288, -16); // 288, -16 else Sbar_DrawRunes (288, -16); // sigils 288, -16 Sbar_DrawFrags (); } // status bar if (sbar_show_bg.value) Sbar_DrawTransPic (0, 0, sb_sbar); Sbar_DrawArmor (0, 24, 0); // 0, 24, 0 Sbar_DrawHealth (112, 136, 0); // 112, 136, 0 Sbar_DrawHipKeys (209, 3); // keys (hipnotic only) 209, 3 Sbar_DrawAmmo (224, 248, 0); // 224, 248, 0 } else if (sbar.value == 4) { #define SBAR_PADDING 4 if (rogue || hipnotic) Sbar_SoloScoreboard (SBAR_PADDING, -49, 1); else Sbar_SoloScoreboard (SBAR_PADDING, -33, 1); Sbar_DrawAmmoList (320 - SBAR_PADDING - 28, -9, 1); Sbar_DrawWeaponList (320 - SBAR_PADDING - 24, -48, 1); if (rogue) Sbar_DrawKeys (320 - SBAR_PADDING - 56, -16); else Sbar_DrawKeys (320 - SBAR_PADDING - 88, -16); if (rogue || hipnotic) { Sbar_DrawPowerUps (SBAR_PADDING, -40); Sbar_DrawPowerups_Rogue (64 + SBAR_PADDING, -40); Sbar_DrawPowerups_Hipnotic (64 + SBAR_PADDING, -40); } else Sbar_DrawPowerUps (320 - SBAR_PADDING - 88, -32); Sbar_DrawRunes (320 - SBAR_PADDING - 56, -16); // sigils // Sbar_DrawFrags (); // TO DO Sbar_DrawArmor (SBAR_PADDING, 24 + SBAR_PADDING, -24); Sbar_DrawHealth (SBAR_PADDING, 24 + SBAR_PADDING, 0); Sbar_DrawHipKeys (320 - SBAR_PADDING - 40, -18); // keys (hipnotic only) Sbar_DrawAmmo (320 - SBAR_PADDING - 24, 320 - SBAR_PADDING - 96, 0); } if (cl.gametype == GAME_DEATHMATCH) if (sb_showscores || cl.stats[STAT_HEALTH] <= 0) Sbar_DeathmatchOverlay (); // mankrip - end }
void SetingWindos_DestroyPowerValue(void) { Draw_Fill(20+6*9,55,20+6*13-1,63,0);// 填充空白 }
/* ================== Sbar_DeathmatchOverlay ping time frags name ================== */ void Sbar_DeathmatchOverlay(int start) { const qpic_t *pic; int i, k, l; int top, bottom; int x, y, f; char num[12]; player_info_t *s; int total; int minutes; int p; int teamplay; char team[5]; int skip = 10; if (largegame) skip = 8; // request new ping times every two second if (realtime - cl.last_ping_request > 2) { cl.last_ping_request = realtime; MSG_WriteByte(&cls.netchan.message, clc_stringcmd); MSG_WriteString(&cls.netchan.message, "pings"); } teamplay = atoi(Info_ValueForKey(cl.serverinfo, "teamplay")); scr_copyeverything = 1; scr_fullupdate = 0; if (!start) { pic = Draw_CachePic("gfx/ranking.lmp"); Draw_Pic(160 - pic->width / 2, 0, pic); } // scores Sbar_SortFrags(true); // draw the text l = scoreboardlines; if (start) y = start; else y = 24; if (teamplay) { x = 4; // 0 40 64 104 152 192 Draw_String(x, y, "ping pl time frags team name"); y += 8; // Draw_String ( x , y, "---- -- ---- ----- ---- ----------------"); 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"); y += 8; } else { x = 16; // 0 40 64 104 152 Draw_String(x, y, "ping pl time frags name"); y += 8; // Draw_String ( x , y, "---- -- ---- ----- ----------------"); 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"); y += 8; } for (i = 0; i < l && y <= vid.height - 10; i++) { k = fragsort[i]; s = &cl.players[k]; if (!s->name[0]) continue; // draw ping p = s->ping; if (p < 0 || p > 999) p = 999; sprintf(num, "%4i", p); Draw_String(x, y, num); // draw pl p = s->pl; sprintf(num, "%3i", p); if (p > 25) Draw_Alt_String(x + 32, y, num); else Draw_String(x + 32, y, num); if (s->spectator) { Draw_String(x + 40, y, "(spectator)"); // draw name if (teamplay) Draw_String(x + 152 + 40, y, s->name); else Draw_String(x + 152, y, s->name); y += skip; continue; } // draw time if (cl.intermission) total = cl.completed_time - s->entertime; else total = realtime - s->entertime; minutes = (int)total / 60; sprintf(num, "%4i", minutes); Draw_String(x + 64, y, num); // draw background top = Sbar_ColorForMap(s->topcolor); bottom = Sbar_ColorForMap(s->bottomcolor); if (largegame) Draw_Fill(x + 104, y + 1, 40, 3, top); else Draw_Fill(x + 104, y, 40, 4, top); Draw_Fill(x + 104, y + 4, 40, 4, bottom); // draw number f = s->frags; sprintf(num, "%3i", f); Draw_Character(x + 112, y, num[0]); Draw_Character(x + 120, y, num[1]); Draw_Character(x + 128, y, num[2]); if (k == cl.playernum) { Draw_Character(x + 104, y, 16); Draw_Character(x + 136, y, 17); } // team if (teamplay) { team[4] = 0; strncpy(team, Info_ValueForKey(s->userinfo, "team"), 4); Draw_String(x + 152, y, team); } // draw name if (teamplay) Draw_String(x + 152 + 40, y, s->name); else Draw_String(x + 152, y, s->name); y += skip; } if (y >= vid.height - 10) // we ran over the screen size, squish largegame = true; }
/* ================== Sbar_MiniDeathmatchOverlay frags name frags team name displayed to right of status bar if there's room ================== */ void Sbar_MiniDeathmatchOverlay(void) { int i, k; int top, bottom; int x, y, f; char num[12]; player_info_t *s; int teamplay; char team[5]; int numlines; char name[16 + 1]; team_t *tm; if (vid.width < 512 || !sb_lines) return; // not enuff room teamplay = atoi(Info_ValueForKey(cl.serverinfo, "teamplay")); scr_copyeverything = 1; scr_fullupdate = 0; // scores Sbar_SortFrags(false); if (vid.width >= 640) Sbar_SortTeams(); if (!scoreboardlines) return; // no one there? // draw the text y = vid.height - sb_lines - 1; numlines = sb_lines / 8; if (numlines < 3) return; // not enough room // find us for (i = 0; i < scoreboardlines; i++) if (fragsort[i] == cl.playernum) break; if (i == scoreboardlines) // we're not there, we are probably a spectator, just display top i = 0; else // figure out start i = i - numlines / 2; if (i > scoreboardlines - numlines) i = scoreboardlines - numlines; if (i < 0) i = 0; x = 324; for ( /* */ ; i < scoreboardlines && y < vid.height - 8 + 1; i++) { k = fragsort[i]; s = &cl.players[k]; if (!s->name[0]) continue; // draw ping top = Sbar_ColorForMap(s->topcolor); bottom = Sbar_ColorForMap(s->bottomcolor); Draw_Fill(x, y + 1, 40, 3, top); Draw_Fill(x, y + 4, 40, 4, bottom); // draw number f = s->frags; sprintf(num, "%3i", f); Draw_Character(x + 8, y, num[0]); Draw_Character(x + 16, y, num[1]); Draw_Character(x + 24, y, num[2]); if (k == cl.playernum) { Draw_Character(x, y, 16); Draw_Character(x + 32, y, 17); } // team if (teamplay) { team[4] = 0; strncpy(team, Info_ValueForKey(s->userinfo, "team"), 4); Draw_String(x + 48, y, team); } // draw name name[16] = 0; strncpy(name, s->name, 16); if (teamplay) Draw_String(x + 48 + 40, y, name); else Draw_String(x + 48, y, name); y += 8; } // draw teams if room if (vid.width < 640 || !teamplay) return; // draw seperator x += 208; for (y = vid.height - sb_lines; y < vid.height - 6; y += 2) Draw_Character(x, y, 14); x += 16; y = vid.height - sb_lines; for (i = 0; i < scoreboardteams && y <= vid.height; i++) { k = teamsort[i]; tm = teams + k; // draw pings team[4] = 0; strncpy(team, tm->team, 4); Draw_String(x, y, team); // draw total sprintf(num, "%5i", tm->frags); Draw_String(x + 40, y, num); if (!strncmp(Info_ValueForKey(cl.players[cl.playernum].userinfo, "team"), tm->team, 16)) { Draw_Character(x - 8, y, 16); Draw_Character(x + 32, y, 17); } y += 8; } }
/* * Returns true if a cinematic is active, meaning the * view rendering should be skipped */ qboolean SCR_DrawCinematic(void) { int x, y, w, h; if (cl.cinematictime <= 0) { return false; } /* blank screen and pause if menu is up */ if (cls.key_dest == key_menu) { R_SetPalette(NULL); cl.cinematicpalette_active = false; return true; } if (!cl.cinematicpalette_active) { R_SetPalette(cl.cinematicpalette); cl.cinematicpalette_active = true; } if (!cin.pic) { return true; } if (cin_force43->value) { w = viddef.height * 4 / 3; if (w > viddef.width) { w = viddef.width; } w &= ~3; h = w * 3 / 4; x = (viddef.width - w) / 2; y = (viddef.height - h) / 2; } else { x = y = 0; w = viddef.width; h = viddef.height; } if (x > 0) { Draw_Fill(0, 0, x, viddef.height, 0); } if (x + w < viddef.width) { Draw_Fill(x + w, 0, viddef.width - (x + w), viddef.height, 0); } if (y > 0) { Draw_Fill(x, 0, w, y, 0); } if (y + h < viddef.height) { Draw_Fill(x, y + h, w, viddef.height - (y + h), 0); } Draw_StretchRaw(x, y, w, h, cin.width, cin.height, cin.pic); return true; }
void SetingWindos_DestroyFMchValue(void) { Draw_Fill(20+6*3,47,20+6*8-1,54,0);// 填充空白 }
/* ================== Sbar_MiniDeathmatchOverlay frags name frags team name displayed to right of status bar if there's room ================== */ void Sbar_MiniDeathmatchOverlay(void) { int x, y, line, numlines, top, bottom; int teamplay; /* Don't bother if not enough room */ if (vid.width < 512 || !sb_lines) return; teamplay = atoi(Info_ValueForKey(cl.serverinfo, "teamplay")); scr_copyeverything = 1; scr_fullupdate = 0; Sbar_SortFrags(false); if (vid.width >= 640) Sbar_SortTeams(); if (!scoreboardlines) return; /* Check for space to draw the text */ y = vid.height - sb_lines - 1; numlines = sb_lines / 8; if (numlines < 3) return; /* Find client in the scoreboard, if not there (spectator) display top */ for (line = 0; line < scoreboardlines; line++) if (fragsort[line] == cl.playernum) break; if (line == scoreboardlines) line = 0; /* Put the client in the centre of the displayed lines */ line = qclamp(line - numlines / 2, 0, scoreboardlines - numlines); x = 324; while (line < scoreboardlines && y < vid.height - 8 + 1) { const int playernum = fragsort[line++]; const player_info_t *player = &cl.players[playernum]; if (!player->name[0]) continue; /* draw background */ top = Sbar_ColorForMap(player->topcolor); bottom = Sbar_ColorForMap(player->bottomcolor); Draw_Fill(x, y + 1, 40, 3, top); Draw_Fill(x, y + 4, 40, 4, bottom); /* draw frags */ char frags[4]; snprintf(frags, sizeof(frags), "%3d", player->frags); Draw_Character(x + 8, y, frags[0]); Draw_Character(x + 16, y, frags[1]); Draw_Character(x + 24, y, frags[2]); if (playernum == cl.playernum) { Draw_Character(x, y, 16); Draw_Character(x + 32, y, 17); } /* draw team name */ if (teamplay) { const char *playerteam = Info_ValueForKey(player->userinfo, "team"); char short_team[5]; snprintf(short_team, sizeof(short_team), "%-4s", playerteam); Draw_String(x + 48, y, short_team); } /* draw name */ char name[17]; snprintf(name, sizeof(name), "%-16s", player->name); if (teamplay) Draw_String(x + 48 + 40, y, name); else Draw_String(x + 48, y, name); y += 8; } /* draw teams if room */ if (vid.width < 640 || !teamplay) return; /* draw seperator */ x += 208; for (y = vid.height - sb_lines; y < vid.height - 6; y += 2) Draw_Character(x, y, 14); const player_info_t *player = &cl.players[cl.playernum]; const char *playerteam = Info_ValueForKey(player->userinfo, "team"); x += 16; y = vid.height - sb_lines; line = 0; while (line < scoreboardteams && y <= vid.height) { const team_t *team = teams + teamsort[line++]; /* draw teamname */ char short_team[5]; snprintf(short_team, sizeof(short_team), "%-4s", team->team); Draw_String(x, y, short_team); /* draw frags */ char frags[4]; snprintf(frags, sizeof(frags), "%3d", team->frags); Draw_String(x + 40, y, frags); if (!strncmp(team->team, playerteam, 16)) { Draw_Character(x - 8, y, 16); Draw_Character(x + 32, y, 17); } y += 8; } }