|
|
@ -32,7 +32,12 @@ ConfigureGraphics::ConfigureGraphics(QWidget* parent) |
|
|
SetConfiguration(); |
|
|
SetConfiguration(); |
|
|
|
|
|
|
|
|
connect(ui->api, qOverload<int>(&QComboBox::currentIndexChanged), this, |
|
|
connect(ui->api, qOverload<int>(&QComboBox::currentIndexChanged), this, |
|
|
[this] { UpdateDeviceComboBox(); }); |
|
|
|
|
|
|
|
|
[this] { |
|
|
|
|
|
UpdateDeviceComboBox(); |
|
|
|
|
|
if (!Settings::configuring_global) { |
|
|
|
|
|
ConfigurationShared::SetHighlight(ui->api_layout, "api_layout", ui->api->currentIndex() != ConfigurationShared::USE_GLOBAL_INDEX); |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
connect(ui->device, qOverload<int>(&QComboBox::activated), this, |
|
|
connect(ui->device, qOverload<int>(&QComboBox::activated), this, |
|
|
[this](int device) { UpdateDeviceSelection(device); }); |
|
|
[this](int device) { UpdateDeviceSelection(device); }); |
|
|
|
|
|
|
|
|
@ -65,25 +70,23 @@ void ConfigureGraphics::SetConfiguration() { |
|
|
ui->api->setEnabled(runtime_lock); |
|
|
ui->api->setEnabled(runtime_lock); |
|
|
ui->use_asynchronous_gpu_emulation->setEnabled(runtime_lock); |
|
|
ui->use_asynchronous_gpu_emulation->setEnabled(runtime_lock); |
|
|
ui->use_disk_shader_cache->setEnabled(runtime_lock); |
|
|
ui->use_disk_shader_cache->setEnabled(runtime_lock); |
|
|
|
|
|
ui->use_disk_shader_cache->setChecked(Settings::values.use_disk_shader_cache.GetValue()); |
|
|
|
|
|
ui->use_asynchronous_gpu_emulation->setChecked( |
|
|
|
|
|
Settings::values.use_asynchronous_gpu_emulation.GetValue()); |
|
|
|
|
|
|
|
|
if (Settings::configuring_global) { |
|
|
if (Settings::configuring_global) { |
|
|
ui->api->setCurrentIndex(static_cast<int>(Settings::values.renderer_backend.GetValue())); |
|
|
ui->api->setCurrentIndex(static_cast<int>(Settings::values.renderer_backend.GetValue())); |
|
|
ui->aspect_ratio_combobox->setCurrentIndex(Settings::values.aspect_ratio.GetValue()); |
|
|
ui->aspect_ratio_combobox->setCurrentIndex(Settings::values.aspect_ratio.GetValue()); |
|
|
ui->use_disk_shader_cache->setChecked(Settings::values.use_disk_shader_cache.GetValue()); |
|
|
|
|
|
ui->use_asynchronous_gpu_emulation->setChecked( |
|
|
|
|
|
Settings::values.use_asynchronous_gpu_emulation.GetValue()); |
|
|
|
|
|
} else { |
|
|
} else { |
|
|
ConfigurationShared::SetPerGameSetting(ui->use_disk_shader_cache, |
|
|
|
|
|
&Settings::values.use_disk_shader_cache); |
|
|
|
|
|
ConfigurationShared::SetPerGameSetting(ui->use_asynchronous_gpu_emulation, |
|
|
|
|
|
&Settings::values.use_asynchronous_gpu_emulation); |
|
|
|
|
|
|
|
|
|
|
|
ConfigurationShared::SetPerGameSetting(ui->api, &Settings::values.renderer_backend); |
|
|
ConfigurationShared::SetPerGameSetting(ui->api, &Settings::values.renderer_backend); |
|
|
ConfigurationShared::SetPerGameSetting(ui->aspect_ratio_combobox, |
|
|
ConfigurationShared::SetPerGameSetting(ui->aspect_ratio_combobox, |
|
|
&Settings::values.aspect_ratio); |
|
|
&Settings::values.aspect_ratio); |
|
|
|
|
|
|
|
|
ui->bg_combobox->setCurrentIndex(Settings::values.bg_red.UsingGlobal() ? 0 : 1); |
|
|
ui->bg_combobox->setCurrentIndex(Settings::values.bg_red.UsingGlobal() ? 0 : 1); |
|
|
ui->bg_button->setEnabled(!Settings::values.bg_red.UsingGlobal()); |
|
|
ui->bg_button->setEnabled(!Settings::values.bg_red.UsingGlobal()); |
|
|
|
|
|
ConfigurationShared::SetHighlight(ui->aspect_ratio_layout, "aspect_ratio_layout", !Settings::values.aspect_ratio.UsingGlobal()); |
|
|
|
|
|
ConfigurationShared::SetHighlight(ui->bg_layout, "bg_layout", !Settings::values.bg_red.UsingGlobal()); |
|
|
|
|
|
// FIXME: ConfigurationShared::SetHighlight(ui->api_layout, "api_layout", !Settings::values.renderer_backend.UsingGlobal());
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
UpdateBackgroundColorButton(QColor::fromRgbF(Settings::values.bg_red.GetValue(), |
|
|
UpdateBackgroundColorButton(QColor::fromRgbF(Settings::values.bg_red.GetValue(), |
|
|
@ -240,11 +243,23 @@ void ConfigureGraphics::SetupPerGameUI() { |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
connect(ui->aspect_ratio_combobox, static_cast<void (QComboBox::*)(int)>(&QComboBox::activated), this, [this](int index) { |
|
|
|
|
|
ConfigurationShared::SetHighlight(ui->aspect_ratio_layout, "aspect_ratio_layout", index != 0); |
|
|
|
|
|
}); |
|
|
connect(ui->bg_combobox, static_cast<void (QComboBox::*)(int)>(&QComboBox::activated), this, |
|
|
connect(ui->bg_combobox, static_cast<void (QComboBox::*)(int)>(&QComboBox::activated), this, |
|
|
[this](int index) { ui->bg_button->setEnabled(index == 1); }); |
|
|
|
|
|
|
|
|
|
|
|
ui->use_disk_shader_cache->setTristate(true); |
|
|
|
|
|
ui->use_asynchronous_gpu_emulation->setTristate(true); |
|
|
|
|
|
ConfigurationShared::InsertGlobalItem(ui->aspect_ratio_combobox); |
|
|
|
|
|
ConfigurationShared::InsertGlobalItem(ui->api); |
|
|
|
|
|
|
|
|
[this](int index) { |
|
|
|
|
|
ui->bg_button->setEnabled(index == 1); |
|
|
|
|
|
ConfigurationShared::SetHighlight(ui->bg_layout, "bg_layout", index == 1); |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
ConfigurationShared::SetColoredTristate(ui->use_disk_shader_cache, "use_disk_shader_cache", |
|
|
|
|
|
Settings::values.use_disk_shader_cache, |
|
|
|
|
|
ConfigurationShared::trackers.use_disk_shader_cache); |
|
|
|
|
|
ConfigurationShared::SetColoredTristate( |
|
|
|
|
|
ui->use_asynchronous_gpu_emulation, "use_asynchronous_gpu_emulation", |
|
|
|
|
|
Settings::values.use_asynchronous_gpu_emulation, |
|
|
|
|
|
ConfigurationShared::trackers.use_asynchronous_gpu_emulation); |
|
|
|
|
|
|
|
|
|
|
|
ConfigurationShared::InsertGlobalItem(ui->aspect_ratio_combobox, ui->aspect_ratio_combobox->itemText(Settings::values.aspect_ratio.GetValue(true))); |
|
|
|
|
|
ConfigurationShared::InsertGlobalItem(ui->api, ui->api->itemText(static_cast<int>(Settings::values.renderer_backend.GetValue(true)))); |
|
|
} |
|
|
} |