Fix: Respect Config Window Resolution (#807)

* Fix regression witn using config window res

* Fix fullscreen presets
This commit is contained in:
David Chavez 2022-07-19 01:28:12 +02:00 committed by GitHub
parent 9679075cba
commit 37afdbd84c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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