Qt: Tidy up Enhancement settings

This commit is contained in:
Stenzek 2024-01-19 21:40:44 +10:00
parent f369724b7c
commit 37276472eb
No known key found for this signature in database
4 changed files with 74 additions and 67 deletions

View file

@ -3999,7 +3999,7 @@ void FullscreenUI::DrawDisplaySettingsPage()
DrawToggleSetting(bsi, FSUI_CSTR("True Color Debanding"),
FSUI_CSTR("Applies modern dithering techniques to further smooth out gradients when true color is enabled."), "GPU",
"Debanding", false, is_hardware);
"Debanding", false, is_hardware && bsi->GetBoolValue("GPU", "TrueColor", false));
DrawToggleSetting(bsi, FSUI_CSTR("Widescreen Hack"),
FSUI_CSTR("Increases the field of view from 4:3 to the chosen display aspect ratio in 3D games."),

View file

@ -43,12 +43,12 @@ EnhancementSettingsWidget::EnhancementSettingsWidget(SettingsWindow* dialog, QWi
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.pgxpCPU, "GPU", "PGXPCPU", false);
connect(m_ui.resolutionScale, QOverload<int>::of(&QComboBox::currentIndexChanged), this,
&EnhancementSettingsWidget::updateScaledDitheringEnabled);
&EnhancementSettingsWidget::onTrueColorChanged);
connect(m_ui.gpuDownsampleMode, QOverload<int>::of(&QComboBox::currentIndexChanged), this,
&EnhancementSettingsWidget::updateDownsampleScaleVisible);
connect(m_ui.trueColor, &QCheckBox::stateChanged, this, &EnhancementSettingsWidget::updateScaledDitheringEnabled);
connect(m_ui.trueColor, &QCheckBox::stateChanged, this, &EnhancementSettingsWidget::onTrueColorChanged);
updateDownsampleScaleVisible();
updateScaledDitheringEnabled();
onTrueColorChanged();
connect(m_ui.pgxpEnable, &QCheckBox::stateChanged, this, &EnhancementSettingsWidget::updatePGXPSettingsEnabled);
connect(m_ui.pgxpTextureCorrection, &QCheckBox::stateChanged, this,
@ -63,7 +63,7 @@ EnhancementSettingsWidget::EnhancementSettingsWidget(SettingsWindow* dialog, QWi
tr("Selects the resolution scale that will be applied to the final image. 1x will "
"downsample to the original console resolution."));
dialog->registerWidgetHelp(
m_ui.disableInterlacing, tr("Disable Interlacing (force progressive render/scan)"), tr("Unchecked"),
m_ui.disableInterlacing, tr("Disable Interlacing"), tr("Unchecked"),
tr(
"Forces the rendering and display of frames to progressive mode. <br>This removes the \"combing\" effect seen in "
"480i games by rendering them in 480p. Usually safe to enable.<br> "
@ -74,7 +74,7 @@ EnhancementSettingsWidget::EnhancementSettingsWidget(SettingsWindow* dialog, QWi
"to the hardware backends. <br>This option is usually safe, with most games looking fine at "
"higher resolutions. Higher resolutions require a more powerful GPU."));
dialog->registerWidgetHelp(
m_ui.trueColor, tr("True Color Rendering (24-bit, disables dithering)"), tr("Unchecked"),
m_ui.trueColor, tr("True Color Rendering"), tr("Unchecked"),
tr("Forces the precision of colours output to the console's framebuffer to use the full 8 bits of precision per "
"channel. This produces nicer looking gradients at the cost of making some colours look slightly different. "
"Disabling the option also enables dithering, which makes the transition between colours less sharp by applying "
@ -83,10 +83,11 @@ EnhancementSettingsWidget::EnhancementSettingsWidget(SettingsWindow* dialog, QWi
dialog->registerWidgetHelp(
m_ui.debanding, tr("True Color Debanding"), tr("Unchecked"),
tr("Applies modern dithering techniques to further smooth out gradients when true color is enabled. "
"This debanding is performed during rendering (as opposed to a post-processing step), which allows it to be fast while preserving detail. "
"Debanding increases the file size of screenshots due to the subtle dithering pattern present in screenshots."));
"This debanding is performed during rendering (as opposed to a post-processing step), which allows it to be "
"fast while preserving detail. "
"Debanding increases the file size of screenshots due to the subtle dithering pattern present in screenshots."));
dialog->registerWidgetHelp(
m_ui.scaledDithering, tr("Scaled Dithering (scale dither pattern to resolution)"), tr("Checked"),
m_ui.scaledDithering, tr("Scaled Dithering"), tr("Checked"),
tr("Scales the dither pattern to the resolution scale of the emulated GPU. This makes the dither pattern much less "
"obvious at higher resolutions. <br>Usually safe to enable, and only supported by the hardware renderers."));
dialog->registerWidgetHelp(m_ui.forceNTSCTimings, tr("Force NTSC Timings (60hz-on-PAL)"), tr("Unchecked"),
@ -145,12 +146,14 @@ EnhancementSettingsWidget::EnhancementSettingsWidget(SettingsWindow* dialog, QWi
EnhancementSettingsWidget::~EnhancementSettingsWidget() = default;
void EnhancementSettingsWidget::updateScaledDitheringEnabled()
void EnhancementSettingsWidget::onTrueColorChanged()
{
const int resolution_scale = m_ui.resolutionScale->currentIndex();
const bool true_color = m_ui.trueColor->isChecked();
const bool allow_scaled_dithering = (resolution_scale != 1 && !true_color);
const bool allow_debanding = true_color;
m_ui.scaledDithering->setEnabled(allow_scaled_dithering);
m_ui.debanding->setEnabled(allow_debanding);
}
void EnhancementSettingsWidget::updateDownsampleScaleVisible()

View file

@ -18,7 +18,7 @@ public:
~EnhancementSettingsWidget();
private Q_SLOTS:
void updateScaledDitheringEnabled();
void onTrueColorChanged();
void updateDownsampleScaleVisible();
void updatePGXPSettingsEnabled();

View file

@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>448</width>
<height>516</height>
<width>640</width>
<height>452</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
@ -49,41 +49,6 @@
<item row="2" column="1">
<widget class="QComboBox" name="textureFiltering"/>
</item>
<item row="4" column="0">
<widget class="QCheckBox" name="trueColor">
<property name="text">
<string>True Color Rendering (24-bit, disables dithering)</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QCheckBox" name="debanding">
<property name="text">
<string>True Color Debanding</string>
</property>
</widget>
</item>
<item row="5" column="0" colspan="2">
<widget class="QCheckBox" name="scaledDithering">
<property name="text">
<string>Scaled Dithering (scale dither pattern to resolution)</string>
</property>
</widget>
</item>
<item row="6" column="0" colspan="2">
<widget class="QCheckBox" name="widescreenHack">
<property name="text">
<string>Widescreen Hack (render 3D in display aspect ratio)</string>
</property>
</widget>
</item>
<item row="7" column="0" colspan="2">
<widget class="QCheckBox" name="useSoftwareRendererForReadbacks">
<property name="text">
<string>Software Renderer Readbacks (run in parallel for VRAM-&gt;CPU transfers)</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label">
<property name="text">
@ -111,6 +76,52 @@
</item>
</layout>
</item>
<item row="4" column="0" colspan="2">
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
<widget class="QCheckBox" name="trueColor">
<property name="text">
<string>True Color Rendering</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QCheckBox" name="debanding">
<property name="text">
<string>True Color Debanding</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QCheckBox" name="scaledDithering">
<property name="text">
<string>Scaled Dithering</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QCheckBox" name="widescreenHack">
<property name="text">
<string>Widescreen Hack</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QCheckBox" name="useSoftwareRendererForReadbacks">
<property name="text">
<string>Software Renderer Readbacks</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QCheckBox" name="disableInterlacing">
<property name="text">
<string>Disable Interlacing</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
@ -119,32 +130,25 @@
<property name="title">
<string>Display Enhancements</string>
</property>
<layout class="QFormLayout" name="formLayout_3">
<item row="0" column="0" colspan="2">
<widget class="QCheckBox" name="disableInterlacing">
<property name="text">
<string>Disable Interlacing (force progressive render/scan)</string>
</property>
</widget>
</item>
<item row="1" column="0" colspan="2">
<widget class="QCheckBox" name="forceNTSCTimings">
<property name="text">
<string>Force NTSC Timings (60hz-on-PAL)</string>
</property>
</widget>
</item>
<item row="2" column="0" colspan="2">
<layout class="QGridLayout" name="gridLayout_3">
<item row="0" column="0">
<widget class="QCheckBox" name="force43For24Bit">
<property name="text">
<string>Force 4:3 For 24-Bit Display (disable widescreen for FMVs)</string>
<string>Force 4:3 For FMVs</string>
</property>
</widget>
</item>
<item row="3" column="0" colspan="2">
<item row="0" column="1">
<widget class="QCheckBox" name="chromaSmoothingFor24Bit">
<property name="text">
<string>Chroma Smoothing For 24-Bit Display (reduce FMV color blockyness)</string>
<string>FMV Chroma Smoothing</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QCheckBox" name="forceNTSCTimings">
<property name="text">
<string>Force NTSC Timings</string>
</property>
</widget>
</item>