diff options
| author | 2021-07-25 11:45:45 -0700 | |
|---|---|---|
| committer | 2021-07-25 11:45:45 -0700 | |
| commit | 7e272d3cd81656b65b21f5a569fc9a2d76cac758 (patch) | |
| tree | 5d50ce761c8e1a1b67b27cab16821e9196932fff /src | |
| parent | Merge pull request #6709 from ameerj/screenshot-path (diff) | |
| parent | Update src/yuzu/main.cpp (diff) | |
| download | yuzu-7e272d3cd81656b65b21f5a569fc9a2d76cac758.tar.gz yuzu-7e272d3cd81656b65b21f5a569fc9a2d76cac758.tar.xz yuzu-7e272d3cd81656b65b21f5a569fc9a2d76cac758.zip | |
Merge pull request #6575 from FernandoS27/new_settings
Settings: Eliminate ASYNC & MULTICORE Toggles and add GPU Accuracy to status bar
Diffstat (limited to '')
| -rw-r--r-- | src/yuzu/main.cpp | 80 | ||||
| -rw-r--r-- | src/yuzu/main.h | 4 |
2 files changed, 45 insertions, 39 deletions
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index e97bfd976..2f84ada73 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(); |
| @@ -1401,8 +1388,6 @@ void GMainWindow::BootGame(const QString& filename, u64 program_id, std::size_t | |||
| 1401 | game_list_placeholder->hide(); | 1388 | game_list_placeholder->hide(); |
| 1402 | } | 1389 | } |
| 1403 | status_bar_update_timer.start(500); | 1390 | status_bar_update_timer.start(500); |
| 1404 | async_status_button->setDisabled(true); | ||
| 1405 | multicore_status_button->setDisabled(true); | ||
| 1406 | renderer_status_button->setDisabled(true); | 1391 | renderer_status_button->setDisabled(true); |
| 1407 | 1392 | ||
| 1408 | if (UISettings::values.hide_mouse || Settings::values.mouse_panning) { | 1393 | if (UISettings::values.hide_mouse || Settings::values.mouse_panning) { |
| @@ -1506,8 +1491,6 @@ void GMainWindow::ShutdownGame() { | |||
| 1506 | emu_speed_label->setVisible(false); | 1491 | emu_speed_label->setVisible(false); |
| 1507 | game_fps_label->setVisible(false); | 1492 | game_fps_label->setVisible(false); |
| 1508 | emu_frametime_label->setVisible(false); | 1493 | emu_frametime_label->setVisible(false); |
| 1509 | async_status_button->setEnabled(true); | ||
| 1510 | multicore_status_button->setEnabled(true); | ||
| 1511 | renderer_status_button->setEnabled(true); | 1494 | renderer_status_button->setEnabled(true); |
| 1512 | 1495 | ||
| 1513 | emulation_running = false; | 1496 | emulation_running = false; |
| @@ -2947,12 +2930,35 @@ void GMainWindow::UpdateStatusBar() { | |||
| 2947 | emu_frametime_label->setVisible(true); | 2930 | emu_frametime_label->setVisible(true); |
| 2948 | } | 2931 | } |
| 2949 | 2932 | ||
| 2933 | void GMainWindow::UpdateGPUAccuracyButton() { | ||
| 2934 | switch (Settings::values.gpu_accuracy.GetValue()) { | ||
| 2935 | case Settings::GPUAccuracy::Normal: { | ||
| 2936 | gpu_accuracy_button->setText(tr("GPU NORMAL")); | ||
| 2937 | gpu_accuracy_button->setChecked(false); | ||
| 2938 | break; | ||
| 2939 | } | ||
| 2940 | case Settings::GPUAccuracy::High: { | ||
| 2941 | gpu_accuracy_button->setText(tr("GPU HIGH")); | ||
| 2942 | gpu_accuracy_button->setChecked(true); | ||
| 2943 | break; | ||
| 2944 | } | ||
| 2945 | case Settings::GPUAccuracy::Extreme: { | ||
| 2946 | gpu_accuracy_button->setText(tr("GPU EXTREME")); | ||
| 2947 | gpu_accuracy_button->setChecked(true); | ||
| 2948 | break; | ||
| 2949 | } | ||
| 2950 | default: { | ||
| 2951 | gpu_accuracy_button->setText(tr("GPU ERROR")); | ||
| 2952 | gpu_accuracy_button->setChecked(true); | ||
| 2953 | } | ||
| 2954 | } | ||
| 2955 | } | ||
| 2956 | |||
| 2950 | void GMainWindow::UpdateStatusButtons() { | 2957 | void GMainWindow::UpdateStatusButtons() { |
| 2951 | dock_status_button->setChecked(Settings::values.use_docked_mode.GetValue()); | 2958 | dock_status_button->setChecked(Settings::values.use_docked_mode.GetValue()); |
| 2952 | multicore_status_button->setChecked(Settings::values.use_multi_core.GetValue()); | ||
| 2953 | async_status_button->setChecked(Settings::values.use_asynchronous_gpu_emulation.GetValue()); | ||
| 2954 | renderer_status_button->setChecked(Settings::values.renderer_backend.GetValue() == | 2959 | renderer_status_button->setChecked(Settings::values.renderer_backend.GetValue() == |
| 2955 | Settings::RendererBackend::Vulkan); | 2960 | Settings::RendererBackend::Vulkan); |
| 2961 | UpdateGPUAccuracyButton(); | ||
| 2956 | } | 2962 | } |
| 2957 | 2963 | ||
| 2958 | void GMainWindow::UpdateUISettings() { | 2964 | void GMainWindow::UpdateUISettings() { |
diff --git a/src/yuzu/main.h b/src/yuzu/main.h index 3eb6aed56..38e66ccd0 100644 --- a/src/yuzu/main.h +++ b/src/yuzu/main.h | |||
| @@ -292,6 +292,7 @@ private: | |||
| 292 | void UpdateWindowTitle(std::string_view title_name = {}, std::string_view title_version = {}, | 292 | void UpdateWindowTitle(std::string_view title_name = {}, std::string_view title_version = {}, |
| 293 | std::string_view gpu_vendor = {}); | 293 | std::string_view gpu_vendor = {}); |
| 294 | void UpdateStatusBar(); | 294 | void UpdateStatusBar(); |
| 295 | void UpdateGPUAccuracyButton(); | ||
| 295 | void UpdateStatusButtons(); | 296 | void UpdateStatusButtons(); |
| 296 | void UpdateUISettings(); | 297 | void UpdateUISettings(); |
| 297 | void HideMouseCursor(); | 298 | void HideMouseCursor(); |
| @@ -317,8 +318,7 @@ private: | |||
| 317 | QLabel* emu_speed_label = nullptr; | 318 | QLabel* emu_speed_label = nullptr; |
| 318 | QLabel* game_fps_label = nullptr; | 319 | QLabel* game_fps_label = nullptr; |
| 319 | QLabel* emu_frametime_label = nullptr; | 320 | QLabel* emu_frametime_label = nullptr; |
| 320 | QPushButton* async_status_button = nullptr; | 321 | QPushButton* gpu_accuracy_button = nullptr; |
| 321 | QPushButton* multicore_status_button = nullptr; | ||
| 322 | QPushButton* renderer_status_button = nullptr; | 322 | QPushButton* renderer_status_button = nullptr; |
| 323 | QPushButton* dock_status_button = nullptr; | 323 | QPushButton* dock_status_button = nullptr; |
| 324 | QTimer status_bar_update_timer; | 324 | QTimer status_bar_update_timer; |