Skip to content

Commit

Permalink
fix ammo text obstructed by bars
Browse files Browse the repository at this point in the history
  • Loading branch information
rr- committed Feb 22, 2021
1 parent 014aa11 commit d12e829
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/game/health.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

void DrawGameInfo()
{
DrawAmmoInfo();
if (OverlayFlag > 0) {
DrawHealthBar();
DrawAirBar();
Expand All @@ -18,6 +17,11 @@ void DrawGameInfo()
DrawPickups();
}

// NOTE: this was drawn before the healthbars in the original code.
// In T1M it's called after drawing the healthbars, as it updates the
// healthbars position and thus vertical offset for the ammo text.
DrawAmmoInfo();

T_DrawText();
}

Expand Down Expand Up @@ -119,6 +123,12 @@ void DrawAmmoInfo()
AmmoText = T_Print(-17, 22, 0, ammostring);
T_RightAlign(AmmoText, 1);
}

#ifdef T1M_FEAT_UI
AmmoText->ypos = BarOffsetY[T1M_BL_TOP_RIGHT]
? 30 + (int)(BarOffsetY[T1M_BL_TOP_RIGHT] * 10 / GetRenderScale(10))
: 22;
#endif
}

void MakeAmmoString(char* string)
Expand Down

0 comments on commit d12e829

Please sign in to comment.