Skip to content

Commit

Permalink
Add "Render at constant factor of native resolution" option to GUI.
Browse files Browse the repository at this point in the history
  • Loading branch information
gonetz committed Feb 27, 2016
1 parent 54d4863 commit 676e00f
Show file tree
Hide file tree
Showing 3 changed files with 100 additions and 13 deletions.
2 changes: 2 additions & 0 deletions src/GLideNUI/ConfigDialog.cpp
Expand Up @@ -144,6 +144,7 @@ void ConfigDialog::_init()
ui->aspectAdjustRadioButton->setChecked(true);
break;
}
ui->resolutionFactorSlider->setValue(config.frameBufferEmulation.nativeResFactor);
ui->copyAuxBuffersCheckBox->setChecked(config.frameBufferEmulation.copyAuxToRDRAM != 0);
ui->fbInfoDisableCheckBox->setChecked(config.frameBufferEmulation.fbInfoDisabled != 0);
ui->readColorChunkCheckBox->setChecked(config.frameBufferEmulation.fbInfoReadColorChunk != 0);
Expand Down Expand Up @@ -323,6 +324,7 @@ void ConfigDialog::accept()
config.frameBufferEmulation.aspect = Config::a169;
else if (ui->aspectAdjustRadioButton->isChecked())
config.frameBufferEmulation.aspect = Config::aAdjust;
config.frameBufferEmulation.nativeResFactor = ui->resolutionFactorSlider->value();
config.frameBufferEmulation.copyAuxToRDRAM = ui->copyAuxBuffersCheckBox->isChecked() ? 1 : 0;
config.frameBufferEmulation.fbInfoDisabled = ui->fbInfoDisableCheckBox->isChecked() ? 1: 0;
config.frameBufferEmulation.fbInfoReadColorChunk = ui->readColorChunkCheckBox->isChecked() ? 1 : 0;
Expand Down
2 changes: 2 additions & 0 deletions src/GLideNUI/Settings.cpp
Expand Up @@ -47,6 +47,7 @@ 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.nativeResFactor = settings.value("nativeResFactor", config.frameBufferEmulation.nativeResFactor).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();
Expand Down Expand Up @@ -160,6 +161,7 @@ void writeSettings(const QString & _strIniFolder)
settings.beginGroup("frameBufferEmulation");
settings.setValue("enable", config.frameBufferEmulation.enable);
settings.setValue("aspect", config.frameBufferEmulation.aspect);
settings.setValue("nativeResFactor", config.frameBufferEmulation.nativeResFactor);
settings.setValue("bufferSwapMode", config.frameBufferEmulation.bufferSwapMode);
settings.setValue("N64DepthCompare", config.frameBufferEmulation.N64DepthCompare);
settings.setValue("copyAuxToRDRAM", config.frameBufferEmulation.copyAuxToRDRAM);
Expand Down
109 changes: 96 additions & 13 deletions src/GLideNUI/configDialog.ui
Expand Up @@ -171,6 +171,73 @@
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_5">
<item>
<layout class="QVBoxLayout" name="verticalLayout_9">
<item>
<widget class="QLabel" name="label_29">
<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;Render at constant factor of native resolution.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;If frame buffer emulation enabled and factor is not zero, internal frame buffer size will be that factor of native N64 resolution. The buffer will be scaled to screen resolution when rendered to screen. If factor is zero (default), internal buffer size is equal to screen size. If factor is 1, the game will be rendered in native resolution and then up-scaled to screen resolution.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Render at constant factor of native resolution&lt;span style=&quot; vertical-align:super;&quot;&gt;*&lt;/span&gt;:&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_19">
<item>
<widget class="QSlider" name="resolutionFactorSlider">
<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;Render at constant factor of native resolution.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;If frame buffer emulation enabled and factor is not zero, internal frame buffer size will be that factor of native N64 resolution. The buffer will be scaled to screen resolution when rendered to screen. If factor is zero (default), internal buffer size is equal to screen size. If factor is 1, the game will be rendered in native resolution and then up-scaled to screen resolution.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="maximum">
<number>16</number>
</property>
<property name="pageStep">
<number>2</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="tickPosition">
<enum>QSlider::TicksBelow</enum>
</property>
<property name="tickInterval">
<number>1</number>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_20">
<property name="spacing">
<number>0</number>
</property>
<item>
<widget class="QLabel" name="factorLabelVal">
<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;Render at constant factor of native resolution.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;If frame buffer emulation enabled and factor is not zero, internal frame buffer size will be that factor of native N64 resolution. The buffer will be scaled to screen resolution when rendered to screen. If factor is zero (default), internal buffer size is equal to screen size. If factor is 1, the game will be rendered in native resolution and then up-scaled to screen resolution.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string notr="true">0</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_31">
<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;Render at constant factor of native resolution.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;If frame buffer emulation enabled and factor is not zero, internal frame buffer size will be that factor of native N64 resolution. The buffer will be scaled to screen resolution when rendered to screen. If factor is zero (default), internal buffer size is equal to screen size. If factor is 1, the game will be rendered in native resolution and then up-scaled to screen resolution.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string notr="true">X</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item>
</layout>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_6">
<item>
Expand Down Expand Up @@ -212,14 +279,14 @@
<item>
<widget class="QLabel" name="aliasingLabelVal">
<property name="text">
<string>0</string>
<string notr="true">0</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_5">
<property name="text">
<string>X</string>
<string notr="true">X</string>
</property>
</widget>
</item>
Expand Down Expand Up @@ -316,14 +383,14 @@
<item>
<widget class="QLabel" name="anisotropicLabelVal">
<property name="text">
<string>0</string>
<string notr="true">0</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_3">
<property name="text">
<string>X</string>
<string notr="true">X</string>
</property>
</widget>
</item>
Expand Down Expand Up @@ -1591,12 +1658,12 @@
<slot>setNum(int)</slot>
<hints>
<hint type="sourcelabel">
<x>92</x>
<y>291</y>
<x>107</x>
<y>347</y>
</hint>
<hint type="destinationlabel">
<x>459</x>
<y>290</y>
<y>346</y>
</hint>
</hints>
</connection>
Expand All @@ -1607,12 +1674,12 @@
<slot>setNum(int)</slot>
<hints>
<hint type="sourcelabel">
<x>92</x>
<y>187</y>
<x>107</x>
<y>243</y>
</hint>
<hint type="destinationlabel">
<x>459</x>
<y>186</y>
<y>242</y>
</hint>
</hints>
</connection>
Expand Down Expand Up @@ -1680,12 +1747,28 @@
</hint>
</hints>
</connection>
<connection>
<sender>resolutionFactorSlider</sender>
<signal>valueChanged(int)</signal>
<receiver>factorLabelVal</receiver>
<slot>setNum(int)</slot>
<hints>
<hint type="sourcelabel">
<x>400</x>
<y>168</y>
</hint>
<hint type="destinationlabel">
<x>457</x>
<y>174</y>
</hint>
</hints>
</connection>
</connections>
<buttongroups>
<buttongroup name="bilinearButtonGroup"/>
<buttongroup name="aspectButtonGroup"/>
<buttongroup name="copyFrameBufferButtonGroup"/>
<buttongroup name="bloomBlendModeButtonGroup"/>
<buttongroup name="copyFrameBufferButtonGroup"/>
<buttongroup name="aspectButtonGroup"/>
<buttongroup name="bilinearButtonGroup"/>
<buttongroup name="screenshotButtonGroup"/>
</buttongroups>
</ui>

0 comments on commit 676e00f

Please sign in to comment.