X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=sbar.c;h=5e5ffd838aaaf6660fbf57257844868af36c75ad;hb=75ed014650cc6c57abc48b854fb60f78bc249eab;hp=016a1dfb798091962310f38f8bcb95c5dae542bf;hpb=257e50517fda2dd24dd2b9a651ee68b405da2a25;p=xonotic%2Fdarkplaces.git diff --git a/sbar.c b/sbar.c index 016a1dfb..5e5ffd83 100644 --- a/sbar.c +++ b/sbar.c @@ -549,7 +549,7 @@ void Sbar_DrawInventory (void) // weapons for (i=0 ; i<7 ; i++) { - if (cl.items & (IT_SHOTGUN<1)) @@ -651,7 +651,7 @@ void Sbar_DrawInventory (void) if (gamemode == GAME_HIPNOTIC) { for (i=0 ; i<2 ; i++) - if (cl.items & (1<<(24+i))) + if (cl.stats[STAT_ITEMS] & (1<<(24+i))) Sbar_DrawPic (288 + i*16, -16, hsb_items[i]); } @@ -659,14 +659,14 @@ void Sbar_DrawInventory (void) { // new rogue items for (i=0 ; i<2 ; i++) - if (cl.items & (1<<(29+i))) + if (cl.stats[STAT_ITEMS] & (1<<(29+i))) Sbar_DrawPic (288 + i*16, -16, rsb_items[i]); } else { // sigils for (i=0 ; i<4 ; i++) - if (cl.items & (1<<(28+i))) + if (cl.stats[STAT_ITEMS] & (1<<(28+i))) Sbar_DrawPic (320-32 + i*8, -16, sb_sigil[i]); } } @@ -772,13 +772,13 @@ void Sbar_DrawFace (void) } // PGM 01/19/97 - team color drawing - if ( (cl.items & (IT_INVISIBILITY | IT_INVULNERABILITY) ) == (IT_INVISIBILITY | IT_INVULNERABILITY) ) + if ( (cl.stats[STAT_ITEMS] & (IT_INVISIBILITY | IT_INVULNERABILITY) ) == (IT_INVISIBILITY | IT_INVULNERABILITY) ) Sbar_DrawPic (112, 0, sb_face_invis_invuln); - else if (cl.items & IT_QUAD) + else if (cl.stats[STAT_ITEMS] & IT_QUAD) Sbar_DrawPic (112, 0, sb_face_quad ); - else if (cl.items & IT_INVISIBILITY) + else if (cl.stats[STAT_ITEMS] & IT_INVISIBILITY) Sbar_DrawPic (112, 0, sb_face_invis ); - else if (cl.items & IT_INVULNERABILITY) + else if (cl.stats[STAT_ITEMS] & IT_INVULNERABILITY) Sbar_DrawPic (112, 0, sb_face_invuln); else { @@ -830,15 +830,14 @@ void Sbar_ShowFPS(void) static int framerate = 0, framecount = 0; double newtime; newtime = Sys_DoubleTime(); - if (newtime < nexttime) - framecount++; - else + if (newtime >= nexttime) { framerate = (int) (framecount / (newtime - lasttime) + 0.5); lasttime = newtime; - nexttime = lasttime + 0.2; - framecount = 1; + nexttime = max(nexttime + 1, lasttime - 1); + framecount = 0; } + framecount++; calc = framerate; } snprintf(fpsstring, sizeof(fpsstring), "%4i fps", calc); @@ -886,9 +885,6 @@ Sbar_Draw */ void Sbar_Draw (void) { - if (scr_con_current == vid.conheight) - return; // console is full screen - if (cl.intermission == 1) { Sbar_IntermissionOverlay(); @@ -913,11 +909,11 @@ void Sbar_Draw (void) // armor if (cl.stats[STAT_ARMOR]) { - if (cl.items & IT_ARMOR3) + if (cl.stats[STAT_ITEMS] & IT_ARMOR3) Sbar_DrawPic(0, 0, somsb_armor[2]); - else if (cl.items & IT_ARMOR2) + else if (cl.stats[STAT_ITEMS] & IT_ARMOR2) Sbar_DrawPic(0, 0, somsb_armor[1]); - else if (cl.items & IT_ARMOR1) + else if (cl.stats[STAT_ITEMS] & IT_ARMOR1) Sbar_DrawPic(0, 0, somsb_armor[0]); Sbar_DrawNum(24, 0, cl.stats[STAT_ARMOR], 3, cl.stats[STAT_ARMOR] <= 25); } @@ -927,13 +923,13 @@ void Sbar_Draw (void) Sbar_DrawNum(24, 24, cl.stats[STAT_HEALTH], 3, cl.stats[STAT_HEALTH] <= 25); // ammo icon - if (cl.items & IT_SHELLS) + if (cl.stats[STAT_ITEMS] & IT_SHELLS) Sbar_DrawPic(0, 48, somsb_ammo[0]); - else if (cl.items & IT_NAILS) + else if (cl.stats[STAT_ITEMS] & IT_NAILS) Sbar_DrawPic(0, 48, somsb_ammo[1]); - else if (cl.items & IT_ROCKETS) + else if (cl.stats[STAT_ITEMS] & IT_ROCKETS) Sbar_DrawPic(0, 48, somsb_ammo[2]); - else if (cl.items & IT_CELLS) + else if (cl.stats[STAT_ITEMS] & IT_CELLS) Sbar_DrawPic(0, 48, somsb_ammo[3]); Sbar_DrawNum(24, 48, cl.stats[STAT_AMMO], 3, false); if (cl.stats[STAT_SHELLS]) @@ -962,14 +958,11 @@ void Sbar_Draw (void) fade = (1.0 - 0.5 * time); fade *= fade; for (i = 0; i < 8;i++) - { - if (!(cl.items & (1 << i))) - continue; - Sbar_DrawWeapon(i + 1, fade, ((1<