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

Add FBInfo controls to GUI.

This commit is contained in:
Sergey Lipskiy 2016-02-03 21:21:10 +06:00
parent 91f7608af8
commit 806f884a51
4 changed files with 204 additions and 20 deletions

View File

@ -144,6 +144,12 @@ void ConfigDialog::_init()
ui->aspectAdjustRadioButton->setChecked(true);
break;
}
ui->copyAuxBuffersCheckBox->setChecked(config.frameBufferEmulation.copyAuxToRDRAM != 0);
ui->fbInfoDisableCheckBox->setChecked(config.frameBufferEmulation.fbInfoDisabled != 0);
ui->readColorChunkCheckBox->setChecked(config.frameBufferEmulation.fbInfoReadColorChunk != 0);
ui->readColorChunkCheckBox->setEnabled(config.frameBufferEmulation.fbInfoDisabled == 0);
ui->readDepthChunkCheckBox->setChecked(config.frameBufferEmulation.fbInfoReadDepthChunk != 0);
ui->readDepthChunkCheckBox->setEnabled(config.frameBufferEmulation.fbInfoDisabled == 0);
// Texture filter settings
QStringList textureFiltersList;
@ -317,6 +323,10 @@ void ConfigDialog::accept()
config.frameBufferEmulation.aspect = Config::a169;
else if (ui->aspectAdjustRadioButton->isChecked())
config.frameBufferEmulation.aspect = Config::aAdjust;
config.frameBufferEmulation.copyAuxToRDRAM = ui->copyAuxBuffersCheckBox->isChecked() ? 1 : 0;
config.frameBufferEmulation.fbInfoDisabled = ui->fbInfoDisableCheckBox->isChecked() ? 1: 0;
config.frameBufferEmulation.fbInfoReadColorChunk = ui->readColorChunkCheckBox->isChecked() ? 1 : 0;
config.frameBufferEmulation.fbInfoReadDepthChunk = ui->readDepthChunkCheckBox->isChecked() ? 1 : 0;
// Texture filter settings
config.textureFilter.txFilterMode = ui->filterComboBox->currentIndex();
@ -439,3 +449,9 @@ void ConfigDialog::on_texPackPathButton_clicked()
if (!directory.isEmpty())
ui->txPathLabel->setText(directory);
}
void ConfigDialog::on_fbInfoDisableCheckBox_toggled(bool checked)
{
ui->readColorChunkCheckBox->setEnabled(!checked);
ui->readDepthChunkCheckBox->setEnabled(!checked);
}

View File

@ -33,6 +33,8 @@ private slots:
void on_texPackPathButton_clicked();
void on_fbInfoDisableCheckBox_toggled(bool checked);
private:
void _init();
void _getTranslations(QStringList & _translationFiles) const;

View File

@ -46,12 +46,16 @@ void _loadSettings(QSettings & settings)
settings.beginGroup("frameBufferEmulation");
config.frameBufferEmulation.enable = settings.value("enable", config.frameBufferEmulation.enable).toInt();
config.frameBufferEmulation.aspect = settings.value("aspect", config.frameBufferEmulation.aspect).toInt();
config.frameBufferEmulation.bufferSwapMode = settings.value("bufferSwapMode", config.frameBufferEmulation.bufferSwapMode).toInt();
config.frameBufferEmulation.N64DepthCompare = settings.value("N64DepthCompare", config.frameBufferEmulation.N64DepthCompare).toInt();
config.frameBufferEmulation.copyAuxToRDRAM = settings.value("copyAuxToRDRAM", config.frameBufferEmulation.copyAuxToRDRAM).toInt();
config.frameBufferEmulation.copyToRDRAM = settings.value("copyToRDRAM", config.frameBufferEmulation.copyToRDRAM).toInt();
config.frameBufferEmulation.copyDepthToRDRAM = settings.value("copyDepthToRDRAM", config.frameBufferEmulation.copyDepthToRDRAM).toInt();
config.frameBufferEmulation.copyFromRDRAM = settings.value("copyFromRDRAM", config.frameBufferEmulation.copyFromRDRAM).toInt();
config.frameBufferEmulation.N64DepthCompare = settings.value("N64DepthCompare", config.frameBufferEmulation.N64DepthCompare).toInt();
config.frameBufferEmulation.aspect = settings.value("aspect", config.frameBufferEmulation.aspect).toInt();
config.frameBufferEmulation.bufferSwapMode = settings.value("bufferSwapMode", config.frameBufferEmulation.bufferSwapMode).toInt();
config.frameBufferEmulation.fbInfoDisabled = settings.value("fbInfoDisabled", config.frameBufferEmulation.fbInfoDisabled).toInt();
config.frameBufferEmulation.fbInfoReadColorChunk = settings.value("fbInfoReadColorChunk", config.frameBufferEmulation.fbInfoReadColorChunk).toInt();
config.frameBufferEmulation.fbInfoReadDepthChunk = settings.value("fbInfoReadDepthChunk", config.frameBufferEmulation.fbInfoReadDepthChunk).toInt();
settings.endGroup();
@ -155,12 +159,16 @@ void writeSettings(const QString & _strIniFolder)
settings.beginGroup("frameBufferEmulation");
settings.setValue("enable", config.frameBufferEmulation.enable);
settings.setValue("copyToRDRAM", config.frameBufferEmulation.copyToRDRAM);
settings.setValue("copyDepthToRDRAM", config.frameBufferEmulation.copyDepthToRDRAM);
settings.setValue("copyFromRDRAM", config.frameBufferEmulation.copyFromRDRAM);
settings.setValue("N64DepthCompare", config.frameBufferEmulation.N64DepthCompare);
settings.setValue("aspect", config.frameBufferEmulation.aspect);
settings.setValue("bufferSwapMode", config.frameBufferEmulation.bufferSwapMode);
settings.setValue("N64DepthCompare", config.frameBufferEmulation.N64DepthCompare);
settings.setValue("copyAuxToRDRAM", config.frameBufferEmulation.copyAuxToRDRAM);
settings.setValue("copyFromRDRAM", config.frameBufferEmulation.copyFromRDRAM);
settings.setValue("copyToRDRAM", config.frameBufferEmulation.copyToRDRAM);
settings.setValue("copyDepthToRDRAM", config.frameBufferEmulation.copyDepthToRDRAM);
settings.setValue("fbInfoDisabled", config.frameBufferEmulation.fbInfoDisabled);
settings.setValue("fbInfoReadColorChunk", config.frameBufferEmulation.fbInfoReadColorChunk);
settings.setValue("fbInfoReadDepthChunk", config.frameBufferEmulation.fbInfoReadDepthChunk);
settings.endGroup();
settings.beginGroup("textureFilter");

View File

@ -640,6 +640,55 @@
<bool>true</bool>
</property>
<layout class="QVBoxLayout" name="verticalLayout_10">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_15">
<property name="spacing">
<number>0</number>
</property>
<item>
<widget class="Line" name="line_4">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_26">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>General options</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item>
<widget class="Line" name="line_5">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="bufferSwapHorizontalLayout">
<item>
@ -676,6 +725,125 @@
</item>
</layout>
</item>
<item>
<widget class="QCheckBox" name="n64DepthCompareCheckBox">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Use shaders to emulate N64 depth compare modes. &lt;span style=&quot; font-weight:600;&quot;&gt;Experimental!&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Emulate N64 depth compare</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="copyAuxBuffersCheckBox">
<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;Copy auxiliary color buffers to RDRAM:&lt;/span&gt;&lt;/p&gt;&lt;p&gt;TODO: add description&lt;/p&gt;&lt;p&gt;[Recommended: &lt;span style=&quot; font-style:italic;&quot;&gt;mostly off&lt;/span&gt;]&lt;br/&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Copy auxiliary color buffers to RDRAM</string>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_16">
<item>
<widget class="Line" name="line_6">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_27">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;If emulator supports &lt;span style=&quot; font-style:italic;&quot;&gt;FBInfo&lt;/span&gt; API extension, plugin will rely on its help to read/write buffers only when game needs them.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Buffers read/write with emulator help</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item>
<widget class="Line" name="line_7">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QCheckBox" name="fbInfoDisableCheckBox">
<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;Do not use emulator help:&lt;/span&gt;&lt;/p&gt;&lt;p&gt;Depending on emulator, frame buffer usage notification may work imperfect and some frame buffer effects will not work. You may disable emulator help and force buffers copy.&lt;/p&gt;&lt;p&gt;[Recommended: off]&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Do not use emulator help</string>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_17">
<item>
<widget class="QCheckBox" name="readColorChunkCheckBox">
<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;Read color buffer by chunks:&lt;/span&gt;&lt;/p&gt;&lt;p&gt;When enabled, color bufer will be read by 4kb chunks. Otherwise the buffer will be read as whole. Read of one chunk is much faster than read of the whole buffer, but if game needs to read the whole buffer, read it by chunks will be slow.&lt;/p&gt;&lt;p&gt;[Recommended: &lt;span style=&quot; font-style:italic;&quot;&gt;mostly off, because color buffer usually read as whole&lt;/span&gt;]&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Read color buffer by chunks</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="readDepthChunkCheckBox">
<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;Read depth buffer by chunks:&lt;/span&gt;&lt;/p&gt;&lt;p&gt;When enabled, depth bufer will be read by 4kb chunks. Otherwise the buffer will be read as whole. Read of one chunk is much faster than read of the whole buffer, but if game needs to read the whole buffer, read it by chunks will be slow.&lt;/p&gt;&lt;p&gt;[Recommended: &lt;span style=&quot; font-style:italic;&quot;&gt;on, because depth buffer seldom read as whole&lt;/span&gt;]&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Read depth buffer by chunks</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_18">
<item>
<widget class="Line" name="line_8">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_28">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;If emulator does not support &lt;span style=&quot; font-style:italic;&quot;&gt;FBInfo&lt;/span&gt; API extension, plugin have to read/write buffers each frame to emulate &lt;span style=&quot; font-style:italic;&quot;&gt;some&lt;/span&gt; frame buffer based effects. It can be slow and also can cause glitches or even crashes. Enable these options only for games, which really need them.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Buffers read/write without emulator help</string>
</property>
</widget>
</item>
<item>
<widget class="Line" name="line_9">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_10">
<item>
@ -749,16 +917,6 @@
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="n64DepthCompareCheckBox">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Use shaders to emulate N64 depth compare modes. &lt;span style=&quot; font-weight:600;&quot;&gt;Experimental!&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Emulate N64 depth compare</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
@ -1524,10 +1682,10 @@
</connection>
</connections>
<buttongroups>
<buttongroup name="screenshotButtonGroup"/>
<buttongroup name="copyFrameBufferButtonGroup"/>
<buttongroup name="bloomBlendModeButtonGroup"/>
<buttongroup name="bilinearButtonGroup"/>
<buttongroup name="aspectButtonGroup"/>
<buttongroup name="copyFrameBufferButtonGroup"/>
<buttongroup name="bloomBlendModeButtonGroup"/>
<buttongroup name="screenshotButtonGroup"/>
</buttongroups>
</ui>