mirror of
https://git.suyu.dev/suyu/suyu.git
synced 2024-11-26 05:16:24 -05:00
Yuzu UI: Add button for Anti Alias
This commit is contained in:
parent
21a8ba0437
commit
a96c9c803b
3 changed files with 45 additions and 0 deletions
|
@ -76,6 +76,7 @@ enum class ScalingFilter : u32 {
|
|||
enum class AntiAliasing : u32 {
|
||||
None = 0,
|
||||
Fxaa = 1,
|
||||
LastAA = Fxaa,
|
||||
};
|
||||
|
||||
struct ResolutionScalingInfo {
|
||||
|
|
|
@ -774,6 +774,26 @@ void GMainWindow::InitializeWidgets() {
|
|||
tas_label->setFocusPolicy(Qt::NoFocus);
|
||||
statusBar()->insertPermanentWidget(0, tas_label);
|
||||
|
||||
// setup AA button
|
||||
aa_status_button = new QPushButton();
|
||||
aa_status_button->setObjectName(QStringLiteral("TogglableStatusBarButton"));
|
||||
aa_status_button->setFocusPolicy(Qt::NoFocus);
|
||||
connect(aa_status_button, &QPushButton::clicked, [&] {
|
||||
auto aa_mode = Settings::values.anti_aliasing.GetValue();
|
||||
if (aa_mode == Settings::AntiAliasing::LastAA) {
|
||||
aa_mode = Settings::AntiAliasing::None;
|
||||
} else {
|
||||
aa_mode = static_cast<Settings::AntiAliasing>(static_cast<u32>(aa_mode) + 1);
|
||||
}
|
||||
Settings::values.anti_aliasing.SetValue(aa_mode);
|
||||
aa_status_button->setChecked(true);
|
||||
UpdateAAText();
|
||||
});
|
||||
UpdateAAText();
|
||||
aa_status_button->setCheckable(true);
|
||||
aa_status_button->setChecked(true);
|
||||
statusBar()->insertPermanentWidget(0, aa_status_button);
|
||||
|
||||
// Setup Filter button
|
||||
filter_status_button = new QPushButton();
|
||||
filter_status_button->setObjectName(QStringLiteral("TogglableStatusBarButton"));
|
||||
|
@ -800,6 +820,7 @@ void GMainWindow::InitializeWidgets() {
|
|||
}
|
||||
UpdateFilterText();
|
||||
filter_status_button->setCheckable(true);
|
||||
filter_status_button->setChecked(true);
|
||||
statusBar()->insertPermanentWidget(0, filter_status_button);
|
||||
|
||||
// Setup Dock button
|
||||
|
@ -872,6 +893,11 @@ void GMainWindow::InitializeWidgets() {
|
|||
Settings::values.renderer_backend.SetValue(Settings::RendererBackend::Vulkan);
|
||||
} else {
|
||||
Settings::values.renderer_backend.SetValue(Settings::RendererBackend::OpenGL);
|
||||
const auto filter = Settings::values.scaling_filter.GetValue();
|
||||
if (filter == Settings::ScalingFilter::Fsr) {
|
||||
Settings::values.scaling_filter.SetValue(Settings::ScalingFilter::NearestNeighbor);
|
||||
UpdateFilterText();
|
||||
}
|
||||
}
|
||||
|
||||
system->ApplySettings();
|
||||
|
@ -3088,12 +3114,28 @@ void GMainWindow::UpdateFilterText() {
|
|||
}
|
||||
}
|
||||
|
||||
void GMainWindow::UpdateAAText() {
|
||||
const auto aa_mode = Settings::values.anti_aliasing.GetValue();
|
||||
switch (aa_mode) {
|
||||
case Settings::AntiAliasing::Fxaa:
|
||||
aa_status_button->setText(tr("FXAA"));
|
||||
break;
|
||||
case Settings::AntiAliasing::None:
|
||||
aa_status_button->setText(tr("NO AA"));
|
||||
break;
|
||||
default:
|
||||
aa_status_button->setText(tr("FXAA"));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void GMainWindow::UpdateStatusButtons() {
|
||||
dock_status_button->setChecked(Settings::values.use_docked_mode.GetValue());
|
||||
renderer_status_button->setChecked(Settings::values.renderer_backend.GetValue() ==
|
||||
Settings::RendererBackend::Vulkan);
|
||||
UpdateGPUAccuracyButton();
|
||||
UpdateFilterText();
|
||||
UpdateAAText();
|
||||
}
|
||||
|
||||
void GMainWindow::UpdateUISettings() {
|
||||
|
|
|
@ -303,6 +303,7 @@ private:
|
|||
void UpdateWindowTitle(std::string_view title_name = {}, std::string_view title_version = {},
|
||||
std::string_view gpu_vendor = {});
|
||||
void UpdateFilterText();
|
||||
void UpdateAAText();
|
||||
void UpdateStatusBar();
|
||||
void UpdateGPUAccuracyButton();
|
||||
void UpdateStatusButtons();
|
||||
|
@ -338,6 +339,7 @@ private:
|
|||
QPushButton* renderer_status_button = nullptr;
|
||||
QPushButton* dock_status_button = nullptr;
|
||||
QPushButton* filter_status_button = nullptr;
|
||||
QPushButton* aa_status_button = nullptr;
|
||||
QTimer status_bar_update_timer;
|
||||
|
||||
std::unique_ptr<Config> config;
|
||||
|
|
Loading…
Reference in a new issue