From 228906ab0b30fef50f028b7b75a0de576c86d4b6 Mon Sep 17 00:00:00 2001 From: pineappleEA Date: Fri, 21 May 2021 09:31:35 +0200 Subject: [PATCH] early-access version 1703 --- README.md | 2 +- src/video_core/renderer_opengl/gl_device.cpp | 2 +- src/yuzu/configuration/configure_dialog.cpp | 14 ++++++ src/yuzu/configuration/configure_dialog.h | 4 +- src/yuzu/configuration/configure_per_game.cpp | 14 ++++++ src/yuzu/configuration/configure_per_game.h | 3 ++ src/yuzu/main.cpp | 44 +++++++++++-------- src/yuzu/uisettings.h | 2 + 8 files changed, 63 insertions(+), 22 deletions(-) diff --git a/README.md b/README.md index f349d4e35..46450fef4 100755 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ yuzu emulator early access ============= -This is the source code for early-access 1702. +This is the source code for early-access 1703. ## Legal Notice diff --git a/src/video_core/renderer_opengl/gl_device.cpp b/src/video_core/renderer_opengl/gl_device.cpp index b113f54db..3f4532ca7 100755 --- a/src/video_core/renderer_opengl/gl_device.cpp +++ b/src/video_core/renderer_opengl/gl_device.cpp @@ -241,7 +241,7 @@ Device::Device() { has_variable_aoffi = TestVariableAoffi(); has_component_indexing_bug = is_amd; has_precise_bug = TestPreciseBug(); - has_broken_texture_view_formats = is_amd || is_intel; + has_broken_texture_view_formats = is_amd || (!is_linux && is_intel); has_nv_viewport_array2 = GLAD_GL_NV_viewport_array2; has_vertex_buffer_unified_memory = GLAD_GL_NV_vertex_buffer_unified_memory; has_debugging_tool_attached = IsDebugToolAttached(extensions); diff --git a/src/yuzu/configuration/configure_dialog.cpp b/src/yuzu/configuration/configure_dialog.cpp index 3ad40d2b3..6028135c5 100755 --- a/src/yuzu/configuration/configure_dialog.cpp +++ b/src/yuzu/configuration/configure_dialog.cpp @@ -2,8 +2,11 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include +#include #include #include +#include #include #include "common/settings.h" #include "core/core.h" @@ -31,6 +34,12 @@ ConfigureDialog::ConfigureDialog(QWidget* parent, HotkeyRegistry& registry, connect(ui->selectorList, &QListWidget::itemSelectionChanged, this, &ConfigureDialog::UpdateVisibleTabs); + if (Core::System::GetInstance().IsPoweredOn()) { + QPushButton* apply_button = ui->buttonBox->addButton(QDialogButtonBox::Apply); + connect(apply_button, &QAbstractButton::clicked, this, + &ConfigureDialog::HandleApplyButtonClicked); + } + adjustSize(); ui->selectorList->setCurrentRow(0); } @@ -80,6 +89,11 @@ void ConfigureDialog::RetranslateUI() { ui->tabWidget->setCurrentIndex(old_index); } +void ConfigureDialog::HandleApplyButtonClicked() { + UISettings::values.configuration_applied = true; + ApplyConfiguration(); +} + Q_DECLARE_METATYPE(QList); void ConfigureDialog::PopulateSelectionList() { diff --git a/src/yuzu/configuration/configure_dialog.h b/src/yuzu/configuration/configure_dialog.h index 570c3b941..6be934457 100755 --- a/src/yuzu/configuration/configure_dialog.h +++ b/src/yuzu/configuration/configure_dialog.h @@ -5,6 +5,7 @@ #pragma once #include +#include #include class HotkeyRegistry; @@ -35,9 +36,10 @@ signals: private: void changeEvent(QEvent* event) override; - void RetranslateUI(); + void HandleApplyButtonClicked(); + void SetConfiguration(); void UpdateVisibleTabs(); void PopulateSelectionList(); diff --git a/src/yuzu/configuration/configure_per_game.cpp b/src/yuzu/configuration/configure_per_game.cpp index 3e13bd438..d89f1ad4b 100755 --- a/src/yuzu/configuration/configure_per_game.cpp +++ b/src/yuzu/configuration/configure_per_game.cpp @@ -6,9 +6,12 @@ #include #include +#include #include +#include #include #include +#include #include #include #include @@ -42,6 +45,12 @@ ConfigurePerGame::ConfigurePerGame(QWidget* parent, u64 title_id) scene = new QGraphicsScene; ui->icon_view->setScene(scene); + if (Core::System::GetInstance().IsPoweredOn()) { + QPushButton* apply_button = ui->buttonBox->addButton(QDialogButtonBox::Apply); + connect(apply_button, &QAbstractButton::clicked, this, + &ConfigurePerGame::HandleApplyButtonClicked); + } + LoadConfiguration(); } @@ -74,6 +83,11 @@ void ConfigurePerGame::RetranslateUI() { ui->retranslateUi(this); } +void ConfigurePerGame::HandleApplyButtonClicked() { + UISettings::values.configuration_applied = true; + ApplyConfiguration(); +} + void ConfigurePerGame::LoadFromFile(FileSys::VirtualFile file) { this->file = std::move(file); LoadConfiguration(); diff --git a/src/yuzu/configuration/configure_per_game.h b/src/yuzu/configuration/configure_per_game.h index 5f9a08cef..7dd79cbee 100755 --- a/src/yuzu/configuration/configure_per_game.h +++ b/src/yuzu/configuration/configure_per_game.h @@ -7,6 +7,7 @@ #include #include +#include #include #include @@ -39,6 +40,8 @@ private: void changeEvent(QEvent* event) override; void RetranslateUI(); + void HandleApplyButtonClicked(); + void LoadConfiguration(); std::unique_ptr ui; diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index f45180a00..00afa6f43 100755 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp @@ -2575,12 +2575,12 @@ void GMainWindow::OnConfigure() { &GMainWindow::OnLanguageChanged); const auto result = configure_dialog.exec(); - if (result != QDialog::Accepted) { + if (result != QDialog::Accepted && !UISettings::values.configuration_applied) { return; + } else if (result == QDialog::Accepted) { + configure_dialog.ApplyConfiguration(); + controller_dialog->refreshConfiguration(); } - - configure_dialog.ApplyConfiguration(); - controller_dialog->refreshConfiguration(); InitializeHotkeys(); if (UISettings::values.theme != old_theme) { UpdateUITheme(); @@ -2595,6 +2595,8 @@ void GMainWindow::OnConfigure() { game_list->PopulateAsync(UISettings::values.game_dirs); } + UISettings::values.configuration_applied = false; + config->Save(); if ((UISettings::values.hide_mouse || Settings::values.mouse_panning) && emulation_running) { @@ -2624,23 +2626,27 @@ void GMainWindow::OpenPerGameConfiguration(u64 title_id, const std::string& file ConfigurePerGame dialog(this, title_id); dialog.LoadFromFile(v_file); const auto result = dialog.exec(); - if (result == QDialog::Accepted) { - dialog.ApplyConfiguration(); - const auto reload = UISettings::values.is_game_list_reload_pending.exchange(false); - if (reload) { - game_list->PopulateAsync(UISettings::values.game_dirs); - } - - // Do not cause the global config to write local settings into the config file - const bool is_powered_on = system.IsPoweredOn(); - Settings::RestoreGlobalState(is_powered_on); - - if (!is_powered_on) { - config->Save(); - } - } else { + if (result != QDialog::Accepted && !UISettings::values.configuration_applied) { Settings::RestoreGlobalState(system.IsPoweredOn()); + return; + } else if (result == QDialog::Accepted) { + dialog.ApplyConfiguration(); + } + + const auto reload = UISettings::values.is_game_list_reload_pending.exchange(false); + if (reload) { + game_list->PopulateAsync(UISettings::values.game_dirs); + } + + // Do not cause the global config to write local settings into the config file + const bool is_powered_on = system.IsPoweredOn(); + Settings::RestoreGlobalState(is_powered_on); + + UISettings::values.configuration_applied = false; + + if (!is_powered_on) { + config->Save(); } } diff --git a/src/yuzu/uisettings.h b/src/yuzu/uisettings.h index 5ba00b8c8..49122ec32 100755 --- a/src/yuzu/uisettings.h +++ b/src/yuzu/uisettings.h @@ -95,6 +95,8 @@ struct Values { uint8_t row_2_text_id; std::atomic_bool is_game_list_reload_pending{false}; bool cache_game_list; + + bool configuration_applied; }; extern Values values;