Qt: GS Settings Fixes

This commit is contained in:
TheLastRar 2022-03-24 00:58:29 +00:00 committed by refractionpcsx2
parent 1fa6fb0a8c
commit 74ed14496b
3 changed files with 18 additions and 12 deletions

View File

@ -56,7 +56,7 @@ static constexpr RendererInfo s_renderer_info[] = {
static const char* s_anisotropic_filtering_entries[] = {QT_TRANSLATE_NOOP("GraphicsSettingsWidget", "Off (Default)"),
QT_TRANSLATE_NOOP("GraphicsSettingsWidget", "2x"), QT_TRANSLATE_NOOP("GraphicsSettingsWidget", "4x"),
QT_TRANSLATE_NOOP("GraphicsSettingsWidget", "8x"), QT_TRANSLATE_NOOP("GraphicsSettingsWidget", "16x"), nullptr};
static const char* s_anisotropic_filtering_values[] = {"1", "2", "4", "8", "16", nullptr};
static const char* s_anisotropic_filtering_values[] = {"0", "2", "4", "8", "16", nullptr};
static constexpr int DEFAULT_INTERLACE_MODE = 7;
@ -122,7 +122,7 @@ GraphicsSettingsWidget::GraphicsSettingsWidget(SettingsDialog* dialog, QWidget*
//////////////////////////////////////////////////////////////////////////
// HW Settings
//////////////////////////////////////////////////////////////////////////
SettingWidgetBinder::BindWidgetToIntSetting(sif, m_ui.upscaleMultiplier, "EmuCore/GS", "upscale_multiplier", 1);
SettingWidgetBinder::BindWidgetToIntSetting(sif, m_ui.upscaleMultiplier, "EmuCore/GS", "upscale_multiplier", 1, 1);
SettingWidgetBinder::BindWidgetToIntSetting(sif, m_ui.textureFiltering, "EmuCore/GS", "filter", static_cast<int>(BiFiltering::PS2));
SettingWidgetBinder::BindWidgetToIntSetting(
sif, m_ui.trilinearFiltering, "EmuCore/GS", "UserHacks_TriFilter", static_cast<int>(TriFiltering::Off));
@ -138,6 +138,9 @@ GraphicsSettingsWidget::GraphicsSettingsWidget(SettingsDialog* dialog, QWidget*
SettingWidgetBinder::BindWidgetToIntSetting(sif, m_ui.texturePreloading, "EmuCore/GS", "texture_preloading",
static_cast<int>(TexturePreloadingLevel::Off));
connect(m_ui.gpuPaletteConversion, QOverload<int>::of(&QCheckBox::stateChanged), this, &GraphicsSettingsWidget::onGpuPaletteConversionChanged);
onGpuPaletteConversionChanged(m_ui.gpuPaletteConversion->checkState());
//////////////////////////////////////////////////////////////////////////
// HW Renderer Fixes
//////////////////////////////////////////////////////////////////////////
@ -206,18 +209,18 @@ GraphicsSettingsWidget::GraphicsSettingsWidget(SettingsDialog* dialog, QWidget*
// per-game override for renderer is slightly annoying, since we need to populate the global setting field
if (sif)
{
const int global_renderer = QtHost::GetBaseIntSettingValue("EmuCore/GS", "Renderer", static_cast<int>(GSRendererType::Auto));
QString global_renderer_name;
for (const RendererInfo& ri : s_renderer_info)
{
if (renderer == static_cast<int>(ri.type))
if (global_renderer == static_cast<int>(ri.type))
global_renderer_name = qApp->translate("GraphicsSettingsWidget", ri.name);
}
m_ui.renderer->insertItem(0, tr("Use Global Setting [%1]").arg(global_renderer_name));
// Effective Index already selected, set to global if setting is not per-game
int override_renderer;
if (sif->GetIntValue("EmuCore/GS", "Renderer", &override_renderer))
m_ui.renderer->setCurrentIndex(override_renderer + 1);
else
if (!sif->GetIntValue("EmuCore/GS", "Renderer", &override_renderer))
m_ui.renderer->setCurrentIndex(0);
}
@ -281,6 +284,13 @@ void GraphicsSettingsWidget::onFullscreenModeChanged(int index)
void GraphicsSettingsWidget::onIntegerScalingChanged() { m_ui.bilinearFiltering->setEnabled(!m_ui.integerScaling->isChecked()); }
void GraphicsSettingsWidget::onGpuPaletteConversionChanged(int state)
{
const bool enabled = state == Qt::CheckState::PartiallyChecked ? QtHost::GetBaseBoolSettingValue("EmuCore/GS", "paltex", false) : state;
m_ui.anisotropicFiltering->setEnabled(!enabled);
}
void GraphicsSettingsWidget::onEnableHardwareFixesChanged()
{
const bool enabled = (m_ui.enableHWFixes->checkState() == Qt::Checked);

View File

@ -41,6 +41,7 @@ private Q_SLOTS:
void onAdapterChanged(int index);
void onEnableHardwareFixesChanged();
void onIntegerScalingChanged();
void onGpuPaletteConversionChanged(int state);
void onFullscreenModeChanged(int index);
private:

View File

@ -307,11 +307,6 @@
</item>
<item row="0" column="1">
<widget class="QComboBox" name="upscaleMultiplier">
<item>
<property name="text">
<string>Custom</string>
</property>
</item>
<item>
<property name="text">
<string>Native (PS2)</string>
@ -349,7 +344,7 @@
</item>
<item>
<property name="text">
<string>8x Native (~2280p)</string>
<string>8x Native (~2880p)</string>
</property>
</item>
</widget>