2020-02-23 19:01:17 -05:00
|
|
|
// Copyright 2020 yuzu Emulator Project
|
|
|
|
// Licensed under GPLv2 or any later version
|
|
|
|
// Refer to the license.txt file included.
|
|
|
|
|
|
|
|
#include "core/core.h"
|
|
|
|
#include "core/settings.h"
|
|
|
|
#include "ui_configure_graphics_advanced.h"
|
|
|
|
#include "yuzu/configuration/configure_graphics_advanced.h"
|
|
|
|
|
|
|
|
ConfigureGraphicsAdvanced::ConfigureGraphicsAdvanced(QWidget* parent)
|
|
|
|
: QWidget(parent), ui(new Ui::ConfigureGraphicsAdvanced) {
|
|
|
|
|
|
|
|
ui->setupUi(this);
|
|
|
|
|
|
|
|
SetConfiguration();
|
|
|
|
}
|
|
|
|
|
|
|
|
ConfigureGraphicsAdvanced::~ConfigureGraphicsAdvanced() = default;
|
|
|
|
|
|
|
|
void ConfigureGraphicsAdvanced::SetConfiguration() {
|
|
|
|
const bool runtime_lock = !Core::System::GetInstance().IsPoweredOn();
|
2020-02-18 15:51:42 -05:00
|
|
|
ui->gpu_accuracy->setCurrentIndex(static_cast<int>(Settings::values.gpu_accuracy));
|
2020-02-23 19:01:17 -05:00
|
|
|
ui->use_vsync->setEnabled(runtime_lock);
|
|
|
|
ui->use_vsync->setChecked(Settings::values.use_vsync);
|
2020-05-17 20:06:32 -04:00
|
|
|
ui->use_assembly_shaders->setEnabled(runtime_lock);
|
|
|
|
ui->use_assembly_shaders->setChecked(Settings::values.use_assembly_shaders);
|
2020-04-20 13:20:52 -04:00
|
|
|
ui->use_fast_gpu_time->setChecked(Settings::values.use_fast_gpu_time);
|
2020-02-23 19:01:17 -05:00
|
|
|
ui->force_30fps_mode->setEnabled(runtime_lock);
|
|
|
|
ui->force_30fps_mode->setChecked(Settings::values.force_30fps_mode);
|
|
|
|
ui->anisotropic_filtering_combobox->setEnabled(runtime_lock);
|
|
|
|
ui->anisotropic_filtering_combobox->setCurrentIndex(Settings::values.max_anisotropy);
|
|
|
|
}
|
|
|
|
|
|
|
|
void ConfigureGraphicsAdvanced::ApplyConfiguration() {
|
2020-02-18 15:51:42 -05:00
|
|
|
auto gpu_accuracy = static_cast<Settings::GPUAccuracy>(ui->gpu_accuracy->currentIndex());
|
|
|
|
Settings::values.gpu_accuracy = gpu_accuracy;
|
2020-02-23 19:01:17 -05:00
|
|
|
Settings::values.use_vsync = ui->use_vsync->isChecked();
|
2020-05-17 20:06:32 -04:00
|
|
|
Settings::values.use_assembly_shaders = ui->use_assembly_shaders->isChecked();
|
2020-04-20 13:20:52 -04:00
|
|
|
Settings::values.use_fast_gpu_time = ui->use_fast_gpu_time->isChecked();
|
2020-02-23 19:01:17 -05:00
|
|
|
Settings::values.force_30fps_mode = ui->force_30fps_mode->isChecked();
|
|
|
|
Settings::values.max_anisotropy = ui->anisotropic_filtering_combobox->currentIndex();
|
|
|
|
}
|
|
|
|
|
|
|
|
void ConfigureGraphicsAdvanced::changeEvent(QEvent* event) {
|
|
|
|
if (event->type() == QEvent::LanguageChange) {
|
|
|
|
RetranslateUI();
|
|
|
|
}
|
|
|
|
|
|
|
|
QWidget::changeEvent(event);
|
|
|
|
}
|
|
|
|
|
|
|
|
void ConfigureGraphicsAdvanced::RetranslateUI() {
|
|
|
|
ui->retranslateUi(this);
|
|
|
|
}
|