Merge branch 'fireflower-icon' into 'next'

Display power-up icon for Fire Flower

See merge request STJr/SRB2!2097
This commit is contained in:
Logan Aerl Arias 2024-02-12 05:04:57 +00:00
commit bf9904cfc2

View file

@ -134,6 +134,7 @@ static patch_t *minicaps;
static patch_t *gotrflag; static patch_t *gotrflag;
static patch_t *gotbflag; static patch_t *gotbflag;
static patch_t *fnshico; static patch_t *fnshico;
static patch_t *fireflower;
hudinfo_t hudinfo[NUMHUDITEMS] = hudinfo_t hudinfo[NUMHUDITEMS] =
{ {
@ -315,6 +316,8 @@ void ST_LoadGraphics(void)
sneakers = W_CachePatchName("TVSSICON", PU_HUDGFX); sneakers = W_CachePatchName("TVSSICON", PU_HUDGFX);
gravboots = W_CachePatchName("TVGVICON", PU_HUDGFX); gravboots = W_CachePatchName("TVGVICON", PU_HUDGFX);
fireflower = W_CachePatchName("GOTFFLOW", PU_HUDGFX);
tagico = W_CachePatchName("TAGICO", PU_HUDGFX); tagico = W_CachePatchName("TAGICO", PU_HUDGFX);
gotrflag = W_CachePatchName("GOTRFLAG", PU_HUDGFX); gotrflag = W_CachePatchName("GOTRFLAG", PU_HUDGFX);
gotbflag = W_CachePatchName("GOTBFLAG", PU_HUDGFX); gotbflag = W_CachePatchName("GOTBFLAG", PU_HUDGFX);
@ -1508,7 +1511,7 @@ static void ST_drawPowerupHUD(void)
UINT16 invulntime = 0; UINT16 invulntime = 0;
INT32 offs = hudinfo[HUD_POWERUPS].x; INT32 offs = hudinfo[HUD_POWERUPS].x;
const UINT8 q = ((splitscreen && stplyr == &players[secondarydisplayplayer]) ? 1 : 0); const UINT8 q = ((splitscreen && stplyr == &players[secondarydisplayplayer]) ? 1 : 0);
static INT32 flagoffs[2] = {0, 0}, shieldoffs[2] = {0, 0}, finishoffs[2] = {0, 0}; static INT32 flagoffs[2] = {0, 0}, shieldoffs[2] = {0, 0}, finishoffs[2] = {0, 0}, stackoffs[2] = {0,0};
if (F_GetPromptHideHud(hudinfo[HUD_POWERUPS].y)) if (F_GetPromptHideHud(hudinfo[HUD_POWERUPS].y))
return; return;
@ -1583,6 +1586,22 @@ static void ST_drawPowerupHUD(void)
offs -= shieldoffs[q]; offs -= shieldoffs[q];
//Fire Flower "shield"
if ((stplyr->powers[pw_shield] & SH_FIREFLOWER) == SH_FIREFLOWER)
{
stackoffs[q] = ICONSEP;
V_DrawSmallScaledPatch(offs, hudinfo[HUD_POWERUPS].y, V_PERPLAYER|hudinfo[HUD_POWERUPS].f|V_HUDTRANS, fireflower);
}
else if (stackoffs[q])
{
if (stackoffs[q] > 1)
stackoffs[q] = 2*stackoffs[q]/3;
else
stackoffs[q] = 0;
}
offs -= stackoffs[q];
// --------- // ---------
// CTF flags // CTF flags
// --------- // ---------