From 0c3fe272b6f9640134b4897b0ec1970bf2864b0d Mon Sep 17 00:00:00 2001 From: GPUCode <47210458+GPUCode@users.noreply.github.com> Date: Tue, 21 Mar 2023 23:12:13 +0200 Subject: [PATCH] citra_qt: Add enhancement options to per-game (#6308) Co-authored-by: Tobias --- src/citra_qt/configuration/config.cpp | 20 +- .../configuration/configuration_shared.cpp | 10 + .../configuration/configuration_shared.h | 5 + .../configuration/configure_enhancements.cpp | 119 +++-- .../configuration/configure_enhancements.h | 12 + .../configuration/configure_enhancements.ui | 430 +++++++++++------- .../configuration/configure_per_game.cpp | 5 + .../configuration/configure_per_game.h | 2 + src/common/settings.cpp | 27 +- src/common/settings.h | 49 +- 10 files changed, 421 insertions(+), 258 deletions(-) diff --git a/src/citra_qt/configuration/config.cpp b/src/citra_qt/configuration/config.cpp index 6483a2981..d7ae2b377 100644 --- a/src/citra_qt/configuration/config.cpp +++ b/src/citra_qt/configuration/config.cpp @@ -256,7 +256,6 @@ void Config::ReadValues() { ReadDebuggingValues(); ReadWebServiceValues(); ReadVideoDumpingValues(); - ReadUtilityValues(); } ReadUIValues(); @@ -265,6 +264,7 @@ void Config::ReadValues() { ReadLayoutValues(); ReadAudioValues(); ReadSystemValues(); + ReadUtilityValues(); } void Config::ReadAudioValues() { @@ -436,9 +436,9 @@ void Config::ReadControlValues() { void Config::ReadUtilityValues() { qt_config->beginGroup(QStringLiteral("Utility")); - ReadBasicSetting(Settings::values.dump_textures); - ReadBasicSetting(Settings::values.custom_textures); - ReadBasicSetting(Settings::values.preload_textures); + ReadGlobalSetting(Settings::values.dump_textures); + ReadGlobalSetting(Settings::values.custom_textures); + ReadGlobalSetting(Settings::values.preload_textures); qt_config->endGroup(); } @@ -497,9 +497,9 @@ void Config::ReadLayoutValues() { ReadGlobalSetting(Settings::values.render_3d); ReadGlobalSetting(Settings::values.factor_3d); + ReadGlobalSetting(Settings::values.filter_mode); ReadGlobalSetting(Settings::values.pp_shader_name); ReadGlobalSetting(Settings::values.anaglyph_shader_name); - ReadGlobalSetting(Settings::values.filter_mode); ReadGlobalSetting(Settings::values.layout_option); ReadGlobalSetting(Settings::values.swap_screen); ReadGlobalSetting(Settings::values.upright_screen); @@ -830,7 +830,6 @@ void Config::SaveValues() { SaveDebuggingValues(); SaveWebServiceValues(); SaveVideoDumpingValues(); - SaveUtilityValues(); } SaveUIValues(); @@ -839,6 +838,7 @@ void Config::SaveValues() { SaveLayoutValues(); SaveAudioValues(); SaveSystemValues(); + SaveUtilityValues(); qt_config->sync(); } @@ -951,9 +951,9 @@ void Config::SaveControlValues() { void Config::SaveUtilityValues() { qt_config->beginGroup(QStringLiteral("Utility")); - WriteBasicSetting(Settings::values.dump_textures); - WriteBasicSetting(Settings::values.custom_textures); - WriteBasicSetting(Settings::values.preload_textures); + WriteGlobalSetting(Settings::values.dump_textures); + WriteGlobalSetting(Settings::values.custom_textures); + WriteGlobalSetting(Settings::values.preload_textures); qt_config->endGroup(); } @@ -1007,9 +1007,9 @@ void Config::SaveLayoutValues() { WriteGlobalSetting(Settings::values.render_3d); WriteGlobalSetting(Settings::values.factor_3d); + WriteGlobalSetting(Settings::values.filter_mode); WriteGlobalSetting(Settings::values.pp_shader_name); WriteGlobalSetting(Settings::values.anaglyph_shader_name); - WriteGlobalSetting(Settings::values.filter_mode); WriteGlobalSetting(Settings::values.layout_option); WriteGlobalSetting(Settings::values.swap_screen); WriteGlobalSetting(Settings::values.upright_screen); diff --git a/src/citra_qt/configuration/configuration_shared.cpp b/src/citra_qt/configuration/configuration_shared.cpp index e5039256a..681a7d781 100644 --- a/src/citra_qt/configuration/configuration_shared.cpp +++ b/src/citra_qt/configuration/configuration_shared.cpp @@ -33,6 +33,16 @@ void ConfigurationShared::SetPerGameSetting(QCheckBox* checkbox, } } +template <> +void ConfigurationShared::SetPerGameSetting( + QComboBox* combobox, const Settings::SwitchableSetting* setting) { + const int index = + static_cast(combobox->findText(QString::fromStdString(setting->GetValue()))); + combobox->setCurrentIndex(setting->UsingGlobal() + ? ConfigurationShared::USE_GLOBAL_INDEX + : index + ConfigurationShared::USE_GLOBAL_OFFSET); +} + void ConfigurationShared::SetHighlight(QWidget* widget, bool highlighted) { if (highlighted) { widget->setStyleSheet(QStringLiteral("QWidget#%1 { background-color:rgba(0,203,255,0.5) }") diff --git a/src/citra_qt/configuration/configuration_shared.h b/src/citra_qt/configuration/configuration_shared.h index 63a77edd3..74bd17d2d 100644 --- a/src/citra_qt/configuration/configuration_shared.h +++ b/src/citra_qt/configuration/configuration_shared.h @@ -78,6 +78,11 @@ void SetPerGameSetting(QComboBox* combobox, ConfigurationShared::USE_GLOBAL_OFFSET); } +/// Specialization for string settings +template <> +void SetPerGameSetting(QComboBox* combobox, + const Settings::SwitchableSetting* setting); + /// Given a Qt widget sets the background color to indicate whether the setting /// is per-game overriden (highlighted) or global (non-highlighted) void SetHighlight(QWidget* widget, bool highlighted); diff --git a/src/citra_qt/configuration/configure_enhancements.cpp b/src/citra_qt/configuration/configure_enhancements.cpp index ee27a89ce..88e5a62ea 100644 --- a/src/citra_qt/configuration/configure_enhancements.cpp +++ b/src/citra_qt/configuration/configure_enhancements.cpp @@ -3,9 +3,9 @@ // Refer to the license.txt file included. #include +#include "citra_qt/configuration/configuration_shared.h" #include "citra_qt/configuration/configure_enhancements.h" #include "common/settings.h" -#include "core/core.h" #include "ui_configure_enhancements.h" #include "video_core/renderer_opengl/post_processing_opengl.h" #include "video_core/renderer_opengl/texture_filters/texture_filterer.h" @@ -17,9 +17,10 @@ ConfigureEnhancements::ConfigureEnhancements(QWidget* parent) for (const auto& filter : OpenGL::TextureFilterer::GetFilterNames()) ui->texture_filter_combobox->addItem(QString::fromStdString(filter.data())); + SetupPerGameUI(); SetConfiguration(); - ui->layoutBox->setEnabled(!Settings::values.custom_layout); + ui->layout_group->setEnabled(!Settings::values.custom_layout); ui->resolution_factor_combobox->setEnabled(Settings::values.use_hw_renderer.GetValue()); @@ -49,8 +50,33 @@ ConfigureEnhancements::ConfigureEnhancements(QWidget* parent) }); } +ConfigureEnhancements::~ConfigureEnhancements() = default; + void ConfigureEnhancements::SetConfiguration() { - ui->resolution_factor_combobox->setCurrentIndex(Settings::values.resolution_factor.GetValue()); + + if (!Settings::IsConfiguringGlobal()) { + ConfigurationShared::SetPerGameSetting(ui->resolution_factor_combobox, + &Settings::values.resolution_factor); + ConfigurationShared::SetPerGameSetting(ui->texture_filter_combobox, + &Settings::values.texture_filter_name); + ConfigurationShared::SetHighlight(ui->widget_texture_filter, + !Settings::values.texture_filter_name.UsingGlobal()); + ConfigurationShared::SetPerGameSetting(ui->layout_combobox, + &Settings::values.layout_option); + } else { + ui->resolution_factor_combobox->setCurrentIndex( + Settings::values.resolution_factor.GetValue()); + ui->layout_combobox->setCurrentIndex( + static_cast(Settings::values.layout_option.GetValue())); + int tex_filter_idx = ui->texture_filter_combobox->findText( + QString::fromStdString(Settings::values.texture_filter_name.GetValue())); + if (tex_filter_idx == -1) { + ui->texture_filter_combobox->setCurrentIndex(0); + } else { + ui->texture_filter_combobox->setCurrentIndex(tex_filter_idx); + } + } + ui->render_3d_combobox->setCurrentIndex( static_cast(Settings::values.render_3d.GetValue())); ui->factor_3d->setValue(Settings::values.factor_3d.GetValue()); @@ -58,17 +84,8 @@ void ConfigureEnhancements::SetConfiguration() { static_cast(Settings::values.mono_render_option.GetValue())); updateShaders(Settings::values.render_3d.GetValue()); ui->toggle_linear_filter->setChecked(Settings::values.filter_mode.GetValue()); - int tex_filter_idx = ui->texture_filter_combobox->findText( - QString::fromStdString(Settings::values.texture_filter_name.GetValue())); - if (tex_filter_idx == -1) { - ui->texture_filter_combobox->setCurrentIndex(0); - } else { - ui->texture_filter_combobox->setCurrentIndex(tex_filter_idx); - } - ui->layout_combobox->setCurrentIndex( - static_cast(Settings::values.layout_option.GetValue())); - ui->swap_screen->setChecked(Settings::values.swap_screen.GetValue()); - ui->upright_screen->setChecked(Settings::values.upright_screen.GetValue()); + ui->toggle_swap_screen->setChecked(Settings::values.swap_screen.GetValue()); + ui->toggle_upright_screen->setChecked(Settings::values.upright_screen.GetValue()); ui->large_screen_proportion->setValue(Settings::values.large_screen_proportion.GetValue()); ui->toggle_dump_textures->setChecked(Settings::values.dump_textures.GetValue()); ui->toggle_custom_textures->setChecked(Settings::values.custom_textures.GetValue()); @@ -118,8 +135,8 @@ void ConfigureEnhancements::RetranslateUI() { } void ConfigureEnhancements::ApplyConfiguration() { - Settings::values.resolution_factor = - static_cast(ui->resolution_factor_combobox->currentIndex()); + ConfigurationShared::ApplyPerGameSetting(&Settings::values.resolution_factor, + ui->resolution_factor_combobox); Settings::values.render_3d = static_cast(ui->render_3d_combobox->currentIndex()); Settings::values.factor_3d = ui->factor_3d->value(); @@ -132,19 +149,69 @@ void ConfigureEnhancements::ApplyConfiguration() { Settings::values.pp_shader_name = ui->shader_combobox->itemText(ui->shader_combobox->currentIndex()).toStdString(); } - Settings::values.filter_mode = ui->toggle_linear_filter->isChecked(); - Settings::values.texture_filter_name = ui->texture_filter_combobox->currentText().toStdString(); - Settings::values.layout_option = - static_cast(ui->layout_combobox->currentIndex()); - Settings::values.swap_screen = ui->swap_screen->isChecked(); - Settings::values.upright_screen = ui->upright_screen->isChecked(); Settings::values.large_screen_proportion = ui->large_screen_proportion->value(); - Settings::values.dump_textures = ui->toggle_dump_textures->isChecked(); - Settings::values.custom_textures = ui->toggle_custom_textures->isChecked(); - Settings::values.preload_textures = ui->toggle_preload_textures->isChecked(); + + ConfigurationShared::ApplyPerGameSetting(&Settings::values.filter_mode, + ui->toggle_linear_filter, linear_filter); + ConfigurationShared::ApplyPerGameSetting( + &Settings::values.texture_filter_name, ui->texture_filter_combobox, + [this](int index) { return ui->texture_filter_combobox->itemText(index).toStdString(); }); + ConfigurationShared::ApplyPerGameSetting(&Settings::values.layout_option, ui->layout_combobox); + ConfigurationShared::ApplyPerGameSetting(&Settings::values.swap_screen, ui->toggle_swap_screen, + swap_screen); + ConfigurationShared::ApplyPerGameSetting(&Settings::values.upright_screen, + ui->toggle_upright_screen, upright_screen); + ConfigurationShared::ApplyPerGameSetting(&Settings::values.dump_textures, + ui->toggle_dump_textures, dump_textures); + ConfigurationShared::ApplyPerGameSetting(&Settings::values.custom_textures, + ui->toggle_custom_textures, custom_textures); + ConfigurationShared::ApplyPerGameSetting(&Settings::values.preload_textures, + ui->toggle_preload_textures, preload_textures); + Settings::values.bg_red = static_cast(bg_color.redF()); Settings::values.bg_green = static_cast(bg_color.greenF()); Settings::values.bg_blue = static_cast(bg_color.blueF()); } -ConfigureEnhancements::~ConfigureEnhancements() {} +void ConfigureEnhancements::SetupPerGameUI() { + // Block the global settings if a game is currently running that overrides them + if (Settings::IsConfiguringGlobal()) { + ui->widget_resolution->setEnabled(Settings::values.resolution_factor.UsingGlobal()); + ui->widget_texture_filter->setEnabled(Settings::values.texture_filter_name.UsingGlobal()); + ui->toggle_linear_filter->setEnabled(Settings::values.filter_mode.UsingGlobal()); + ui->toggle_swap_screen->setEnabled(Settings::values.swap_screen.UsingGlobal()); + ui->toggle_upright_screen->setEnabled(Settings::values.upright_screen.UsingGlobal()); + ui->toggle_dump_textures->setEnabled(Settings::values.dump_textures.UsingGlobal()); + ui->toggle_custom_textures->setEnabled(Settings::values.custom_textures.UsingGlobal()); + ui->toggle_preload_textures->setEnabled(Settings::values.preload_textures.UsingGlobal()); + return; + } + + ui->stereo_group->setVisible(false); + ui->widget_shader->setVisible(false); + ui->bg_color_group->setVisible(false); + + ConfigurationShared::SetColoredTristate(ui->toggle_linear_filter, Settings::values.filter_mode, + linear_filter); + ConfigurationShared::SetColoredTristate(ui->toggle_swap_screen, Settings::values.swap_screen, + swap_screen); + ConfigurationShared::SetColoredTristate(ui->toggle_upright_screen, + Settings::values.upright_screen, upright_screen); + ConfigurationShared::SetColoredTristate(ui->toggle_dump_textures, + Settings::values.dump_textures, dump_textures); + ConfigurationShared::SetColoredTristate(ui->toggle_custom_textures, + Settings::values.custom_textures, custom_textures); + ConfigurationShared::SetColoredTristate(ui->toggle_preload_textures, + Settings::values.preload_textures, preload_textures); + + ConfigurationShared::SetColoredComboBox( + ui->resolution_factor_combobox, ui->widget_resolution, + static_cast(Settings::values.resolution_factor.GetValue(true))); + + ConfigurationShared::SetColoredComboBox(ui->texture_filter_combobox, ui->widget_texture_filter, + 0); + + ConfigurationShared::SetColoredComboBox( + ui->layout_combobox, ui->widget_layout, + static_cast(Settings::values.layout_option.GetValue(true))); +} diff --git a/src/citra_qt/configuration/configure_enhancements.h b/src/citra_qt/configuration/configure_enhancements.h index 59f9ba1ad..2bd5d644a 100644 --- a/src/citra_qt/configuration/configure_enhancements.h +++ b/src/citra_qt/configuration/configure_enhancements.h @@ -12,6 +12,10 @@ namespace Settings { enum class StereoRenderOption : u32; } +namespace ConfigurationShared { +enum class CheckState; +} + namespace Ui { class ConfigureEnhancements; } @@ -27,10 +31,18 @@ public: void RetranslateUI(); void SetConfiguration(); + void SetupPerGameUI(); + private: void updateShaders(Settings::StereoRenderOption stereo_option); void updateTextureFilter(int index); std::unique_ptr ui; + ConfigurationShared::CheckState linear_filter; + ConfigurationShared::CheckState swap_screen; + ConfigurationShared::CheckState upright_screen; + ConfigurationShared::CheckState dump_textures; + ConfigurationShared::CheckState custom_textures; + ConfigurationShared::CheckState preload_textures; QColor bg_color; }; diff --git a/src/citra_qt/configuration/configure_enhancements.ui b/src/citra_qt/configuration/configure_enhancements.ui index d8b31af86..be9aca92e 100644 --- a/src/citra_qt/configuration/configure_enhancements.ui +++ b/src/citra_qt/configuration/configure_enhancements.ui @@ -7,7 +7,7 @@ 0 0 400 - 634 + 657 @@ -27,74 +27,88 @@ - - - - - Internal Resolution - - - - - - + + + + 0 + + + 0 + + + 0 + + + 0 + + + - Auto (Window Size) + Internal Resolution - - - - Native (400x240) - - - - - 2x Native (800x480) - - - - - 3x Native (1200x720) - - - - - 4x Native (1600x960) - - - - - 5x Native (2000x1200) - - - - - 6x Native (2400x1440) - - - - - 7x Native (2800x1680) - - - - - 8x Native (3200x1920) - - - - - 9x Native (3600x2160) - - - - - 10x Native (4000x2400) - - - - - + + + + + + + Auto (Window Size) + + + + + Native (400x240) + + + + + 2x Native (800x480) + + + + + 3x Native (1200x720) + + + + + 4x Native (1600x960) + + + + + 5x Native (2000x1200) + + + + + 6x Native (2400x1440) + + + + + 7x Native (2800x1680) + + + + + 8x Native (3200x1920) + + + + + 9x Native (3600x2160) + + + + + 10x Native (4000x2400) + + + + + + @@ -104,38 +118,66 @@ - - - - - Post-Processing Shader - - - - - - - + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + Post-Processing Shader + + + + + + + + - - - - - Texture Filter - - - - - - - + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + Texture Filter + + + + + + + + - + Stereoscopy @@ -236,109 +278,151 @@ - + Layout - - - - - Screen Layout: - - - - - - + + + + 0 + + + 0 + + + 0 + + + 0 + + + - Default + Screen Layout: - - - - Single Screen - - - - - Large Screen - - - - - Side by Side - - - - - Separate Windows - - - - - + + + + + + + Default + + + + + Single Screen + + + + + Large Screen + + + + + Side by Side + + + + + Separate Windows + + + + + + - + Swap Screens - + Rotate Screens Upright - - - - - Large Screen Proportion: - - - - - - - 1 - - - 16 - - - 4 - - - + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + Large Screen Proportion: + + + + + + + 1.000000000000000 + + + 16.000000000000000 + + + 4.000000000000000 + + + + - - - - - Background Color: - - - - - - - - 40 - 16777215 - - - - - + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + Background Color: + + + + + + + + 40 + 16777215 + + + + + + @@ -406,8 +490,8 @@ factor_3d mono_rendering_eye layout_combobox - swap_screen - upright_screen + toggle_swap_screen + toggle_upright_screen large_screen_proportion bg_button toggle_custom_textures diff --git a/src/citra_qt/configuration/configure_per_game.cpp b/src/citra_qt/configuration/configure_per_game.cpp index 506b597ec..e41fa462a 100644 --- a/src/citra_qt/configuration/configure_per_game.cpp +++ b/src/citra_qt/configuration/configure_per_game.cpp @@ -10,6 +10,7 @@ #include "citra_qt/configuration/config.h" #include "citra_qt/configuration/configure_audio.h" #include "citra_qt/configuration/configure_debug.h" +#include "citra_qt/configuration/configure_enhancements.h" #include "citra_qt/configuration/configure_general.h" #include "citra_qt/configuration/configure_graphics.h" #include "citra_qt/configuration/configure_per_game.h" @@ -30,6 +31,7 @@ ConfigurePerGame::ConfigurePerGame(QWidget* parent, u64 title_id_, const QString audio_tab = std::make_unique(this); general_tab = std::make_unique(this); + enhancements_tab = std::make_unique(this); graphics_tab = std::make_unique(this); system_tab = std::make_unique(this); debug_tab = std::make_unique(this); @@ -38,6 +40,7 @@ ConfigurePerGame::ConfigurePerGame(QWidget* parent, u64 title_id_, const QString ui->tabWidget->addTab(general_tab.get(), tr("General")); ui->tabWidget->addTab(system_tab.get(), tr("System")); + ui->tabWidget->addTab(enhancements_tab.get(), tr("Enhancements")); ui->tabWidget->addTab(graphics_tab.get(), tr("Graphics")); ui->tabWidget->addTab(audio_tab.get(), tr("Audio")); ui->tabWidget->addTab(debug_tab.get(), tr("Debug")); @@ -81,10 +84,12 @@ void ConfigurePerGame::ResetDefaults() { void ConfigurePerGame::ApplyConfiguration() { general_tab->ApplyConfiguration(); system_tab->ApplyConfiguration(); + enhancements_tab->ApplyConfiguration(); graphics_tab->ApplyConfiguration(); audio_tab->ApplyConfiguration(); debug_tab->ApplyConfiguration(); + Settings::Apply(); Settings::LogSettings(); game_config->Save(); diff --git a/src/citra_qt/configuration/configure_per_game.h b/src/citra_qt/configuration/configure_per_game.h index 87addd6e7..d84b42c28 100644 --- a/src/citra_qt/configuration/configure_per_game.h +++ b/src/citra_qt/configuration/configure_per_game.h @@ -15,6 +15,7 @@ class System; class ConfigureAudio; class ConfigureGeneral; +class ConfigureEnhancements; class ConfigureGraphics; class ConfigureSystem; class ConfigureDebug; @@ -65,6 +66,7 @@ private: std::unique_ptr audio_tab; std::unique_ptr general_tab; + std::unique_ptr enhancements_tab; std::unique_ptr graphics_tab; std::unique_ptr system_tab; std::unique_ptr debug_tab; diff --git a/src/common/settings.cpp b/src/common/settings.cpp index 4f485f582..a94c89218 100644 --- a/src/common/settings.cpp +++ b/src/common/settings.cpp @@ -20,6 +20,17 @@ namespace Settings { +std::string_view GetAudioEmulationName(AudioEmulation emulation) { + switch (emulation) { + case AudioEmulation::HLE: + return "HLE"; + case AudioEmulation::LLE: + return "LLE"; + case AudioEmulation::LLEMultithreaded: + return "LLE Multithreaded"; + } +}; + Values values = {}; static bool configuring_global = true; @@ -86,17 +97,6 @@ void LogSettings() { LOG_INFO(Config, "{}: {}", name, value); }; - const auto to_string = [](AudioEmulation emulation) -> std::string_view { - switch (emulation) { - case AudioEmulation::HLE: - return "HLE"; - case AudioEmulation::LLE: - return "LLE"; - case AudioEmulation::LLEMultithreaded: - return "LLE Multithreaded"; - } - }; - LOG_INFO(Config, "Citra Configuration:"); log_setting("Core_UseCpuJit", values.use_cpu_jit.GetValue()); log_setting("Core_CPUClockPercentage", values.cpu_clock_percentage.GetValue()); @@ -125,7 +125,7 @@ void LogSettings() { log_setting("Utility_DumpTextures", values.dump_textures.GetValue()); log_setting("Utility_CustomTextures", values.custom_textures.GetValue()); log_setting("Utility_UseDiskShaderCache", values.use_disk_shader_cache.GetValue()); - log_setting("Audio_Emulation", to_string(values.audio_emulation.GetValue())); + log_setting("Audio_Emulation", GetAudioEmulationName(values.audio_emulation.GetValue())); log_setting("Audio_OutputEngine", values.sink_id.GetValue()); log_setting("Audio_EnableAudioStretching", values.enable_audio_stretching.GetValue()); log_setting("Audio_OutputDevice", values.audio_device_id.GetValue()); @@ -207,6 +207,9 @@ void RestoreGlobalState(bool is_powered_on) { values.filter_mode.SetGlobal(true); values.pp_shader_name.SetGlobal(true); values.anaglyph_shader_name.SetGlobal(true); + values.dump_textures.SetGlobal(true); + values.custom_textures.SetGlobal(true); + values.preload_textures.SetGlobal(true); } void LoadProfile(int index) { diff --git a/src/common/settings.h b/src/common/settings.h index ae493b79f..354dbafce 100644 --- a/src/common/settings.h +++ b/src/common/settings.h @@ -54,9 +54,16 @@ enum class StereoRenderOption : u32 { // Which eye to render when 3d is off. 800px wide mode could be added here in the future, when // implemented -enum class MonoRenderOption : u32 { LeftEye = 0, RightEye = 1 }; +enum class MonoRenderOption : u32 { + LeftEye = 0, + RightEye = 1, +}; -enum class AudioEmulation : u32 { HLE = 0, LLE = 1, LLEMultithreaded = 2 }; +enum class AudioEmulation : u32 { + HLE = 0, + LLE = 1, + LLEMultithreaded = 2, +}; namespace NativeButton { @@ -361,38 +368,6 @@ protected: Type custom{}; ///< The custom value of the setting }; -/** - * The InputSetting class allows for getting a reference to either the global or custom members. - * This is required as we cannot easily modify the values of user-defined types within containers - * using the SetValue() member function found in the Setting class. The primary purpose of this - * class is to store an array of 10 PlayerInput structs for both the global and custom setting and - * allows for easily accessing and modifying both settings. - */ -template -class InputSetting final { -public: - InputSetting() = default; - explicit InputSetting(Type val) : Setting(val) {} - ~InputSetting() = default; - void SetGlobal(bool to_global) { - use_global = to_global; - } - [[nodiscard]] bool UsingGlobal() const { - return use_global; - } - [[nodiscard]] Type& GetValue(bool need_global = false) { - if (use_global || need_global) { - return global; - } - return custom; - } - -private: - bool use_global{true}; ///< The setting's global state - Type global{}; ///< The setting - Type custom{}; ///< The custom setting value -}; - struct InputProfile { std::string name; std::array buttons; @@ -485,9 +460,9 @@ struct Values { SwitchableSetting pp_shader_name{"none (builtin)", "pp_shader_name"}; SwitchableSetting anaglyph_shader_name{"dubois (builtin)", "anaglyph_shader_name"}; - Setting dump_textures{false, "dump_textures"}; - Setting custom_textures{false, "custom_textures"}; - Setting preload_textures{false, "preload_textures"}; + SwitchableSetting dump_textures{false, "dump_textures"}; + SwitchableSetting custom_textures{false, "custom_textures"}; + SwitchableSetting preload_textures{false, "preload_textures"}; // Audio bool audio_muted;