Add PPfilter to Settings Dialog GUI

This commit is contained in:
rainmakerv2 2025-01-13 16:58:04 +08:00 committed by Quang Ngô
parent 8885f4377b
commit b9b09c9492
4 changed files with 24 additions and 2 deletions

View File

@ -331,6 +331,10 @@ void setVblankDiv(u32 value) {
vblankDivider = value;
}
void setPostProcessingFilter(const std::string& type) {
ppFilter = type;
}
void setIsFullscreen(bool enable) {
isFullscreen = enable;
}

View File

@ -66,6 +66,7 @@ void setNullGpu(bool enable);
void setCopyGPUCmdBuffers(bool enable);
void setDumpShaders(bool enable);
void setVblankDiv(u32 value);
void setPostProcessingFilter(const std::string& type);
void setGpuId(s32 selectedGpuId);
void setScreenWidth(u32 width);
void setScreenHeight(u32 height);

View File

@ -91,6 +91,9 @@ 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"));
InitializeEmulatorLanguages();
LoadValuesFromConfig();
@ -302,6 +305,7 @@ 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")));
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));
@ -550,6 +554,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::setDumpShaders(ui->dumpShadersCheckBox->isChecked());
Config::setNullGpu(ui->nullGpuCheckBox->isChecked());
Config::setSeparateUpdateEnabled(ui->separateUpdatesCheckBox->isChecked());

View File

@ -964,6 +964,18 @@
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QGroupBox" name="ppFilterGroupBox">
<property name="title">
<string>Post-Processing Filter</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QComboBox" name="ppFilterComboBox"/>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
</item>
@ -1239,8 +1251,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>946</width>
<height>586</height>
<width>510</width>
<height>269</height>
</rect>
</property>
<layout class="QVBoxLayout" name="debugTabVLayout" stretch="0,1">