From 94c294bfdcfb7caa84c88649f3630605ed90e884 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Blot?= Date: Sun, 2 Jul 2017 20:29:58 +0200 Subject: 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 --- src/hud.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/hud.cpp') 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(); -- cgit v1.2.3