aboutsummaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorLoic Blot <loic.blot@unix-experience.fr>2021-04-29 20:38:35 +0200
committerLoïc Blot <nerzhul@users.noreply.github.com>2021-05-03 19:49:19 +0200
commit48d5abd5bee7a3f956cb2b92745bed6313cf5d8a (patch)
tree3ecf00918b1011dbe9e141e38eb989e8d0152335 /src/gui
parenta93712458b2f8914fdb43ec436c5caf908ba93b8 (diff)
downloadminetest-48d5abd5bee7a3f956cb2b92745bed6313cf5d8a.tar.gz
minetest-48d5abd5bee7a3f956cb2b92745bed6313cf5d8a.tar.bz2
minetest-48d5abd5bee7a3f956cb2b92745bed6313cf5d8a.zip
refacto: remove get_gui_env & draw_load_screen from RenderingEngine singleton
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/guiEngine.cpp1
-rw-r--r--src/gui/guiFormSpecMenu.cpp12
-rw-r--r--src/gui/guiFormSpecMenu.h6
3 files changed, 11 insertions, 8 deletions
diff --git a/src/gui/guiEngine.cpp b/src/gui/guiEngine.cpp
index 0c7b96492..694baf482 100644
--- a/src/gui/guiEngine.cpp
+++ b/src/gui/guiEngine.cpp
@@ -170,6 +170,7 @@ GUIEngine::GUIEngine(JoystickController *joystick,
-1,
m_menumanager,
NULL /* &client */,
+ m_rendering_engine->get_gui_env(),
m_texture_source,
m_sound_manager,
m_formspecgui,
diff --git a/src/gui/guiFormSpecMenu.cpp b/src/gui/guiFormSpecMenu.cpp
index fdcf27a0a..c6435804f 100644
--- a/src/gui/guiFormSpecMenu.cpp
+++ b/src/gui/guiFormSpecMenu.cpp
@@ -96,10 +96,10 @@ inline u32 clamp_u8(s32 value)
GUIFormSpecMenu::GUIFormSpecMenu(JoystickController *joystick,
gui::IGUIElement *parent, s32 id, IMenuManager *menumgr,
- Client *client, ISimpleTextureSource *tsrc, ISoundManager *sound_manager,
- IFormSource *fsrc, TextDest *tdst,
+ Client *client, gui::IGUIEnvironment *guienv, ISimpleTextureSource *tsrc,
+ ISoundManager *sound_manager, IFormSource *fsrc, TextDest *tdst,
const std::string &formspecPrepend, bool remap_dbl_click):
- GUIModalMenu(RenderingEngine::get_gui_env(), parent, id, menumgr, remap_dbl_click),
+ GUIModalMenu(guienv, parent, id, menumgr, remap_dbl_click),
m_invmgr(client),
m_tsrc(tsrc),
m_sound_manager(sound_manager),
@@ -145,12 +145,12 @@ GUIFormSpecMenu::~GUIFormSpecMenu()
}
void GUIFormSpecMenu::create(GUIFormSpecMenu *&cur_formspec, Client *client,
- JoystickController *joystick, IFormSource *fs_src, TextDest *txt_dest,
- const std::string &formspecPrepend, ISoundManager *sound_manager)
+ gui::IGUIEnvironment *guienv, JoystickController *joystick, IFormSource *fs_src,
+ TextDest *txt_dest, const std::string &formspecPrepend, ISoundManager *sound_manager)
{
if (cur_formspec == nullptr) {
cur_formspec = new GUIFormSpecMenu(joystick, guiroot, -1, &g_menumgr,
- client, client->getTextureSource(), sound_manager, fs_src,
+ client, guienv, client->getTextureSource(), sound_manager, fs_src,
txt_dest, formspecPrepend);
cur_formspec->doPause = false;
diff --git a/src/gui/guiFormSpecMenu.h b/src/gui/guiFormSpecMenu.h
index d658aba7b..926de66d5 100644
--- a/src/gui/guiFormSpecMenu.h
+++ b/src/gui/guiFormSpecMenu.h
@@ -152,6 +152,7 @@ public:
gui::IGUIElement* parent, s32 id,
IMenuManager *menumgr,
Client *client,
+ gui::IGUIEnvironment *guienv,
ISimpleTextureSource *tsrc,
ISoundManager *sound_manager,
IFormSource* fs_src,
@@ -162,8 +163,9 @@ public:
~GUIFormSpecMenu();
static void create(GUIFormSpecMenu *&cur_formspec, Client *client,
- JoystickController *joystick, IFormSource *fs_src, TextDest *txt_dest,
- const std::string &formspecPrepend, ISoundManager *sound_manager);
+ gui::IGUIEnvironment *guienv, JoystickController *joystick, IFormSource *fs_src,
+ TextDest *txt_dest, const std::string &formspecPrepend,
+ ISoundManager *sound_manager);
void setFormSpec(const std::string &formspec_string,
const InventoryLocation &current_inventory_location)