From ff2cc4d02b32c99ddbecd02e4ceb6988f48847d9 Mon Sep 17 00:00:00 2001 From: "Admiral H. Curtiss" Date: Sun, 20 Nov 2022 23:25:35 +0100 Subject: [PATCH] Qt/EnhancementsWidget: Convert texture filtering option to a ComboBox. --- .../Config/Graphics/EnhancementsWidget.cpp | 27 +++++-------------- .../Config/Graphics/EnhancementsWidget.h | 3 +-- 2 files changed, 8 insertions(+), 22 deletions(-) diff --git a/Source/Core/DolphinQt/Config/Graphics/EnhancementsWidget.cpp b/Source/Core/DolphinQt/Config/Graphics/EnhancementsWidget.cpp index 8af802aac6..55a1f2e4aa 100644 --- a/Source/Core/DolphinQt/Config/Graphics/EnhancementsWidget.cpp +++ b/Source/Core/DolphinQt/Config/Graphics/EnhancementsWidget.cpp @@ -7,7 +7,6 @@ #include #include -#include #include #include #include @@ -77,6 +76,9 @@ void EnhancementsWidget::CreateWidgets() m_aa_combo = new ToolTipComboBox(); m_af_combo = new GraphicsChoice({tr("1x"), tr("2x"), tr("4x"), tr("8x"), tr("16x")}, Config::GFX_ENHANCE_MAX_ANISOTROPY); + m_texture_filtering_combo = + new GraphicsChoice({tr("Default"), tr("Force Nearest"), tr("Force Linear")}, + Config::GFX_ENHANCE_FORCE_TEXTURE_FILTERING); m_pp_effect = new ToolTipComboBox(); m_configure_pp_effect = new NonDefaultQPushButton(tr("Configure")); @@ -84,18 +86,6 @@ void EnhancementsWidget::CreateWidgets() m_per_pixel_lighting = new GraphicsBool(tr("Per-Pixel Lighting"), Config::GFX_ENABLE_PIXEL_LIGHTING); - const std::array texture_filtering_modes = {{ - QT_TR_NOOP("Default"), - QT_TR_NOOP("Force Nearest"), - QT_TR_NOOP("Force Linear"), - }}; - for (size_t i = 0; i < texture_filtering_modes.size(); ++i) - { - m_force_texture_filtering[i] = - new GraphicsRadioInt(tr(texture_filtering_modes[i]), - Config::GFX_ENHANCE_FORCE_TEXTURE_FILTERING, static_cast(i)); - } - m_widescreen_hack = new GraphicsBool(tr("Widescreen Hack"), Config::GFX_WIDESCREEN_HACK); m_disable_fog = new GraphicsBool(tr("Disable Fog"), Config::GFX_DISABLE_FOG); m_force_24bit_color = @@ -119,10 +109,7 @@ void EnhancementsWidget::CreateWidgets() ++row; enhancements_layout->addWidget(new QLabel(tr("Texture Filtering:")), row, 0); - auto* force_filtering_box = new QHBoxLayout(); - for (size_t i = 0; i < texture_filtering_modes.size(); ++i) - force_filtering_box->addWidget(m_force_texture_filtering[i]); - enhancements_layout->addLayout(force_filtering_box, row, 1, 1, -1); + enhancements_layout->addWidget(m_texture_filtering_combo, row, 1, 1, -1); ++row; enhancements_layout->addWidget(new QLabel(tr("Post-Processing Effect:")), row, 0); @@ -413,6 +400,9 @@ void EnhancementsWidget::AddDescriptions() m_af_combo->SetTitle(tr("Anisotropic Filtering")); m_af_combo->SetDescription(tr(TR_ANISOTROPIC_FILTERING_DESCRIPTION)); + m_texture_filtering_combo->SetTitle(tr("Texture Filtering")); + m_texture_filtering_combo->SetDescription(tr(TR_FORCE_TEXTURE_FILTERING_DESCRIPTION)); + m_pp_effect->SetTitle(tr("Post-Processing Effect")); m_pp_effect->SetDescription(tr(TR_POSTPROCESSING_DESCRIPTION)); @@ -426,9 +416,6 @@ void EnhancementsWidget::AddDescriptions() m_force_24bit_color->SetDescription(tr(TR_FORCE_24BIT_DESCRIPTION)); - for (size_t i = 0; i < m_force_texture_filtering.size(); ++i) - m_force_texture_filtering[i]->SetDescription(tr(TR_FORCE_TEXTURE_FILTERING_DESCRIPTION)); - m_disable_copy_filter->SetDescription(tr(TR_DISABLE_COPY_FILTER_DESCRIPTION)); m_arbitrary_mipmap_detection->SetDescription(tr(TR_ARBITRARY_MIPMAP_DETECTION_DESCRIPTION)); diff --git a/Source/Core/DolphinQt/Config/Graphics/EnhancementsWidget.h b/Source/Core/DolphinQt/Config/Graphics/EnhancementsWidget.h index c0bcfcff2a..057bcc8bf8 100644 --- a/Source/Core/DolphinQt/Config/Graphics/EnhancementsWidget.h +++ b/Source/Core/DolphinQt/Config/Graphics/EnhancementsWidget.h @@ -9,7 +9,6 @@ class GraphicsBool; class GraphicsChoice; -class GraphicsRadioInt; class GraphicsSlider; class GraphicsWindow; class QCheckBox; @@ -38,11 +37,11 @@ private: GraphicsChoice* m_ir_combo; ToolTipComboBox* m_aa_combo; GraphicsChoice* m_af_combo; + GraphicsChoice* m_texture_filtering_combo; ToolTipComboBox* m_pp_effect; QPushButton* m_configure_pp_effect; GraphicsBool* m_scaled_efb_copy; GraphicsBool* m_per_pixel_lighting; - std::array m_force_texture_filtering; GraphicsBool* m_widescreen_hack; GraphicsBool* m_disable_fog; GraphicsBool* m_force_24bit_color;