3 Copyright (C) 2010-2013 kwolekr, Ryan Kwolek <kwolekr@minetest.net>
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU Lesser General Public License as published by
7 the Free Software Foundation; either version 2.1 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public License along
16 with this program; if not, write to the Free Software Foundation, Inc.,
17 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
23 #include "irrlichttypes_extrabloated.h"
25 #define HUD_DIR_LEFT_RIGHT 0
26 #define HUD_DIR_RIGHT_LEFT 1
27 #define HUD_DIR_TOP_BOTTOM 2
28 #define HUD_DIR_BOTTOM_TOP 3
30 #define HUD_CORNER_UPPER 0
31 #define HUD_CORNER_LOWER 1
32 #define HUD_CORNER_CENTER 2
40 HUD_ELEM_INVENTORY = 3
65 inline u32 hud_get_free_id(Player *player) {
66 size_t size = player->hud.size();
67 for (size_t i = 0; i != size; i++) {
81 #include "inventory.h"
82 #include "localplayer.h"
86 video::IVideoDriver *driver;
87 gui::IGUIEnvironment *guienv;
99 video::SColor crosshair_argb;
100 video::SColor selectionbox_argb;
102 Hud(video::IVideoDriver *driver, gui::IGUIEnvironment* guienv,
103 gui::IGUIFont *font, u32 text_height, IGameDef *gamedef,
104 LocalPlayer *player, Inventory *inventory);
106 void drawItem(v2s32 upperleftpos, s32 imgsize, s32 itemcount,
107 InventoryList *mainlist, u16 selectitem, u16 direction);
108 void drawLuaElements();
109 void drawStatbar(v2s32 pos, u16 corner, u16 drawdir, std::string texture, s32 count);
111 void drawHotbar(v2s32 centerlowerpos, s32 halfheartcount, u16 playeritem);
114 void drawCrosshair();
115 void drawSelectionBoxes(std::vector<aabb3f> &hilightboxes);