1
0
mirror of https://github.com/blawar/GLideN64.git synced 2024-06-24 21:39:35 +00:00

Support FXAA in GUI.

This commit is contained in:
Sergey Lipskiy 2018-08-26 21:51:40 +07:00
parent bb6debf2f7
commit 67e68ed1f6
4 changed files with 49 additions and 35 deletions

View File

@ -111,6 +111,8 @@ void ConfigDialog::_init()
ui->fullScreenResolutionComboBox->setCurrentIndex(fullscreenMode);
ui->fullScreenRefreshRateComboBox->setCurrentIndex(fullscreenRate);
ui->fxaaCheckBox->toggle();
ui->fxaaCheckBox->setChecked(config.video.fxaa != 0);
ui->aliasingSlider->setValue(powof(config.video.multisampling));
ui->aliasingLabelVal->setText(QString::number(config.video.multisampling));
ui->anisotropicSlider->setValue(config.texture.maxAnisotropy);
@ -386,7 +388,8 @@ void ConfigDialog::accept()
getFullscreenResolutions(ui->fullScreenResolutionComboBox->currentIndex(), config.video.fullscreenWidth, config.video.fullscreenHeight);
getFullscreenRefreshRate(ui->fullScreenRefreshRateComboBox->currentIndex(), config.video.fullscreenRefresh);
config.video.multisampling = ui->n64DepthCompareCheckBox->isChecked() ? 0 : pow2(ui->aliasingSlider->value());
config.video.fxaa = ui->fxaaCheckBox->isChecked() ? 1 : 0;
config.video.multisampling = (ui->fxaaCheckBox->isChecked() || ui->n64DepthCompareCheckBox->isChecked()) ? 0 : pow2(ui->aliasingSlider->value());
config.texture.maxAnisotropy = ui->anisotropicSlider->value();
if (ui->blnrStandardRadioButton->isChecked())
@ -793,3 +796,13 @@ void ConfigDialog::on_removeProfilePushButton_clicked()
ui->removeProfilePushButton->setDisabled(ui->profilesComboBox->count() < 2);
}
}
void ConfigDialog::on_fxaaCheckBox_toggled(bool checked)
{
ui->aliasingFrame->setEnabled(!checked && !ui->n64DepthCompareCheckBox->isChecked());
}
void ConfigDialog::on_n64DepthCompareCheckBox_toggled(bool checked)
{
ui->aliasingFrame->setEnabled(!checked && !ui->fxaaCheckBox->isChecked());
}

View File

@ -60,6 +60,10 @@ private slots:
void on_removeProfilePushButton_clicked();
void on_fxaaCheckBox_toggled(bool checked);
void on_n64DepthCompareCheckBox_toggled(bool checked);
private:
void _init();
void _getTranslations(QStringList & _translationFiles) const;

View File

@ -27,6 +27,7 @@ void _loadSettings(QSettings & settings)
config.video.windowedHeight = settings.value("windowedHeight", config.video.windowedHeight).toInt();
config.video.fullscreenRefresh = settings.value("fullscreenRefresh", config.video.fullscreenRefresh).toInt();
config.video.multisampling = settings.value("multisampling", config.video.multisampling).toInt();
config.video.fxaa= settings.value("fxaa", config.video.fxaa).toInt();
config.video.verticalSync = settings.value("verticalSync", config.video.verticalSync).toInt();
settings.endGroup();
@ -189,6 +190,7 @@ void writeSettings(const QString & _strIniFolder)
settings.setValue("windowedHeight", config.video.windowedHeight);
settings.setValue("fullscreenRefresh", config.video.fullscreenRefresh);
settings.setValue("multisampling", config.video.multisampling);
settings.setValue("fxaa", config.video.fxaa);
settings.setValue("verticalSync", config.video.verticalSync);
settings.endGroup();
@ -370,6 +372,7 @@ void saveCustomRomSettings(const QString & _strIniFolder, const char * _strRomNa
WriteCustomSetting(video, windowedHeight);
WriteCustomSetting(video, fullscreenRefresh);
WriteCustomSetting(video, multisampling);
WriteCustomSetting(video, fxaa);
WriteCustomSetting(video, verticalSync);
settings.endGroup();

View File

@ -35,6 +35,9 @@
<height>450</height>
</size>
</property>
<property name="currentIndex">
<number>0</number>
</property>
<property name="usesScrollButtons">
<bool>false</bool>
</property>
@ -392,6 +395,13 @@
<property name="spacing">
<number>18</number>
</property>
<item>
<widget class="QCheckBox" name="fxaaCheckBox">
<property name="text">
<string>Fast Approximate Anti-Aliasing (FXAA)</string>
</property>
</widget>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_21">
<item>
@ -415,7 +425,7 @@
<item>
<widget class="QLabel" name="aliasingLabel">
<property name="text">
<string>Anti-aliasing:</string>
<string>Multisample Anti-Aliasing (MSAA):</string>
</property>
</widget>
</item>
@ -585,7 +595,7 @@
<item>
<widget class="QLabel" name="aliasingWarningLabel">
<property name="text">
<string>Anti-aliasing is not compatible with N64-style depth compare</string>
<string>Multisample anti-aliasing is not compatible with N64-style depth compare</string>
</property>
<property name="wordWrap">
<bool>true</bool>
@ -3807,8 +3817,8 @@
<y>41</y>
</hint>
<hint type="destinationlabel">
<x>112</x>
<y>587</y>
<x>123</x>
<y>565</y>
</hint>
</hints>
</connection>
@ -3819,12 +3829,12 @@
<slot>setNum(int)</slot>
<hints>
<hint type="sourcelabel">
<x>566</x>
<y>183</y>
<x>599</x>
<y>218</y>
</hint>
<hint type="destinationlabel">
<x>413</x>
<y>199</y>
<x>408</x>
<y>234</y>
</hint>
</hints>
</connection>
@ -3871,8 +3881,8 @@
<y>386</y>
</hint>
<hint type="destinationlabel">
<x>591</x>
<y>130</y>
<x>634</x>
<y>165</y>
</hint>
</hints>
</connection>
@ -3956,22 +3966,6 @@
</hint>
</hints>
</connection>
<connection>
<sender>n64DepthCompareCheckBox</sender>
<signal>toggled(bool)</signal>
<receiver>aliasingFrame</receiver>
<slot>setDisabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>91</x>
<y>386</y>
</hint>
<hint type="destinationlabel">
<x>400</x>
<y>75</y>
</hint>
</hints>
</connection>
<connection>
<sender>frameBufferCheckBox</sender>
<signal>toggled(bool)</signal>
@ -3983,8 +3977,8 @@
<y>41</y>
</hint>
<hint type="destinationlabel">
<x>312</x>
<y>584</y>
<x>323</x>
<y>565</y>
</hint>
</hints>
</connection>
@ -4011,11 +4005,11 @@
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>99</x>
<x>111</x>
<y>71</y>
</hint>
<hint type="destinationlabel">
<x>92</x>
<x>106</x>
<y>85</y>
</hint>
</hints>
@ -4075,8 +4069,8 @@
<slot>setVisible(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>149</x>
<y>307</y>
<x>162</x>
<y>232</y>
</hint>
<hint type="destinationlabel">
<x>144</x>
@ -4086,10 +4080,10 @@
</connection>
</connections>
<buttongroups>
<buttongroup name="screenshotButtonGroup"/>
<buttongroup name="fixTexrectCoordsButtonGroup"/>
<buttongroup name="factorButtonGroup"/>
<buttongroup name="osdButtonGroup"/>
<buttongroup name="aspectButtonGroup"/>
<buttongroup name="fixTexrectCoordsButtonGroup"/>
<buttongroup name="screenshotButtonGroup"/>
</buttongroups>
</ui>