mirror of
https://github.com/WinampDesktop/winamp.git
synced 2025-06-17 10:25:46 -04:00
GPU: Add downsample scale option
This commit is contained in:
@ -20,6 +20,7 @@ EnhancementSettingsWidget::EnhancementSettingsWidget(SettingsDialog* dialog, QWi
|
||||
SettingWidgetBinder::BindWidgetToEnumSetting(sif, m_ui.gpuDownsampleMode, "GPU", "DownsampleMode",
|
||||
&Settings::ParseDownsampleModeName, &Settings::GetDownsampleModeName,
|
||||
Settings::DEFAULT_GPU_DOWNSAMPLE_MODE);
|
||||
SettingWidgetBinder::BindWidgetToIntSetting(sif, m_ui.gpuDownsampleScale, "GPU", "DownsampleScale", 1);
|
||||
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.trueColor, "GPU", "TrueColor", false);
|
||||
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.scaledDithering, "GPU", "ScaledDithering", false);
|
||||
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.disableInterlacing, "GPU", "DisableInterlacing", true);
|
||||
@ -43,7 +44,10 @@ EnhancementSettingsWidget::EnhancementSettingsWidget(SettingsDialog* dialog, QWi
|
||||
|
||||
connect(m_ui.resolutionScale, QOverload<int>::of(&QComboBox::currentIndexChanged), this,
|
||||
&EnhancementSettingsWidget::updateScaledDitheringEnabled);
|
||||
connect(m_ui.gpuDownsampleMode, QOverload<int>::of(&QComboBox::currentIndexChanged), this,
|
||||
&EnhancementSettingsWidget::updateDownsampleScaleVisible);
|
||||
connect(m_ui.trueColor, &QCheckBox::stateChanged, this, &EnhancementSettingsWidget::updateScaledDitheringEnabled);
|
||||
updateDownsampleScaleVisible();
|
||||
updateScaledDitheringEnabled();
|
||||
|
||||
connect(m_ui.pgxpEnable, &QCheckBox::stateChanged, this, &EnhancementSettingsWidget::updatePGXPSettingsEnabled);
|
||||
@ -55,6 +59,9 @@ EnhancementSettingsWidget::EnhancementSettingsWidget(SettingsDialog* dialog, QWi
|
||||
m_ui.gpuDownsampleMode, tr("Downsampling"), tr("Disabled"),
|
||||
tr("Downsamples the rendered image prior to displaying it. Can improve overall image quality in mixed 2D/3D games, "
|
||||
"but should be disabled for pure 3D games. Only applies to the hardware renderers."));
|
||||
dialog->registerWidgetHelp(m_ui.gpuDownsampleScale, tr("Downsampling Display Scale"), tr("1x"),
|
||||
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"),
|
||||
tr(
|
||||
@ -141,6 +148,29 @@ void EnhancementSettingsWidget::updateScaledDitheringEnabled()
|
||||
m_ui.scaledDithering->setEnabled(allow_scaled_dithering);
|
||||
}
|
||||
|
||||
void EnhancementSettingsWidget::updateDownsampleScaleVisible()
|
||||
{
|
||||
const GPUDownsampleMode mode =
|
||||
Settings::ParseDownsampleModeName(
|
||||
m_dialog
|
||||
->getEffectiveStringValue("GPU", "DownsampleMode",
|
||||
Settings::GetDownsampleModeName(Settings::DEFAULT_GPU_DOWNSAMPLE_MODE))
|
||||
.c_str())
|
||||
.value_or(Settings::DEFAULT_GPU_DOWNSAMPLE_MODE);
|
||||
|
||||
const bool visible = (mode == GPUDownsampleMode::Box);
|
||||
if (visible && m_ui.gpuDownsampleLayout->indexOf(m_ui.gpuDownsampleScale) < 0)
|
||||
{
|
||||
m_ui.gpuDownsampleScale->setVisible(true);
|
||||
m_ui.gpuDownsampleLayout->addWidget(m_ui.gpuDownsampleScale, 0);
|
||||
}
|
||||
else if (!visible && m_ui.gpuDownsampleLayout->indexOf(m_ui.gpuDownsampleScale) >= 0)
|
||||
{
|
||||
m_ui.gpuDownsampleScale->setVisible(false);
|
||||
m_ui.gpuDownsampleLayout->removeWidget(m_ui.gpuDownsampleScale);
|
||||
}
|
||||
}
|
||||
|
||||
void EnhancementSettingsWidget::setupAdditionalUi()
|
||||
{
|
||||
QtUtils::FillComboBoxWithResolutionScales(m_ui.resolutionScale);
|
||||
|
@ -19,6 +19,7 @@ public:
|
||||
|
||||
private Q_SLOTS:
|
||||
void updateScaledDitheringEnabled();
|
||||
void updateDownsampleScaleVisible();
|
||||
void updatePGXPSettingsEnabled();
|
||||
|
||||
private:
|
||||
|
@ -88,7 +88,24 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QComboBox" name="gpuDownsampleMode"/>
|
||||
<layout class="QHBoxLayout" name="gpuDownsampleLayout" stretch="1,0">
|
||||
<item>
|
||||
<widget class="QComboBox" name="gpuDownsampleMode"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QSpinBox" name="gpuDownsampleScale">
|
||||
<property name="suffix">
|
||||
<string>x</string>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>16</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
|
Reference in New Issue
Block a user