From 6a1424f2b18520f40ba8cfd12f7988f6b33db9a6 Mon Sep 17 00:00:00 2001 From: sfan5 Date: Sat, 28 Aug 2021 12:15:12 +0200 Subject: Async-related script cleanups --- src/gui/guiEngine.cpp | 7 ------- 1 file changed, 7 deletions(-) (limited to 'src/gui/guiEngine.cpp') diff --git a/src/gui/guiEngine.cpp b/src/gui/guiEngine.cpp index 694baf482..b3808535c 100644 --- a/src/gui/guiEngine.cpp +++ b/src/gui/guiEngine.cpp @@ -614,10 +614,3 @@ void GUIEngine::stopSound(s32 handle) { m_sound_manager->stopSound(handle); } - -/******************************************************************************/ -unsigned int GUIEngine::queueAsync(const std::string &serialized_func, - const std::string &serialized_params) -{ - return m_script->queueAsync(serialized_func, serialized_params); -} -- cgit v1.2.3 From 719a12ecac1c5363612e0c230eae411bdb3fe058 Mon Sep 17 00:00:00 2001 From: Lars Müller <34514239+appgurueu@users.noreply.github.com> Date: Tue, 14 Sep 2021 20:46:02 +0200 Subject: Chop game background in mainmenu (#10796) --- games/devtest/menu/background.png | Bin 152 -> 160 bytes src/gui/guiEngine.cpp | 15 ++++++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) (limited to 'src/gui/guiEngine.cpp') diff --git a/games/devtest/menu/background.png b/games/devtest/menu/background.png index 415bb3d14..89c45fcd5 100644 Binary files a/games/devtest/menu/background.png and b/games/devtest/menu/background.png differ diff --git a/src/gui/guiEngine.cpp b/src/gui/guiEngine.cpp index b3808535c..c39c3ee0d 100644 --- a/src/gui/guiEngine.cpp +++ b/src/gui/guiEngine.cpp @@ -437,9 +437,22 @@ void GUIEngine::drawBackground(video::IVideoDriver *driver) return; } + // Chop background image to the smaller screen dimension + v2u32 bg_size = screensize; + v2f32 scale( + (f32) bg_size.X / sourcesize.X, + (f32) bg_size.Y / sourcesize.Y); + if (scale.X < scale.Y) + bg_size.X = (int) (scale.Y * sourcesize.X); + else + bg_size.Y = (int) (scale.X * sourcesize.Y); + v2s32 offset = v2s32( + (s32) screensize.X - (s32) bg_size.X, + (s32) screensize.Y - (s32) bg_size.Y + ) / 2; /* Draw background texture */ draw2DImageFilterScaled(driver, texture, - core::rect(0, 0, screensize.X, screensize.Y), + core::rect(offset.X, offset.Y, bg_size.X + offset.X, bg_size.Y + offset.Y), core::rect(0, 0, sourcesize.X, sourcesize.Y), NULL, NULL, true); } -- cgit v1.2.3