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_assembly_shaders;
CheckState use_asynchronous_shaders;
CheckState use_fast_gpu_time;
CheckState force_30fps_mode;
} extern trackers;

@ -28,32 +28,25 @@ void ConfigureGraphicsAdvanced::SetConfiguration() {
ui->force_30fps_mode->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) {
ui->gpu_accuracy->setCurrentIndex(
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(
Settings::values.max_anisotropy.GetValue());
} else {
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,
&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 {
ConfigurationShared::ApplyPerGameSetting(&Settings::values.max_anisotropy,
ui->anisotropic_filtering_combobox);
ConfigurationShared::ApplyPerGameSetting(&Settings::values.use_vsync, ui->use_vsync);
ConfigurationShared::ApplyPerGameSetting(&Settings::values.use_assembly_shaders,
ui->use_assembly_shaders);
ConfigurationShared::ApplyPerGameSetting(&Settings::values.use_asynchronous_shaders,
ui->use_asynchronous_shaders);
ConfigurationShared::ApplyPerGameSetting(&Settings::values.use_asynchronous_shaders,
ui->use_asynchronous_shaders);
ConfigurationShared::ApplyPerGameSetting(&Settings::values.use_vsync, ui->use_vsync,
ConfigurationShared::trackers.use_vsync);
ConfigurationShared::ApplyPerGameSetting(
&Settings::values.use_assembly_shaders, ui->use_assembly_shaders,
ConfigurationShared::trackers.use_assembly_shaders);
ConfigurationShared::ApplyPerGameSetting(
&Settings::values.use_asynchronous_shaders, ui->use_asynchronous_shaders,
ConfigurationShared::trackers.use_asynchronous_shaders);
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,
ui->force_30fps_mode);
ui->force_30fps_mode,
ConfigurationShared::trackers.force_30fps_mode);
ConfigurationShared::ApplyPerGameSetting(&Settings::values.max_anisotropy,
ui->anisotropic_filtering_combobox);
@ -146,11 +142,36 @@ void ConfigureGraphicsAdvanced::SetupPerGameUI() {
return;
}
ConfigurationShared::InsertGlobalItem(ui->gpu_accuracy);
ui->use_vsync->setTristate(true);
ui->use_assembly_shaders->setTristate(true);
ui->use_asynchronous_shaders->setTristate(true);
ui->use_fast_gpu_time->setTristate(true);
ui->force_30fps_mode->setTristate(true);
ConfigurationShared::InsertGlobalItem(ui->anisotropic_filtering_combobox);
ConfigurationShared::SetColoredTristate(ui->use_vsync, "use_vsync", Settings::values.use_vsync,
ConfigurationShared::trackers.use_vsync);
ConfigurationShared::SetColoredTristate(ui->use_assembly_shaders, "use_assembly_shaders",
Settings::values.use_assembly_shaders,
ConfigurationShared::trackers.use_assembly_shaders);
ConfigurationShared::SetColoredTristate(ui->use_assembly_shaders, "use_asynchronous_shaders",
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>
<x>0</x>
<y>0</y>
<width>400</width>
<width>404</width>
<height>321</height>
</rect>
</property>
@ -23,34 +23,48 @@
</property>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QLabel" name="label_gpu_accuracy">
<property name="text">
<string>Accuracy Level:</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="gpu_accuracy">
<item>
<widget class="QWidget" name="gpu_accuracy_layout" native="true">
<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>
<widget class="QLabel" name="label_gpu_accuracy">
<property name="text">
<string notr="true">Normal</string>
<string>Accuracy Level:</string>
</property>
</item>
<item>
<property name="text">
<string notr="true">High</string>
</property>
</item>
<item>
<property name="text">
<string notr="true">Extreme(very slow)</string>
</property>
</item>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QComboBox" name="gpu_accuracy">
<item>
<property name="text">
<string notr="true">Normal</string>
</property>
</item>
<item>
<property name="text">
<string notr="true">High</string>
</property>
</item>
<item>
<property name="text">
<string notr="true">Extreme(very slow)</string>
</property>
</item>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QCheckBox" name="use_vsync">
@ -97,44 +111,58 @@
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_1">
<item>
<widget class="QLabel" name="af_label">
<property name="text">
<string>Anisotropic Filtering:</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="anisotropic_filtering_combobox">
<item>
<widget class="QWidget" name="af_layout" native="true">
<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>
<widget class="QLabel" name="af_label">
<property name="text">
<string>Default</string>
<string>Anisotropic Filtering:</string>
</property>
</item>
<item>
<property name="text">
<string>2x</string>
</property>
</item>
<item>
<property name="text">
<string>4x</string>
</property>
</item>
<item>
<property name="text">
<string>8x</string>
</property>
</item>
<item>
<property name="text">
<string>16x</string>
</property>
</item>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QComboBox" name="anisotropic_filtering_combobox">
<item>
<property name="text">
<string>Default</string>
</property>
</item>
<item>
<property name="text">
<string>2x</string>
</property>
</item>
<item>
<property name="text">
<string>4x</string>
</property>
</item>
<item>
<property name="text">
<string>8x</string>
</property>
</item>
<item>
<property name="text">
<string>16x</string>
</property>
</item>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>