From 37afdbd84c51c9dd1f6742f414c617640a9958c8 Mon Sep 17 00:00:00 2001 From: David Chavez Date: Tue, 19 Jul 2022 01:28:12 +0200 Subject: [PATCH] Fix: Respect Config Window Resolution (#807) * Fix regression witn using config window res * Fix fullscreen presets --- libultraship/libultraship/Window.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/libultraship/libultraship/Window.cpp b/libultraship/libultraship/Window.cpp index b8f8957c4..9d28ecf5e 100644 --- a/libultraship/libultraship/Window.cpp +++ b/libultraship/libultraship/Window.cpp @@ -212,8 +212,8 @@ namespace Ship { pConf->setString("Window.GfxBackend", ""); pConf->setBool("Window.Fullscreen.Enabled", false); - pConf->setInt("Window.Fullscreen.Width", 640); - pConf->setInt("Window.Fullscreen.Height", 480); + pConf->setInt("Window.Fullscreen.Width", 1920); + pConf->setInt("Window.Fullscreen.Height", 1080); pConf->setString("Game.SaveName", ""); pConf->setString("Game.Main Archive", ""); @@ -233,8 +233,14 @@ namespace Ship { SetAudioPlayer(); bIsFullscreen = pConf->getBool("Window.Fullscreen.Enabled", false); - dwWidth = pConf->getInt("Window.Fullscreen.Width", bIsFullscreen ? 1920 : 640); - dwHeight = pConf->getInt("Window.Fullscreen.Height", bIsFullscreen ? 1080 : 480); + if (bIsFullscreen) { + dwWidth = pConf->getInt("Window.Fullscreen.Width", 1920); + dwHeight = pConf->getInt("Window.Fullscreen.Height", 1080); + } else { + dwWidth = pConf->getInt("Window.Width", 640); + dwHeight = pConf->getInt("Window.Height", 480); + } + dwMenubar = pConf->getBool("Window.Options", false); const std::string& gfx_backend = pConf->getString("Window.GfxBackend"); SetWindowManager(&WmApi, &RenderingApi, gfx_backend);