summaryrefslogtreecommitdiff
path: root/src/hud.cpp
diff options
context:
space:
mode:
authorsapier <Sapier at GMX dot net>2014-11-28 20:06:34 +0100
committersapier <Sapier at GMX dot net>2014-11-30 18:06:54 +0100
commit39162de15a2603f1282241aef412ef1b70162b27 (patch)
treeddcd0c42420093eaebdda13ed10101308af345dc /src/hud.cpp
parentd1d6a97b1cd05ec34358b6519fc232fc158cf521 (diff)
downloadminetest-39162de15a2603f1282241aef412ef1b70162b27.tar.gz
minetest-39162de15a2603f1282241aef412ef1b70162b27.tar.bz2
minetest-39162de15a2603f1282241aef412ef1b70162b27.zip
Make hud use fontengine too
Fix non coding style conforming glb_fontengine to g_fontengine Fix fonts never been deleted due to grabbed to often
Diffstat (limited to 'src/hud.cpp')
-rw-r--r--src/hud.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/hud.cpp b/src/hud.cpp
index 02071835f..eb2dca573 100644
--- a/src/hud.cpp
+++ b/src/hud.cpp
@@ -31,6 +31,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "localplayer.h"
#include "camera.h"
#include "porting.h"
+#include "fontengine.h"
#include <IGUIStaticText.h>
#ifdef HAVE_TOUCHSCREENGUI
@@ -38,14 +39,11 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#endif
Hud::Hud(video::IVideoDriver *driver, scene::ISceneManager* smgr,
- gui::IGUIEnvironment* guienv, gui::IGUIFont *font,
- u32 text_height, IGameDef *gamedef,
- LocalPlayer *player, Inventory *inventory) {
+ gui::IGUIEnvironment* guienv, IGameDef *gamedef, LocalPlayer *player,
+ Inventory *inventory) {
this->driver = driver;
this->smgr = smgr;
this->guienv = guienv;
- this->font = font;
- this->text_height = text_height;
this->gamedef = gamedef;
this->player = player;
this->inventory = inventory;
@@ -156,7 +154,7 @@ void Hud::drawItem(const ItemStack &item, const core::rect<s32>& rect, bool sele
video::SColor bgcolor2(128, 0, 0, 0);
if (!use_hotbar_image)
driver->draw2DRectangle(bgcolor2, rect, NULL);
- drawItemStack(driver, font, item, rect, NULL, gamedef);
+ drawItemStack(driver, g_fontengine->getFont(), item, rect, NULL, gamedef);
}
//NOTE: selectitem = 0 -> no selected; selectitem 1-based
@@ -240,6 +238,8 @@ void Hud::drawItems(v2s32 upperleftpos, s32 itemcount, s32 offset,
void Hud::drawLuaElements(v3s16 camera_offset) {
+ uint32_t text_height = g_fontengine->getTextHeight();
+ irr::gui::IGUIFont* font = g_fontengine->getFont();
for (size_t i = 0; i != player->maxHudId(); i++) {
HudElement *e = player->getHud(i);
if (!e)