cachepic_t *zymsb_crosshair_left2;
cachepic_t *zymsb_crosshair_right;
+cachepic_t *sb_ranking;
+cachepic_t *sb_complete;
+cachepic_t *sb_inter;
+cachepic_t *sb_finale;
+
cvar_t showfps = {CVAR_SAVE, "showfps", "0", "shows your rendered fps (frames per second)"};
cvar_t showtime = {CVAR_SAVE, "showtime", "0", "shows current time of day (useful on screenshots)"};
cvar_t showtime_format = {CVAR_SAVE, "showtime_format", "%H:%M:%S", "format string for time of day"};
cvar_t cl_deathscoreboard = {0, "cl_deathscoreboard", "1", "shows scoreboard (+showscores) while dead"};
+cvar_t crosshair_color_red = {CVAR_SAVE, "crosshair_color_red", "1", "customizable crosshair color"};
+cvar_t crosshair_color_green = {CVAR_SAVE, "crosshair_color_green", "0", "customizable crosshair color"};
+cvar_t crosshair_color_blue = {CVAR_SAVE, "crosshair_color_blue", "0", "customizable crosshair color"};
+cvar_t crosshair_color_alpha = {CVAR_SAVE, "crosshair_color_alpha", "1", "how opaque the crosshair should be"};
+cvar_t crosshair_size = {CVAR_SAVE, "crosshair_size", "1", "adjusts size of the crosshair on the screen"};
+
void Sbar_MiniDeathmatchOverlay (int x, int y);
void Sbar_DeathmatchOverlay (void);
void Sbar_IntermissionOverlay (void);
}
else if (gamemode == GAME_SOM)
{
- sb_disc = Draw_CachePic("gfx/disc", false);
+ sb_disc = Draw_CachePic("gfx/disc", true);
for (i = 0;i < 10;i++)
- sb_nums[0][i] = Draw_CachePic (va("gfx/num_%i",i), false);
-
- somsb_health = Draw_CachePic("gfx/hud_health", false);
- somsb_ammo[0] = Draw_CachePic("gfx/sb_shells", false);
- somsb_ammo[1] = Draw_CachePic("gfx/sb_nails", false);
- somsb_ammo[2] = Draw_CachePic("gfx/sb_rocket", false);
- somsb_ammo[3] = Draw_CachePic("gfx/sb_cells", false);
- somsb_armor[0] = Draw_CachePic("gfx/sb_armor1", false);
- somsb_armor[1] = Draw_CachePic("gfx/sb_armor2", false);
- somsb_armor[2] = Draw_CachePic("gfx/sb_armor3", false);
+ sb_nums[0][i] = Draw_CachePic (va("gfx/num_%i",i), true);
+
+ somsb_health = Draw_CachePic("gfx/hud_health", true);
+ somsb_ammo[0] = Draw_CachePic("gfx/sb_shells", true);
+ somsb_ammo[1] = Draw_CachePic("gfx/sb_nails", true);
+ somsb_ammo[2] = Draw_CachePic("gfx/sb_rocket", true);
+ somsb_ammo[3] = Draw_CachePic("gfx/sb_cells", true);
+ somsb_armor[0] = Draw_CachePic("gfx/sb_armor1", true);
+ somsb_armor[1] = Draw_CachePic("gfx/sb_armor2", true);
+ somsb_armor[2] = Draw_CachePic("gfx/sb_armor3", true);
}
else if (gamemode == GAME_NEXUIZ)
{
for (i = 0;i < 10;i++)
- sb_nums[0][i] = Draw_CachePic (va("gfx/num_%i",i), false);
- sb_nums[0][10] = Draw_CachePic ("gfx/num_minus", false);
+ sb_nums[0][i] = Draw_CachePic (va("gfx/num_%i",i), true);
+ sb_nums[0][10] = Draw_CachePic ("gfx/num_minus", true);
- sb_ammo[0] = Draw_CachePic ("gfx/sb_shells", false);
- sb_ammo[1] = Draw_CachePic ("gfx/sb_bullets", false);
- sb_ammo[2] = Draw_CachePic ("gfx/sb_rocket", false);
- sb_ammo[3] = Draw_CachePic ("gfx/sb_cells", false);
+ sb_ammo[0] = Draw_CachePic ("gfx/sb_shells", true);
+ sb_ammo[1] = Draw_CachePic ("gfx/sb_bullets", true);
+ sb_ammo[2] = Draw_CachePic ("gfx/sb_rocket", true);
+ sb_ammo[3] = Draw_CachePic ("gfx/sb_cells", true);
- sb_items[2] = Draw_CachePic ("gfx/sb_slowmo", false);
- sb_items[3] = Draw_CachePic ("gfx/sb_invinc", false);
- sb_items[4] = Draw_CachePic ("gfx/sb_energy", false);
- sb_items[5] = Draw_CachePic ("gfx/sb_str", false);
+ sb_items[2] = Draw_CachePic ("gfx/sb_slowmo", true);
+ sb_items[3] = Draw_CachePic ("gfx/sb_invinc", true);
+ sb_items[4] = Draw_CachePic ("gfx/sb_energy", true);
+ sb_items[5] = Draw_CachePic ("gfx/sb_str", true);
- sb_sbar = Draw_CachePic("gfx/sbar", false);
- sb_sbar_minimal = Draw_CachePic("gfx/sbar_minimal", false);
- sb_sbar_overlay = Draw_CachePic("gfx/sbar_overlay", false);
+ sb_sbar = Draw_CachePic("gfx/sbar", true);
+ sb_sbar_minimal = Draw_CachePic("gfx/sbar_minimal", true);
+ sb_sbar_overlay = Draw_CachePic("gfx/sbar_overlay", true);
for(i = 0; i < 9;i++)
- sb_weapons[0][i] = Draw_CachePic(va("gfx/inv_weapon%i",i), false);
+ sb_weapons[0][i] = Draw_CachePic(va("gfx/inv_weapon%i",i), true);
}
else if (gamemode == GAME_ZYMOTIC)
{
- zymsb_crosshair_center = Draw_CachePic ("gfx/hud/crosshair_center", false);
- zymsb_crosshair_line = Draw_CachePic ("gfx/hud/crosshair_line", false);
- zymsb_crosshair_health = Draw_CachePic ("gfx/hud/crosshair_health", false);
- zymsb_crosshair_clip = Draw_CachePic ("gfx/hud/crosshair_clip", false);
- zymsb_crosshair_ammo = Draw_CachePic ("gfx/hud/crosshair_ammo", false);
- zymsb_crosshair_background = Draw_CachePic ("gfx/hud/crosshair_background", false);
- zymsb_crosshair_left1 = Draw_CachePic ("gfx/hud/crosshair_left1", false);
- zymsb_crosshair_left2 = Draw_CachePic ("gfx/hud/crosshair_left2", false);
- zymsb_crosshair_right = Draw_CachePic ("gfx/hud/crosshair_right", false);
+ zymsb_crosshair_center = Draw_CachePic ("gfx/hud/crosshair_center", true);
+ zymsb_crosshair_line = Draw_CachePic ("gfx/hud/crosshair_line", true);
+ zymsb_crosshair_health = Draw_CachePic ("gfx/hud/crosshair_health", true);
+ zymsb_crosshair_clip = Draw_CachePic ("gfx/hud/crosshair_clip", true);
+ zymsb_crosshair_ammo = Draw_CachePic ("gfx/hud/crosshair_ammo", true);
+ zymsb_crosshair_background = Draw_CachePic ("gfx/hud/crosshair_background", true);
+ zymsb_crosshair_left1 = Draw_CachePic ("gfx/hud/crosshair_left1", true);
+ zymsb_crosshair_left2 = Draw_CachePic ("gfx/hud/crosshair_left2", true);
+ zymsb_crosshair_right = Draw_CachePic ("gfx/hud/crosshair_right", true);
}
else
{
- sb_disc = Draw_CachePic("gfx/disc", false);
+ sb_disc = Draw_CachePic("gfx/disc", true);
for (i = 0;i < 10;i++)
{
- sb_nums[0][i] = Draw_CachePic (va("gfx/num_%i",i), false);
- sb_nums[1][i] = Draw_CachePic (va("gfx/anum_%i",i), false);
+ sb_nums[0][i] = Draw_CachePic (va("gfx/num_%i",i), true);
+ sb_nums[1][i] = Draw_CachePic (va("gfx/anum_%i",i), true);
}
- sb_nums[0][10] = Draw_CachePic ("gfx/num_minus", false);
- sb_nums[1][10] = Draw_CachePic ("gfx/anum_minus", false);
+ sb_nums[0][10] = Draw_CachePic ("gfx/num_minus", true);
+ sb_nums[1][10] = Draw_CachePic ("gfx/anum_minus", true);
- sb_colon = Draw_CachePic ("gfx/num_colon", false);
- sb_slash = Draw_CachePic ("gfx/num_slash", false);
+ sb_colon = Draw_CachePic ("gfx/num_colon", true);
+ sb_slash = Draw_CachePic ("gfx/num_slash", true);
- sb_weapons[0][0] = Draw_CachePic ("gfx/inv_shotgun", false);
- sb_weapons[0][1] = Draw_CachePic ("gfx/inv_sshotgun", false);
- sb_weapons[0][2] = Draw_CachePic ("gfx/inv_nailgun", false);
- sb_weapons[0][3] = Draw_CachePic ("gfx/inv_snailgun", false);
- sb_weapons[0][4] = Draw_CachePic ("gfx/inv_rlaunch", false);
- sb_weapons[0][5] = Draw_CachePic ("gfx/inv_srlaunch", false);
- sb_weapons[0][6] = Draw_CachePic ("gfx/inv_lightng", false);
+ sb_weapons[0][0] = Draw_CachePic ("gfx/inv_shotgun", true);
+ sb_weapons[0][1] = Draw_CachePic ("gfx/inv_sshotgun", true);
+ sb_weapons[0][2] = Draw_CachePic ("gfx/inv_nailgun", true);
+ sb_weapons[0][3] = Draw_CachePic ("gfx/inv_snailgun", true);
+ sb_weapons[0][4] = Draw_CachePic ("gfx/inv_rlaunch", true);
+ sb_weapons[0][5] = Draw_CachePic ("gfx/inv_srlaunch", true);
+ sb_weapons[0][6] = Draw_CachePic ("gfx/inv_lightng", true);
- sb_weapons[1][0] = Draw_CachePic ("gfx/inv2_shotgun", false);
- sb_weapons[1][1] = Draw_CachePic ("gfx/inv2_sshotgun", false);
- sb_weapons[1][2] = Draw_CachePic ("gfx/inv2_nailgun", false);
- sb_weapons[1][3] = Draw_CachePic ("gfx/inv2_snailgun", false);
- sb_weapons[1][4] = Draw_CachePic ("gfx/inv2_rlaunch", false);
- sb_weapons[1][5] = Draw_CachePic ("gfx/inv2_srlaunch", false);
- sb_weapons[1][6] = Draw_CachePic ("gfx/inv2_lightng", false);
+ sb_weapons[1][0] = Draw_CachePic ("gfx/inv2_shotgun", true);
+ sb_weapons[1][1] = Draw_CachePic ("gfx/inv2_sshotgun", true);
+ sb_weapons[1][2] = Draw_CachePic ("gfx/inv2_nailgun", true);
+ sb_weapons[1][3] = Draw_CachePic ("gfx/inv2_snailgun", true);
+ sb_weapons[1][4] = Draw_CachePic ("gfx/inv2_rlaunch", true);
+ sb_weapons[1][5] = Draw_CachePic ("gfx/inv2_srlaunch", true);
+ sb_weapons[1][6] = Draw_CachePic ("gfx/inv2_lightng", true);
for (i = 0;i < 5;i++)
{
- sb_weapons[2+i][0] = Draw_CachePic (va("gfx/inva%i_shotgun",i+1), false);
- sb_weapons[2+i][1] = Draw_CachePic (va("gfx/inva%i_sshotgun",i+1), false);
- sb_weapons[2+i][2] = Draw_CachePic (va("gfx/inva%i_nailgun",i+1), false);
- sb_weapons[2+i][3] = Draw_CachePic (va("gfx/inva%i_snailgun",i+1), false);
- sb_weapons[2+i][4] = Draw_CachePic (va("gfx/inva%i_rlaunch",i+1), false);
- sb_weapons[2+i][5] = Draw_CachePic (va("gfx/inva%i_srlaunch",i+1), false);
- sb_weapons[2+i][6] = Draw_CachePic (va("gfx/inva%i_lightng",i+1), false);
+ sb_weapons[2+i][0] = Draw_CachePic (va("gfx/inva%i_shotgun",i+1), true);
+ sb_weapons[2+i][1] = Draw_CachePic (va("gfx/inva%i_sshotgun",i+1), true);
+ sb_weapons[2+i][2] = Draw_CachePic (va("gfx/inva%i_nailgun",i+1), true);
+ sb_weapons[2+i][3] = Draw_CachePic (va("gfx/inva%i_snailgun",i+1), true);
+ sb_weapons[2+i][4] = Draw_CachePic (va("gfx/inva%i_rlaunch",i+1), true);
+ sb_weapons[2+i][5] = Draw_CachePic (va("gfx/inva%i_srlaunch",i+1), true);
+ sb_weapons[2+i][6] = Draw_CachePic (va("gfx/inva%i_lightng",i+1), true);
}
- sb_ammo[0] = Draw_CachePic ("gfx/sb_shells", false);
- sb_ammo[1] = Draw_CachePic ("gfx/sb_nails", false);
- sb_ammo[2] = Draw_CachePic ("gfx/sb_rocket", false);
- sb_ammo[3] = Draw_CachePic ("gfx/sb_cells", false);
-
- sb_armor[0] = Draw_CachePic ("gfx/sb_armor1", false);
- sb_armor[1] = Draw_CachePic ("gfx/sb_armor2", false);
- sb_armor[2] = Draw_CachePic ("gfx/sb_armor3", false);
-
- sb_items[0] = Draw_CachePic ("gfx/sb_key1", false);
- sb_items[1] = Draw_CachePic ("gfx/sb_key2", false);
- sb_items[2] = Draw_CachePic ("gfx/sb_invis", false);
- sb_items[3] = Draw_CachePic ("gfx/sb_invuln", false);
- sb_items[4] = Draw_CachePic ("gfx/sb_suit", false);
- sb_items[5] = Draw_CachePic ("gfx/sb_quad", false);
-
- sb_sigil[0] = Draw_CachePic ("gfx/sb_sigil1", false);
- sb_sigil[1] = Draw_CachePic ("gfx/sb_sigil2", false);
- sb_sigil[2] = Draw_CachePic ("gfx/sb_sigil3", false);
- sb_sigil[3] = Draw_CachePic ("gfx/sb_sigil4", false);
-
- sb_faces[4][0] = Draw_CachePic ("gfx/face1", false);
- sb_faces[4][1] = Draw_CachePic ("gfx/face_p1", false);
- sb_faces[3][0] = Draw_CachePic ("gfx/face2", false);
- sb_faces[3][1] = Draw_CachePic ("gfx/face_p2", false);
- sb_faces[2][0] = Draw_CachePic ("gfx/face3", false);
- sb_faces[2][1] = Draw_CachePic ("gfx/face_p3", false);
- sb_faces[1][0] = Draw_CachePic ("gfx/face4", false);
- sb_faces[1][1] = Draw_CachePic ("gfx/face_p4", false);
- sb_faces[0][0] = Draw_CachePic ("gfx/face5", false);
- sb_faces[0][1] = Draw_CachePic ("gfx/face_p5", false);
-
- sb_face_invis = Draw_CachePic ("gfx/face_invis", false);
- sb_face_invuln = Draw_CachePic ("gfx/face_invul2", false);
- sb_face_invis_invuln = Draw_CachePic ("gfx/face_inv2", false);
- sb_face_quad = Draw_CachePic ("gfx/face_quad", false);
-
- sb_sbar = Draw_CachePic ("gfx/sbar", false);
- sb_ibar = Draw_CachePic ("gfx/ibar", false);
- sb_scorebar = Draw_CachePic ("gfx/scorebar", false);
+ sb_ammo[0] = Draw_CachePic ("gfx/sb_shells", true);
+ sb_ammo[1] = Draw_CachePic ("gfx/sb_nails", true);
+ sb_ammo[2] = Draw_CachePic ("gfx/sb_rocket", true);
+ sb_ammo[3] = Draw_CachePic ("gfx/sb_cells", true);
+
+ sb_armor[0] = Draw_CachePic ("gfx/sb_armor1", true);
+ sb_armor[1] = Draw_CachePic ("gfx/sb_armor2", true);
+ sb_armor[2] = Draw_CachePic ("gfx/sb_armor3", true);
+
+ sb_items[0] = Draw_CachePic ("gfx/sb_key1", true);
+ sb_items[1] = Draw_CachePic ("gfx/sb_key2", true);
+ sb_items[2] = Draw_CachePic ("gfx/sb_invis", true);
+ sb_items[3] = Draw_CachePic ("gfx/sb_invuln", true);
+ sb_items[4] = Draw_CachePic ("gfx/sb_suit", true);
+ sb_items[5] = Draw_CachePic ("gfx/sb_quad", true);
+
+ sb_sigil[0] = Draw_CachePic ("gfx/sb_sigil1", true);
+ sb_sigil[1] = Draw_CachePic ("gfx/sb_sigil2", true);
+ sb_sigil[2] = Draw_CachePic ("gfx/sb_sigil3", true);
+ sb_sigil[3] = Draw_CachePic ("gfx/sb_sigil4", true);
+
+ sb_faces[4][0] = Draw_CachePic ("gfx/face1", true);
+ sb_faces[4][1] = Draw_CachePic ("gfx/face_p1", true);
+ sb_faces[3][0] = Draw_CachePic ("gfx/face2", true);
+ sb_faces[3][1] = Draw_CachePic ("gfx/face_p2", true);
+ sb_faces[2][0] = Draw_CachePic ("gfx/face3", true);
+ sb_faces[2][1] = Draw_CachePic ("gfx/face_p3", true);
+ sb_faces[1][0] = Draw_CachePic ("gfx/face4", true);
+ sb_faces[1][1] = Draw_CachePic ("gfx/face_p4", true);
+ sb_faces[0][0] = Draw_CachePic ("gfx/face5", true);
+ sb_faces[0][1] = Draw_CachePic ("gfx/face_p5", true);
+
+ sb_face_invis = Draw_CachePic ("gfx/face_invis", true);
+ sb_face_invuln = Draw_CachePic ("gfx/face_invul2", true);
+ sb_face_invis_invuln = Draw_CachePic ("gfx/face_inv2", true);
+ sb_face_quad = Draw_CachePic ("gfx/face_quad", true);
+
+ sb_sbar = Draw_CachePic ("gfx/sbar", true);
+ sb_ibar = Draw_CachePic ("gfx/ibar", true);
+ sb_scorebar = Draw_CachePic ("gfx/scorebar", true);
//MED 01/04/97 added new hipnotic weapons
if (gamemode == GAME_HIPNOTIC)
{
- hsb_weapons[0][0] = Draw_CachePic ("gfx/inv_laser", false);
- hsb_weapons[0][1] = Draw_CachePic ("gfx/inv_mjolnir", false);
- hsb_weapons[0][2] = Draw_CachePic ("gfx/inv_gren_prox", false);
- hsb_weapons[0][3] = Draw_CachePic ("gfx/inv_prox_gren", false);
- hsb_weapons[0][4] = Draw_CachePic ("gfx/inv_prox", false);
-
- hsb_weapons[1][0] = Draw_CachePic ("gfx/inv2_laser", false);
- hsb_weapons[1][1] = Draw_CachePic ("gfx/inv2_mjolnir", false);
- hsb_weapons[1][2] = Draw_CachePic ("gfx/inv2_gren_prox", false);
- hsb_weapons[1][3] = Draw_CachePic ("gfx/inv2_prox_gren", false);
- hsb_weapons[1][4] = Draw_CachePic ("gfx/inv2_prox", false);
+ hsb_weapons[0][0] = Draw_CachePic ("gfx/inv_laser", true);
+ hsb_weapons[0][1] = Draw_CachePic ("gfx/inv_mjolnir", true);
+ hsb_weapons[0][2] = Draw_CachePic ("gfx/inv_gren_prox", true);
+ hsb_weapons[0][3] = Draw_CachePic ("gfx/inv_prox_gren", true);
+ hsb_weapons[0][4] = Draw_CachePic ("gfx/inv_prox", true);
+
+ hsb_weapons[1][0] = Draw_CachePic ("gfx/inv2_laser", true);
+ hsb_weapons[1][1] = Draw_CachePic ("gfx/inv2_mjolnir", true);
+ hsb_weapons[1][2] = Draw_CachePic ("gfx/inv2_gren_prox", true);
+ hsb_weapons[1][3] = Draw_CachePic ("gfx/inv2_prox_gren", true);
+ hsb_weapons[1][4] = Draw_CachePic ("gfx/inv2_prox", true);
for (i = 0;i < 5;i++)
{
- hsb_weapons[2+i][0] = Draw_CachePic (va("gfx/inva%i_laser",i+1), false);
- hsb_weapons[2+i][1] = Draw_CachePic (va("gfx/inva%i_mjolnir",i+1), false);
- hsb_weapons[2+i][2] = Draw_CachePic (va("gfx/inva%i_gren_prox",i+1), false);
- hsb_weapons[2+i][3] = Draw_CachePic (va("gfx/inva%i_prox_gren",i+1), false);
- hsb_weapons[2+i][4] = Draw_CachePic (va("gfx/inva%i_prox",i+1), false);
+ hsb_weapons[2+i][0] = Draw_CachePic (va("gfx/inva%i_laser",i+1), true);
+ hsb_weapons[2+i][1] = Draw_CachePic (va("gfx/inva%i_mjolnir",i+1), true);
+ hsb_weapons[2+i][2] = Draw_CachePic (va("gfx/inva%i_gren_prox",i+1), true);
+ hsb_weapons[2+i][3] = Draw_CachePic (va("gfx/inva%i_prox_gren",i+1), true);
+ hsb_weapons[2+i][4] = Draw_CachePic (va("gfx/inva%i_prox",i+1), true);
}
- hsb_items[0] = Draw_CachePic ("gfx/sb_wsuit", false);
- hsb_items[1] = Draw_CachePic ("gfx/sb_eshld", false);
+ hsb_items[0] = Draw_CachePic ("gfx/sb_wsuit", true);
+ hsb_items[1] = Draw_CachePic ("gfx/sb_eshld", true);
}
else if (gamemode == GAME_ROGUE)
{
- rsb_invbar[0] = Draw_CachePic ("gfx/r_invbar1", false);
- rsb_invbar[1] = Draw_CachePic ("gfx/r_invbar2", false);
+ rsb_invbar[0] = Draw_CachePic ("gfx/r_invbar1", true);
+ rsb_invbar[1] = Draw_CachePic ("gfx/r_invbar2", true);
- rsb_weapons[0] = Draw_CachePic ("gfx/r_lava", false);
- rsb_weapons[1] = Draw_CachePic ("gfx/r_superlava", false);
- rsb_weapons[2] = Draw_CachePic ("gfx/r_gren", false);
- rsb_weapons[3] = Draw_CachePic ("gfx/r_multirock", false);
- rsb_weapons[4] = Draw_CachePic ("gfx/r_plasma", false);
+ rsb_weapons[0] = Draw_CachePic ("gfx/r_lava", true);
+ rsb_weapons[1] = Draw_CachePic ("gfx/r_superlava", true);
+ rsb_weapons[2] = Draw_CachePic ("gfx/r_gren", true);
+ rsb_weapons[3] = Draw_CachePic ("gfx/r_multirock", true);
+ rsb_weapons[4] = Draw_CachePic ("gfx/r_plasma", true);
- rsb_items[0] = Draw_CachePic ("gfx/r_shield1", false);
- rsb_items[1] = Draw_CachePic ("gfx/r_agrav1", false);
+ rsb_items[0] = Draw_CachePic ("gfx/r_shield1", true);
+ rsb_items[1] = Draw_CachePic ("gfx/r_agrav1", true);
// PGM 01/19/97 - team color border
- rsb_teambord = Draw_CachePic ("gfx/r_teambord", false);
+ rsb_teambord = Draw_CachePic ("gfx/r_teambord", true);
// PGM 01/19/97 - team color border
- rsb_ammo[0] = Draw_CachePic ("gfx/r_ammolava", false);
- rsb_ammo[1] = Draw_CachePic ("gfx/r_ammomulti", false);
- rsb_ammo[2] = Draw_CachePic ("gfx/r_ammoplasma", false);
+ rsb_ammo[0] = Draw_CachePic ("gfx/r_ammolava", true);
+ rsb_ammo[1] = Draw_CachePic ("gfx/r_ammomulti", true);
+ rsb_ammo[2] = Draw_CachePic ("gfx/r_ammoplasma", true);
}
}
+
+ sb_ranking = Draw_CachePic ("gfx/ranking", true);
+ sb_complete = Draw_CachePic ("gfx/complete", true);
+ sb_inter = Draw_CachePic ("gfx/inter", true);
+ sb_finale = Draw_CachePic ("gfx/finale", true);
}
void sbar_shutdown(void)
void Sbar_Init (void)
{
- Cmd_AddCommand ("+showscores", Sbar_ShowScores, "show scoreboard");
- Cmd_AddCommand ("-showscores", Sbar_DontShowScores, "hide scoreboard");
- Cvar_RegisterVariable (&showfps);
- Cvar_RegisterVariable (&showtime);
- Cvar_RegisterVariable (&showtime_format);
- Cvar_RegisterVariable (&showdate);
- Cvar_RegisterVariable (&showdate_format);
- Cvar_RegisterVariable (&sbar_alpha_bg);
- Cvar_RegisterVariable (&sbar_alpha_fg);
- Cvar_RegisterVariable (&cl_deathscoreboard);
+ Cmd_AddCommand("+showscores", Sbar_ShowScores, "show scoreboard");
+ Cmd_AddCommand("-showscores", Sbar_DontShowScores, "hide scoreboard");
+ Cvar_RegisterVariable(&showfps);
+ Cvar_RegisterVariable(&showtime);
+ Cvar_RegisterVariable(&showtime_format);
+ Cvar_RegisterVariable(&showdate);
+ Cvar_RegisterVariable(&showdate_format);
+ Cvar_RegisterVariable(&sbar_alpha_bg);
+ Cvar_RegisterVariable(&sbar_alpha_fg);
+ Cvar_RegisterVariable(&cl_deathscoreboard);
+
+ Cvar_RegisterVariable(&crosshair_color_red);
+ Cvar_RegisterVariable(&crosshair_color_green);
+ Cvar_RegisterVariable(&crosshair_color_blue);
+ Cvar_RegisterVariable(&crosshair_color_alpha);
+ Cvar_RegisterVariable(&crosshair_size);
R_RegisterModule("sbar", sbar_start, sbar_shutdown, sbar_newmap);
}
}
// time
- minutes = cl.time / 60;
- seconds = cl.time - 60*minutes;
+ minutes = (int)(cl.time / 60);
+ seconds = (int)(cl.time - 60*minutes);
tens = seconds / 10;
units = seconds - 10*tens;
sprintf (str,"Time :%3i:%i%i", minutes, tens, units);
void Sbar_DrawScoreboard (void)
{
Sbar_SoloScoreboard ();
- if (cl.gametype == GAME_DEATHMATCH)
+ // LordHavoc: changed to draw the deathmatch overlays in any multiplayer mode
+ //if (cl.gametype == GAME_DEATHMATCH)
+ if (!cl.islocalgame)
Sbar_DeathmatchOverlay ();
}
if (showfps.integer)
{
float calc;
- if (showfps.integer > 1)
- {
- static double currtime, frametimes[32];
- double newtime, total;
- int count, i;
- static int framecycle = 0;
-
- newtime = Sys_DoubleTime();
- frametimes[framecycle] = newtime - currtime;
- total = 0;
- count = 0;
- while(total < 0.2 && count < 32 && frametimes[i = (framecycle - count) & 31])
- {
- total += frametimes[i];
- count++;
- }
- framecycle++;
- framecycle &= 31;
- if (showfps.integer == 2)
- calc = (((double)count / total) + 0.5);
- else // showfps 3, rapid update
- calc = ((1.0 / (newtime - currtime)) + 0.5);
- currtime = newtime;
- }
- else
+ static double nexttime = 0, lasttime = 0;
+ static double framerate = 0;
+ static int framecount = 0;
+ double newtime;
+ newtime = Sys_DoubleTime();
+ if (newtime >= nexttime)
{
- static double nexttime = 0, lasttime = 0;
- static float framerate = 0;
- static int framecount = 0;
- double newtime;
- newtime = Sys_DoubleTime();
- if (newtime >= nexttime)
- {
- framerate = ((float)framecount / (newtime - lasttime) + 0.5);
- lasttime = newtime;
- nexttime = max(nexttime + 1, lasttime - 1);
- framecount = 0;
- }
- framecount++;
- calc = framerate;
+ framerate = framecount / (newtime - lasttime);
+ lasttime = newtime;
+ nexttime = max(nexttime + 1, lasttime - 1);
+ framecount = 0;
}
+ framecount++;
+ calc = framerate;
if ((red = (calc < 1.0f)))
dpsnprintf(fpsstring, sizeof(fpsstring), "%4i spf", (int)(1.0f / calc + 0.5));
extern cvar_t v_kicktime;
void Sbar_Draw (void)
{
+ cachepic_t *pic;
+
if(cl.csqc_vidvars.drawenginesbar) //[515]: csqc drawsbar
{
if (cl.intermission == 1)
kickoffset[0] = (v_dmg_time/v_kicktime.value*v_dmg_roll) * 10 * scale;
kickoffset[1] = (v_dmg_time/v_kicktime.value*v_dmg_pitch) * 10 * scale;
}
- sbar_x = (vid_conwidth.integer - 256 * scale)/2 + kickoffset[0];
- sbar_y = (vid_conheight.integer - 256 * scale)/2 + kickoffset[1];
+ sbar_x = (int)((vid_conwidth.integer - 256 * scale)/2 + kickoffset[0]);
+ sbar_y = (int)((vid_conheight.integer - 256 * scale)/2 + kickoffset[1]);
// left1 16, 48 : 126 -66
// left2 16, 128 : 196 -66
// right 176, 48 : 196 -136
else // Quake and others
{
sbar_y = vid_conheight.integer - SBAR_HEIGHT;
- if (cl.gametype == GAME_DEATHMATCH && gamemode != GAME_TRANSFUSION)
+ // LordHavoc: changed to draw the deathmatch overlays in any multiplayer mode
+ //if (cl.gametype == GAME_DEATHMATCH && gamemode != GAME_TRANSFUSION)
+ if (!cl.islocalgame && gamemode != GAME_TRANSFUSION)
sbar_x = 0;
else
sbar_x = (vid_conwidth.integer - 320)/2;
}
- if (vid_conwidth.integer > 320 && cl.gametype == GAME_DEATHMATCH)
+ // LordHavoc: changed to draw the deathmatch overlays in any multiplayer mode
+ //if (vid_conwidth.integer > 320 && cl.gametype == GAME_DEATHMATCH)
+ if (!cl.islocalgame && vid_conwidth.integer > 320)
{
if (gamemode == GAME_TRANSFUSION)
Sbar_MiniDeathmatchOverlay (0, 0);
Sbar_ShowFPS();
- if(cl.csqc_vidvars.drawcrosshair)
- R_Draw2DCrosshair();
+ if (cl.csqc_vidvars.drawcrosshair && crosshair.integer >= 1 && crosshair.integer <= NUMCROSSHAIRS && !cl.intermission && !r_letterbox.value && (pic = r_crosshairs[crosshair.integer]))
+ DrawQ_Pic((vid_conwidth.integer - pic->width * crosshair_size.value) * 0.5f, (vid_conheight.integer - pic->height * crosshair_size.value) * 0.5f, pic, pic->width * crosshair_size.value, pic->height * crosshair_size.value, crosshair_color_red.value, crosshair_color_green.value, crosshair_color_blue.value, crosshair_color_alpha.value, 0);
if (cl_prydoncursor.integer)
- 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("gfx/prydoncursor%03i", cl_prydoncursor.integer), false), 0, 0, 1, 1, 1, 1, 0);
+ 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("gfx/prydoncursor%03i", cl_prydoncursor.integer), true), 0, 0, 1, 1, 1, 1, 0);
}
//=============================================================================
{
int minutes;
unsigned char *c;
- if (cls.protocol == PROTOCOL_QUAKEWORLD)
+ minutes = (int)((cl.intermission ? cl.completed_time - s->qw_entertime : cl.time - s->qw_entertime) / 60.0);
+ if (s->qw_spectator)
{
- minutes = (int)((cl.intermission ? cl.completed_time - s->qw_entertime : realtime - s->qw_entertime) / 60.0);
- // draw colors behind score
- c = (unsigned char *)&palette_complete[(s->colors & 0xf0) + 8];
- DrawQ_Pic(x + 14*8, y+1, NULL, 32, 3, c[0] * (1.0f / 255.0f), c[1] * (1.0f / 255.0f), c[2] * (1.0f / 255.0f), c[3] * (1.0f / 255.0f) * sbar_alpha_fg.value, 0);
- c = (unsigned char *)&palette_complete[((s->colors & 15)<<4) + 8];
- DrawQ_Pic(x + 14*8, y+4, NULL, 32, 3, c[0] * (1.0f / 255.0f), c[1] * (1.0f / 255.0f), c[2] * (1.0f / 255.0f), c[3] * (1.0f / 255.0f) * sbar_alpha_fg.value, 0);
- // print the text
- //DrawQ_String(x, y, va("%c%4i %s", (s - cl.scores) == cl.playerentity - 1 ? 13 : ' ', (int) s->frags, s->name), 0, 8, 8, 1, 1, 1, 1 * sbar_alpha_fg.value, 0);
- DrawQ_ColoredString(x, y, va("%c%4i %2i %4i %4i %-4s %s", (s - cl.scores) == cl.playerentity - 1 ? 13 : ' ', bound(0, s->qw_ping, 9999), bound(0, s->qw_packetloss, 99), minutes,(int) s->frags, cl.qw_teamplay ? s->qw_team : "", s->name), 0, 8, 8, 1, 1, 1, 1 * sbar_alpha_fg.value, 0, NULL );
+ if (s->qw_ping || s->qw_packetloss)
+ DrawQ_ColoredString(x, y, va("%4i %3i %4i spect %-4s %c%s", bound(0, s->qw_ping, 9999), bound(0, s->qw_packetloss, 99), minutes, cl.qw_teamplay ? s->qw_team : "", (s - cl.scores) == cl.playerentity - 1 ? 13 : ' ', s->name), 0, 8, 8, 1, 1, 1, 1 * sbar_alpha_fg.value, 0, NULL );
+ else
+ DrawQ_ColoredString(x, y, va(" %4i spect %-4s %c%s", minutes, cl.qw_teamplay ? s->qw_team : "", (s - cl.scores) == cl.playerentity - 1 ? 13 : ' ', s->name), 0, 8, 8, 1, 1, 1, 1 * sbar_alpha_fg.value, 0, NULL );
}
else
{
// draw colors behind score
c = (unsigned char *)&palette_complete[(s->colors & 0xf0) + 8];
- DrawQ_Pic(x + 1*8, y+1, NULL, 32, 3, c[0] * (1.0f / 255.0f), c[1] * (1.0f / 255.0f), c[2] * (1.0f / 255.0f), c[3] * (1.0f / 255.0f) * sbar_alpha_fg.value, 0);
+ DrawQ_Pic(x + 14*8, y+1, NULL, 40, 3, c[0] * (1.0f / 255.0f), c[1] * (1.0f / 255.0f), c[2] * (1.0f / 255.0f), c[3] * (1.0f / 255.0f) * sbar_alpha_fg.value, 0);
c = (unsigned char *)&palette_complete[((s->colors & 15)<<4) + 8];
- DrawQ_Pic(x + 1*8, y+4, NULL, 32, 3, c[0] * (1.0f / 255.0f), c[1] * (1.0f / 255.0f), c[2] * (1.0f / 255.0f), c[3] * (1.0f / 255.0f) * sbar_alpha_fg.value, 0);
+ DrawQ_Pic(x + 14*8, y+4, NULL, 40, 3, c[0] * (1.0f / 255.0f), c[1] * (1.0f / 255.0f), c[2] * (1.0f / 255.0f), c[3] * (1.0f / 255.0f) * sbar_alpha_fg.value, 0);
// print the text
//DrawQ_String(x, y, va("%c%4i %s", (s - cl.scores) == cl.playerentity - 1 ? 13 : ' ', (int) s->frags, s->name), 0, 8, 8, 1, 1, 1, 1 * sbar_alpha_fg.value, 0);
- DrawQ_ColoredString(x, y, va("%c%4i %s", (s - cl.scores) == cl.playerentity - 1 ? 13 : ' ', (int) s->frags, s->name), 0, 8, 8, 1, 1, 1, 1 * sbar_alpha_fg.value, 0, NULL );
+ if (s->qw_ping || s->qw_packetloss)
+ DrawQ_ColoredString(x, y, va("%4i %3i %4i %5i %-4s %c%s", bound(0, s->qw_ping, 9999), bound(0, s->qw_packetloss, 99), minutes,(int) s->frags, cl.qw_teamplay ? s->qw_team : "", (s - cl.scores) == cl.playerentity - 1 ? 13 : ' ', s->name), 0, 8, 8, 1, 1, 1, 1 * sbar_alpha_fg.value, 0, NULL );
+ else
+ DrawQ_ColoredString(x, y, va(" %4i %5i %-4s %c%s", minutes,(int) s->frags, cl.qw_teamplay ? s->qw_team : "", (s - cl.scores) == cl.playerentity - 1 ? 13 : ' ', s->name), 0, 8, 8, 1, 1, 1, 1 * sbar_alpha_fg.value, 0, NULL );
}
return 8;
}
void Sbar_DeathmatchOverlay (void)
{
int i, x, y;
- cachepic_t *pic;
// request new ping times every two second
- if (cl.last_ping_request < realtime - 2)
+ if (cl.last_ping_request < realtime - 2 && cls.netcon)
{
cl.last_ping_request = realtime;
if (cls.protocol == PROTOCOL_QUAKEWORLD)
MSG_WriteByte(&cls.netcon->message, qw_clc_stringcmd);
MSG_WriteString(&cls.netcon->message, "pings");
}
+ else if (cls.protocol == PROTOCOL_QUAKE || cls.protocol == PROTOCOL_QUAKEDP || cls.protocol == PROTOCOL_NEHAHRAMOVIE || cls.protocol == PROTOCOL_DARKPLACES1 || cls.protocol == PROTOCOL_DARKPLACES2 || cls.protocol == PROTOCOL_DARKPLACES3 || cls.protocol == PROTOCOL_DARKPLACES4 || cls.protocol == PROTOCOL_DARKPLACES5 || cls.protocol == PROTOCOL_DARKPLACES6 || cls.protocol == PROTOCOL_DARKPLACES7)
+ {
+ // 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
+ cl.parsingtextexpectingpingforscores = true; // hide the output of the next ping report
+ MSG_WriteByte(&cls.netcon->message, clc_stringcmd);
+ MSG_WriteString(&cls.netcon->message, "ping");
+ }
+ else
+ {
+ // newer server definitely has pings command, so use it for more efficiency
+ MSG_WriteByte(&cls.netcon->message, clc_stringcmd);
+ MSG_WriteString(&cls.netcon->message, "pings");
+ }
}
- pic = Draw_CachePic ("gfx/ranking", true);
- DrawQ_Pic ((vid_conwidth.integer - pic->width)/2, 8, pic, 0, 0, 1, 1, 1, 1 * sbar_alpha_fg.value, 0);
+ DrawQ_Pic ((vid_conwidth.integer - sb_ranking->width)/2, 8, sb_ranking, 0, 0, 1, 1, 1, 1 * sbar_alpha_fg.value, 0);
// scores
Sbar_SortFrags ();
// draw the text
- if (cls.protocol == PROTOCOL_QUAKEWORLD)
- x = (vid_conwidth.integer - (6 + 17 + 15) * 8) / 2;
- else
- x = (vid_conwidth.integer - (6 + 15) * 8) / 2;
+ x = (vid_conwidth.integer - (6 + 18 + 15) * 8) / 2;
y = 40;
+ DrawQ_ColoredString(x, y, va("ping pl%% time frags team name"), 0, 8, 8, 1, 1, 1, 1 * sbar_alpha_fg.value, 0, NULL );
+ y += 8;
if (Sbar_IsTeammatch ())
{
// show team scores first
for (i = 0;i < teamlines && y < vid_conheight.integer;i++)
- y += Sbar_PrintScoreboardItem((teams + teamsort[i]), x, y);
+ y += (int)Sbar_PrintScoreboardItem((teams + teamsort[i]), x, y);
y += 5;
}
for (i = 0;i < scoreboardlines && y < vid_conheight.integer;i++)
- y += Sbar_PrintScoreboardItem(cl.scores + fragsort[i], x, y);
+ y += (int)Sbar_PrintScoreboardItem(cl.scores + fragsort[i], x, y);
}
/*
if (gamemode == GAME_TRANSFUSION)
{
for (;i < scoreboardlines && x < vid_conwidth.integer;i++)
- x += 128 + Sbar_PrintScoreboardItem(cl.scores + fragsort[i], x, y);
+ x += 128 + (int)Sbar_PrintScoreboardItem(cl.scores + fragsort[i], x, y);
}
else
{
for (;i < scoreboardlines && y < vid_conheight.integer;i++)
- y += Sbar_PrintScoreboardItem(cl.scores + fragsort[i], x, y);
+ y += (int)Sbar_PrintScoreboardItem(cl.scores + fragsort[i], x, y);
}
}
int dig;
int num;
- if (cl.gametype == GAME_DEATHMATCH)
+ // LordHavoc: changed to draw the deathmatch overlays in any multiplayer mode
+ //if (cl.gametype == GAME_DEATHMATCH)
+ if (!cl.islocalgame)
{
Sbar_DeathmatchOverlay ();
return;
sbar_x = (vid_conwidth.integer - 320) >> 1;
sbar_y = (vid_conheight.integer - 200) >> 1;
- DrawQ_Pic (sbar_x + 64, sbar_y + 24, Draw_CachePic("gfx/complete", false), 0, 0, 1, 1, 1, 1 * sbar_alpha_fg.value, 0);
- DrawQ_Pic (sbar_x + 0, sbar_y + 56, Draw_CachePic("gfx/inter", false), 0, 0, 1, 1, 1, 1 * sbar_alpha_fg.value, 0);
+ DrawQ_Pic (sbar_x + 64, sbar_y + 24, sb_complete, 0, 0, 1, 1, 1, 1 * sbar_alpha_fg.value, 0);
+ DrawQ_Pic (sbar_x + 0, sbar_y + 56, sb_inter, 0, 0, 1, 1, 1, 1 * sbar_alpha_fg.value, 0);
// time
- dig = cl.completed_time/60;
+ dig = (int)cl.completed_time / 60;
Sbar_DrawNum (160, 64, dig, 3, 0);
- num = cl.completed_time - dig*60;
+ num = (int)cl.completed_time - dig*60;
if (gamemode != GAME_NEXUIZ)
Sbar_DrawPic (234,64,sb_colon);
Sbar_DrawPic (246,64,sb_nums[0][num/10]);
*/
void Sbar_FinaleOverlay (void)
{
- cachepic_t *pic;
-
- pic = Draw_CachePic ("gfx/finale", true);
- DrawQ_Pic((vid_conwidth.integer - pic->width)/2, 16, pic, 0, 0, 1, 1, 1, 1 * sbar_alpha_fg.value, 0);
+ DrawQ_Pic((vid_conwidth.integer - sb_finale->width)/2, 16, sb_finale, 0, 0, 1, 1, 1, 1 * sbar_alpha_fg.value, 0);
}