]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - sbar.c
remove unused allowedpermutations field
[xonotic/darkplaces.git] / sbar.c
diff --git a/sbar.c b/sbar.c
index da545f49a0e771d460541e71d96fde591287908b..01ee3e96b55aa83ef45fc37f2cd5e9d51c2575d9 100644 (file)
--- a/sbar.c
+++ b/sbar.c
@@ -98,6 +98,7 @@ cvar_t sbar_alpha_fg = {CVAR_SAVE, "sbar_alpha_fg", "1", "opacity value of the s
 cvar_t sbar_hudselector = {CVAR_SAVE, "sbar_hudselector", "0", "selects which of the builtin hud layouts to use (meaning is somewhat dependent on gamemode, so nexuiz has a very different set of hud layouts than quake for example)"};
 cvar_t sbar_miniscoreboard_size = {CVAR_SAVE, "sbar_miniscoreboard_size", "-1", "sets the size of the mini deathmatch overlay in items, or disables it when set to 0, or sets it to a sane default when set to -1"};
 cvar_t sbar_flagstatus_right = {CVAR_SAVE, "sbar_flagstatus_right", "0", "moves Nexuiz flag status icons to the right"};
+cvar_t sbar_flagstatus_pos = {CVAR_SAVE, "sbar_flagstatus_pos", "115", "pixel position of the Nexuiz flag status icons, from the bottom"};
 
 cvar_t cl_deathscoreboard = {0, "cl_deathscoreboard", "1", "shows scoreboard (+showscores) while dead"};
 
@@ -388,7 +389,10 @@ void Sbar_Init (void)
        Cvar_RegisterVariable(&crosshair_size);
 
        if(gamemode == GAME_NEXUIZ)
+       {
                Cvar_RegisterVariable(&sbar_flagstatus_right); // this cvar makes no sense in other games
+               Cvar_RegisterVariable(&sbar_flagstatus_pos); // this cvar makes no sense in other games
+       }
 
        R_RegisterModule("sbar", sbar_start, sbar_shutdown, sbar_newmap);
 }
@@ -1108,7 +1112,7 @@ void Sbar_ShowFPS(void)
                                break;
                        case 5:
                                unit = "knots";
-                               f = 0.0254 * 1.852;
+                               f = 0.0254 * 1.943844492; // 1 m/s = 1.943844492 knots, because 1 knot = 1.852 km/h
                                if(gamemode != GAME_NEXUIZ) f *= 1.5;
                                break;
                }
@@ -1282,14 +1286,14 @@ void Sbar_Draw (void)
                                {
                                        // The Impossible Combination[tm]
                                        // Can only happen in Key Hunt mode...
-                                       Sbar_DrawPic (x, -179, sb_items[14]);
+                                       Sbar_DrawPic (x, (vid_conheight.integer - sbar_y) - (sbar_flagstatus_pos.value + 128), sb_items[14]);
                                }
                                else
                                {
                                        if (redflag)
-                                               Sbar_DrawPic (x, -117, sb_items[redflag+10]);
+                                               Sbar_DrawPic (x, (vid_conheight.integer - sbar_y) - (sbar_flagstatus_pos.value + 64), sb_items[redflag+10]);
                                        if (blueflag)
-                                               Sbar_DrawPic (x, -177, sb_items[blueflag+14]);
+                                               Sbar_DrawPic (x, (vid_conheight.integer - sbar_y) - (sbar_flagstatus_pos.value + 128), sb_items[blueflag+14]);
                                }
 
                                // armor