move display mode and hdr to graphics tab (#2485)
Some checks are pending
Build and Release / macos-sdl (push) Blocked by required conditions
Build and Release / reuse (push) Waiting to run
Build and Release / clang-format (push) Waiting to run
Build and Release / get-info (push) Waiting to run
Build and Release / windows-sdl (push) Blocked by required conditions
Build and Release / windows-qt (push) Blocked by required conditions
Build and Release / macos-qt (push) Blocked by required conditions
Build and Release / linux-sdl (push) Blocked by required conditions
Build and Release / linux-qt (push) Blocked by required conditions
Build and Release / linux-sdl-gcc (push) Blocked by required conditions
Build and Release / linux-qt-gcc (push) Blocked by required conditions
Build and Release / pre-release (push) Blocked by required conditions

* move display mode and hdr to graphics tab

* add left margin to display settings box

* merge display combo box and fullscreen checkbox

* remove commented out checkbox

* Rename borderless to windowed

* rename graphics box and mode

* Rename window modes and map

* fix formatting

* fix: xml formatting

* Rename borderless windowed

* change resolution input layout

* rename resolution to window size

* change window size layout oriention

* add true fullscreen mode

* fix duplicate label name

* set fullscreen on true fullscreen or borderless

* remove commented out ref

* rearrange settings config for new schema

* move HDR config to GPU section
This commit is contained in:
jarred wilson 2025-02-23 09:01:09 -06:00 committed by GitHub
parent e1e697a3ff
commit bc85357235
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 178 additions and 174 deletions

View file

@ -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<bool>(general, "allowHDR", false);
isNeo = toml::find_or<bool>(general, "isPS4Pro", false);
isFullscreen = toml::find_or<bool>(general, "Fullscreen", false);
fullscreenMode = toml::find_or<std::string>(general, "FullscreenMode", "borderless");
playBGM = toml::find_or<bool>(general, "playBGM", false);
isTrophyPopupDisabled = toml::find_or<bool>(general, "isTrophyPopupDisabled", false);
BGMvolume = toml::find_or<int>(general, "BGMvolume", 50);
@ -742,6 +739,10 @@ void load(const std::filesystem::path& path) {
shouldDumpShaders = toml::find_or<bool>(gpu, "dumpShaders", false);
shouldPatchShaders = toml::find_or<bool>(gpu, "patchShaders", true);
vblankDivider = toml::find_or<int>(gpu, "vblankDivider", 1);
isFullscreen = toml::find_or<bool>(gpu, "Fullscreen", false);
fullscreenMode =
toml::find_or<std::string>(gpu, "FullscreenMode", "Fullscreen (Borderless)");
isHDRAllowed = toml::find_or<bool>(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;

View file

@ -60,7 +60,7 @@ const QVector<int> 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<QString, QString> channelMap;
QMap<QString, QString> logTypeMap;
QMap<QString, QString> fullscreenModeMap;
QMap<QString, QString> screenModeMap;
QMap<QString, QString> chooseHomeTabMap;
int backgroundImageOpacitySlider_backup;
@ -80,7 +80,9 @@ SettingsDialog::SettingsDialog(std::span<const QString> 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<const QString> 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<const QString> 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<int>(data, "General", "BGMvolume", 50));
ui->discordRPCCheckbox->setChecked(
toml::find_or<bool>(data, "General", "enableDiscordRPC", true));
ui->fullscreenCheckBox->setChecked(toml::find_or<bool>(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<bool>(data, "General", "separateUpdateEnabled", false));
ui->gameSizeCheckBox->setChecked(toml::find_or<bool>(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<std::string> 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());

View file

@ -135,49 +135,6 @@
<property name="spacing">
<number>10</number>
</property>
<item>
<widget class="QCheckBox" name="fullscreenCheckBox">
<property name="text">
<string>Enable Fullscreen</string>
</property>
</widget>
</item>
<item>
<widget class="QGroupBox" name="fullscreenModeGroupBox">
<property name="title">
<string>Fullscreen Mode</string>
</property>
<layout class="QVBoxLayout" name="fullscreenModeLayout">
<item>
<widget class="QComboBox" name="fullscreenModeComboBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<item>
<property name="text">
<string>Borderless</string>
</property>
</item>
<item>
<property name="text">
<string>True</string>
</property>
</item>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QCheckBox" name="enableHDRCheckBox">
<property name="text">
<string>Enable HDR</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="separateUpdatesCheckBox">
<property name="text">
@ -1007,117 +964,168 @@
<item>
<layout class="QVBoxLayout" name="graphicsTabLayoutMiddle">
<item>
<layout class="QVBoxLayout" name="layoutResolution">
<property name="spacing">
<number>6</number>
<widget class="QGroupBox" name="displayOptionsGroupBox">
<property name="title">
<string>Video</string>
</property>
<property name="leftMargin">
<number>0</number>
</property>
<item>
<layout class="QHBoxLayout" name="resolutionLayout">
<item>
<widget class="QGroupBox" name="widthGroupBox">
<property name="title">
<string>Width</string>
</property>
<layout class="QVBoxLayout" name="widthLayout">
<item>
<widget class="QSpinBox" name="widthSpinBox">
<property name="accelerated">
<bool>true</bool>
<layout class="QVBoxLayout" name="layoutResolution">
<property name="spacing">
<number>6</number>
</property>
<property name="leftMargin">
<number>12</number>
</property>
<item>
<widget class="QGroupBox" name="displayModeGroupBox">
<property name="title">
<string>Display Mode</string>
</property>
<layout class="QVBoxLayout" name="displayModeLayout">
<item>
<widget class="QComboBox" name="displayModeComboBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<item>
<property name="text">
<string>Windowed</string>
</property>
<property name="correctionMode">
<enum>QAbstractSpinBox::CorrectionMode::CorrectToNearestValue</enum>
</item>
<item>
<property name="text">
<string>Fullscreen</string>
</property>
<property name="keyboardTracking">
<bool>false</bool>
</item>
<item>
<property name="text">
<string>Fullscreen (Borderless)</string>
</property>
<property name="minimum">
<number>0</number>
</property>
<property name="maximum">
<number>9999</number>
</property>
<property name="value">
<number>1280</number>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="heightGroupBox">
<property name="title">
<string>Height</string>
</property>
<layout class="QVBoxLayout" name="heightLayout">
<item>
<widget class="QSpinBox" name="heightSpinBox">
<property name="frame">
<bool>true</bool>
</property>
<property name="accelerated">
<bool>true</bool>
</property>
<property name="correctionMode">
<enum>QAbstractSpinBox::CorrectionMode::CorrectToNearestValue</enum>
</property>
<property name="keyboardTracking">
<bool>false</bool>
</property>
<property name="minimum">
<number>0</number>
</property>
<property name="maximum">
<number>9999</number>
</property>
<property name="value">
<number>720</number>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="heightDivider">
<property name="title">
<string>Vblank Divider</string>
</property>
<layout class="QVBoxLayout" name="vblankLayout">
<item>
<widget class="QSpinBox" name="vblankSpinBox">
<property name="frame">
<bool>true</bool>
</property>
<property name="accelerated">
<bool>true</bool>
</property>
<property name="correctionMode">
<enum>QAbstractSpinBox::CorrectionMode::CorrectToNearestValue</enum>
</property>
<property name="keyboardTracking">
<bool>false</bool>
</property>
<property name="minimum">
<number>1</number>
</property>
<property name="maximum">
<number>9999</number>
</property>
<property name="value">
<number>1</number>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</item>
</layout>
</item>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="windowSizeLayout">
<item>
<widget class="QGroupBox" name="windowSizeGroupBox">
<property name="title">
<string>Window Size</string>
</property>
<layout class="QHBoxLayout" name="resLayout">
<item>
<widget class="QLabel" name="widthLabel">
<property name="text">
<string>W:</string>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="widthSpinBox">
<property name="accelerated">
<bool>true</bool>
</property>
<property name="correctionMode">
<enum>QAbstractSpinBox::CorrectionMode::CorrectToNearestValue</enum>
</property>
<property name="keyboardTracking">
<bool>false</bool>
</property>
<property name="minimum">
<number>0</number>
</property>
<property name="maximum">
<number>9999</number>
</property>
<property name="value">
<number>1280</number>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="heightLabel">
<property name="text">
<string>H:</string>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="heightSpinBox">
<property name="frame">
<bool>true</bool>
</property>
<property name="accelerated">
<bool>true</bool>
</property>
<property name="correctionMode">
<enum>QAbstractSpinBox::CorrectionMode::CorrectToNearestValue</enum>
</property>
<property name="keyboardTracking">
<bool>false</bool>
</property>
<property name="minimum">
<number>0</number>
</property>
<property name="maximum">
<number>9999</number>
</property>
<property name="value">
<number>720</number>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="heightDivider">
<property name="title">
<string>Vblank Divider</string>
</property>
<layout class="QVBoxLayout" name="vblankLayout">
<item>
<widget class="QSpinBox" name="vblankSpinBox">
<property name="frame">
<bool>true</bool>
</property>
<property name="accelerated">
<bool>true</bool>
</property>
<property name="correctionMode">
<enum>QAbstractSpinBox::CorrectionMode::CorrectToNearestValue</enum>
</property>
<property name="keyboardTracking">
<bool>false</bool>
</property>
<property name="minimum">
<number>1</number>
</property>
<property name="maximum">
<number>9999</number>
</property>
<property name="value">
<number>1</number>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QCheckBox" name="enableHDRCheckBox">
<property name="text">
<string>Enable HDR</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<spacer name="verticalSpacer">

View file

@ -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());