1
0
mirror of https://github.com/blawar/GLideN64.git synced 2024-06-30 16:29:56 +00:00

Make optimization implemented in e0418c3c34 as optional.

S. F. Rush looks much better without the optimization.

Fixed #2068 S. F. Rush and Rush 2 - Regressions
This commit is contained in:
Sergey Lipskiy 2019-11-27 17:08:17 +07:00
parent a8f23045fd
commit bc05d5f0d8
8 changed files with 61 additions and 35 deletions

View File

@ -182,18 +182,22 @@ graphics2D\correctTexrectCoords=2
[RUSH%202]
frameBufferEmulation\bufferSwapMode=1
graphics2D\correctTexrectCoords=2
[SAN%20FRANCISCO%20RUSH]
Good_Name=San Francisco Rush Extreme Racing (U)
frameBufferEmulation\bufferSwapMode=1
graphics2D\enableNativeResTexrects=2
[S.F.RUSH]
Good_Name=San Francisco Rush Extreme Racing (E)
frameBufferEmulation\bufferSwapMode=1
graphics2D\enableNativeResTexrects=2
[S.F.%20RUSH]
Good_Name=San Francisco Rush Extreme Racing (U)
frameBufferEmulation\bufferSwapMode=1
graphics2D\enableNativeResTexrects=2
[SHADOWMAN]
Good_Name=Shadow Man (B)(E)(F)(G)(U)

View File

@ -50,7 +50,7 @@ void Config::resetToDefaults()
#endif
graphics2D.correctTexrectCoords = tcDisable;
graphics2D.enableNativeResTexrects = 0;
graphics2D.enableNativeResTexrects = NativeResTexrectsMode::ntDisable;
graphics2D.bgMode = BGMode::bgStripped;
frameBufferEmulation.enable = 1;

View File

@ -68,6 +68,12 @@ struct Config
bgStripped = 1
};
enum NativeResTexrectsMode {
ntDisable = 0,
ntOptimized,
ntUnptimized
};
struct {
u32 correctTexrectCoords;
u32 enableNativeResTexrects;

View File

@ -182,8 +182,7 @@ void ConfigDialog::_init(bool reInit, bool blockCustomSettings)
ui->halosRemovalCheckBox->setChecked(config.texture.enableHalosRemoval != 0);
ui->nativeRes2D_checkBox->toggle();
ui->nativeRes2D_checkBox->setChecked(config.graphics2D.enableNativeResTexrects != 0);
ui->nativeRes2DComboBox->setCurrentIndex(config.graphics2D.enableNativeResTexrects);
ui->gammaCorrectionNoteFrame->setHidden(true);
ui->gammaLevelSpinBox->setValue(config.gammaCorrection.force != 0 ? config.gammaCorrection.level : 2.0);
@ -483,7 +482,7 @@ void ConfigDialog::accept(bool justSave) {
config.graphics2D.bgMode = Config::BGMode::bgStripped;
config.texture.enableHalosRemoval = ui->halosRemovalCheckBox->isChecked() ? 1 : 0;
config.graphics2D.enableNativeResTexrects = ui->nativeRes2D_checkBox->isChecked() ? 1 : 0;
config.graphics2D.enableNativeResTexrects = ui->nativeRes2DComboBox->currentIndex();
config.frameBufferEmulation.enable = ui->frameBufferCheckBox->isChecked() ? 1 : 0;
@ -977,3 +976,8 @@ void ConfigDialog::on_removeProfilePushButton_clicked()
ui->removeProfilePushButton->setDisabled(ui->profilesComboBox->count() == 3);
}
}
void ConfigDialog::on_nativeRes2DComboBox_currentIndexChanged(int index)
{
ui->fixTexrectFrame->setEnabled(index == 0);
}

View File

@ -76,6 +76,8 @@ private slots:
void on_removeProfilePushButton_clicked();
void on_nativeRes2DComboBox_currentIndexChanged(int index);
private:
void _init(bool reInit = false, bool blockCustomSettings = false);
void _getTranslations(QStringList & _translationFiles) const;

View File

@ -1419,6 +1419,42 @@
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<layout class="QHBoxLayout" name="nativeRes2Dlayout">
<item>
<widget class="QLabel" name="nativeRes2DLabel">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;When checked, 2D elements are rendered at the N64s resolution before copying them to output. This usually eliminates display issues with 2D elements, but it can be slow. This option uses heuristics to detect adjacent 2D elements that doesn't work for every game.&lt;/p&gt;&lt;p&gt;[Recommended: &lt;span style=&quot; font-style:italic;&quot;&gt;Checked, unless you have performance problems&lt;/span&gt;]&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Render 2D elements in N64 resolution (best quality, can be slow):</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="nativeRes2DComboBox">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;When checked, 2D elements are rendered at the N64s resolution before copying them to output. This usually eliminates display issues with 2D elements, but it can be slow. This option uses heuristics to detect adjacent 2D elements that doesn't work for every game.&lt;/p&gt;&lt;p&gt;[Recommended: &lt;span style=&quot; font-style:italic;&quot;&gt;Checked, unless you have performance problems&lt;/span&gt;]&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<item>
<property name="text">
<string>Disable</string>
</property>
</item>
<item>
<property name="text">
<string>Enable optimized</string>
</property>
</item>
<item>
<property name="text">
<string>Enable unoptimized</string>
</property>
</item>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QCheckBox" name="halosRemovalCheckBox">
<property name="text">
@ -1426,19 +1462,6 @@
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="nativeRes2D_checkBox">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;When checked, 2D elements are rendered at the N64s resolution before copying them to output. This usually eliminates display issues with 2D elements, but it can be slow. This option uses heuristics to detect adjacent 2D elements that doesn't work for every game.&lt;/p&gt;&lt;p&gt;[Recommended: &lt;span style=&quot; font-style:italic;&quot;&gt;Checked, unless you have performance problems&lt;/span&gt;]&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string extracomment="2D elements, formerly labelled texrects, are usually used for title screens or HUDs">Render 2D elements in N64 resolution (best quality, can be slow)</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
<item>
@ -3945,22 +3968,6 @@
</hint>
</hints>
</connection>
<connection>
<sender>nativeRes2D_checkBox</sender>
<signal>toggled(bool)</signal>
<receiver>fixTexrectFrame</receiver>
<slot>setDisabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>235</x>
<y>350</y>
</hint>
<hint type="destinationlabel">
<x>253</x>
<y>446</y>
</hint>
</hints>
</connection>
<connection>
<sender>frameBufferCheckBox</sender>
<signal>toggled(bool)</signal>

View File

@ -4,6 +4,7 @@
#include <cmath>
#include <Graphics/Context.h>
#include <Graphics/Parameters.h>
#include "Config.h"
#include "DisplayWindow.h"
#include "Textures.h"
#include "RDP.h"
@ -133,6 +134,8 @@ TexrectDrawer::iRect TexrectDrawer::_getiRect(u32 w0, u32 w1) const
bool TexrectDrawer::_lookAhead(bool _checkCoordinates) const
{
if (config.graphics2D.enableNativeResTexrects != Config::NativeResTexrectsMode::ntOptimized)
return true;
if (RSP.LLE)
return true;
switch (GBI.getMicrocodeType()) {

View File

@ -94,7 +94,7 @@ bool Config_SetDefault()
//#2D graphics Settings
res = ConfigSetDefaultInt(g_configVideoGliden64, "CorrectTexrectCoords", config.graphics2D.correctTexrectCoords, "Make texrect coordinates continuous to avoid black lines between them. (0=Off, 1=Auto, 2=Force)");
assert(res == M64ERR_SUCCESS);
res = ConfigSetDefaultBool(g_configVideoGliden64, "EnableNativeResTexrects", config.graphics2D.enableNativeResTexrects, "Render 2D texrects in native resolution to fix misalignment between parts of 2D image.");
res = ConfigSetDefaultInt(g_configVideoGliden64, "EnableNativeResTexrects", config.graphics2D.enableNativeResTexrects, "Render 2D texrects in native resolution to fix misalignment between parts of 2D image. (0=Off, 1=Optimized, 2=Unoptimized)");
assert(res == M64ERR_SUCCESS);
res = ConfigSetDefaultInt(g_configVideoGliden64, "BackgroundsMode", config.graphics2D.bgMode, "Render backgrounds mode (HLE only). (0=One piece (fast), 1=Stripped (precise))");
assert(res == M64ERR_SUCCESS);
@ -407,7 +407,7 @@ void Config_LoadConfig()
#endif
//#2D graphics Settings
config.graphics2D.correctTexrectCoords = ConfigGetParamInt(g_configVideoGliden64, "CorrectTexrectCoords");
config.graphics2D.enableNativeResTexrects = ConfigGetParamBool(g_configVideoGliden64, "EnableNativeResTexrects");
config.graphics2D.enableNativeResTexrects = ConfigGetParamInt(g_configVideoGliden64, "EnableNativeResTexrects");
config.graphics2D.bgMode = ConfigGetParamInt(g_configVideoGliden64, "BackgroundsMode");
//#Frame Buffer Settings:"
config.frameBufferEmulation.enable = ConfigGetParamBool(g_configVideoGliden64, "EnableFBEmulation");