diff options
author | Loic Blot <loic.blot@unix-experience.fr> | 2021-04-28 12:48:13 +0200 |
---|---|---|
committer | Loïc Blot <nerzhul@users.noreply.github.com> | 2021-05-03 19:49:19 +0200 |
commit | 258101a91031f3ff9ee01a974030b02529ffdac0 (patch) | |
tree | f57e2b95910b26a40d15c6b623084b8d93a528a9 /src/client/renderingengine.cpp | |
parent | 74125a74d34e9b1a003107d4ef6b95b8483d2464 (diff) | |
download | minetest-258101a91031f3ff9ee01a974030b02529ffdac0.tar.gz minetest-258101a91031f3ff9ee01a974030b02529ffdac0.tar.bz2 minetest-258101a91031f3ff9ee01a974030b02529ffdac0.zip |
refacto: RenderingEngine is now better hidden
* No more access to the singleton instance from everywhere (RenderingEngine::get_instance dropped)
* RenderingEngine::get_timer_time is now non static
* RenderingEngine::draw_menu_scene is now non static
* RenderingEngine::draw_scene is now non static
* RenderingEngine::{initialize,finalize} are now non static
* RenderingEngine::run is now non static
* RenderingEngine::getWindowSize now have a static helper. It was mandatory to hide the global get_instance access
Diffstat (limited to 'src/client/renderingengine.cpp')
-rw-r--r-- | src/client/renderingengine.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/client/renderingengine.cpp b/src/client/renderingengine.cpp index da9022477..ec8f47576 100644 --- a/src/client/renderingengine.cpp +++ b/src/client/renderingengine.cpp @@ -159,7 +159,7 @@ RenderingEngine::~RenderingEngine() s_singleton = nullptr; } -v2u32 RenderingEngine::getWindowSize() const +v2u32 RenderingEngine::_getWindowSize() const { if (core) return core->getVirtualSize(); @@ -497,7 +497,7 @@ void RenderingEngine::_draw_load_screen(const std::wstring &text, gui::IGUIEnvironment *guienv, ITextureSource *tsrc, float dtime, int percent, bool clouds) { - v2u32 screensize = RenderingEngine::get_instance()->getWindowSize(); + v2u32 screensize = getWindowSize(); v2s32 textsize(g_fontengine->getTextWidth(text), g_fontengine->getLineHeight()); v2s32 center(screensize.X / 2, screensize.Y / 2); @@ -565,7 +565,7 @@ void RenderingEngine::_draw_load_screen(const std::wstring &text, /* Draws the menu scene including (optional) cloud background. */ -void RenderingEngine::_draw_menu_scene(gui::IGUIEnvironment *guienv, +void RenderingEngine::draw_menu_scene(gui::IGUIEnvironment *guienv, float dtime, bool clouds) { bool cloud_menu_background = clouds && g_settings->getBool("menu_clouds"); @@ -613,19 +613,19 @@ std::vector<irr::video::E_DRIVER_TYPE> RenderingEngine::getSupportedVideoDrivers return drivers; } -void RenderingEngine::_initialize(Client *client, Hud *hud) +void RenderingEngine::initialize(Client *client, Hud *hud) { const std::string &draw_mode = g_settings->get("3d_mode"); core.reset(createRenderingCore(draw_mode, m_device, client, hud)); core->initialize(); } -void RenderingEngine::_finalize() +void RenderingEngine::finalize() { core.reset(); } -void RenderingEngine::_draw_scene(video::SColor skycolor, bool show_hud, +void RenderingEngine::draw_scene(video::SColor skycolor, bool show_hud, bool show_minimap, bool draw_wield_tool, bool draw_crosshair) { core->draw(skycolor, show_hud, show_minimap, draw_wield_tool, draw_crosshair); |