mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-12-10 05:38:49 +00:00
config: Add present mode option. (#3502)
* config: Add present mode option. * settings_dialog: Add details for present modes.
This commit is contained in:
@@ -67,6 +67,7 @@ const QVector<int> languageIndexes = {21, 23, 14, 6, 18, 1, 12, 22, 2, 4, 25, 2
|
||||
QMap<QString, QString> channelMap;
|
||||
QMap<QString, QString> logTypeMap;
|
||||
QMap<QString, QString> screenModeMap;
|
||||
QMap<QString, QString> presentModeMap;
|
||||
QMap<QString, QString> chooseHomeTabMap;
|
||||
QMap<QString, QString> micMap;
|
||||
|
||||
@@ -93,6 +94,9 @@ SettingsDialog::SettingsDialog(std::shared_ptr<gui_settings> gui_settings,
|
||||
screenModeMap = {{tr("Fullscreen (Borderless)"), "Fullscreen (Borderless)"},
|
||||
{tr("Windowed"), "Windowed"},
|
||||
{tr("Fullscreen"), "Fullscreen"}};
|
||||
presentModeMap = {{tr("Mailbox (Vsync)"), "Mailbox"},
|
||||
{tr("Fifo (Vsync)"), "Fifo"},
|
||||
{tr("Immediate (No Vsync)"), "Immediate"}};
|
||||
chooseHomeTabMap = {{tr("General"), "General"}, {tr("GUI"), "GUI"},
|
||||
{tr("Graphics"), "Graphics"}, {tr("User"), "User"},
|
||||
{tr("Input"), "Input"}, {tr("Paths"), "Paths"},
|
||||
@@ -414,6 +418,7 @@ SettingsDialog::SettingsDialog(std::shared_ptr<gui_settings> gui_settings,
|
||||
// Graphics
|
||||
ui->graphicsAdapterGroupBox->installEventFilter(this);
|
||||
ui->windowSizeGroupBox->installEventFilter(this);
|
||||
ui->presentModeGroupBox->installEventFilter(this);
|
||||
ui->heightDivider->installEventFilter(this);
|
||||
ui->dumpShadersCheckBox->installEventFilter(this);
|
||||
ui->nullGpuCheckBox->installEventFilter(this);
|
||||
@@ -540,6 +545,9 @@ void SettingsDialog::LoadValuesFromConfig() {
|
||||
QString translatedText_FullscreenMode =
|
||||
screenModeMap.key(QString::fromStdString(Config::getFullscreenMode()));
|
||||
ui->displayModeComboBox->setCurrentText(translatedText_FullscreenMode);
|
||||
QString translatedText_PresentMode =
|
||||
presentModeMap.key(QString::fromStdString(Config::getPresentMode()));
|
||||
ui->presentModeComboBox->setCurrentText(translatedText_PresentMode);
|
||||
ui->gameSizeCheckBox->setChecked(toml::find_or<bool>(data, "GUI", "loadGameSizeEnabled", true));
|
||||
ui->showSplashCheckBox->setChecked(toml::find_or<bool>(data, "General", "showSplash", false));
|
||||
QString translatedText_logType = logTypeMap.key(QString::fromStdString(Config::getLogType()));
|
||||
@@ -746,6 +754,11 @@ 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 == "presentModeGroupBox") {
|
||||
text = tr("Present Mode:\\nConfigures how video output will be presented to your screen.\\n\\n"
|
||||
"Mailbox: Frames synchronize with your screen's refresh rate. New frames will replace any pending frames. Reduces latency but may skip frames if running behind.\\n"
|
||||
"Fifo: Frames synchronize with your screen's refresh rate. New frames will be queued behind pending frames. Ensures all frames are presented but may increase latency.\\n"
|
||||
"Immediate: Frames immediately present to your screen when ready. May result in tearing.");
|
||||
} 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") {
|
||||
@@ -834,6 +847,8 @@ void SettingsDialog::UpdateSettings() {
|
||||
"Windowed");
|
||||
Config::setFullscreenMode(
|
||||
screenModeMap.value(ui->displayModeComboBox->currentText()).toStdString());
|
||||
Config::setPresentMode(
|
||||
presentModeMap.value(ui->presentModeComboBox->currentText()).toStdString());
|
||||
Config::setIsMotionControlsEnabled(ui->motionControlsCheckBox->isChecked());
|
||||
Config::setBackgroundControllerInput(ui->backgroundControllerCheckBox->isChecked());
|
||||
Config::setisTrophyPopupDisabled(ui->disableTrophycheckBox->isChecked());
|
||||
|
||||
Reference in New Issue
Block a user