1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Generalize hud_builtin_enable into hud_set_flags

This commit is contained in:
kwolekr 2013-04-25 19:27:22 -04:00
parent d83602d98e
commit d3f0ce6224
12 changed files with 85 additions and 107 deletions

View file

@ -2186,14 +2186,6 @@ void the_game(
delete event.hudchange.v2fdata;
delete event.hudchange.sdata;
}
else if (event.type == CE_HUD_BUILTIN_ENABLE) {
u32 bit = (u32)event.hudbuiltin.id;
u32 mask = 1 << bit;
if (event.hudbuiltin.flag)
player->hud_flags |= mask;
else
player->hud_flags &= ~mask;
}
}
}
@ -3078,7 +3070,7 @@ void the_game(
/*
Wielded tool
*/
if(show_hud && (player->hud_flags & HUD_DRAW_WIELDITEM))
if(show_hud && (player->hud_flags & HUD_FLAG_WIELDITEM_VISIBLE))
{
// Warning: This clears the Z buffer.
camera.drawWieldedTool();
@ -3102,7 +3094,7 @@ void the_game(
/*
Draw crosshair
*/
if (show_hud && (player->hud_flags & HUD_DRAW_CROSSHAIR))
if (show_hud)
hud.drawCrosshair();
} // timer
@ -3117,8 +3109,7 @@ void the_game(
if (show_hud)
{
hud.drawHotbar(v2s32(displaycenter.X, screensize.Y),
client.getHP(), client.getPlayerItem(),
player->hud_flags);
client.getHP(), client.getPlayerItem());
}
/*