mirror of
https://github.com/stenzek/duckstation.git
synced 2026-07-08 17:46:19 +00:00
Qt: Warn when upscaling is enabled without PGXP
This commit is contained in:
@@ -836,6 +836,12 @@ void GraphicsSettingsWidget::populateAndConnectUpscalingModes(int max_scale)
|
||||
"ResolutionScale", 1);
|
||||
connect(m_ui.resolutionScale, &QComboBox::currentIndexChanged, this,
|
||||
&GraphicsSettingsWidget::updateResolutionDependentOptions);
|
||||
|
||||
m_ui.resolutionScaleWarningIcon->setPixmap(
|
||||
QIcon(QtHost::GetResourceQPath("images/warning.svg", true)).pixmap(16, 16));
|
||||
m_ui.resolutionScaleWarningIcon->setToolTip(
|
||||
tr("PGXP is not enabled. Increasing the resolution without enabling PGXP will result in visible polygon "
|
||||
"glitches."));
|
||||
}
|
||||
|
||||
void GraphicsSettingsWidget::populateUpscalingModes(QComboBox* const cb, int max_scale)
|
||||
@@ -1002,18 +1008,22 @@ void GraphicsSettingsWidget::updatePGXPSettingsEnabled()
|
||||
m_ui.pgxpDisableOn2DPolygons->setEnabled(enabled &&
|
||||
!m_dialog->hasGameTrait(GameDatabase::Trait::DisablePGXPOn2DPolygons));
|
||||
m_ui.pgxpTransparentDepthTest->setEnabled(depth_enabled);
|
||||
updateResolutionDependentOptions();
|
||||
}
|
||||
|
||||
void GraphicsSettingsWidget::updateResolutionDependentOptions()
|
||||
{
|
||||
const bool is_hardware = (getEffectiveRenderer() != GPURenderer::Software);
|
||||
const int scale = m_dialog->getEffectiveIntValue("GPU", "ResolutionScale", 1);
|
||||
const bool pgxp_enabled = (is_hardware && m_dialog->getEffectiveBoolValue("GPU", "PGXPEnable", false) &&
|
||||
!m_dialog->hasGameTrait(GameDatabase::Trait::DisablePGXP));
|
||||
const GPUTextureFilter texture_filtering =
|
||||
Settings::ParseTextureFilterName(m_dialog->getEffectiveStringValue("GPU", "TextureFilter").c_str())
|
||||
.value_or(Settings::DEFAULT_GPU_TEXTURE_FILTER);
|
||||
m_ui.forceRoundedTexcoords->setEnabled(
|
||||
is_hardware && scale != 1 && texture_filtering == GPUTextureFilter::Nearest &&
|
||||
!m_dialog->hasGameTrait(GameDatabase::Trait::ForceRoundUpscaledTextureCoordinates));
|
||||
m_ui.resolutionScaleWarningIcon->setVisible(scale != 1 && !pgxp_enabled);
|
||||
}
|
||||
|
||||
void GraphicsSettingsWidget::warnAboutRendererChange()
|
||||
|
||||
@@ -84,11 +84,49 @@
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_4" columnstretch="0,1">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="resolutionScaleLabel">
|
||||
<property name="text">
|
||||
<string>Internal Resolution:</string>
|
||||
<layout class="QHBoxLayout" name="resolutionScaleLabelLayout">
|
||||
<property name="spacing">
|
||||
<number>4</number>
|
||||
</property>
|
||||
</widget>
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="resolutionScaleLabel">
|
||||
<property name="text">
|
||||
<string>Internal Resolution:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="resolutionScaleWarningIcon">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>16</width>
|
||||
<height>16</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16</width>
|
||||
<height>16</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="visible">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QComboBox" name="resolutionScale"/>
|
||||
|
||||
@@ -509,10 +509,21 @@ void SetupWizardDialog::doMultipleDeviceAutomaticBinding(u32 port, QLabel* updat
|
||||
|
||||
void SetupWizardDialog::setupGraphicsPage(bool initial)
|
||||
{
|
||||
if (initial)
|
||||
{
|
||||
m_ui.resolutionScaleWarningIcon->setPixmap(
|
||||
QIcon(QtHost::GetResourceQPath("images/warning.svg", true)).pixmap(16, 16));
|
||||
}
|
||||
m_ui.resolutionScaleWarningIcon->setToolTip(
|
||||
tr("PGXP is not enabled. Increasing the resolution without enabling PGXP will result in visible polygon "
|
||||
"glitches."));
|
||||
|
||||
SettingWidgetBinder::DisconnectWidget(m_ui.resolutionScale);
|
||||
m_ui.resolutionScale->clear();
|
||||
GraphicsSettingsWidget::populateUpscalingModes(m_ui.resolutionScale);
|
||||
SettingWidgetBinder::BindWidgetToIntSetting(nullptr, m_ui.resolutionScale, "GPU", "ResolutionScale", 1);
|
||||
connect(m_ui.resolutionScale, &QComboBox::currentIndexChanged, this,
|
||||
&SetupWizardDialog::updateResolutionScaleWarning);
|
||||
|
||||
SettingWidgetBinder::DisconnectWidget(m_ui.textureFiltering);
|
||||
m_ui.textureFiltering->clear();
|
||||
@@ -570,7 +581,16 @@ void SetupWizardDialog::setupGraphicsPage(bool initial)
|
||||
{
|
||||
SettingWidgetBinder::BindWidgetToBoolSetting(nullptr, m_ui.pgxpEnable, "GPU", "PGXPEnable", false);
|
||||
SettingWidgetBinder::BindWidgetToBoolSetting(nullptr, m_ui.widescreenHack, "GPU", "WidescreenHack", false);
|
||||
connect(m_ui.pgxpEnable, &QCheckBox::checkStateChanged, this, &SetupWizardDialog::updateResolutionScaleWarning);
|
||||
}
|
||||
|
||||
updateResolutionScaleWarning();
|
||||
}
|
||||
|
||||
void SetupWizardDialog::updateResolutionScaleWarning()
|
||||
{
|
||||
m_ui.resolutionScaleWarningIcon->setVisible(m_ui.resolutionScale->currentData().toInt() != 1 &&
|
||||
!m_ui.pgxpEnable->isChecked());
|
||||
}
|
||||
|
||||
void SetupWizardDialog::setupAchievementsPage(bool initial)
|
||||
|
||||
@@ -41,6 +41,7 @@ private:
|
||||
void setupGameListPage();
|
||||
void setupControllerPage(bool initial);
|
||||
void setupGraphicsPage(bool initial);
|
||||
void updateResolutionScaleWarning();
|
||||
void setupAchievementsPage(bool initial);
|
||||
void setupInterfacePage();
|
||||
void setupGameListViewPage();
|
||||
|
||||
@@ -846,11 +846,49 @@
|
||||
<number>10</number>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="resolutionScaleLabel">
|
||||
<property name="text">
|
||||
<string>Internal Resolution:</string>
|
||||
<layout class="QHBoxLayout" name="resolutionScaleLabelLayout">
|
||||
<property name="spacing">
|
||||
<number>4</number>
|
||||
</property>
|
||||
</widget>
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="resolutionScaleLabel">
|
||||
<property name="text">
|
||||
<string>Internal Resolution:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="resolutionScaleWarningIcon">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>16</width>
|
||||
<height>16</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16</width>
|
||||
<height>16</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="visible">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QComboBox" name="resolutionScale">
|
||||
|
||||
Reference in New Issue
Block a user