From a81be019141c809b72e138e155753503e5ddb79b Mon Sep 17 00:00:00 2001 From: hendricks266 Date: Mon, 23 Mar 2015 06:26:59 +0000 Subject: [PATCH] Modify the modern mini-HUD so that: 1. Instead of the Mighty Foot using the Protective Boots inventory item as its icon, display no icon at all. 2. Adjust the ammo icon so that it is drawn at one-quarter size if its y-size is >=50 instead of >50. This fixes the display of Water Pistol Ammo in Duke Caribbean. git-svn-id: https://svn.eduke32.com/eduke32@5057 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/source/game.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/polymer/eduke32/source/game.c b/polymer/eduke32/source/game.c index 1826c88e6..dabcc7fbc 100644 --- a/polymer/eduke32/source/game.c +++ b/polymer/eduke32/source/game.c @@ -2009,14 +2009,14 @@ static void G_DrawStatusBar(int32_t snum) int32_t hudoffset = althud == 2 ? 32 : 200; static int32_t ammo_sprites[MAX_WEAPONS]; - if (ammo_sprites[0] == 0) + if (EDUKE32_PREDICT_FALSE(ammo_sprites[0] == 0)) { /* this looks stupid but it lets us initialize static memory to dynamic values these values can be changed from the CONs with dynamic tile remapping but we don't want to have to recreate the values in memory every time the HUD is drawn */ - int32_t asprites[MAX_WEAPONS] = { BOOTS, AMMO, SHOTGUNAMMO, BATTERYAMMO, + int32_t asprites[MAX_WEAPONS] = { -1, AMMO, SHOTGUNAMMO, BATTERYAMMO, RPGAMMO, HBOMBAMMO, CRYSTALAMMO, DEVISTATORAMMO, TRIPBOMBSPRITE, FREEZEAMMO+1, HBOMBAMMO, GROWAMMO }; @@ -2045,10 +2045,12 @@ static void G_DrawStatusBar(int32_t snum) lAmount = p->inv_amount[GET_SHIELD]; G_DrawAltDigiNum(105,-(hudoffset-22),lAmount,-16,10+16+256); } - - i = (tilesiz[ammo_sprites[p->curr_weapon]].y > 50) ? 16384 : 32768; - rotatesprite_althudr(57,hudoffset-15,sbarsc(i),0,ammo_sprites[p->curr_weapon],0,0,10+512); + if (ammo_sprites[p->curr_weapon] >= 0) + { + i = (tilesiz[ammo_sprites[p->curr_weapon]].y >= 50) ? 16384 : 32768; + rotatesprite_althudr(57,hudoffset-15,sbarsc(i),0,ammo_sprites[p->curr_weapon],0,0,10+512); + } if (PWEAPON(snum, p->curr_weapon, WorksLike) == HANDREMOTE_WEAPON) i = HANDBOMB_WEAPON; else i = p->curr_weapon;