diff options
Diffstat (limited to 'src')
| -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 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; |