Skip to content

Commit

Permalink
Add PPfilter to Settings Dialog GUI
Browse files Browse the repository at this point in the history
  • Loading branch information
rainmakerv3 authored and ngoquang2708 committed Jan 14, 2025
1 parent 223bd88 commit 4b8a1f3
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 6 deletions.
4 changes: 4 additions & 0 deletions src/common/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,10 @@ void setVblankDiv(u32 value) {
vblankDivider = value;
}

void setPostProcessingFilter(const std::string& type) {
ppFilter = type;
}

void setIsFullscreen(bool enable) {
isFullscreen = enable;
}
Expand Down
1 change: 1 addition & 0 deletions src/common/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
5 changes: 5 additions & 0 deletions src/qt_gui/settings_dialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down Expand Up @@ -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));
Expand Down Expand Up @@ -566,6 +570,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());
Expand Down
24 changes: 18 additions & 6 deletions src/qt_gui/settings_dialog.ui
Original file line number Diff line number Diff line change
Expand Up @@ -644,8 +644,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>946</width>
<height>586</height>
<width>463</width>
<height>246</height>
</rect>
</property>
<layout class="QVBoxLayout" name="inputTabVLayout" stretch="0,0">
Expand Down Expand Up @@ -978,6 +978,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>
Expand Down Expand Up @@ -1193,8 +1205,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>946</width>
<height>586</height>
<width>218</width>
<height>173</height>
</rect>
</property>
<layout class="QVBoxLayout" name="pathsTabLayout" stretch="0">
Expand Down Expand Up @@ -1266,8 +1278,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">
Expand Down

0 comments on commit 4b8a1f3

Please sign in to comment.