diff --git a/src/common/config.cpp b/src/common/config.cpp index 32c5e670b..a190e4da1 100644 --- a/src/common/config.cpp +++ b/src/common/config.cpp @@ -34,7 +34,7 @@ namespace Config { static bool isHDRAllowed = false; static bool isNeo = false; static bool isFullscreen = false; -static std::string fullscreenMode = "borderless"; +static std::string fullscreenMode = "Fullscreen (Borderless)"; static bool playBGM = false; static bool isTrophyPopupDisabled = false; static int BGMvolume = 50; @@ -694,10 +694,7 @@ void load(const std::filesystem::path& path) { if (data.contains("General")) { const toml::value& general = data.at("General"); - isHDRAllowed = toml::find_or(general, "allowHDR", false); isNeo = toml::find_or(general, "isPS4Pro", false); - isFullscreen = toml::find_or(general, "Fullscreen", false); - fullscreenMode = toml::find_or(general, "FullscreenMode", "borderless"); playBGM = toml::find_or(general, "playBGM", false); isTrophyPopupDisabled = toml::find_or(general, "isTrophyPopupDisabled", false); BGMvolume = toml::find_or(general, "BGMvolume", 50); @@ -742,6 +739,10 @@ void load(const std::filesystem::path& path) { shouldDumpShaders = toml::find_or(gpu, "dumpShaders", false); shouldPatchShaders = toml::find_or(gpu, "patchShaders", true); vblankDivider = toml::find_or(gpu, "vblankDivider", 1); + isFullscreen = toml::find_or(gpu, "Fullscreen", false); + fullscreenMode = + toml::find_or(gpu, "FullscreenMode", "Fullscreen (Borderless)"); + isHDRAllowed = toml::find_or(gpu, "allowHDR", false); } if (data.contains("Vulkan")) { @@ -844,10 +845,7 @@ void save(const std::filesystem::path& path) { fmt::print("Saving new configuration file {}\n", fmt::UTF(path.u8string())); } - data["General"]["allowHDR"] = isHDRAllowed; data["General"]["isPS4Pro"] = isNeo; - data["General"]["Fullscreen"] = isFullscreen; - data["General"]["FullscreenMode"] = fullscreenMode; data["General"]["isTrophyPopupDisabled"] = isTrophyPopupDisabled; data["General"]["playBGM"] = playBGM; data["General"]["BGMvolume"] = BGMvolume; @@ -877,6 +875,9 @@ void save(const std::filesystem::path& path) { data["GPU"]["dumpShaders"] = shouldDumpShaders; data["GPU"]["patchShaders"] = shouldPatchShaders; data["GPU"]["vblankDivider"] = vblankDivider; + data["GPU"]["Fullscreen"] = isFullscreen; + data["GPU"]["FullscreenMode"] = fullscreenMode; + data["GPU"]["allowHDR"] = isHDRAllowed; data["Vulkan"]["gpuId"] = gpuId; data["Vulkan"]["validation"] = vkValidation; data["Vulkan"]["validation_sync"] = vkValidationSync; diff --git a/src/qt_gui/settings_dialog.cpp b/src/qt_gui/settings_dialog.cpp index ee88bbbab..bf09c979b 100644 --- a/src/qt_gui/settings_dialog.cpp +++ b/src/qt_gui/settings_dialog.cpp @@ -60,7 +60,7 @@ const QVector languageIndexes = {21, 23, 14, 6, 18, 1, 12, 22, 2, 4, 25, 2 15, 16, 17, 7, 26, 8, 11, 20, 3, 13, 27, 10, 19, 30, 28}; QMap channelMap; QMap logTypeMap; -QMap fullscreenModeMap; +QMap screenModeMap; QMap chooseHomeTabMap; int backgroundImageOpacitySlider_backup; @@ -80,7 +80,9 @@ SettingsDialog::SettingsDialog(std::span physical_devices, channelMap = {{tr("Release"), "Release"}, {tr("Nightly"), "Nightly"}}; logTypeMap = {{tr("async"), "async"}, {tr("sync"), "sync"}}; - fullscreenModeMap = {{tr("Borderless"), "Borderless"}, {tr("True"), "True"}}; + screenModeMap = {{tr("Fullscreen (Borderless)"), "Fullscreen (Borderless)"}, + {tr("Windowed"), "Windowed"}, + {tr("Fullscreen"), "Fullscreen"}}; chooseHomeTabMap = {{tr("General"), "General"}, {tr("GUI"), "GUI"}, {tr("Graphics"), "Graphics"}, {tr("User"), "User"}, {tr("Input"), "Input"}, {tr("Paths"), "Paths"}, @@ -288,7 +290,6 @@ SettingsDialog::SettingsDialog(std::span physical_devices, // General ui->consoleLanguageGroupBox->installEventFilter(this); ui->emulatorLanguageGroupBox->installEventFilter(this); - ui->fullscreenCheckBox->installEventFilter(this); ui->separateUpdatesCheckBox->installEventFilter(this); ui->showSplashCheckBox->installEventFilter(this); ui->discordRPCCheckbox->installEventFilter(this); @@ -314,8 +315,7 @@ SettingsDialog::SettingsDialog(std::span physical_devices, // Graphics ui->graphicsAdapterGroupBox->installEventFilter(this); - ui->widthGroupBox->installEventFilter(this); - ui->heightGroupBox->installEventFilter(this); + ui->windowSizeGroupBox->installEventFilter(this); ui->heightDivider->installEventFilter(this); ui->dumpShadersCheckBox->installEventFilter(this); ui->nullGpuCheckBox->installEventFilter(this); @@ -406,12 +406,9 @@ void SettingsDialog::LoadValuesFromConfig() { ui->BGMVolumeSlider->setValue(toml::find_or(data, "General", "BGMvolume", 50)); ui->discordRPCCheckbox->setChecked( toml::find_or(data, "General", "enableDiscordRPC", true)); - ui->fullscreenCheckBox->setChecked(toml::find_or(data, "General", "Fullscreen", false)); QString translatedText_FullscreenMode = - fullscreenModeMap.key(QString::fromStdString(Config::getFullscreenMode())); - if (!translatedText_FullscreenMode.isEmpty()) { - ui->fullscreenModeComboBox->setCurrentText(translatedText_FullscreenMode); - } + screenModeMap.key(QString::fromStdString(Config::getFullscreenMode())); + ui->displayModeComboBox->setCurrentText(translatedText_FullscreenMode); ui->separateUpdatesCheckBox->setChecked( toml::find_or(data, "General", "separateUpdateEnabled", false)); ui->gameSizeCheckBox->setChecked(toml::find_or(data, "GUI", "loadGameSizeEnabled", true)); @@ -560,8 +557,6 @@ void SettingsDialog::updateNoteTextEdit(const QString& elementName) { text = tr("Console Language:\\nSets the language that the PS4 game uses.\\nIt's recommended to set this to a language the game supports, which will vary by region."); } else if (elementName == "emulatorLanguageGroupBox") { text = tr("Emulator Language:\\nSets the language of the emulator's user interface."); - } else if (elementName == "fullscreenCheckBox") { - text = tr("Enable Full Screen:\\nAutomatically puts the game window into full-screen mode.\\nThis can be toggled by pressing the F11 key."); } else if (elementName == "separateUpdatesCheckBox") { text = tr("Enable Separate Update Folder:\\nEnables installing game updates into a separate folder for easy management.\\nThis can be manually created by adding the extracted update to the game folder with the name \"CUSA00000-UPDATE\" where the CUSA ID matches the game's ID."); } else if (elementName == "showSplashCheckBox") { @@ -608,7 +603,7 @@ void SettingsDialog::updateNoteTextEdit(const QString& elementName) { // Graphics if (elementName == "graphicsAdapterGroupBox") { text = tr("Graphics Device:\\nOn multiple GPU systems, select the GPU the emulator will use from the drop down list,\\nor select \"Auto Select\" to automatically determine it."); - } else if (elementName == "widthGroupBox" || elementName == "heightGroupBox") { + } else if (elementName == "windowSizeGroupBox") { text = tr("Width/Height:\\nSets the size of the emulator window at launch, which can be resized during gameplay.\\nThis is different from the in-game resolution."); } else if (elementName == "heightDivider") { text = tr("Vblank Divider:\\nThe frame rate at which the emulator refreshes at is multiplied by this number. Changing this may have adverse effects, such as increasing the game speed, or breaking critical game functionality that does not expect this to change!"); @@ -679,9 +674,9 @@ void SettingsDialog::UpdateSettings() { const QVector TouchPadIndex = {"left", "center", "right", "none"}; Config::setBackButtonBehavior(TouchPadIndex[ui->backButtonBehaviorComboBox->currentIndex()]); - Config::setIsFullscreen(ui->fullscreenCheckBox->isChecked()); + Config::setIsFullscreen(ui->displayModeComboBox->currentText().toStdString() != "Windowed"); Config::setFullscreenMode( - fullscreenModeMap.value(ui->fullscreenModeComboBox->currentText()).toStdString()); + screenModeMap.value(ui->displayModeComboBox->currentText()).toStdString()); Config::setIsMotionControlsEnabled(ui->motionControlsCheckBox->isChecked()); Config::setisTrophyPopupDisabled(ui->disableTrophycheckBox->isChecked()); Config::setPlayBGM(ui->playBGMCheckBox->isChecked()); diff --git a/src/qt_gui/settings_dialog.ui b/src/qt_gui/settings_dialog.ui index 53bae664f..c65162e37 100644 --- a/src/qt_gui/settings_dialog.ui +++ b/src/qt_gui/settings_dialog.ui @@ -135,49 +135,6 @@ 10 - - - - Enable Fullscreen - - - - - - - Fullscreen Mode - - - - - - - 0 - 0 - - - - - Borderless - - - - - True - - - - - - - - - - - Enable HDR - - - @@ -1007,117 +964,168 @@ - - - 6 + + + Video - - 0 - - - - - - - Width - - - - - - true + + + 6 + + + 12 + + + + + Display Mode + + + + + + + 0 + 0 + + + + + Windowed - - QAbstractSpinBox::CorrectionMode::CorrectToNearestValue + + + + Fullscreen - - false + + + + Fullscreen (Borderless) - - 0 - - - 9999 - - - 1280 - - - - - - - - - - Height - - - - - - true - - - true - - - QAbstractSpinBox::CorrectionMode::CorrectToNearestValue - - - false - - - 0 - - - 9999 - - - 720 - - - - - - - - - - Vblank Divider - - - - - - true - - - true - - - QAbstractSpinBox::CorrectionMode::CorrectToNearestValue - - - false - - - 1 - - - 9999 - - - 1 - - - - - - - - - + + + + + + + + + + + + Window Size + + + + + + W: + + + + + + + true + + + QAbstractSpinBox::CorrectionMode::CorrectToNearestValue + + + false + + + 0 + + + 9999 + + + 1280 + + + + + + + H: + + + + + + + true + + + true + + + QAbstractSpinBox::CorrectionMode::CorrectToNearestValue + + + false + + + 0 + + + 9999 + + + 720 + + + + + + + + + + Vblank Divider + + + + + + true + + + true + + + QAbstractSpinBox::CorrectionMode::CorrectToNearestValue + + + false + + + 1 + + + 9999 + + + 1 + + + + + + + + + + + + Enable HDR + + + + + diff --git a/src/sdl_window.cpp b/src/sdl_window.cpp index db6f37e2a..943746e3f 100644 --- a/src/sdl_window.cpp +++ b/src/sdl_window.cpp @@ -290,8 +290,8 @@ WindowSDL::WindowSDL(s32 width_, s32 height_, Input::GameController* controller_ error = true; } if (!error) { - SDL_SetWindowFullscreenMode(window, - Config::getFullscreenMode() == "True" ? displayMode : NULL); + SDL_SetWindowFullscreenMode( + window, Config::getFullscreenMode() == "Fullscreen" ? displayMode : NULL); } SDL_SetWindowFullscreen(window, Config::getIsFullscreen());