diff options
| author | 2021-07-08 23:21:08 +0200 | |
|---|---|---|
| committer | 2021-07-09 02:08:08 +0200 | |
| commit | fd09be5496b742b61c0ee1babf0012d2dafa196d (patch) | |
| tree | ab1ec6ed83a513573d1501675714aec1a69d374e | |
| parent | Merge pull request #6539 from lat9nq/default-setting (diff) | |
| download | yuzu-fd09be5496b742b61c0ee1babf0012d2dafa196d.tar.gz yuzu-fd09be5496b742b61c0ee1babf0012d2dafa196d.tar.xz yuzu-fd09be5496b742b61c0ee1babf0012d2dafa196d.zip | |
Settings: Eliminate ASYNC & MULTICORE Toggles and add GPU Accuracy Toggle.
| -rw-r--r-- | dist/qt_themes/default/style.qss | 20 | ||||
| -rw-r--r-- | dist/qt_themes/qdarkstyle/style.qss | 21 | ||||
| -rw-r--r-- | dist/qt_themes/qdarkstyle_midnight_blue/style.qss | 21 | ||||
| -rw-r--r-- | src/yuzu/main.cpp | 80 | ||||
| -rw-r--r-- | src/yuzu/main.h | 4 |
5 files changed, 107 insertions, 39 deletions
diff --git a/dist/qt_themes/default/style.qss b/dist/qt_themes/default/style.qss index cee219374..9915a40ba 100644 --- a/dist/qt_themes/default/style.qss +++ b/dist/qt_themes/default/style.qss | |||
| @@ -38,6 +38,26 @@ QPushButton#RendererStatusBarButton:!checked { | |||
| 38 | color: #0066ff; | 38 | color: #0066ff; |
| 39 | } | 39 | } |
| 40 | 40 | ||
| 41 | QPushButton#GPUStatusBarButton { | ||
| 42 | color: #656565; | ||
| 43 | border: 1px solid transparent; | ||
| 44 | background-color: transparent; | ||
| 45 | padding: 0px 3px 0px 3px; | ||
| 46 | text-align: center; | ||
| 47 | } | ||
| 48 | |||
| 49 | QPushButton#GPUStatusBarButton:hover { | ||
| 50 | border: 1px solid #76797C; | ||
| 51 | } | ||
| 52 | |||
| 53 | QPushButton#GPUStatusBarButton:checked { | ||
| 54 | color: #ff8040; | ||
| 55 | } | ||
| 56 | |||
| 57 | QPushButton#GPUStatusBarButton:!checked { | ||
| 58 | color: #40dd40; | ||
| 59 | } | ||
| 60 | |||
| 41 | QPushButton#buttonRefreshDevices { | 61 | QPushButton#buttonRefreshDevices { |
| 42 | min-width: 21px; | 62 | min-width: 21px; |
| 43 | min-height: 21px; | 63 | min-height: 21px; |
diff --git a/dist/qt_themes/qdarkstyle/style.qss b/dist/qt_themes/qdarkstyle/style.qss index 3d0ccbb9e..dac2dba86 100644 --- a/dist/qt_themes/qdarkstyle/style.qss +++ b/dist/qt_themes/qdarkstyle/style.qss | |||
| @@ -1283,6 +1283,27 @@ QPushButton#RendererStatusBarButton:!checked { | |||
| 1283 | color: #00ccdd; | 1283 | color: #00ccdd; |
| 1284 | } | 1284 | } |
| 1285 | 1285 | ||
| 1286 | QPushButton#GPUStatusBarButton { | ||
| 1287 | min-width: 0px; | ||
| 1288 | color: #656565; | ||
| 1289 | border: 1px solid transparent; | ||
| 1290 | background-color: transparent; | ||
| 1291 | padding: 0px 3px 0px 3px; | ||
| 1292 | text-align: center; | ||
| 1293 | } | ||
| 1294 | |||
| 1295 | QPushButton#GPUStatusBarButton:hover { | ||
| 1296 | border: 1px solid #76797C; | ||
| 1297 | } | ||
| 1298 | |||
| 1299 | QPushButton#GPUStatusBarButton:checked { | ||
| 1300 | color: #ff8040; | ||
| 1301 | } | ||
| 1302 | |||
| 1303 | QPushButton#GPUStatusBarButton:!checked { | ||
| 1304 | color: #40dd40; | ||
| 1305 | } | ||
| 1306 | |||
| 1286 | QPushButton#buttonRefreshDevices { | 1307 | QPushButton#buttonRefreshDevices { |
| 1287 | min-width: 23px; | 1308 | min-width: 23px; |
| 1288 | min-height: 23px; | 1309 | min-height: 23px; |
diff --git a/dist/qt_themes/qdarkstyle_midnight_blue/style.qss b/dist/qt_themes/qdarkstyle_midnight_blue/style.qss index 51bec2fd7..032d05ec6 100644 --- a/dist/qt_themes/qdarkstyle_midnight_blue/style.qss +++ b/dist/qt_themes/qdarkstyle_midnight_blue/style.qss | |||
| @@ -2186,6 +2186,27 @@ QPushButton#RendererStatusBarButton:!checked { | |||
| 2186 | color: #00ccdd; | 2186 | color: #00ccdd; |
| 2187 | } | 2187 | } |
| 2188 | 2188 | ||
| 2189 | QPushButton#GPUStatusBarButton { | ||
| 2190 | min-width: 0px; | ||
| 2191 | color: #656565; | ||
| 2192 | border: 1px solid transparent; | ||
| 2193 | background-color: transparent; | ||
| 2194 | padding: 0px 3px 0px 3px; | ||
| 2195 | text-align: center; | ||
| 2196 | } | ||
| 2197 | |||
| 2198 | QPushButton#GPUStatusBarButton:hover { | ||
| 2199 | border: 1px solid #76797C; | ||
| 2200 | } | ||
| 2201 | |||
| 2202 | QPushButton#GPUStatusBarButton:checked { | ||
| 2203 | color: #ff8040; | ||
| 2204 | } | ||
| 2205 | |||
| 2206 | QPushButton#GPUStatusBarButton:!checked { | ||
| 2207 | color: #40dd40; | ||
| 2208 | } | ||
| 2209 | |||
| 2189 | QPushButton#buttonRefreshDevices { | 2210 | QPushButton#buttonRefreshDevices { |
| 2190 | min-width: 19px; | 2211 | min-width: 19px; |
| 2191 | min-height: 19px; | 2212 | min-height: 19px; |
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index 5ed3b90b8..1e6f0e4a7 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp | |||
| @@ -789,41 +789,28 @@ void GMainWindow::InitializeWidgets() { | |||
| 789 | dock_status_button->setChecked(Settings::values.use_docked_mode.GetValue()); | 789 | dock_status_button->setChecked(Settings::values.use_docked_mode.GetValue()); |
| 790 | statusBar()->insertPermanentWidget(0, dock_status_button); | 790 | statusBar()->insertPermanentWidget(0, dock_status_button); |
| 791 | 791 | ||
| 792 | // Setup ASync button | 792 | gpu_accuracy_button = new QPushButton(); |
| 793 | async_status_button = new QPushButton(); | 793 | gpu_accuracy_button->setObjectName(QStringLiteral("GPUStatusBarButton")); |
| 794 | async_status_button->setObjectName(QStringLiteral("TogglableStatusBarButton")); | 794 | gpu_accuracy_button->setCheckable(true); |
| 795 | async_status_button->setFocusPolicy(Qt::NoFocus); | 795 | gpu_accuracy_button->setFocusPolicy(Qt::NoFocus); |
| 796 | connect(async_status_button, &QPushButton::clicked, [&] { | 796 | connect(gpu_accuracy_button, &QPushButton::clicked, [this] { |
| 797 | if (emulation_running) { | 797 | switch (Settings::values.gpu_accuracy.GetValue()) { |
| 798 | return; | 798 | case Settings::GPUAccuracy::High: { |
| 799 | Settings::values.gpu_accuracy.SetValue(Settings::GPUAccuracy::Normal); | ||
| 800 | break; | ||
| 801 | } | ||
| 802 | case Settings::GPUAccuracy::Normal: | ||
| 803 | case Settings::GPUAccuracy::Extreme: | ||
| 804 | default: { | ||
| 805 | Settings::values.gpu_accuracy.SetValue(Settings::GPUAccuracy::High); | ||
| 799 | } | 806 | } |
| 800 | Settings::values.use_asynchronous_gpu_emulation.SetValue( | ||
| 801 | !Settings::values.use_asynchronous_gpu_emulation.GetValue()); | ||
| 802 | async_status_button->setChecked(Settings::values.use_asynchronous_gpu_emulation.GetValue()); | ||
| 803 | Core::System::GetInstance().ApplySettings(); | ||
| 804 | }); | ||
| 805 | async_status_button->setText(tr("ASYNC")); | ||
| 806 | async_status_button->setCheckable(true); | ||
| 807 | async_status_button->setChecked(Settings::values.use_asynchronous_gpu_emulation.GetValue()); | ||
| 808 | |||
| 809 | // Setup Multicore button | ||
| 810 | multicore_status_button = new QPushButton(); | ||
| 811 | multicore_status_button->setObjectName(QStringLiteral("TogglableStatusBarButton")); | ||
| 812 | multicore_status_button->setFocusPolicy(Qt::NoFocus); | ||
| 813 | connect(multicore_status_button, &QPushButton::clicked, [&] { | ||
| 814 | if (emulation_running) { | ||
| 815 | return; | ||
| 816 | } | 807 | } |
| 817 | Settings::values.use_multi_core.SetValue(!Settings::values.use_multi_core.GetValue()); | 808 | |
| 818 | multicore_status_button->setChecked(Settings::values.use_multi_core.GetValue()); | ||
| 819 | Core::System::GetInstance().ApplySettings(); | 809 | Core::System::GetInstance().ApplySettings(); |
| 810 | UpdateGPUAccuracyButton(); | ||
| 820 | }); | 811 | }); |
| 821 | multicore_status_button->setText(tr("MULTICORE")); | 812 | UpdateGPUAccuracyButton(); |
| 822 | multicore_status_button->setCheckable(true); | 813 | statusBar()->insertPermanentWidget(0, gpu_accuracy_button); |
| 823 | multicore_status_button->setChecked(Settings::values.use_multi_core.GetValue()); | ||
| 824 | |||
| 825 | statusBar()->insertPermanentWidget(0, multicore_status_button); | ||
| 826 | statusBar()->insertPermanentWidget(0, async_status_button); | ||
| 827 | 814 | ||
| 828 | // Setup Renderer API button | 815 | // Setup Renderer API button |
| 829 | renderer_status_button = new QPushButton(); | 816 | renderer_status_button = new QPushButton(); |
| @@ -1397,8 +1384,6 @@ void GMainWindow::BootGame(const QString& filename, std::size_t program_index, S | |||
| 1397 | game_list_placeholder->hide(); | 1384 | game_list_placeholder->hide(); |
| 1398 | } | 1385 | } |
| 1399 | status_bar_update_timer.start(500); | 1386 | status_bar_update_timer.start(500); |
| 1400 | async_status_button->setDisabled(true); | ||
| 1401 | multicore_status_button->setDisabled(true); | ||
| 1402 | renderer_status_button->setDisabled(true); | 1387 | renderer_status_button->setDisabled(true); |
| 1403 | 1388 | ||
| 1404 | if (UISettings::values.hide_mouse || Settings::values.mouse_panning) { | 1389 | if (UISettings::values.hide_mouse || Settings::values.mouse_panning) { |
| @@ -1500,8 +1485,6 @@ void GMainWindow::ShutdownGame() { | |||
| 1500 | emu_speed_label->setVisible(false); | 1485 | emu_speed_label->setVisible(false); |
| 1501 | game_fps_label->setVisible(false); | 1486 | game_fps_label->setVisible(false); |
| 1502 | emu_frametime_label->setVisible(false); | 1487 | emu_frametime_label->setVisible(false); |
| 1503 | async_status_button->setEnabled(true); | ||
| 1504 | multicore_status_button->setEnabled(true); | ||
| 1505 | renderer_status_button->setEnabled(true); | 1488 | renderer_status_button->setEnabled(true); |
| 1506 | 1489 | ||
| 1507 | emulation_running = false; | 1490 | emulation_running = false; |
| @@ -2921,12 +2904,35 @@ void GMainWindow::UpdateStatusBar() { | |||
| 2921 | emu_frametime_label->setVisible(true); | 2904 | emu_frametime_label->setVisible(true); |
| 2922 | } | 2905 | } |
| 2923 | 2906 | ||
| 2907 | void GMainWindow::UpdateGPUAccuracyButton() { | ||
| 2908 | switch (Settings::values.gpu_accuracy.GetValue()) { | ||
| 2909 | case Settings::GPUAccuracy::Normal: { | ||
| 2910 | gpu_accuracy_button->setText(tr("GPU NORMAL ")); | ||
| 2911 | gpu_accuracy_button->setChecked(false); | ||
| 2912 | break; | ||
| 2913 | } | ||
| 2914 | case Settings::GPUAccuracy::High: { | ||
| 2915 | gpu_accuracy_button->setText(tr("GPU HIGH ")); | ||
| 2916 | gpu_accuracy_button->setChecked(true); | ||
| 2917 | break; | ||
| 2918 | } | ||
| 2919 | case Settings::GPUAccuracy::Extreme: { | ||
| 2920 | gpu_accuracy_button->setText(tr("GPU EXTREME")); | ||
| 2921 | gpu_accuracy_button->setChecked(true); | ||
| 2922 | break; | ||
| 2923 | } | ||
| 2924 | default: { | ||
| 2925 | gpu_accuracy_button->setText(tr("GPU ERROR")); | ||
| 2926 | gpu_accuracy_button->setChecked(true); | ||
| 2927 | } | ||
| 2928 | } | ||
| 2929 | } | ||
| 2930 | |||
| 2924 | void GMainWindow::UpdateStatusButtons() { | 2931 | void GMainWindow::UpdateStatusButtons() { |
| 2925 | dock_status_button->setChecked(Settings::values.use_docked_mode.GetValue()); | 2932 | dock_status_button->setChecked(Settings::values.use_docked_mode.GetValue()); |
| 2926 | multicore_status_button->setChecked(Settings::values.use_multi_core.GetValue()); | ||
| 2927 | async_status_button->setChecked(Settings::values.use_asynchronous_gpu_emulation.GetValue()); | ||
| 2928 | renderer_status_button->setChecked(Settings::values.renderer_backend.GetValue() == | 2933 | renderer_status_button->setChecked(Settings::values.renderer_backend.GetValue() == |
| 2929 | Settings::RendererBackend::Vulkan); | 2934 | Settings::RendererBackend::Vulkan); |
| 2935 | UpdateGPUAccuracyButton(); | ||
| 2930 | } | 2936 | } |
| 2931 | 2937 | ||
| 2932 | void GMainWindow::UpdateUISettings() { | 2938 | void GMainWindow::UpdateUISettings() { |
diff --git a/src/yuzu/main.h b/src/yuzu/main.h index 45c8310e1..15e4deab9 100644 --- a/src/yuzu/main.h +++ b/src/yuzu/main.h | |||
| @@ -291,6 +291,7 @@ private: | |||
| 291 | void UpdateWindowTitle(std::string_view title_name = {}, std::string_view title_version = {}, | 291 | void UpdateWindowTitle(std::string_view title_name = {}, std::string_view title_version = {}, |
| 292 | std::string_view gpu_vendor = {}); | 292 | std::string_view gpu_vendor = {}); |
| 293 | void UpdateStatusBar(); | 293 | void UpdateStatusBar(); |
| 294 | void UpdateGPUAccuracyButton(); | ||
| 294 | void UpdateStatusButtons(); | 295 | void UpdateStatusButtons(); |
| 295 | void UpdateUISettings(); | 296 | void UpdateUISettings(); |
| 296 | void HideMouseCursor(); | 297 | void HideMouseCursor(); |
| @@ -316,8 +317,7 @@ private: | |||
| 316 | QLabel* emu_speed_label = nullptr; | 317 | QLabel* emu_speed_label = nullptr; |
| 317 | QLabel* game_fps_label = nullptr; | 318 | QLabel* game_fps_label = nullptr; |
| 318 | QLabel* emu_frametime_label = nullptr; | 319 | QLabel* emu_frametime_label = nullptr; |
| 319 | QPushButton* async_status_button = nullptr; | 320 | QPushButton* gpu_accuracy_button = nullptr; |
| 320 | QPushButton* multicore_status_button = nullptr; | ||
| 321 | QPushButton* renderer_status_button = nullptr; | 321 | QPushButton* renderer_status_button = nullptr; |
| 322 | QPushButton* dock_status_button = nullptr; | 322 | QPushButton* dock_status_button = nullptr; |
| 323 | QTimer status_bar_update_timer; | 323 | QTimer status_bar_update_timer; |