diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/settings.h | 1 | ||||
| -rw-r--r-- | src/yuzu/configuration/config.cpp | 14 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure_graphics.cpp | 19 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure_graphics.ui | 41 | ||||
| -rw-r--r-- | src/yuzu/main.cpp | 54 |
5 files changed, 120 insertions, 9 deletions
diff --git a/src/core/settings.h b/src/core/settings.h index a81016b23..6c03a6ea9 100644 --- a/src/core/settings.h +++ b/src/core/settings.h | |||
| @@ -139,6 +139,7 @@ struct Values { | |||
| 139 | Setting<int> vulkan_device; | 139 | Setting<int> vulkan_device; |
| 140 | 140 | ||
| 141 | Setting<u16> resolution_factor{1}; | 141 | Setting<u16> resolution_factor{1}; |
| 142 | Setting<int> fullscreen_mode; | ||
| 142 | Setting<int> aspect_ratio; | 143 | Setting<int> aspect_ratio; |
| 143 | Setting<int> max_anisotropy; | 144 | Setting<int> max_anisotropy; |
| 144 | Setting<bool> use_frame_limit; | 145 | Setting<bool> use_frame_limit; |
diff --git a/src/yuzu/configuration/config.cpp b/src/yuzu/configuration/config.cpp index 1d6155999..50ea15e2a 100644 --- a/src/yuzu/configuration/config.cpp +++ b/src/yuzu/configuration/config.cpp | |||
| @@ -771,6 +771,13 @@ void Config::ReadRendererValues() { | |||
| 771 | ReadSettingGlobal(Settings::values.renderer_backend, QStringLiteral("backend"), 0); | 771 | ReadSettingGlobal(Settings::values.renderer_backend, QStringLiteral("backend"), 0); |
| 772 | ReadSettingGlobal(Settings::values.renderer_debug, QStringLiteral("debug"), false); | 772 | ReadSettingGlobal(Settings::values.renderer_debug, QStringLiteral("debug"), false); |
| 773 | ReadSettingGlobal(Settings::values.vulkan_device, QStringLiteral("vulkan_device"), 0); | 773 | ReadSettingGlobal(Settings::values.vulkan_device, QStringLiteral("vulkan_device"), 0); |
| 774 | #ifdef _WIN32 | ||
| 775 | ReadSettingGlobal(Settings::values.fullscreen_mode, QStringLiteral("fullscreen_mode"), 0); | ||
| 776 | #else | ||
| 777 | // *nix platforms may have issues with the borderless windowed fullscreen mode. | ||
| 778 | // Default to exclusive fullscreen on these platforms for now. | ||
| 779 | ReadSettingGlobal(Settings::values.fullscreen_mode, QStringLiteral("fullscreen_mode"), 1); | ||
| 780 | #endif | ||
| 774 | ReadSettingGlobal(Settings::values.aspect_ratio, QStringLiteral("aspect_ratio"), 0); | 781 | ReadSettingGlobal(Settings::values.aspect_ratio, QStringLiteral("aspect_ratio"), 0); |
| 775 | ReadSettingGlobal(Settings::values.max_anisotropy, QStringLiteral("max_anisotropy"), 0); | 782 | ReadSettingGlobal(Settings::values.max_anisotropy, QStringLiteral("max_anisotropy"), 0); |
| 776 | ReadSettingGlobal(Settings::values.use_frame_limit, QStringLiteral("use_frame_limit"), true); | 783 | ReadSettingGlobal(Settings::values.use_frame_limit, QStringLiteral("use_frame_limit"), true); |
| @@ -1334,6 +1341,13 @@ void Config::SaveRendererValues() { | |||
| 1334 | Settings::values.renderer_backend.UsingGlobal(), 0); | 1341 | Settings::values.renderer_backend.UsingGlobal(), 0); |
| 1335 | WriteSetting(QStringLiteral("debug"), Settings::values.renderer_debug, false); | 1342 | WriteSetting(QStringLiteral("debug"), Settings::values.renderer_debug, false); |
| 1336 | WriteSettingGlobal(QStringLiteral("vulkan_device"), Settings::values.vulkan_device, 0); | 1343 | WriteSettingGlobal(QStringLiteral("vulkan_device"), Settings::values.vulkan_device, 0); |
| 1344 | #ifdef _WIN32 | ||
| 1345 | WriteSettingGlobal(QStringLiteral("fullscreen_mode"), Settings::values.fullscreen_mode, 0); | ||
| 1346 | #else | ||
| 1347 | // *nix platforms may have issues with the borderless windowed fullscreen mode. | ||
| 1348 | // Default to exclusive fullscreen on these platforms for now. | ||
| 1349 | WriteSettingGlobal(QStringLiteral("fullscreen_mode"), Settings::values.fullscreen_mode, 1); | ||
| 1350 | #endif | ||
| 1337 | WriteSettingGlobal(QStringLiteral("aspect_ratio"), Settings::values.aspect_ratio, 0); | 1351 | WriteSettingGlobal(QStringLiteral("aspect_ratio"), Settings::values.aspect_ratio, 0); |
| 1338 | WriteSettingGlobal(QStringLiteral("max_anisotropy"), Settings::values.max_anisotropy, 0); | 1352 | WriteSettingGlobal(QStringLiteral("max_anisotropy"), Settings::values.max_anisotropy, 0); |
| 1339 | WriteSettingGlobal(QStringLiteral("use_frame_limit"), Settings::values.use_frame_limit, true); | 1353 | WriteSettingGlobal(QStringLiteral("use_frame_limit"), Settings::values.use_frame_limit, true); |
diff --git a/src/yuzu/configuration/configure_graphics.cpp b/src/yuzu/configuration/configure_graphics.cpp index 49acc48b2..8a2008b2a 100644 --- a/src/yuzu/configuration/configure_graphics.cpp +++ b/src/yuzu/configuration/configure_graphics.cpp | |||
| @@ -77,18 +77,25 @@ void ConfigureGraphics::SetConfiguration() { | |||
| 77 | 77 | ||
| 78 | if (Settings::IsConfiguringGlobal()) { | 78 | if (Settings::IsConfiguringGlobal()) { |
| 79 | ui->api->setCurrentIndex(static_cast<int>(Settings::values.renderer_backend.GetValue())); | 79 | ui->api->setCurrentIndex(static_cast<int>(Settings::values.renderer_backend.GetValue())); |
| 80 | ui->fullscreen_mode_combobox->setCurrentIndex(Settings::values.fullscreen_mode.GetValue()); | ||
| 80 | ui->aspect_ratio_combobox->setCurrentIndex(Settings::values.aspect_ratio.GetValue()); | 81 | ui->aspect_ratio_combobox->setCurrentIndex(Settings::values.aspect_ratio.GetValue()); |
| 81 | } else { | 82 | } else { |
| 82 | ConfigurationShared::SetPerGameSetting(ui->api, &Settings::values.renderer_backend); | 83 | ConfigurationShared::SetPerGameSetting(ui->api, &Settings::values.renderer_backend); |
| 83 | ConfigurationShared::SetHighlight(ui->api_layout, | 84 | ConfigurationShared::SetHighlight(ui->api_layout, |
| 84 | !Settings::values.renderer_backend.UsingGlobal()); | 85 | !Settings::values.renderer_backend.UsingGlobal()); |
| 86 | |||
| 87 | ConfigurationShared::SetPerGameSetting(ui->fullscreen_mode_combobox, | ||
| 88 | &Settings::values.fullscreen_mode); | ||
| 89 | ConfigurationShared::SetHighlight(ui->fullscreen_mode_label, | ||
| 90 | !Settings::values.fullscreen_mode.UsingGlobal()); | ||
| 91 | |||
| 85 | ConfigurationShared::SetPerGameSetting(ui->aspect_ratio_combobox, | 92 | ConfigurationShared::SetPerGameSetting(ui->aspect_ratio_combobox, |
| 86 | &Settings::values.aspect_ratio); | 93 | &Settings::values.aspect_ratio); |
| 94 | ConfigurationShared::SetHighlight(ui->ar_label, | ||
| 95 | !Settings::values.aspect_ratio.UsingGlobal()); | ||
| 87 | 96 | ||
| 88 | ui->bg_combobox->setCurrentIndex(Settings::values.bg_red.UsingGlobal() ? 0 : 1); | 97 | ui->bg_combobox->setCurrentIndex(Settings::values.bg_red.UsingGlobal() ? 0 : 1); |
| 89 | ui->bg_button->setEnabled(!Settings::values.bg_red.UsingGlobal()); | 98 | ui->bg_button->setEnabled(!Settings::values.bg_red.UsingGlobal()); |
| 90 | ConfigurationShared::SetHighlight(ui->ar_label, | ||
| 91 | !Settings::values.aspect_ratio.UsingGlobal()); | ||
| 92 | ConfigurationShared::SetHighlight(ui->bg_layout, !Settings::values.bg_red.UsingGlobal()); | 99 | ConfigurationShared::SetHighlight(ui->bg_layout, !Settings::values.bg_red.UsingGlobal()); |
| 93 | } | 100 | } |
| 94 | 101 | ||
| @@ -107,6 +114,9 @@ void ConfigureGraphics::ApplyConfiguration() { | |||
| 107 | if (Settings::values.vulkan_device.UsingGlobal()) { | 114 | if (Settings::values.vulkan_device.UsingGlobal()) { |
| 108 | Settings::values.vulkan_device.SetValue(vulkan_device); | 115 | Settings::values.vulkan_device.SetValue(vulkan_device); |
| 109 | } | 116 | } |
| 117 | if (Settings::values.fullscreen_mode.UsingGlobal()) { | ||
| 118 | Settings::values.fullscreen_mode.SetValue(ui->fullscreen_mode_combobox->currentIndex()); | ||
| 119 | } | ||
| 110 | if (Settings::values.aspect_ratio.UsingGlobal()) { | 120 | if (Settings::values.aspect_ratio.UsingGlobal()) { |
| 111 | Settings::values.aspect_ratio.SetValue(ui->aspect_ratio_combobox->currentIndex()); | 121 | Settings::values.aspect_ratio.SetValue(ui->aspect_ratio_combobox->currentIndex()); |
| 112 | } | 122 | } |
| @@ -140,6 +150,8 @@ void ConfigureGraphics::ApplyConfiguration() { | |||
| 140 | } | 150 | } |
| 141 | } | 151 | } |
| 142 | 152 | ||
| 153 | ConfigurationShared::ApplyPerGameSetting(&Settings::values.fullscreen_mode, | ||
| 154 | ui->fullscreen_mode_combobox); | ||
| 143 | ConfigurationShared::ApplyPerGameSetting(&Settings::values.aspect_ratio, | 155 | ConfigurationShared::ApplyPerGameSetting(&Settings::values.aspect_ratio, |
| 144 | ui->aspect_ratio_combobox); | 156 | ui->aspect_ratio_combobox); |
| 145 | 157 | ||
| @@ -253,6 +265,7 @@ void ConfigureGraphics::SetupPerGameUI() { | |||
| 253 | if (Settings::IsConfiguringGlobal()) { | 265 | if (Settings::IsConfiguringGlobal()) { |
| 254 | ui->api->setEnabled(Settings::values.renderer_backend.UsingGlobal()); | 266 | ui->api->setEnabled(Settings::values.renderer_backend.UsingGlobal()); |
| 255 | ui->device->setEnabled(Settings::values.renderer_backend.UsingGlobal()); | 267 | ui->device->setEnabled(Settings::values.renderer_backend.UsingGlobal()); |
| 268 | ui->fullscreen_mode_combobox->setEnabled(Settings::values.fullscreen_mode.UsingGlobal()); | ||
| 256 | ui->aspect_ratio_combobox->setEnabled(Settings::values.aspect_ratio.UsingGlobal()); | 269 | ui->aspect_ratio_combobox->setEnabled(Settings::values.aspect_ratio.UsingGlobal()); |
| 257 | ui->use_asynchronous_gpu_emulation->setEnabled( | 270 | ui->use_asynchronous_gpu_emulation->setEnabled( |
| 258 | Settings::values.use_asynchronous_gpu_emulation.UsingGlobal()); | 271 | Settings::values.use_asynchronous_gpu_emulation.UsingGlobal()); |
| @@ -278,6 +291,8 @@ void ConfigureGraphics::SetupPerGameUI() { | |||
| 278 | 291 | ||
| 279 | ConfigurationShared::SetColoredComboBox(ui->aspect_ratio_combobox, ui->ar_label, | 292 | ConfigurationShared::SetColoredComboBox(ui->aspect_ratio_combobox, ui->ar_label, |
| 280 | Settings::values.aspect_ratio.GetValue(true)); | 293 | Settings::values.aspect_ratio.GetValue(true)); |
| 294 | ConfigurationShared::SetColoredComboBox(ui->fullscreen_mode_combobox, ui->fullscreen_mode_label, | ||
| 295 | Settings::values.fullscreen_mode.GetValue(true)); | ||
| 281 | ConfigurationShared::InsertGlobalItem( | 296 | ConfigurationShared::InsertGlobalItem( |
| 282 | ui->api, static_cast<int>(Settings::values.renderer_backend.GetValue(true))); | 297 | ui->api, static_cast<int>(Settings::values.renderer_backend.GetValue(true))); |
| 283 | } | 298 | } |
diff --git a/src/yuzu/configuration/configure_graphics.ui b/src/yuzu/configuration/configure_graphics.ui index 58486eb1e..ab0bd4d77 100644 --- a/src/yuzu/configuration/configure_graphics.ui +++ b/src/yuzu/configuration/configure_graphics.ui | |||
| @@ -105,8 +105,47 @@ | |||
| 105 | </widget> | 105 | </widget> |
| 106 | </item> | 106 | </item> |
| 107 | <item> | 107 | <item> |
| 108 | <widget class="QWidget" name="fullscreen_mode_layout" native="true"> | ||
| 109 | <layout class="QHBoxLayout" name="horizontalLayout_1"> | ||
| 110 | <property name="leftMargin"> | ||
| 111 | <number>0</number> | ||
| 112 | </property> | ||
| 113 | <property name="topMargin"> | ||
| 114 | <number>0</number> | ||
| 115 | </property> | ||
| 116 | <property name="rightMargin"> | ||
| 117 | <number>0</number> | ||
| 118 | </property> | ||
| 119 | <property name="bottomMargin"> | ||
| 120 | <number>0</number> | ||
| 121 | </property> | ||
| 122 | <item> | ||
| 123 | <widget class="QLabel" name="fullscreen_mode_label"> | ||
| 124 | <property name="text"> | ||
| 125 | <string>Fullscreen Mode:</string> | ||
| 126 | </property> | ||
| 127 | </widget> | ||
| 128 | </item> | ||
| 129 | <item> | ||
| 130 | <widget class="QComboBox" name="fullscreen_mode_combobox"> | ||
| 131 | <item> | ||
| 132 | <property name="text"> | ||
| 133 | <string>Borderless Windowed</string> | ||
| 134 | </property> | ||
| 135 | </item> | ||
| 136 | <item> | ||
| 137 | <property name="text"> | ||
| 138 | <string>Exclusive Fullscreen</string> | ||
| 139 | </property> | ||
| 140 | </item> | ||
| 141 | </widget> | ||
| 142 | </item> | ||
| 143 | </layout> | ||
| 144 | </widget> | ||
| 145 | </item> | ||
| 146 | <item> | ||
| 108 | <widget class="QWidget" name="aspect_ratio_layout" native="true"> | 147 | <widget class="QWidget" name="aspect_ratio_layout" native="true"> |
| 109 | <layout class="QHBoxLayout" name="horizontalLayout_6"> | 148 | <layout class="QHBoxLayout" name="horizontalLayout_2"> |
| 110 | <property name="leftMargin"> | 149 | <property name="leftMargin"> |
| 111 | <number>0</number> | 150 | <number>0</number> |
| 112 | </property> | 151 | </property> |
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index 06445b993..23ea4983d 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp | |||
| @@ -2295,24 +2295,66 @@ void GMainWindow::ToggleFullscreen() { | |||
| 2295 | void GMainWindow::ShowFullscreen() { | 2295 | void GMainWindow::ShowFullscreen() { |
| 2296 | if (ui.action_Single_Window_Mode->isChecked()) { | 2296 | if (ui.action_Single_Window_Mode->isChecked()) { |
| 2297 | UISettings::values.geometry = saveGeometry(); | 2297 | UISettings::values.geometry = saveGeometry(); |
| 2298 | |||
| 2298 | ui.menubar->hide(); | 2299 | ui.menubar->hide(); |
| 2299 | statusBar()->hide(); | 2300 | statusBar()->hide(); |
| 2300 | showFullScreen(); | 2301 | |
| 2302 | if (Settings::values.fullscreen_mode.GetValue() == 1) { | ||
| 2303 | showFullScreen(); | ||
| 2304 | return; | ||
| 2305 | } | ||
| 2306 | |||
| 2307 | hide(); | ||
| 2308 | setWindowFlags(windowFlags() | Qt::FramelessWindowHint); | ||
| 2309 | const auto screen_geometry = QApplication::desktop()->screenGeometry(this); | ||
| 2310 | setGeometry(screen_geometry.x(), screen_geometry.y(), screen_geometry.width(), | ||
| 2311 | screen_geometry.height() + 1); | ||
| 2312 | raise(); | ||
| 2313 | showNormal(); | ||
| 2301 | } else { | 2314 | } else { |
| 2302 | UISettings::values.renderwindow_geometry = render_window->saveGeometry(); | 2315 | UISettings::values.renderwindow_geometry = render_window->saveGeometry(); |
| 2303 | render_window->showFullScreen(); | 2316 | |
| 2317 | if (Settings::values.fullscreen_mode.GetValue() == 1) { | ||
| 2318 | render_window->showFullScreen(); | ||
| 2319 | return; | ||
| 2320 | } | ||
| 2321 | |||
| 2322 | render_window->hide(); | ||
| 2323 | render_window->setWindowFlags(windowFlags() | Qt::FramelessWindowHint); | ||
| 2324 | const auto screen_geometry = QApplication::desktop()->screenGeometry(this); | ||
| 2325 | render_window->setGeometry(screen_geometry.x(), screen_geometry.y(), | ||
| 2326 | screen_geometry.width(), screen_geometry.height() + 1); | ||
| 2327 | render_window->raise(); | ||
| 2328 | render_window->showNormal(); | ||
| 2304 | } | 2329 | } |
| 2305 | } | 2330 | } |
| 2306 | 2331 | ||
| 2307 | void GMainWindow::HideFullscreen() { | 2332 | void GMainWindow::HideFullscreen() { |
| 2308 | if (ui.action_Single_Window_Mode->isChecked()) { | 2333 | if (ui.action_Single_Window_Mode->isChecked()) { |
| 2334 | if (Settings::values.fullscreen_mode.GetValue() == 1) { | ||
| 2335 | showNormal(); | ||
| 2336 | restoreGeometry(UISettings::values.geometry); | ||
| 2337 | } else { | ||
| 2338 | hide(); | ||
| 2339 | setWindowFlags(windowFlags() & ~Qt::FramelessWindowHint); | ||
| 2340 | restoreGeometry(UISettings::values.geometry); | ||
| 2341 | raise(); | ||
| 2342 | show(); | ||
| 2343 | } | ||
| 2344 | |||
| 2309 | statusBar()->setVisible(ui.action_Show_Status_Bar->isChecked()); | 2345 | statusBar()->setVisible(ui.action_Show_Status_Bar->isChecked()); |
| 2310 | ui.menubar->show(); | 2346 | ui.menubar->show(); |
| 2311 | showNormal(); | ||
| 2312 | restoreGeometry(UISettings::values.geometry); | ||
| 2313 | } else { | 2347 | } else { |
| 2314 | render_window->showNormal(); | 2348 | if (Settings::values.fullscreen_mode.GetValue() == 1) { |
| 2315 | render_window->restoreGeometry(UISettings::values.renderwindow_geometry); | 2349 | render_window->showNormal(); |
| 2350 | render_window->restoreGeometry(UISettings::values.renderwindow_geometry); | ||
| 2351 | } else { | ||
| 2352 | render_window->hide(); | ||
| 2353 | render_window->setWindowFlags(windowFlags() & ~Qt::FramelessWindowHint); | ||
| 2354 | render_window->restoreGeometry(UISettings::values.renderwindow_geometry); | ||
| 2355 | render_window->raise(); | ||
| 2356 | render_window->show(); | ||
| 2357 | } | ||
| 2316 | } | 2358 | } |
| 2317 | } | 2359 | } |
| 2318 | 2360 | ||