diff options
Diffstat (limited to '')
| -rw-r--r-- | src/common/settings.cpp | 1 | ||||
| -rw-r--r-- | src/common/settings.h | 2 | ||||
| -rw-r--r-- | src/yuzu/configuration/config.cpp | 4 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure_general.cpp | 20 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure_general.ui | 99 |
5 files changed, 99 insertions, 27 deletions
diff --git a/src/common/settings.cpp b/src/common/settings.cpp index 3bcaa072f..6964a8273 100644 --- a/src/common/settings.cpp +++ b/src/common/settings.cpp | |||
| @@ -183,6 +183,7 @@ void RestoreGlobalState(bool is_powered_on) { | |||
| 183 | values.max_anisotropy.SetGlobal(true); | 183 | values.max_anisotropy.SetGlobal(true); |
| 184 | values.use_speed_limit.SetGlobal(true); | 184 | values.use_speed_limit.SetGlobal(true); |
| 185 | values.speed_limit.SetGlobal(true); | 185 | values.speed_limit.SetGlobal(true); |
| 186 | values.fps_cap.SetGlobal(true); | ||
| 186 | values.use_disk_shader_cache.SetGlobal(true); | 187 | values.use_disk_shader_cache.SetGlobal(true); |
| 187 | values.gpu_accuracy.SetGlobal(true); | 188 | values.gpu_accuracy.SetGlobal(true); |
| 188 | values.use_asynchronous_gpu_emulation.SetGlobal(true); | 189 | values.use_asynchronous_gpu_emulation.SetGlobal(true); |
diff --git a/src/common/settings.h b/src/common/settings.h index 42f8b4a7d..fa4aa8747 100644 --- a/src/common/settings.h +++ b/src/common/settings.h | |||
| @@ -525,7 +525,7 @@ struct Values { | |||
| 525 | Setting<NvdecEmulation> nvdec_emulation{NvdecEmulation::GPU, "nvdec_emulation"}; | 525 | Setting<NvdecEmulation> nvdec_emulation{NvdecEmulation::GPU, "nvdec_emulation"}; |
| 526 | Setting<bool> accelerate_astc{true, "accelerate_astc"}; | 526 | Setting<bool> accelerate_astc{true, "accelerate_astc"}; |
| 527 | Setting<bool> use_vsync{true, "use_vsync"}; | 527 | Setting<bool> use_vsync{true, "use_vsync"}; |
| 528 | BasicRangedSetting<u16> fps_cap{1000, 1, 1000, "fps_cap"}; | 528 | RangedSetting<u16> fps_cap{1000, 1, 1000, "fps_cap"}; |
| 529 | BasicSetting<bool> disable_fps_limit{false, "disable_fps_limit"}; | 529 | BasicSetting<bool> disable_fps_limit{false, "disable_fps_limit"}; |
| 530 | RangedSetting<ShaderBackend> shader_backend{ShaderBackend::GLASM, ShaderBackend::GLSL, | 530 | RangedSetting<ShaderBackend> shader_backend{ShaderBackend::GLASM, ShaderBackend::GLSL, |
| 531 | ShaderBackend::SPIRV, "shader_backend"}; | 531 | ShaderBackend::SPIRV, "shader_backend"}; |
diff --git a/src/yuzu/configuration/config.cpp b/src/yuzu/configuration/config.cpp index 8227d06bc..2b670ddfd 100644 --- a/src/yuzu/configuration/config.cpp +++ b/src/yuzu/configuration/config.cpp | |||
| @@ -830,6 +830,7 @@ void Config::ReadRendererValues() { | |||
| 830 | ReadGlobalSetting(Settings::values.max_anisotropy); | 830 | ReadGlobalSetting(Settings::values.max_anisotropy); |
| 831 | ReadGlobalSetting(Settings::values.use_speed_limit); | 831 | ReadGlobalSetting(Settings::values.use_speed_limit); |
| 832 | ReadGlobalSetting(Settings::values.speed_limit); | 832 | ReadGlobalSetting(Settings::values.speed_limit); |
| 833 | ReadGlobalSetting(Settings::values.fps_cap); | ||
| 833 | ReadGlobalSetting(Settings::values.use_disk_shader_cache); | 834 | ReadGlobalSetting(Settings::values.use_disk_shader_cache); |
| 834 | ReadGlobalSetting(Settings::values.gpu_accuracy); | 835 | ReadGlobalSetting(Settings::values.gpu_accuracy); |
| 835 | ReadGlobalSetting(Settings::values.use_asynchronous_gpu_emulation); | 836 | ReadGlobalSetting(Settings::values.use_asynchronous_gpu_emulation); |
| @@ -844,7 +845,6 @@ void Config::ReadRendererValues() { | |||
| 844 | ReadGlobalSetting(Settings::values.bg_blue); | 845 | ReadGlobalSetting(Settings::values.bg_blue); |
| 845 | 846 | ||
| 846 | if (global) { | 847 | if (global) { |
| 847 | ReadBasicSetting(Settings::values.fps_cap); | ||
| 848 | ReadBasicSetting(Settings::values.renderer_debug); | 848 | ReadBasicSetting(Settings::values.renderer_debug); |
| 849 | ReadBasicSetting(Settings::values.renderer_shader_feedback); | 849 | ReadBasicSetting(Settings::values.renderer_shader_feedback); |
| 850 | ReadBasicSetting(Settings::values.enable_nsight_aftermath); | 850 | ReadBasicSetting(Settings::values.enable_nsight_aftermath); |
| @@ -1382,6 +1382,7 @@ void Config::SaveRendererValues() { | |||
| 1382 | WriteGlobalSetting(Settings::values.max_anisotropy); | 1382 | WriteGlobalSetting(Settings::values.max_anisotropy); |
| 1383 | WriteGlobalSetting(Settings::values.use_speed_limit); | 1383 | WriteGlobalSetting(Settings::values.use_speed_limit); |
| 1384 | WriteGlobalSetting(Settings::values.speed_limit); | 1384 | WriteGlobalSetting(Settings::values.speed_limit); |
| 1385 | WriteGlobalSetting(Settings::values.fps_cap); | ||
| 1385 | WriteGlobalSetting(Settings::values.use_disk_shader_cache); | 1386 | WriteGlobalSetting(Settings::values.use_disk_shader_cache); |
| 1386 | WriteSetting(QString::fromStdString(Settings::values.gpu_accuracy.GetLabel()), | 1387 | WriteSetting(QString::fromStdString(Settings::values.gpu_accuracy.GetLabel()), |
| 1387 | static_cast<u32>(Settings::values.gpu_accuracy.GetValue(global)), | 1388 | static_cast<u32>(Settings::values.gpu_accuracy.GetValue(global)), |
| @@ -1405,7 +1406,6 @@ void Config::SaveRendererValues() { | |||
| 1405 | WriteGlobalSetting(Settings::values.bg_blue); | 1406 | WriteGlobalSetting(Settings::values.bg_blue); |
| 1406 | 1407 | ||
| 1407 | if (global) { | 1408 | if (global) { |
| 1408 | WriteBasicSetting(Settings::values.fps_cap); | ||
| 1409 | WriteBasicSetting(Settings::values.renderer_debug); | 1409 | WriteBasicSetting(Settings::values.renderer_debug); |
| 1410 | WriteBasicSetting(Settings::values.renderer_shader_feedback); | 1410 | WriteBasicSetting(Settings::values.renderer_shader_feedback); |
| 1411 | WriteBasicSetting(Settings::values.enable_nsight_aftermath); | 1411 | WriteBasicSetting(Settings::values.enable_nsight_aftermath); |
diff --git a/src/yuzu/configuration/configure_general.cpp b/src/yuzu/configuration/configure_general.cpp index 7af3ea97e..566879317 100644 --- a/src/yuzu/configuration/configure_general.cpp +++ b/src/yuzu/configuration/configure_general.cpp | |||
| @@ -30,6 +30,9 @@ ConfigureGeneral::ConfigureGeneral(const Core::System& system_, QWidget* parent) | |||
| 30 | 30 | ||
| 31 | connect(ui->button_reset_defaults, &QPushButton::clicked, this, | 31 | connect(ui->button_reset_defaults, &QPushButton::clicked, this, |
| 32 | &ConfigureGeneral::ResetDefaults); | 32 | &ConfigureGeneral::ResetDefaults); |
| 33 | |||
| 34 | ui->fps_cap_label->setVisible(Settings::IsConfiguringGlobal()); | ||
| 35 | ui->fps_cap_combobox->setVisible(!Settings::IsConfiguringGlobal()); | ||
| 33 | } | 36 | } |
| 34 | 37 | ||
| 35 | ConfigureGeneral::~ConfigureGeneral() = default; | 38 | ConfigureGeneral::~ConfigureGeneral() = default; |
| @@ -57,6 +60,11 @@ void ConfigureGeneral::SetConfiguration() { | |||
| 57 | } else { | 60 | } else { |
| 58 | ui->speed_limit->setEnabled(Settings::values.use_speed_limit.GetValue() && | 61 | ui->speed_limit->setEnabled(Settings::values.use_speed_limit.GetValue() && |
| 59 | use_speed_limit != ConfigurationShared::CheckState::Global); | 62 | use_speed_limit != ConfigurationShared::CheckState::Global); |
| 63 | |||
| 64 | ui->fps_cap_combobox->setCurrentIndex(Settings::values.fps_cap.UsingGlobal() ? 0 : 1); | ||
| 65 | ui->fps_cap->setEnabled(!Settings::values.fps_cap.UsingGlobal()); | ||
| 66 | ConfigurationShared::SetHighlight(ui->fps_cap_layout, | ||
| 67 | !Settings::values.fps_cap.UsingGlobal()); | ||
| 60 | } | 68 | } |
| 61 | } | 69 | } |
| 62 | 70 | ||
| @@ -106,6 +114,13 @@ void ConfigureGeneral::ApplyConfiguration() { | |||
| 106 | Qt::Checked); | 114 | Qt::Checked); |
| 107 | Settings::values.speed_limit.SetValue(ui->speed_limit->value()); | 115 | Settings::values.speed_limit.SetValue(ui->speed_limit->value()); |
| 108 | } | 116 | } |
| 117 | |||
| 118 | if (ui->fps_cap_combobox->currentIndex() == ConfigurationShared::USE_GLOBAL_INDEX) { | ||
| 119 | Settings::values.fps_cap.SetGlobal(true); | ||
| 120 | } else { | ||
| 121 | Settings::values.fps_cap.SetGlobal(false); | ||
| 122 | Settings::values.fps_cap.SetValue(ui->fps_cap->value()); | ||
| 123 | } | ||
| 109 | } | 124 | } |
| 110 | } | 125 | } |
| 111 | 126 | ||
| @@ -148,4 +163,9 @@ void ConfigureGeneral::SetupPerGameUI() { | |||
| 148 | ui->speed_limit->setEnabled(ui->toggle_speed_limit->isChecked() && | 163 | ui->speed_limit->setEnabled(ui->toggle_speed_limit->isChecked() && |
| 149 | (use_speed_limit != ConfigurationShared::CheckState::Global)); | 164 | (use_speed_limit != ConfigurationShared::CheckState::Global)); |
| 150 | }); | 165 | }); |
| 166 | |||
| 167 | connect(ui->fps_cap_combobox, qOverload<int>(&QComboBox::activated), this, [this](int index) { | ||
| 168 | ui->fps_cap->setEnabled(index == 1); | ||
| 169 | ConfigurationShared::SetHighlight(ui->fps_cap_layout, index == 1); | ||
| 170 | }); | ||
| 151 | } | 171 | } |
diff --git a/src/yuzu/configuration/configure_general.ui b/src/yuzu/configuration/configure_general.ui index f9f0e3ebf..112dc72b3 100644 --- a/src/yuzu/configuration/configure_general.ui +++ b/src/yuzu/configuration/configure_general.ui | |||
| @@ -6,8 +6,8 @@ | |||
| 6 | <rect> | 6 | <rect> |
| 7 | <x>0</x> | 7 | <x>0</x> |
| 8 | <y>0</y> | 8 | <y>0</y> |
| 9 | <width>329</width> | 9 | <width>744</width> |
| 10 | <height>407</height> | 10 | <height>568</height> |
| 11 | </rect> | 11 | </rect> |
| 12 | </property> | 12 | </property> |
| 13 | <property name="windowTitle"> | 13 | <property name="windowTitle"> |
| @@ -28,34 +28,85 @@ | |||
| 28 | <item> | 28 | <item> |
| 29 | <layout class="QVBoxLayout" name="GeneralVerticalLayout"> | 29 | <layout class="QVBoxLayout" name="GeneralVerticalLayout"> |
| 30 | <item> | 30 | <item> |
| 31 | <layout class="QHBoxLayout" name="horizontalLayout_2"> | 31 | <widget class="QWidget" name="fps_cap_layout" native="true"> |
| 32 | <item> | 32 | <layout class="QHBoxLayout" name="horizontalLayout" stretch="1,1"> |
| 33 | <widget class="QLabel" name="fps_cap_label"> | 33 | <property name="leftMargin"> |
| 34 | <number>0</number> | ||
| 35 | </property> | ||
| 36 | <property name="topMargin"> | ||
| 37 | <number>0</number> | ||
| 38 | </property> | ||
| 39 | <property name="rightMargin"> | ||
| 40 | <number>0</number> | ||
| 41 | </property> | ||
| 42 | <property name="bottomMargin"> | ||
| 43 | <number>0</number> | ||
| 44 | </property> | ||
| 45 | <item> | ||
| 46 | <layout class="QHBoxLayout" name="horizontalLayout_4"> | ||
| 47 | <item> | ||
| 48 | <widget class="QComboBox" name="fps_cap_combobox"> | ||
| 49 | <property name="currentText"> | ||
| 50 | <string>Use global framerate cap</string> | ||
| 51 | </property> | ||
| 52 | <property name="currentIndex"> | ||
| 53 | <number>0</number> | ||
| 54 | </property> | ||
| 55 | <item> | ||
| 34 | <property name="text"> | 56 | <property name="text"> |
| 35 | <string>Framerate Cap</string> | 57 | <string>Use global framerate cap</string> |
| 36 | </property> | 58 | </property> |
| 37 | <property name="toolTip"> | 59 | </item> |
| 38 | <string>Requires the use of the FPS Limiter Toggle hotkey to take effect.</string> | 60 | <item> |
| 61 | <property name="text"> | ||
| 62 | <string>Set framerate cap:</string> | ||
| 39 | </property> | 63 | </property> |
| 64 | </item> | ||
| 40 | </widget> | 65 | </widget> |
| 41 | </item> | 66 | </item> |
| 42 | <item> | 67 | <item> |
| 43 | <widget class="QSpinBox" name="fps_cap"> | 68 | <widget class="QLabel" name="fps_cap_label"> |
| 44 | <property name="suffix"> | 69 | <property name="toolTip"> |
| 45 | <string>x</string> | 70 | <string>Requires the use of the FPS Limiter Toggle hotkey to take effect.</string> |
| 46 | </property> | 71 | </property> |
| 47 | <property name="minimum"> | 72 | <property name="text"> |
| 48 | <number>1</number> | 73 | <string>Framerate Cap</string> |
| 49 | </property> | 74 | </property> |
| 50 | <property name="maximum"> | ||
| 51 | <number>1000</number> | ||
| 52 | </property> | ||
| 53 | <property name="value"> | ||
| 54 | <number>500</number> | ||
| 55 | </property> | ||
| 56 | </widget> | 75 | </widget> |
| 57 | </item> | 76 | </item> |
| 77 | <item> | ||
| 78 | <spacer name="horizontalSpacer"> | ||
| 79 | <property name="orientation"> | ||
| 80 | <enum>Qt::Horizontal</enum> | ||
| 81 | </property> | ||
| 82 | <property name="sizeHint" stdset="0"> | ||
| 83 | <size> | ||
| 84 | <width>40</width> | ||
| 85 | <height>20</height> | ||
| 86 | </size> | ||
| 87 | </property> | ||
| 88 | </spacer> | ||
| 89 | </item> | ||
| 90 | </layout> | ||
| 91 | </item> | ||
| 92 | <item> | ||
| 93 | <widget class="QSpinBox" name="fps_cap"> | ||
| 94 | <property name="suffix"> | ||
| 95 | <string>x</string> | ||
| 96 | </property> | ||
| 97 | <property name="minimum"> | ||
| 98 | <number>1</number> | ||
| 99 | </property> | ||
| 100 | <property name="maximum"> | ||
| 101 | <number>1000</number> | ||
| 102 | </property> | ||
| 103 | <property name="value"> | ||
| 104 | <number>500</number> | ||
| 105 | </property> | ||
| 106 | </widget> | ||
| 107 | </item> | ||
| 58 | </layout> | 108 | </layout> |
| 109 | </widget> | ||
| 59 | </item> | 110 | </item> |
| 60 | <item> | 111 | <item> |
| 61 | <layout class="QHBoxLayout" name="horizontalLayout_2"> | 112 | <layout class="QHBoxLayout" name="horizontalLayout_2"> |