diff options
author | Aki <please@ignore.pl> | 2024-03-08 23:13:16 +0100 |
---|---|---|
committer | Aki <please@ignore.pl> | 2024-03-08 23:13:16 +0100 |
commit | c0d0a2afb51a58e2a741899c482e25e0afacad7e (patch) | |
tree | b0672fcf8557ad36552999d77524b4fc95d30391 /StarsEx | |
parent | 08d801de7cca4fff2db14796f74ba9b2dd735a81 (diff) | |
download | starshatter-c0d0a2afb51a58e2a741899c482e25e0afacad7e.zip starshatter-c0d0a2afb51a58e2a741899c482e25e0afacad7e.tar.gz starshatter-c0d0a2afb51a58e2a741899c482e25e0afacad7e.tar.bz2 |
Fixed a problem where switching into fullscreen mode would not set chosen resolution
Diffstat (limited to 'StarsEx')
-rw-r--r-- | StarsEx/VidDlg.cpp | 41 |
1 files changed, 10 insertions, 31 deletions
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<bool>(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; |