aboutsummaryrefslogtreecommitdiff
path: root/src/client/hud.cpp
diff options
context:
space:
mode:
authorLoic Blot <loic.blot@unix-experience.fr>2021-04-28 12:48:13 +0200
committerLoïc Blot <nerzhul@users.noreply.github.com>2021-05-03 19:49:19 +0200
commit258101a91031f3ff9ee01a974030b02529ffdac0 (patch)
treef57e2b95910b26a40d15c6b623084b8d93a528a9 /src/client/hud.cpp
parent74125a74d34e9b1a003107d4ef6b95b8483d2464 (diff)
downloadhax-minetest-server-258101a91031f3ff9ee01a974030b02529ffdac0.tar.gz
hax-minetest-server-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/hud.cpp')
-rw-r--r--src/client/hud.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/client/hud.cpp b/src/client/hud.cpp
index c58c7e822..ceea96832 100644
--- a/src/client/hud.cpp
+++ b/src/client/hud.cpp
@@ -747,7 +747,7 @@ void Hud::drawHotbar(u16 playeritem) {
s32 width = hotbar_itemcount * (m_hotbar_imagesize + m_padding * 2);
v2s32 pos = centerlowerpos - v2s32(width / 2, m_hotbar_imagesize + m_padding * 3);
- const v2u32 &window_size = RenderingEngine::get_instance()->getWindowSize();
+ const v2u32 &window_size = RenderingEngine::getWindowSize();
if ((float) width / (float) window_size.X <=
g_settings->getFloat("hud_hotbar_max_width")) {
if (player->hud_flags & HUD_FLAG_HOTBAR_VISIBLE) {
@@ -874,7 +874,7 @@ void Hud::toggleBlockBounds()
void Hud::drawBlockBounds()
{
if (m_block_bounds_mode == BLOCK_BOUNDS_OFF) {
- return;
+ return;
}
video::SMaterial old_material = driver->getMaterial2D();
@@ -956,7 +956,7 @@ void Hud::updateSelectionMesh(const v3s16 &camera_offset)
}
void Hud::resizeHotbar() {
- const v2u32 &window_size = RenderingEngine::get_instance()->getWindowSize();
+ const v2u32 &window_size = RenderingEngine::getWindowSize();
if (m_screensize != window_size) {
m_hotbar_imagesize = floor(HOTBAR_IMAGE_SIZE *