From 757b9421747cec906de5818d3419552c6dd67376 Mon Sep 17 00:00:00 2001 From: Steve Date: Mon, 15 Feb 2016 16:59:47 +0000 Subject: [PATCH] Added hud icons for armour, shield, ecm, and boost. --- gfx/hud/armour.png | Bin 0 -> 276 bytes gfx/hud/boost.png | Bin 0 -> 212 bytes gfx/hud/ecm.png | Bin 0 -> 344 bytes gfx/hud/shield.png | Bin 0 -> 343 bytes src/battle/hud.c | 31 ++++++++++++++++++++++--------- 5 files changed, 22 insertions(+), 9 deletions(-) create mode 100644 gfx/hud/armour.png create mode 100644 gfx/hud/boost.png create mode 100644 gfx/hud/ecm.png create mode 100644 gfx/hud/shield.png diff --git a/gfx/hud/armour.png b/gfx/hud/armour.png new file mode 100644 index 0000000000000000000000000000000000000000..72c74945d787522e2cdb1235ffba844dc5c14403 GIT binary patch literal 276 zcmeAS@N?(olHy`uVBq!ia0vp^d?3uh1|;P@bT0xawj^(N7a$D;Kb?2i11Zh|kH}&M z25w;xW@MN(M*=9wUgGKN%Km_fpWjsfSHIUWppayVYeb22er|4RUI~M9QEFmIYKlU6 zW=V#EyQgnJcq5-UP*IJii(`n!`QA&8Oh*(rm=7$;KV$r{_sfQ*pFdh=fQer~lA&JoM-5O&vcxr_#5q4VH#M(>!MP|ku_QG`p**uBL&4qCHz2%`PaLSo z&(p;*MC1I{Nse3x9C(+h#~mQqB*J3)wAc7ICw@fSiHQw zl6Q{$@(uG=*0KH$kv8{~p5stB$4T>mNR{u`@9W}9%3_%o%voIuG?~HE)z4*}Q$iB} DPKQGI literal 0 HcmV?d00001 diff --git a/gfx/hud/ecm.png b/gfx/hud/ecm.png new file mode 100644 index 0000000000000000000000000000000000000000..76e5661f89a97ea2d1a850c75f3b1a1da3411b1d GIT binary patch literal 344 zcmeAS@N?(olHy`uVBq!ia0vp^d?3uh1|;P@bT0xa&H|6fVg?3oVGw3ym^DWND9B#o z>Fdh=fQetgSbXx@jgx^wk|nMYCC>S|xv6<249-QVi6yBi3gww484B*6z5(HleBwYw zmpok@Lp07WowU2x#gN1GV#<|->kjhk`M*C9dvP#yqE#8Mg^lzY8|%&UpS+#A&V|8> zV_gTw@uebn=5{2!KYMR>$AP<=OF!JwUY@ab;>S?DEn%cwo!8FE8(O5Eh&&2*X&tx8>&&9dr>1$h8*`3_Ka%Fdh=fQes#!{~{0*BhXaWQl7;iF1B#Zfaf$gL6@8Vo7R>LV0FMhJw4NZ$Nk>pEyv_ zMNb#U5RLOoC++QZG303Zn6~bq?S=N=1^ina_(NP@&5%-~3064Km4AG(U~{oN6jeI?5Js@>OH)tBdd4zX#-_H!|LzGScY-^w}5Eo7g+ ke*fbZ!~acp%+>xgn#e{t`KK1;0zJpz>FVdQ&MBb@0D2yO)c^nh literal 0 HcmV?d00001 diff --git a/src/battle/hud.c b/src/battle/hud.c index cac0267..0ce66d7 100644 --- a/src/battle/hud.c +++ b/src/battle/hud.c @@ -39,6 +39,10 @@ static SDL_Texture *targetCircle; static SDL_Texture *smallFighter; static SDL_Texture *arrowLeft; static SDL_Texture *arrowRight; +static SDL_Texture *armour; +static SDL_Texture *shield; +static SDL_Texture *ecm; +static SDL_Texture *boost; static SDL_Texture *nextGun; static int numMessages; static char *gunName[] = {"", "Particle Cannon", "Plasma Cannon", "Laser Cannon", "Mag Cannon", "Rockets"}; @@ -53,6 +57,10 @@ void initHud(void) smallFighter = getTexture("gfx/hud/smallFighter.png"); arrowLeft = getTexture("gfx/widgets/optionsLeft.png"); arrowRight = getTexture("gfx/widgets/optionsRight.png"); + armour = getTexture("gfx/hud/armour.png"); + shield = getTexture("gfx/hud/shield.png"); + ecm = getTexture("gfx/hud/ecm.png"); + boost = getTexture("gfx/hud/boost.png"); nextGun = getTexture("gfx/hud/nextGun.png"); } @@ -170,8 +178,11 @@ static void drawHealthBars(void) g = 200; } - drawHealthShieldBar(player->health, player->maxHealth, 10, 10, r, g, b, 1); - drawHealthShieldBar(player->shield, player->maxShield, 10, 30, 0, 200, 255, 0); + blit(armour, 6, 9, 0); + drawHealthShieldBar(player->health, player->maxHealth, 30, 10, r, g, b, 1); + + blit(shield, 6, 29, 0); + drawHealthShieldBar(player->shield, player->maxShield, 30, 30, 0, 200, 255, 0); } static void drawHealthShieldBar(int current, int max, int x, int y, int r, int g, int b, int flashLow) @@ -217,9 +228,11 @@ static void drawHealthShieldBar(int current, int max, int x, int y, int r, int g static void drawAbilityBars(void) { - drawBoostECMBar(battle.boostTimer, BOOST_RECHARGE_TIME, 10, 50, 128, 128, 255); + blit(boost, 6, 49, 0); + drawBoostECMBar(battle.boostTimer, BOOST_RECHARGE_TIME, 30, 50, 128, 128, 255); - drawBoostECMBar(battle.ecmTimer, ECM_RECHARGE_TIME, 160, 50, 255, 128, 0); + blit(ecm, 155, 49, 0); + drawBoostECMBar(battle.ecmTimer, ECM_RECHARGE_TIME, 175, 50, 255, 128, 0); } static void drawBoostECMBar(int current, int max, int x, int y, int r, int g, int b) @@ -231,7 +244,7 @@ static void drawBoostECMBar(int current, int max, int x, int y, int r, int g, in rect.x = x; rect.y = y; - rect.w = 100; + rect.w = 105; rect.h = 12; SDL_SetRenderDrawColor(app.renderer, 0, 0, 0, 255); @@ -266,7 +279,7 @@ static void drawWeaponInfo(void) { if (battle.numPlayerGuns) { - drawText(10, 70, 14, TA_LEFT, colors.white, gunName[player->selectedGunType]); + drawText(30, 70, 14, TA_LEFT, colors.white, gunName[player->selectedGunType]); if (battle.numPlayerGuns > 1) { @@ -277,15 +290,15 @@ static void drawWeaponInfo(void) } else { - drawText(10, 70, 14, TA_LEFT, colors.white, "(None)"); + drawText(30, 70, 14, TA_LEFT, colors.white, "(None)"); } } else { - drawText(10, 70, 14, TA_LEFT, colors.white, "(Combined Guns)"); + drawText(30, 70, 14, TA_LEFT, colors.white, "(Combined Guns)"); } - drawText(260, 70, 14, TA_RIGHT, colors.white, "Missiles (%d)", player->missiles); + drawText(280, 70, 14, TA_RIGHT, colors.white, "Missiles (%d)", player->missiles); } static void drawPlayerTargeter(void)