diff --git a/src/duckstation-qt/graphicssettingswidget.cpp b/src/duckstation-qt/graphicssettingswidget.cpp index cdf9ed50f..f8aac64b4 100644 --- a/src/duckstation-qt/graphicssettingswidget.cpp +++ b/src/duckstation-qt/graphicssettingswidget.cpp @@ -213,6 +213,10 @@ GraphicsSettingsWidget::GraphicsSettingsWidget(SettingsWindow* dialog, QWidget* &GraphicsSettingsWidget::updatePGXPSettingsEnabled); connect(m_ui.pgxpDepthBuffer, &QCheckBox::checkStateChanged, this, &GraphicsSettingsWidget::updatePGXPSettingsEnabled); + connect(m_ui.resetPGXPGeometryTolerance, &QPushButton::clicked, this, + &GraphicsSettingsWidget::onResetPGXPGeometryToleranceClicked); + connect(m_ui.resetPGXPDepthClearThreshold, &QPushButton::clicked, this, + &GraphicsSettingsWidget::onResetPGXPDepthClearThresholdClicked); SettingWidgetBinder::SetAvailability(m_ui.pgxpTextureCorrection, !m_dialog->hasGameTrait(GameDatabase::Trait::DisablePGXPTextureCorrection)); @@ -982,8 +986,10 @@ void GraphicsSettingsWidget::updatePGXPSettingsEnabled() m_ui.pgxpVertexCache->setEnabled(enabled && !m_dialog->hasGameTrait(GameDatabase::Trait::ForcePGXPVertexCache)); m_ui.pgxpGeometryTolerance->setEnabled(enabled); m_ui.pgxpGeometryToleranceLabel->setEnabled(enabled); + m_ui.resetPGXPGeometryTolerance->setEnabled(enabled); m_ui.pgxpDepthClearThreshold->setEnabled(depth_enabled); m_ui.pgxpDepthClearThresholdLabel->setEnabled(depth_enabled); + m_ui.resetPGXPDepthClearThreshold->setEnabled(depth_enabled); m_ui.pgxpDisableOn2DPolygons->setEnabled(enabled && !m_dialog->hasGameTrait(GameDatabase::Trait::DisablePGXPOn2DPolygons)); m_ui.pgxpTransparentDepthTest->setEnabled(depth_enabled); @@ -1104,6 +1110,25 @@ void GraphicsSettingsWidget::onFineCropResetClicked() } } +void GraphicsSettingsWidget::onResetPGXPGeometryToleranceClicked() +{ + m_dialog->setFloatSettingValue("GPU", "PGXPTolerance", + m_dialog->isPerGameSettings() ? std::nullopt : std::make_optional(-1.0f)); + SettingWidgetBinder::DisconnectWidget(m_ui.pgxpGeometryTolerance); + SettingWidgetBinder::BindWidgetToFloatSetting(m_dialog->getSettingsInterface(), m_ui.pgxpGeometryTolerance, "GPU", + "PGXPTolerance", -1.0f); +} + +void GraphicsSettingsWidget::onResetPGXPDepthClearThresholdClicked() +{ + m_dialog->setFloatSettingValue( + "GPU", "PGXPDepthThreshold", + m_dialog->isPerGameSettings() ? std::nullopt : std::make_optional(Settings::DEFAULT_GPU_PGXP_DEPTH_THRESHOLD)); + SettingWidgetBinder::DisconnectWidget(m_ui.pgxpDepthClearThreshold); + SettingWidgetBinder::BindWidgetToFloatSetting(m_dialog->getSettingsInterface(), m_ui.pgxpDepthClearThreshold, "GPU", + "PGXPDepthThreshold", Settings::DEFAULT_GPU_PGXP_DEPTH_THRESHOLD); +} + void GraphicsSettingsWidget::onEnableTextureCacheChanged() { const bool tc_enabled = m_dialog->getEffectiveBoolValue("GPU", "EnableTextureCache", false); diff --git a/src/duckstation-qt/graphicssettingswidget.h b/src/duckstation-qt/graphicssettingswidget.h index 1c131884a..9e2707936 100644 --- a/src/duckstation-qt/graphicssettingswidget.h +++ b/src/duckstation-qt/graphicssettingswidget.h @@ -48,12 +48,15 @@ private: void updateRendererDependentOptions(); void updatePGXPSettingsEnabled(); void updateResolutionDependentOptions(); - + void warnAboutRendererChange(); void onDownsampleModeChanged(); void onFineCropModeChanged(); void onFineCropResetClicked(); + void onResetPGXPGeometryToleranceClicked(); + void onResetPGXPDepthClearThresholdClicked(); + void onEnableTextureCacheChanged(); void onEnableAnyTextureDumpingChanged(); void onEnableAnyTextureReplacementsChanged(); diff --git a/src/duckstation-qt/graphicssettingswidget.ui b/src/duckstation-qt/graphicssettingswidget.ui index 8591c2658..46e0437ee 100644 --- a/src/duckstation-qt/graphicssettingswidget.ui +++ b/src/duckstation-qt/graphicssettingswidget.ui @@ -629,26 +629,41 @@ - - - - - - px - - - -1.000000000000000 - - - 100.000000000000000 - - - 0.250000000000000 - - - -1.000000000000000 - - + + + + + + + + px + + + -1.000000000000000 + + + 100.000000000000000 + + + 0.250000000000000 + + + -1.000000000000000 + + + + + + + Reset Sequence Length + + + + :/icons/monochrome/svg/delete-back-2-line.svg:/icons/monochrome/svg/delete-back-2-line.svg + + + + @@ -658,11 +673,26 @@ - - - 65536.000000000000000 - - + + + + + 65536.000000000000000 + + + + + + + Reset Sequence Length + + + + :/icons/monochrome/svg/delete-back-2-line.svg:/icons/monochrome/svg/delete-back-2-line.svg + + + +