summaryrefslogtreecommitdiff
path: root/src/hud.cpp
diff options
context:
space:
mode:
authorLoïc Blot <nerzhul@users.noreply.github.com>2017-07-02 20:29:58 +0200
committerGitHub <noreply@github.com>2017-07-02 20:29:58 +0200
commit94c294bfdcfb7caa84c88649f3630605ed90e884 (patch)
tree94fdecef9a4f1204effb95e800f7c2cb39126a67 /src/hud.cpp
parent51104d9cd445da21adc731fb820bbb7d82b45d64 (diff)
downloadminetest-94c294bfdcfb7caa84c88649f3630605ed90e884.tar.gz
minetest-94c294bfdcfb7caa84c88649f3630605ed90e884.tar.bz2
minetest-94c294bfdcfb7caa84c88649f3630605ed90e884.zip
Irrlicht cleanup: cleanup various object to use RenderingEngine (#6088)
* Irrlicht cleanup: cleanup various object to use RenderingEngine * CAO doesn't need scenemanager in addToScene * Camera doesn't need VideoDriver pointer or SceneManager in constructor * Hud doesn't need driver & scene manager in constructor * Hud doesn't need scenemanager pointer * Tile.h doesn't need IrrlichtDevice header (just SMaterial) * WieldMeshSceneNode: only take scene, we always use scene root node as parent
Diffstat (limited to 'src/hud.cpp')
-rw-r--r--src/hud.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/hud.cpp b/src/hud.cpp
index 2285fb71e..70903ce15 100644
--- a/src/hud.cpp
+++ b/src/hud.cpp
@@ -40,12 +40,10 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "touchscreengui.h"
#endif
-Hud::Hud(video::IVideoDriver *driver, scene::ISceneManager* smgr,
- gui::IGUIEnvironment* guienv, Client *client, LocalPlayer *player,
+Hud::Hud(gui::IGUIEnvironment *guienv, Client *client, LocalPlayer *player,
Inventory *inventory)
{
- this->driver = driver;
- this->smgr = smgr;
+ driver = RenderingEngine::get_video_driver();
this->guienv = guienv;
this->client = client;
this->player = player;
@@ -339,7 +337,8 @@ void Hud::drawLuaElements(const v3s16 &camera_offset)
v3f p_pos = player->getPosition() / BS;
v3f w_pos = e->world_pos * BS;
float distance = floor(10 * p_pos.getDistanceFrom(e->world_pos)) / 10;
- scene::ICameraSceneNode* camera = smgr->getActiveCamera();
+ scene::ICameraSceneNode* camera =
+ RenderingEngine::get_scene_manager()->getActiveCamera();
w_pos -= intToFloat(camera_offset, BS);
core::matrix4 trans = camera->getProjectionMatrix();
trans *= camera->getViewMatrix();