citra_qt: Add sample-count to enhancement settings

This commit is contained in:
Wunkolo 2023-11-11 11:08:28 -08:00
parent 3c2f825c84
commit 1a9ae7ca18
2 changed files with 62 additions and 0 deletions

View File

@ -23,6 +23,8 @@ ConfigureEnhancements::ConfigureEnhancements(QWidget* parent)
const auto graphics_api = Settings::values.graphics_api.GetValue();
const bool res_scale_enabled = graphics_api != Settings::GraphicsAPI::Software;
ui->resolution_factor_combobox->setEnabled(res_scale_enabled);
const bool msaa_enabled = graphics_api == Settings::GraphicsAPI::Vulkan;
ui->sample_count_combobox->setEnabled(msaa_enabled);
connect(ui->render_3d_combobox, qOverload<int>(&QComboBox::currentIndexChanged), this,
[this](int currentIndex) {
@ -58,6 +60,8 @@ void ConfigureEnhancements::SetConfiguration() {
if (!Settings::IsConfiguringGlobal()) {
ConfigurationShared::SetPerGameSetting(ui->resolution_factor_combobox,
&Settings::values.resolution_factor);
ConfigurationShared::SetPerGameSetting(ui->sample_count_combobox,
&Settings::values.sample_count);
ConfigurationShared::SetPerGameSetting(ui->texture_filter_combobox,
&Settings::values.texture_filter);
ConfigurationShared::SetHighlight(ui->widget_texture_filter,
@ -67,6 +71,8 @@ void ConfigureEnhancements::SetConfiguration() {
} else {
ui->resolution_factor_combobox->setCurrentIndex(
Settings::values.resolution_factor.GetValue());
ui->sample_count_combobox->setCurrentIndex(
static_cast<int>(Settings::values.sample_count.GetValue()));
ui->layout_combobox->setCurrentIndex(
static_cast<int>(Settings::values.layout_option.GetValue()));
ui->texture_filter_combobox->setCurrentIndex(
@ -136,6 +142,8 @@ void ConfigureEnhancements::RetranslateUI() {
void ConfigureEnhancements::ApplyConfiguration() {
ConfigurationShared::ApplyPerGameSetting(&Settings::values.resolution_factor,
ui->resolution_factor_combobox);
ConfigurationShared::ApplyPerGameSetting(&Settings::values.sample_count,
ui->sample_count_combobox);
Settings::values.render_3d =
static_cast<Settings::StereoRenderOption>(ui->render_3d_combobox->currentIndex());
Settings::values.factor_3d = ui->factor_3d->value();
@ -177,6 +185,7 @@ void ConfigureEnhancements::SetupPerGameUI() {
// Block the global settings if a game is currently running that overrides them
if (Settings::IsConfiguringGlobal()) {
ui->widget_resolution->setEnabled(Settings::values.resolution_factor.UsingGlobal());
ui->widget_sample_count->setEnabled(Settings::values.sample_count.UsingGlobal());
ui->widget_texture_filter->setEnabled(Settings::values.texture_filter.UsingGlobal());
ui->toggle_linear_filter->setEnabled(Settings::values.filter_mode.UsingGlobal());
ui->toggle_swap_screen->setEnabled(Settings::values.swap_screen.UsingGlobal());
@ -213,6 +222,10 @@ void ConfigureEnhancements::SetupPerGameUI() {
ui->resolution_factor_combobox, ui->widget_resolution,
static_cast<int>(Settings::values.resolution_factor.GetValue(true)));
ConfigurationShared::SetColoredComboBox(
ui->sample_count_combobox, ui->widget_sample_count,
static_cast<int>(Settings::values.sample_count.GetValue(true)));
ConfigurationShared::SetColoredComboBox(
ui->texture_filter_combobox, ui->widget_texture_filter,
static_cast<int>(Settings::values.texture_filter.GetValue(true)));

View File

@ -110,6 +110,55 @@
</layout>
</widget>
</item>
<item>
<widget class="QWidget" name="widget_sample_count" native="true">
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QLabel" name="sample_count_label">
<property name="text">
<string>Sample count</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="sample_count_combobox">
<item>
<property name="text">
<string>Native (x1)</string>
</property>
</item>
<item>
<property name="text">
<string>x2</string>
</property>
</item>
<item>
<property name="text">
<string>x4</string>
</property>
</item>
<item>
<property name="text">
<string>x8</string>
</property>
</item>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QCheckBox" name="toggle_linear_filter">
<property name="text">