From 1284e589e1262b36cead0777b5f239f391e3683c Mon Sep 17 00:00:00 2001 From: Laurent alonso Date: Tue, 13 Oct 2020 19:08:43 +0200 Subject: [PATCH] graphic: if needed, scales startsplash and spidlogo at startup --- src/game/boe.startup.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/game/boe.startup.cpp b/src/game/boe.startup.cpp index e62c9ba0..4d2ad9c4 100644 --- a/src/game/boe.startup.cpp +++ b/src/game/boe.startup.cpp @@ -111,16 +111,17 @@ void handle_splash_events() { } void show_logo() { - rectangle whole_window,from_rect; - rectangle logo_from = {0,0,350,350}; + rectangle whole_window; if(get_int_pref("DisplayMode") != 5) hideMenuBar(); whole_window = rectangle(mainPtr); + float ui_scale = get_float_pref("UIScale", 1.0); + if (ui_scale<1) ui_scale=1; + rectangle logo_from = {0,0,int(ui_scale*350),int(ui_scale*350)}; logo_from.offset((whole_window.right - logo_from.right) / 2,(whole_window.bottom - logo_from.bottom) / 2); sf::Texture& pict_to_draw = *ResMgr::graphics.get("spidlogo", true); - from_rect = rectangle(pict_to_draw); play_sound(-95); while(sound_going(95)) { @@ -136,8 +137,10 @@ void show_logo() { } void plop_fancy_startup() { + float ui_scale = get_float_pref("UIScale", 1.0); + if (ui_scale<1) ui_scale=1; rectangle whole_window,from_rect; - rectangle intro_from = {0,0,480,640}; + rectangle intro_from = {0,0,int(ui_scale*480), int(ui_scale*640)}; whole_window = rectangle(mainPtr); sf::Time delay = time_in_ticks(220); intro_from.offset((whole_window.right - intro_from.right) / 2,(whole_window.bottom - intro_from.bottom) / 2);