From 3a7a5edceaec30b0c34c492724068a8dc20eb181 Mon Sep 17 00:00:00 2001 From: lat9nq <22451773+lat9nq@users.noreply.github.com> Date: Mon, 8 May 2023 10:03:40 -0400 Subject: [PATCH] settings: Define base renderer runtime modifiable settings --- src/common/settings.h | 43 ++++++++++--------- src/yuzu/configuration/configuration_shared.h | 9 ++-- 2 files changed, 27 insertions(+), 25 deletions(-) diff --git a/src/common/settings.h b/src/common/settings.h index 1c26081c9..2879237cc 100644 --- a/src/common/settings.h +++ b/src/common/settings.h @@ -701,32 +701,33 @@ struct Values { ResolutionScalingInfo resolution_info{}; SwitchableSetting resolution_setup{linkage, ResolutionSetup::Res1X, "resolution_setup", Category::Renderer}; - SwitchableSetting scaling_filter{linkage, ScalingFilter::Bilinear, - "scaling_filter", Category::Renderer}; - SwitchableSetting fsr_sharpening_slider{ + SwitchableSetting scaling_filter{ + linkage, ScalingFilter::Bilinear, "scaling_filter", Category::Renderer}; + SwitchableSetting fsr_sharpening_slider{ linkage, 25, 0, 200, "fsr_sharpening_slider", Category::Renderer}; - SwitchableSetting anti_aliasing{linkage, AntiAliasing::None, "anti_aliasing", - Category::Renderer}; + SwitchableSetting anti_aliasing{ + linkage, AntiAliasing::None, "anti_aliasing", Category::Renderer}; // *nix platforms may have issues with the borderless windowed fullscreen mode. // Default to exclusive fullscreen on these platforms for now. - SwitchableSetting fullscreen_mode{linkage, + SwitchableSetting fullscreen_mode{linkage, #ifdef _WIN32 - FullscreenMode::Borderless, + FullscreenMode::Borderless, #else - FullscreenMode::Exclusive, + FullscreenMode::Exclusive, #endif - FullscreenMode::Borderless, - FullscreenMode::Exclusive, - "fullscreen_mode", - Category::Renderer}; - SwitchableSetting aspect_ratio{linkage, 0, 0, 4, "aspect_ratio", Category::Renderer}; + FullscreenMode::Borderless, + FullscreenMode::Exclusive, + "fullscreen_mode", + Category::Renderer}; + SwitchableSetting aspect_ratio{ + linkage, 0, 0, 4, "aspect_ratio", Category::Renderer}; SwitchableSetting max_anisotropy{ linkage, AnisotropyMode::Automatic, AnisotropyMode::Automatic, AnisotropyMode::X16, "max_anisotropy", Category::RendererAdvanced}; - SwitchableSetting use_speed_limit{linkage, true, "use_speed_limit", - Category::Renderer}; - SwitchableSetting speed_limit{linkage, 100, 0, - 9999, "speed_limit", Category::Renderer}; + SwitchableSetting use_speed_limit{linkage, true, "use_speed_limit", + Category::Renderer}; + SwitchableSetting speed_limit{ + linkage, 100, 0, 9999, "speed_limit", Category::Renderer}; SwitchableSetting use_disk_shader_cache{linkage, true, "use_disk_shader_cache", Category::Renderer}; SwitchableSetting gpu_accuracy{ @@ -742,7 +743,7 @@ struct Values { AstcDecodeMode::CPUAsynchronous, "accelerate_astc", Category::Renderer}; - Setting vsync_mode{ + Setting vsync_mode{ linkage, VSyncMode::FIFO, VSyncMode::Immediate, VSyncMode::FIFORelaxed, "use_vsync", Category::Renderer}; SwitchableSetting use_reactive_flushing{linkage, true, "use_reactive_flushing", @@ -769,9 +770,9 @@ struct Values { SwitchableSetting barrier_feedback_loops{linkage, true, "barrier_feedback_loops", Category::RendererAdvanced}; - SwitchableSetting bg_red{linkage, 0, "bg_red", Category::Renderer}; - SwitchableSetting bg_green{linkage, 0, "bg_green", Category::Renderer}; - SwitchableSetting bg_blue{linkage, 0, "bg_blue", Category::Renderer}; + SwitchableSetting bg_red{linkage, 0, "bg_red", Category::Renderer}; + SwitchableSetting bg_green{linkage, 0, "bg_green", Category::Renderer}; + SwitchableSetting bg_blue{linkage, 0, "bg_blue", Category::Renderer}; // System SwitchableSetting rng_seed_enabled{linkage, false, "rng_seed_enabled", Category::System}; diff --git a/src/yuzu/configuration/configuration_shared.h b/src/yuzu/configuration/configuration_shared.h index d0fe6ea38..d70828935 100644 --- a/src/yuzu/configuration/configuration_shared.h +++ b/src/yuzu/configuration/configuration_shared.h @@ -92,10 +92,11 @@ void SetPerGameSetting(QComboBox* combobox, void SetHighlight(QWidget* widget, bool highlighted); // Sets up a QCheckBox like a tristate one, given a Setting -template -void SetColoredTristate(QCheckBox* checkbox, - const Settings::SwitchableSetting& setting, - CheckState& tracker) { +template +void SetColoredTristate( + QCheckBox* checkbox, + const Settings::SwitchableSetting& setting, + CheckState& tracker) { if (setting.UsingGlobal()) { tracker = CheckState::Global; } else {