Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/duckstation-qt/consolesettingswidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,8 @@ ConsoleSettingsWidget::ConsoleSettingsWidget(SettingsWindow* dialog, QWidget* pa
connect(m_ui.cpuClockSpeed, &QSlider::valueChanged, this, &ConsoleSettingsWidget::onCPUClockSpeedValueChanged);

SettingWidgetBinder::SetAvailability(m_ui.fastBoot, !m_dialog->hasGameTrait(GameDatabase::Trait::ForceFullBoot));
SettingWidgetBinder::SetAvailability(m_ui.fastForwardBoot, !m_dialog->hasGameTrait(GameDatabase::Trait::ForceFullBoot));
SettingWidgetBinder::SetAvailability(m_ui.fastForwardBoot,
!m_dialog->hasGameTrait(GameDatabase::Trait::ForceFullBoot));
SettingWidgetBinder::SetAvailability(
m_ui.cpuExecutionMode, !m_dialog->hasGameTrait(GameDatabase::Trait::ForceInterpreter), m_ui.cpuExecutionModeLabel);
SettingWidgetBinder::SetAvailability(m_ui.cdromReadSpeedup,
Expand All @@ -151,6 +152,8 @@ ConsoleSettingsWidget::ConsoleSettingsWidget(SettingsWindow* dialog, QWidget* pa
SettingWidgetBinder::SetAvailability(m_ui.cdromSeekSpeedup,
!m_dialog->hasGameTrait(GameDatabase::Trait::DisableCDROMSeekSpeedup),
m_ui.cdromSeekSpeedupLabel);
SettingWidgetBinder::SetForceEnabled(m_ui.recompilerICache,
m_dialog->hasGameTrait(GameDatabase::Trait::ForceRecompilerICache));

calculateCPUClockValue();
}
Expand All @@ -173,7 +176,8 @@ void ConsoleSettingsWidget::updateRecompilerICacheEnabled()
Settings::GetCPUExecutionModeName(Settings::DEFAULT_CPU_EXECUTION_MODE))
.c_str())
.value_or(Settings::DEFAULT_CPU_EXECUTION_MODE);
m_ui.recompilerICache->setEnabled(mode != CPUExecutionMode::Interpreter);
m_ui.recompilerICache->setEnabled(mode != CPUExecutionMode::Interpreter &&
!m_dialog->hasGameTrait(GameDatabase::Trait::ForceRecompilerICache));
}

void ConsoleSettingsWidget::onEnableCPUClockSpeedControlChecked(int state)
Expand Down
15 changes: 10 additions & 5 deletions src/duckstation-qt/graphicssettingswidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,8 @@ GraphicsSettingsWidget::GraphicsSettingsWidget(SettingsWindow* dialog, QWidget*
!m_dialog->hasGameTrait(GameDatabase::Trait::DisableTextureFiltering) ||
!m_dialog->hasGameTrait(GameDatabase::Trait::DisableSpriteTextureFiltering));
SettingWidgetBinder::SetAvailability(m_ui.pgxpEnable, !m_dialog->hasGameTrait(GameDatabase::Trait::DisablePGXP));
SettingWidgetBinder::SetAvailability(m_ui.pgxpDepthBuffer,
!m_dialog->hasGameTrait(GameDatabase::Trait::DisablePGXPDepthBuffer));
SettingWidgetBinder::SetAvailability(m_ui.widescreenHack,
!m_dialog->hasGameTrait(GameDatabase::Trait::DisableWidescreen));

Expand Down Expand Up @@ -205,14 +207,18 @@ GraphicsSettingsWidget::GraphicsSettingsWidget(SettingsWindow* dialog, QWidget*
!m_dialog->hasGameTrait(GameDatabase::Trait::DisablePGXPColorCorrection));
SettingWidgetBinder::SetAvailability(m_ui.pgxpCulling,
!m_dialog->hasGameTrait(GameDatabase::Trait::DisablePGXPCulling));
SettingWidgetBinder::SetAvailability(m_ui.pgxpPreserveProjPrecision,
!m_dialog->hasDatabaseEntry() ||
m_dialog->getDatabaseEntry()->gpu_pgxp_preserve_proj_fp.value_or(true));
SettingWidgetBinder::SetForceEnabled(m_ui.pgxpCPU, m_dialog->hasGameTrait(GameDatabase::Trait::ForcePGXPCPUMode));
SettingWidgetBinder::SetForceEnabled(m_ui.pgxpVertexCache,
m_dialog->hasGameTrait(GameDatabase::Trait::ForcePGXPVertexCache));
SettingWidgetBinder::SetForceEnabled(m_ui.pgxpDisableOn2DPolygons,
m_dialog->hasGameTrait(GameDatabase::Trait::DisablePGXPOn2DPolygons));
if (auto dbentry = m_dialog->getDatabaseEntry(); dbentry && dbentry->gpu_pgxp_preserve_proj_fp.has_value())
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like this should be in a helper functions, since there will be other traits that behave the same way such as those above it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isn't gpu_pgxp_preserve_proj_fp the only one with an explicit true/false value in the db?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was more thinking from the perspective of "results in a forced value", e.g. force software renderer. But eh, I guess the availability kinda handles it.

{
if (*dbentry->gpu_pgxp_preserve_proj_fp)
SettingWidgetBinder::SetForceEnabled(m_ui.pgxpPreserveProjPrecision, true);
else
SettingWidgetBinder::SetAvailability(m_ui.pgxpPreserveProjPrecision, false);
}

// OSD Tab

Expand Down Expand Up @@ -977,8 +983,7 @@ void GraphicsSettingsWidget::updatePGXPSettingsEnabled()
!m_dialog->hasGameTrait(GameDatabase::Trait::DisablePGXPColorCorrection));
m_ui.pgxpDepthBuffer->setEnabled(enabled && !m_dialog->hasGameTrait(GameDatabase::Trait::DisablePGXPDepthBuffer));
m_ui.pgxpPreserveProjPrecision->setEnabled(
enabled &&
(!m_dialog->hasDatabaseEntry() || m_dialog->getDatabaseEntry()->gpu_pgxp_preserve_proj_fp.value_or(true)));
enabled && (!m_dialog->hasDatabaseEntry() || !m_dialog->getDatabaseEntry()->gpu_pgxp_preserve_proj_fp.has_value()));
m_ui.pgxpCPU->setEnabled(enabled && !m_dialog->hasGameTrait(GameDatabase::Trait::ForcePGXPCPUMode));
m_ui.pgxpVertexCache->setEnabled(enabled && !m_dialog->hasGameTrait(GameDatabase::Trait::ForcePGXPVertexCache));
m_ui.pgxpGeometryTolerance->setEnabled(enabled);
Expand Down
Loading