graphic: if needed, scales startsplash and spidlogo at startup

This commit is contained in:
Laurent alonso
2020-10-13 19:08:43 +02:00
committed by Celtic Minstrel
parent 5a8ea7f0ae
commit 1284e589e1

View File

@@ -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);