Skip to content

Commit

Permalink
Update settings_dialog.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
ngoquang2708 committed Jan 14, 2025
1 parent 4b8a1f3 commit 54e1c14
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/qt_gui/settings_dialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ SettingsDialog::SettingsDialog(std::span<const QString> physical_devices,
ui->backButtonBehaviorComboBox->addItem(tr("Touchpad Right"), "right");
ui->backButtonBehaviorComboBox->addItem(tr("None"), "none");

ui->ppFilterComboBox->addItem(tr("linear"));
ui->ppFilterComboBox->addItem(tr("nearest"));
ui->ppFilterComboBox->addItem(tr("Linear"), "linear");
ui->ppFilterComboBox->addItem(tr("Nearest"), "nearest");

InitializeEmulatorLanguages();
LoadValuesFromConfig();
Expand Down Expand Up @@ -305,7 +305,11 @@ void SettingsDialog::LoadValuesFromConfig() {
ui->widthSpinBox->setValue(toml::find_or<int>(data, "GPU", "screenWidth", 1280));
ui->heightSpinBox->setValue(toml::find_or<int>(data, "GPU", "screenHeight", 720));
ui->vblankSpinBox->setValue(toml::find_or<int>(data, "GPU", "vblankDivider", 1));
ui->ppFilterComboBox->setCurrentText(QString::fromStdString(toml::find_or<std::string>(data, "GPU", "ppFilter", "linear")));
if (const auto i = ui->ppFilterComboBox->findData(
QString::fromStdString(toml::find_or<std::string>(data, "GPU", "ppFilter", "linear")));
i != -1) {
ui->ppFilterComboBox->setCurrentIndex(i);
}
ui->dumpShadersCheckBox->setChecked(toml::find_or<bool>(data, "GPU", "dumpShaders", false));
ui->nullGpuCheckBox->setChecked(toml::find_or<bool>(data, "GPU", "nullGpu", false));
ui->playBGMCheckBox->setChecked(toml::find_or<bool>(data, "General", "playBGM", false));
Expand Down Expand Up @@ -570,7 +574,7 @@ void SettingsDialog::UpdateSettings() {
Config::setScreenWidth(ui->widthSpinBox->value());
Config::setScreenHeight(ui->heightSpinBox->value());
Config::setVblankDiv(ui->vblankSpinBox->value());
Config::setPostProcessingFilter(ui->ppFilterComboBox->currentText().toStdString());
Config::setPostProcessingFilter(ui->ppFilterComboBox->currentData().toString().toStdString());
Config::setDumpShaders(ui->dumpShadersCheckBox->isChecked());
Config::setNullGpu(ui->nullGpuCheckBox->isChecked());
Config::setSeparateUpdateEnabled(ui->separateUpdatesCheckBox->isChecked());
Expand Down

0 comments on commit 54e1c14

Please sign in to comment.