rearrange settings config for new schema

This commit is contained in:
Jarred Wilson 2025-02-21 08:19:28 -06:00
parent cafc5fcd49
commit 8b6d0cdf7c
2 changed files with 8 additions and 7 deletions

View File

@ -34,7 +34,7 @@ namespace Config {
static bool isHDRAllowed = false;
static bool isNeo = false;
static bool isFullscreen = false;
static std::string fullscreenMode = "borderless";
static std::string fullscreenMode = "Fullscreen (Borderless)";
static bool playBGM = false;
static bool isTrophyPopupDisabled = false;
static int BGMvolume = 50;
@ -696,8 +696,6 @@ void load(const std::filesystem::path& path) {
isHDRAllowed = toml::find_or<bool>(general, "allowHDR", false);
isNeo = toml::find_or<bool>(general, "isPS4Pro", false);
isFullscreen = toml::find_or<bool>(general, "Fullscreen", false);
fullscreenMode = toml::find_or<std::string>(general, "FullscreenMode", "borderless");
playBGM = toml::find_or<bool>(general, "playBGM", false);
isTrophyPopupDisabled = toml::find_or<bool>(general, "isTrophyPopupDisabled", false);
BGMvolume = toml::find_or<int>(general, "BGMvolume", 50);
@ -742,6 +740,9 @@ void load(const std::filesystem::path& path) {
shouldDumpShaders = toml::find_or<bool>(gpu, "dumpShaders", false);
shouldPatchShaders = toml::find_or<bool>(gpu, "patchShaders", true);
vblankDivider = toml::find_or<int>(gpu, "vblankDivider", 1);
isFullscreen = toml::find_or<bool>(gpu, "Fullscreen", false);
fullscreenMode =
toml::find_or<std::string>(gpu, "FullscreenMode", "Fullscreen (Borderless)");
}
if (data.contains("Vulkan")) {
@ -846,8 +847,6 @@ void save(const std::filesystem::path& path) {
data["General"]["allowHDR"] = isHDRAllowed;
data["General"]["isPS4Pro"] = isNeo;
data["General"]["Fullscreen"] = isFullscreen;
data["General"]["FullscreenMode"] = fullscreenMode;
data["General"]["isTrophyPopupDisabled"] = isTrophyPopupDisabled;
data["General"]["playBGM"] = playBGM;
data["General"]["BGMvolume"] = BGMvolume;
@ -877,6 +876,8 @@ void save(const std::filesystem::path& path) {
data["GPU"]["dumpShaders"] = shouldDumpShaders;
data["GPU"]["patchShaders"] = shouldPatchShaders;
data["GPU"]["vblankDivider"] = vblankDivider;
data["GPU"]["Fullscreen"] = isFullscreen;
data["GPU"]["FullscreenMode"] = fullscreenMode;
data["Vulkan"]["gpuId"] = gpuId;
data["Vulkan"]["validation"] = vkValidation;
data["Vulkan"]["validation_sync"] = vkValidationSync;

View File

@ -290,8 +290,8 @@ WindowSDL::WindowSDL(s32 width_, s32 height_, Input::GameController* controller_
error = true;
}
if (!error) {
SDL_SetWindowFullscreenMode(window,
Config::getFullscreenMode() == "True" ? displayMode : NULL);
SDL_SetWindowFullscreenMode(
window, Config::getFullscreenMode() == "Fullscreen" ? displayMode : NULL);
}
SDL_SetWindowFullscreen(window, Config::getIsFullscreen());