Qt/EnhancementsWidget: Convert texture filtering option to a ComboBox.

This commit is contained in:
Admiral H. Curtiss 2022-11-20 23:25:35 +01:00
parent 8a3b8a925e
commit ff2cc4d02b
No known key found for this signature in database
GPG Key ID: F051B4C4044F33FB
2 changed files with 8 additions and 22 deletions

View File

@ -7,7 +7,6 @@
#include <QGridLayout>
#include <QGroupBox>
#include <QHBoxLayout>
#include <QLabel>
#include <QPushButton>
#include <QVBoxLayout>
@ -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<const char*, 3> 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<int>(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));

View File

@ -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<GraphicsRadioInt*, 3> m_force_texture_filtering;
GraphicsBool* m_widescreen_hack;
GraphicsBool* m_disable_fog;
GraphicsBool* m_force_24bit_color;