configure_graphics_advanced: Implement highlighted overrides

master
lat9nq 2020-07-13 21:37:02 +07:00
parent b79a6ebf9c
commit 38152ab0b9
3 changed files with 146 additions and 96 deletions

@ -33,6 +33,7 @@ struct Trackers {
CheckState use_vsync; CheckState use_vsync;
CheckState use_assembly_shaders; CheckState use_assembly_shaders;
CheckState use_asynchronous_shaders;
CheckState use_fast_gpu_time; CheckState use_fast_gpu_time;
CheckState force_30fps_mode; CheckState force_30fps_mode;
} extern trackers; } extern trackers;

@ -28,32 +28,25 @@ void ConfigureGraphicsAdvanced::SetConfiguration() {
ui->force_30fps_mode->setEnabled(runtime_lock); ui->force_30fps_mode->setEnabled(runtime_lock);
ui->anisotropic_filtering_combobox->setEnabled(runtime_lock); ui->anisotropic_filtering_combobox->setEnabled(runtime_lock);
ui->use_vsync->setChecked(Settings::values.use_vsync.GetValue());
ui->use_assembly_shaders->setChecked(Settings::values.use_assembly_shaders.GetValue());
ui->use_asynchronous_shaders->setChecked(Settings::values.use_asynchronous_shaders.GetValue());
ui->use_fast_gpu_time->setChecked(Settings::values.use_fast_gpu_time.GetValue());
ui->force_30fps_mode->setChecked(Settings::values.force_30fps_mode.GetValue());
if (Settings::configuring_global) { if (Settings::configuring_global) {
ui->gpu_accuracy->setCurrentIndex( ui->gpu_accuracy->setCurrentIndex(
static_cast<int>(Settings::values.gpu_accuracy.GetValue())); static_cast<int>(Settings::values.gpu_accuracy.GetValue()));
ui->use_vsync->setChecked(Settings::values.use_vsync.GetValue());
ui->use_assembly_shaders->setChecked(Settings::values.use_assembly_shaders.GetValue());
ui->use_asynchronous_shaders->setChecked(
Settings::values.use_asynchronous_shaders.GetValue());
ui->use_fast_gpu_time->setChecked(Settings::values.use_fast_gpu_time.GetValue());
ui->force_30fps_mode->setChecked(Settings::values.force_30fps_mode.GetValue());
ui->anisotropic_filtering_combobox->setCurrentIndex( ui->anisotropic_filtering_combobox->setCurrentIndex(
Settings::values.max_anisotropy.GetValue()); Settings::values.max_anisotropy.GetValue());
} else { } else {
ConfigurationShared::SetPerGameSetting(ui->gpu_accuracy, &Settings::values.gpu_accuracy); ConfigurationShared::SetPerGameSetting(ui->gpu_accuracy, &Settings::values.gpu_accuracy);
ConfigurationShared::SetPerGameSetting(ui->use_vsync, &Settings::values.use_vsync);
ConfigurationShared::SetPerGameSetting(ui->use_assembly_shaders,
&Settings::values.use_assembly_shaders);
ConfigurationShared::SetPerGameSetting(ui->use_asynchronous_shaders,
&Settings::values.use_asynchronous_shaders);
ConfigurationShared::SetPerGameSetting(ui->use_asynchronous_shaders,
&Settings::values.use_asynchronous_shaders);
ConfigurationShared::SetPerGameSetting(ui->use_fast_gpu_time,
&Settings::values.use_fast_gpu_time);
ConfigurationShared::SetPerGameSetting(ui->force_30fps_mode,
&Settings::values.force_30fps_mode);
ConfigurationShared::SetPerGameSetting(ui->anisotropic_filtering_combobox, ConfigurationShared::SetPerGameSetting(ui->anisotropic_filtering_combobox,
&Settings::values.max_anisotropy); &Settings::values.max_anisotropy);
ConfigurationShared::SetHighlight(ui->gpu_accuracy_layout, "gpu_accuracy_layout",
!Settings::values.gpu_accuracy.UsingGlobal());
ConfigurationShared::SetHighlight(ui->af_layout, "af_layout",
!Settings::values.max_anisotropy.UsingGlobal());
} }
} }
@ -95,17 +88,20 @@ void ConfigureGraphicsAdvanced::ApplyConfiguration() {
} else { } else {
ConfigurationShared::ApplyPerGameSetting(&Settings::values.max_anisotropy, ConfigurationShared::ApplyPerGameSetting(&Settings::values.max_anisotropy,
ui->anisotropic_filtering_combobox); ui->anisotropic_filtering_combobox);
ConfigurationShared::ApplyPerGameSetting(&Settings::values.use_vsync, ui->use_vsync); ConfigurationShared::ApplyPerGameSetting(&Settings::values.use_vsync, ui->use_vsync,
ConfigurationShared::ApplyPerGameSetting(&Settings::values.use_assembly_shaders, ConfigurationShared::trackers.use_vsync);
ui->use_assembly_shaders); ConfigurationShared::ApplyPerGameSetting(
ConfigurationShared::ApplyPerGameSetting(&Settings::values.use_asynchronous_shaders, &Settings::values.use_assembly_shaders, ui->use_assembly_shaders,
ui->use_asynchronous_shaders); ConfigurationShared::trackers.use_assembly_shaders);
ConfigurationShared::ApplyPerGameSetting(&Settings::values.use_asynchronous_shaders, ConfigurationShared::ApplyPerGameSetting(
ui->use_asynchronous_shaders); &Settings::values.use_asynchronous_shaders, ui->use_asynchronous_shaders,
ConfigurationShared::trackers.use_asynchronous_shaders);
ConfigurationShared::ApplyPerGameSetting(&Settings::values.use_fast_gpu_time, ConfigurationShared::ApplyPerGameSetting(&Settings::values.use_fast_gpu_time,
ui->use_fast_gpu_time); ui->use_fast_gpu_time,
ConfigurationShared::trackers.use_fast_gpu_time);
ConfigurationShared::ApplyPerGameSetting(&Settings::values.force_30fps_mode, ConfigurationShared::ApplyPerGameSetting(&Settings::values.force_30fps_mode,
ui->force_30fps_mode); ui->force_30fps_mode,
ConfigurationShared::trackers.force_30fps_mode);
ConfigurationShared::ApplyPerGameSetting(&Settings::values.max_anisotropy, ConfigurationShared::ApplyPerGameSetting(&Settings::values.max_anisotropy,
ui->anisotropic_filtering_combobox); ui->anisotropic_filtering_combobox);
@ -146,11 +142,36 @@ void ConfigureGraphicsAdvanced::SetupPerGameUI() {
return; return;
} }
ConfigurationShared::InsertGlobalItem(ui->gpu_accuracy); ConfigurationShared::SetColoredTristate(ui->use_vsync, "use_vsync", Settings::values.use_vsync,
ui->use_vsync->setTristate(true); ConfigurationShared::trackers.use_vsync);
ui->use_assembly_shaders->setTristate(true); ConfigurationShared::SetColoredTristate(ui->use_assembly_shaders, "use_assembly_shaders",
ui->use_asynchronous_shaders->setTristate(true); Settings::values.use_assembly_shaders,
ui->use_fast_gpu_time->setTristate(true); ConfigurationShared::trackers.use_assembly_shaders);
ui->force_30fps_mode->setTristate(true); ConfigurationShared::SetColoredTristate(ui->use_assembly_shaders, "use_asynchronous_shaders",
ConfigurationShared::InsertGlobalItem(ui->anisotropic_filtering_combobox); Settings::values.use_asynchronous_shaders,
ConfigurationShared::trackers.use_asynchronous_shaders);
ConfigurationShared::SetColoredTristate(ui->use_fast_gpu_time, "use_fast_gpu_time",
Settings::values.use_fast_gpu_time,
ConfigurationShared::trackers.use_fast_gpu_time);
ConfigurationShared::SetColoredTristate(ui->force_30fps_mode, "force_30fps_mode",
Settings::values.force_30fps_mode,
ConfigurationShared::trackers.force_30fps_mode);
ConfigurationShared::InsertGlobalItem(
ui->gpu_accuracy,
ui->gpu_accuracy->itemText(static_cast<int>(Settings::values.gpu_accuracy.GetValue(true))));
ConfigurationShared::InsertGlobalItem(
ui->anisotropic_filtering_combobox,
ui->anisotropic_filtering_combobox->itemText(
static_cast<int>(Settings::values.max_anisotropy.GetValue(true))));
connect(ui->gpu_accuracy, static_cast<void (QComboBox::*)(int)>(&QComboBox::activated), this,
[this](int index) {
ConfigurationShared::SetHighlight(ui->gpu_accuracy_layout, "gpu_accuracy_layout",
index != 0);
});
connect(ui->anisotropic_filtering_combobox,
static_cast<void (QComboBox::*)(int)>(&QComboBox::activated), this, [this](int index) {
ConfigurationShared::SetHighlight(ui->af_layout, "af_layout", index != 0);
});
} }

@ -6,7 +6,7 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>400</width> <width>404</width>
<height>321</height> <height>321</height>
</rect> </rect>
</property> </property>
@ -23,7 +23,20 @@
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_3"> <layout class="QVBoxLayout" name="verticalLayout_3">
<item> <item>
<widget class="QWidget" name="gpu_accuracy_layout" native="true">
<layout class="QHBoxLayout" name="horizontalLayout_2"> <layout class="QHBoxLayout" name="horizontalLayout_2">
<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> <item>
<widget class="QLabel" name="label_gpu_accuracy"> <widget class="QLabel" name="label_gpu_accuracy">
<property name="text"> <property name="text">
@ -51,6 +64,7 @@
</widget> </widget>
</item> </item>
</layout> </layout>
</widget>
</item> </item>
<item> <item>
<widget class="QCheckBox" name="use_vsync"> <widget class="QCheckBox" name="use_vsync">
@ -97,7 +111,20 @@
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QWidget" name="af_layout" native="true">
<layout class="QHBoxLayout" name="horizontalLayout_1"> <layout class="QHBoxLayout" name="horizontalLayout_1">
<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> <item>
<widget class="QLabel" name="af_label"> <widget class="QLabel" name="af_label">
<property name="text"> <property name="text">
@ -135,6 +162,7 @@
</widget> </widget>
</item> </item>
</layout> </layout>
</widget>
</item> </item>
</layout> </layout>
</widget> </widget>