- if (player->hud_flags & HUD_FLAG_HEALTHBAR_VISIBLE)
- drawStatbar(pos - v2s32(0, 4), HUD_CORNER_LOWER, HUD_DIR_LEFT_RIGHT,
- "heart.png", halfheartcount, v2s32(0, 0));
- if (player->hud_flags & HUD_FLAG_BREATHBAR_VISIBLE && breath <= 10)
- drawStatbar(pos - v2s32(-180, 4), HUD_CORNER_LOWER, HUD_DIR_LEFT_RIGHT,
- "bubble.png", breath*2, v2s32(0, 0));
+ //////////////////////////// compatibility code to be removed //////////////
+ // this is ugly as hell but there's no other way to keep compatibility to
+ // old servers
+ if ((player->hud_flags & HUD_FLAG_HEALTHBAR_VISIBLE)) {
+ drawStatbar(v2s32(floor(0.5 * (float)m_screensize.X + 0.5),
+ floor(1 * (float) m_screensize.Y + 0.5)),
+ HUD_CORNER_UPPER, 0, "heart.png",
+ player->hp, v2s32((-10*24)-25,-(48+24+10)), v2s32(24,24));
+ }
+
+ if ((player->hud_flags & HUD_FLAG_BREATHBAR_VISIBLE) &&
+ (player->getBreath() < 11)) {
+ drawStatbar(v2s32(floor(0.5 * (float)m_screensize.X + 0.5),
+ floor(1 * (float) m_screensize.Y + 0.5)),
+ HUD_CORNER_UPPER, 0, "bubble.png",
+ player->getBreath(), v2s32(25,-(48+24+10)), v2s32(24,24));
+ }
+ ////////////////////////////////////////////////////////////////////////////