Settings: Make integer and linear upscaling mutually exclusive

This commit is contained in:
Connor McLaughlin 2021-02-01 18:39:15 +10:00
parent 91092847f8
commit 904680f0df
4 changed files with 18 additions and 4 deletions

View File

@ -633,6 +633,12 @@ void HostInterface::FixIncompatibleSettings(bool display_osd_messages)
g_settings.bios_patch_tty_enable = false;
}
if (g_settings.display_integer_scaling && g_settings.display_linear_filtering)
{
Log_WarningPrintf("Disabling linear filter due to integer upscaling.");
g_settings.display_linear_filtering = false;
}
if (g_settings.gpu_pgxp_enable)
{
if (g_settings.gpu_renderer == GPURenderer::Software)

View File

@ -55,7 +55,10 @@ DisplaySettingsWidget::DisplaySettingsWidget(QtHostInterface* host_interface, QW
&DisplaySettingsWidget::onGPUAdapterIndexChanged);
connect(m_ui.fullscreenMode, QOverload<int>::of(&QComboBox::currentIndexChanged), this,
&DisplaySettingsWidget::onGPUFullscreenModeIndexChanged);
connect(m_ui.displayIntegerScaling, &QCheckBox::stateChanged, this,
&DisplaySettingsWidget::onIntegerFilteringChanged);
populateGPUAdaptersAndResolutions();
onIntegerFilteringChanged();
dialog->registerWidgetHelp(
m_ui.renderer, tr("Renderer"),
@ -68,9 +71,8 @@ DisplaySettingsWidget::DisplaySettingsWidget(QtHostInterface* host_interface, QW
tr("If your system contains multiple GPUs or adapters, you can select which GPU you wish to use for the hardware "
"renderers. <br>This option is only supported in Direct3D and Vulkan. OpenGL will always use the default "
"device."));
dialog->registerWidgetHelp(
m_ui.fullscreenMode, tr("Fullscreen Mode"), tr("Borderless Fullscreen"),
tr("Chooses the fullscreen resolution and frequency."));
dialog->registerWidgetHelp(m_ui.fullscreenMode, tr("Fullscreen Mode"), tr("Borderless Fullscreen"),
tr("Chooses the fullscreen resolution and frequency."));
dialog->registerWidgetHelp(
m_ui.displayAspectRatio, tr("Aspect Ratio"),
qApp->translate("DisplayAspectRatio", Settings::GetDisplayAspectRatioName(Settings::DEFAULT_DISPLAY_ASPECT_RATIO)),
@ -267,3 +269,8 @@ void DisplaySettingsWidget::onGPUFullscreenModeIndexChanged()
m_host_interface->SetStringSettingValue("GPU", "FullscreenMode",
m_ui.fullscreenMode->currentText().toUtf8().constData());
}
void DisplaySettingsWidget::onIntegerFilteringChanged()
{
m_ui.displayLinearFiltering->setEnabled(!m_ui.displayIntegerScaling->isChecked());
}

View File

@ -20,6 +20,7 @@ private Q_SLOTS:
void populateGPUAdaptersAndResolutions();
void onGPUAdapterIndexChanged();
void onGPUFullscreenModeIndexChanged();
void onIntegerFilteringChanged();
private:
void setupAdditionalUi();

View File

@ -1631,7 +1631,7 @@ void DrawSettingsWindow()
settings_changed |=
ToggleButton("Linear Upscaling", "Uses a bilinear filter when upscaling to display, smoothing out the image.",
&s_settings_copy.display_linear_filtering);
&s_settings_copy.display_linear_filtering, !s_settings_copy.display_integer_scaling);
settings_changed |=
ToggleButton("Integer Upscaling", "Adds padding to ensure pixels are a whole number in size.",