From 6be1b4d293c635d2135020dfdc7ea3017d1070a4 Mon Sep 17 00:00:00 2001 From: fearlessTobi Date: Tue, 5 Feb 2019 22:04:36 +0100 Subject: [PATCH 1/4] renderer_base: backport minor changes from yuzu --- src/video_core/renderer_base.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/video_core/renderer_base.h b/src/video_core/renderer_base.h index ff9a71aba..7cfcf0cef 100644 --- a/src/video_core/renderer_base.h +++ b/src/video_core/renderer_base.h @@ -46,7 +46,11 @@ public: return rasterizer.get(); } - EmuWindow& GetRenderWindow() const { + EmuWindow& GetRenderWindow() { + return render_window; + } + + const EmuWindow& GetRenderWindow() const { return render_window; } From 59dbc72e7bd2da9b3c2f3454f7be23ffc367c1d3 Mon Sep 17 00:00:00 2001 From: fearlessTobi Date: Tue, 5 Feb 2019 22:07:03 +0100 Subject: [PATCH 2/4] configure_dialog: backport minor changes from yuzu --- src/citra_qt/configuration/configure_dialog.cpp | 12 ++++++------ src/citra_qt/configuration/configure_dialog.h | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/citra_qt/configuration/configure_dialog.cpp b/src/citra_qt/configuration/configure_dialog.cpp index a0ef52d2e..e1fc5abac 100644 --- a/src/citra_qt/configuration/configure_dialog.cpp +++ b/src/citra_qt/configuration/configure_dialog.cpp @@ -2,7 +2,7 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include +#include #include #include "citra_qt/configuration/config.h" #include "citra_qt/configuration/configure_dialog.h" @@ -74,7 +74,7 @@ void ConfigureDialog::PopulateSelectionList() { {tr("Controls"), {QT_TR_NOOP("Input"), QT_TR_NOOP("Hotkeys")}}}}; for (const auto& entry : items) { - auto* item = new QListWidgetItem(entry.first); + auto* const item = new QListWidgetItem(entry.first); item->setData(Qt::UserRole, entry.second); ui->selectorList->addItem(item); @@ -111,11 +111,11 @@ void ConfigureDialog::retranslateUi() { } void ConfigureDialog::UpdateVisibleTabs() { - auto items = ui->selectorList->selectedItems(); + const auto items = ui->selectorList->selectedItems(); if (items.isEmpty()) return; - const QHash widgets = { + const std::map widgets = { {"General", ui->generalTab}, {"System", ui->systemTab}, {"Input", ui->inputTab}, {"Hotkeys", ui->hotkeysTab}, {"Graphics", ui->graphicsTab}, {"Audio", ui->audioTab}, @@ -124,8 +124,8 @@ void ConfigureDialog::UpdateVisibleTabs() { ui->tabWidget->clear(); - QStringList tabs = items[0]->data(Qt::UserRole).toStringList(); + const QStringList tabs = items[0]->data(Qt::UserRole).toStringList(); for (const auto& tab : tabs) - ui->tabWidget->addTab(widgets[tab], tr(qPrintable(tab))); + ui->tabWidget->addTab(widgets.at(tab), tr(qPrintable(tab))); } diff --git a/src/citra_qt/configuration/configure_dialog.h b/src/citra_qt/configuration/configure_dialog.h index c902bf702..91234ca0b 100644 --- a/src/citra_qt/configuration/configure_dialog.h +++ b/src/citra_qt/configuration/configure_dialog.h @@ -21,8 +21,6 @@ public: ~ConfigureDialog() override; void applyConfiguration(); - void UpdateVisibleTabs(); - void PopulateSelectionList(); private slots: void onLanguageChanged(const QString& locale); @@ -33,6 +31,8 @@ signals: private: void setConfiguration(); void retranslateUi(); + void UpdateVisibleTabs(); + void PopulateSelectionList(); std::unique_ptr ui; HotkeyRegistry& registry; From e5495e541de0903938cff05c0c487fa3c107b8d6 Mon Sep 17 00:00:00 2001 From: fearlessTobi Date: Tue, 5 Feb 2019 22:09:02 +0100 Subject: [PATCH 3/4] citra_qt/config: backport minor changes from yuzu --- src/citra_qt/configuration/config.cpp | 4 ++-- src/citra_qt/configuration/config.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/citra_qt/configuration/config.cpp b/src/citra_qt/configuration/config.cpp index 9fe88e892..95df2208b 100644 --- a/src/citra_qt/configuration/config.cpp +++ b/src/citra_qt/configuration/config.cpp @@ -635,11 +635,11 @@ void Config::SaveValues() { qt_config->endGroup(); } -QVariant Config::ReadSetting(const QString& name) { +QVariant Config::ReadSetting(const QString& name) const { return qt_config->value(name); } -QVariant Config::ReadSetting(const QString& name, const QVariant& default_value) { +QVariant Config::ReadSetting(const QString& name, const QVariant& default_value) const { QVariant result; if (qt_config->value(name + "/default", false).toBool()) { result = default_value; diff --git a/src/citra_qt/configuration/config.h b/src/citra_qt/configuration/config.h index 70aab4f8c..781926f3f 100644 --- a/src/citra_qt/configuration/config.h +++ b/src/citra_qt/configuration/config.h @@ -27,8 +27,8 @@ public: private: void ReadValues(); void SaveValues(); - QVariant ReadSetting(const QString& name); - QVariant ReadSetting(const QString& name, const QVariant& default_value); + QVariant ReadSetting(const QString& name) const; + QVariant ReadSetting(const QString& name, const QVariant& default_value) const; void WriteSetting(const QString& name, const QVariant& value); void WriteSetting(const QString& name, const QVariant& value, const QVariant& default_value); From fc6e33d8123381f21dc14f9170e03c23626dc17f Mon Sep 17 00:00:00 2001 From: ReinUsesLisp Date: Sat, 26 Jan 2019 02:22:40 -0300 Subject: [PATCH 4/4] video_core: Sort predicate order to have semantically positive value first --- src/video_core/video_core.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/video_core/video_core.cpp b/src/video_core/video_core.cpp index fa68e1d1f..5bba1e3ac 100644 --- a/src/video_core/video_core.cpp +++ b/src/video_core/video_core.cpp @@ -71,9 +71,9 @@ void RequestScreenshot(void* data, std::function callback, u16 GetResolutionScaleFactor() { if (g_hw_renderer_enabled) { - return !Settings::values.resolution_factor - ? g_renderer->GetRenderWindow().GetFramebufferLayout().GetScalingRatio() - : Settings::values.resolution_factor; + return Settings::values.resolution_factor + ? Settings::values.resolution_factor + : g_renderer->GetRenderWindow().GetFramebufferLayout().GetScalingRatio(); } else { // Software renderer always render at native resolution return 1;