From c0d0a2afb51a58e2a741899c482e25e0afacad7e Mon Sep 17 00:00:00 2001 From: Aki Date: Fri, 8 Mar 2024 23:13:16 +0100 Subject: Fixed a problem where switching into fullscreen mode would not set chosen resolution --- StarsEx/VidDlg.cpp | 41 ++++++++++------------------------------- 1 file changed, 10 insertions(+), 31 deletions(-) (limited to 'StarsEx') diff --git a/StarsEx/VidDlg.cpp b/StarsEx/VidDlg.cpp index 37c232c..5bed504 100644 --- a/StarsEx/VidDlg.cpp +++ b/StarsEx/VidDlg.cpp @@ -371,38 +371,17 @@ VidDlg::Apply() t = (int) pow(2.0f, selected_tex_size + 6); bool video_change = false; - - Video* video = Video::GetInstance(); - if (video) { - const VideoSettings* vs = video->GetVideoSettings(); - video_change = static_cast(full_screen->GetSelectedIndex()) != video->IsFullScreen(); - - if (vs) - bias = vs->depth_bias; - - if (video->IsFullScreen()) { - if (video->Width() != w) - video_change = true; - - if (video->Height() != h) - video_change = true; - - if (video->Depth() != d) - video_change = true; - } - else if (vs) { - w = vs->fullscreen_mode.width; - h = vs->fullscreen_mode.height; - - if (vs->fullscreen_mode.format == VideoMode::FMT_R5G6B5 || - vs->fullscreen_mode.format == VideoMode::FMT_R5G5B5) - d = 16; - else - d = 32; + if (const auto* video = Video::GetInstance()) { + if (const auto* settings = video->GetVideoSettings()) { + const bool full_screen_set = full_screen->GetSelectedIndex(); + video_change = full_screen_set == settings->IsWindowed(); + bias = settings->depth_bias; + if (full_screen_set) { + video_change = video_change || (settings->fullscreen_mode.width != w); + video_change = video_change || (settings->fullscreen_mode.height != h); + } + video_change = video_change || (settings->GetTexSize() != t); } - - if (Video::GetInstance()->TexSize() != t) - video_change = true; } FILE* f = 0; -- cgit v1.1