1
0
mirror of https://github.com/blawar/GLideN64.git synced 2024-06-25 22:09:35 +00:00

Support correctTexrectCoords option in GUI

This commit is contained in:
Sergey Lipskiy 2016-04-16 12:27:48 +06:00
parent 6cacfa834f
commit 731e5c259e
3 changed files with 72 additions and 2 deletions

View File

@ -117,6 +117,17 @@ void ConfigDialog::_init()
ui->enableHWLightingCheckBox->setChecked(config.generalEmulation.enableHWLighting != 0);
ui->enableShadersStorageCheckBox->setChecked(config.generalEmulation.enableShadersStorage != 0);
ui->customSettingsCheckBox->setChecked(config.generalEmulation.enableCustomSettings != 0);
switch (config.generalEmulation.correctTexrectCoords) {
case Config::tcDisable:
ui->fixTexrectDisableRadioButton->setChecked(true);
break;
case Config::tcSmart:
ui->fixTexrectSmartRadioButton->setChecked(true);
break;
case Config::tcForce:
ui->fixTexrectForceRadioButton->setChecked(true);
break;
}
ui->bufferSwapComboBox->setCurrentIndex(config.frameBufferEmulation.bufferSwapMode);
ui->frameBufferGroupBox->setChecked(config.frameBufferEmulation.enable != 0);
@ -309,6 +320,12 @@ void ConfigDialog::accept()
config.generalEmulation.enableHWLighting = ui->enableHWLightingCheckBox->isChecked() ? 1 : 0;
config.generalEmulation.enableShadersStorage = ui->enableShadersStorageCheckBox->isChecked() ? 1 : 0;
config.generalEmulation.enableCustomSettings = ui->customSettingsCheckBox->isChecked() ? 1 : 0;
if (ui->fixTexrectDisableRadioButton->isChecked())
config.generalEmulation.correctTexrectCoords = Config::tcDisable;
else if (ui->fixTexrectSmartRadioButton->isChecked())
config.generalEmulation.correctTexrectCoords = Config::tcSmart;
else if (ui->fixTexrectForceRadioButton->isChecked())
config.generalEmulation.correctTexrectCoords = Config::tcForce;
config.frameBufferEmulation.bufferSwapMode = ui->bufferSwapComboBox->currentIndex();
config.frameBufferEmulation.enable = ui->frameBufferGroupBox->isChecked() ? 1 : 0;

View File

@ -42,6 +42,7 @@ void _loadSettings(QSettings & settings)
config.generalEmulation.enableHWLighting = settings.value("enableHWLighting", config.generalEmulation.enableHWLighting).toInt();
config.generalEmulation.enableShadersStorage = settings.value("enableShadersStorage", config.generalEmulation.enableShadersStorage).toInt();
config.generalEmulation.enableCustomSettings = settings.value("enableCustomSettings", config.generalEmulation.enableCustomSettings).toInt();
config.generalEmulation.correctTexrectCoords = settings.value("correctTexrectCoords", config.generalEmulation.correctTexrectCoords).toInt();
settings.endGroup();
settings.beginGroup("frameBufferEmulation");
@ -157,6 +158,7 @@ void writeSettings(const QString & _strIniFolder)
settings.setValue("enableHWLighting", config.generalEmulation.enableHWLighting);
settings.setValue("enableShadersStorage", config.generalEmulation.enableShadersStorage);
settings.setValue("enableCustomSettings", config.generalEmulation.enableCustomSettings);
settings.setValue("correctTexrectCoords", config.generalEmulation.correctTexrectCoords);
settings.endGroup();
settings.beginGroup("frameBufferEmulation");

View File

@ -733,6 +733,56 @@
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_22">
<item>
<widget class="QLabel" name="label_33">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Fix black lines between texrect:&lt;/span&gt;&lt;/p&gt;&lt;p&gt;Most games draw 2D backgrounds using texrect command. Texrect stands for textured rectangle. In some games, texrects coordinates not aligned: there is half-pixel split between adjacent texrects. It is not visible in native resolution, but resulted as black lines when image upscaled. This option enables texrect coordinates correction to avoid black lines issue.&lt;/p&gt;&lt;p&gt;* disable - do not correct texrect coordinates&lt;/p&gt;&lt;p&gt;* smart - apply correction only for polygons, which need it. Use it for games, which have black lines issue.&lt;/p&gt;&lt;p&gt;* force - apply correction for all texrects. Use it when &lt;span style=&quot; font-style:italic;&quot;&gt;smart&lt;/span&gt; does not help.&lt;/p&gt;&lt;p&gt;[Recommended: &lt;span style=&quot; font-style:italic;&quot;&gt;game dependant, mostly off&lt;/span&gt;]&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Fix black lines between texrects</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="fixTexrectDisableRadioButton">
<property name="text">
<string>disable</string>
</property>
<attribute name="buttonGroup">
<string notr="true">fixTexrectCoordsButtonGroup</string>
</attribute>
</widget>
</item>
<item>
<widget class="QRadioButton" name="fixTexrectSmartRadioButton">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Fix black lines between texrect:&lt;/span&gt;&lt;/p&gt;&lt;p&gt;Most games draw 2D backgrounds using texrect command. Texrect stands for textured rectangle. In some games, texrects coordinates not aligned: there is half-pixel split between adjacent texrects. It is not visible in native resolution, but resulted as black lines when image upscaled. This option enables texrect coordinates correction to avoid black lines issue.&lt;/p&gt;&lt;p&gt;* disable - do not correct texrect coordinates&lt;/p&gt;&lt;p&gt;* smart - apply correction only for polygons, which need it. Use it for games, which have black lines issue.&lt;/p&gt;&lt;p&gt;* force - apply correction for all texrects. Use it when &lt;span style=&quot; font-style:italic;&quot;&gt;smart&lt;/span&gt; does not help.&lt;/p&gt;&lt;p&gt;[Recommended: &lt;span style=&quot; font-style:italic;&quot;&gt;game dependant, mostly off&lt;/span&gt;]&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>smart</string>
</property>
<attribute name="buttonGroup">
<string notr="true">fixTexrectCoordsButtonGroup</string>
</attribute>
</widget>
</item>
<item>
<widget class="QRadioButton" name="fixTexrectForceRadioButton">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Fix black lines between texrect:&lt;/span&gt;&lt;/p&gt;&lt;p&gt;Most games draw 2D backgrounds using texrect command. Texrect stands for textured rectangle. In some games, texrects coordinates not aligned: there is half-pixel split between adjacent texrects. It is not visible in native resolution, but resulted as black lines when image upscaled. This option enables texrect coordinates correction to avoid black lines issue.&lt;/p&gt;&lt;p&gt;* disable - do not correct texrect coordinates&lt;/p&gt;&lt;p&gt;* smart - apply correction only for polygons, which need it. Use it for games, which have black lines issue.&lt;/p&gt;&lt;p&gt;* force - apply correction for all texrects. Use it when &lt;span style=&quot; font-style:italic;&quot;&gt;smart&lt;/span&gt; does not help.&lt;/p&gt;&lt;p&gt;[Recommended: &lt;span style=&quot; font-style:italic;&quot;&gt;game dependant, mostly off&lt;/span&gt;]&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>force</string>
</property>
<attribute name="buttonGroup">
<string notr="true">fixTexrectCoordsButtonGroup</string>
</attribute>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
@ -1810,10 +1860,11 @@
</connection>
</connections>
<buttongroups>
<buttongroup name="bloomBlendModeButtonGroup"/>
<buttongroup name="screenshotButtonGroup"/>
<buttongroup name="aspectButtonGroup"/>
<buttongroup name="bilinearButtonGroup"/>
<buttongroup name="copyFrameBufferButtonGroup"/>
<buttongroup name="screenshotButtonGroup"/>
<buttongroup name="bloomBlendModeButtonGroup"/>
<buttongroup name="fixTexrectCoordsButtonGroup"/>
</buttongroups>
</ui>