summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorlat9nq <lat9nq@virginia.edu>2020-07-14 19:55:47 +0200
committerlat9nq <lat9nq@virginia.edu>2020-07-19 19:26:55 +0200
commit0d462f560840f0ad584f1a24b02cd6c03cc4f5c2 (patch)
treef73fd1cba75bc2180a6c85dad6b5c393af9e4336 /src
parentconfigure_system: break instead of semicolon (diff)
downloadyuzu-0d462f560840f0ad584f1a24b02cd6c03cc4f5c2.tar
yuzu-0d462f560840f0ad584f1a24b02cd6c03cc4f5c2.tar.gz
yuzu-0d462f560840f0ad584f1a24b02cd6c03cc4f5c2.tar.bz2
yuzu-0d462f560840f0ad584f1a24b02cd6c03cc4f5c2.tar.lz
yuzu-0d462f560840f0ad584f1a24b02cd6c03cc4f5c2.tar.xz
yuzu-0d462f560840f0ad584f1a24b02cd6c03cc4f5c2.tar.zst
yuzu-0d462f560840f0ad584f1a24b02cd6c03cc4f5c2.zip
Diffstat (limited to 'src')
-rw-r--r--src/yuzu/configuration/configuration_shared.cpp4
-rw-r--r--src/yuzu/configuration/configuration_shared.h19
-rw-r--r--src/yuzu/configuration/configure_audio.cpp4
-rw-r--r--src/yuzu/configuration/configure_audio.h5
-rw-r--r--src/yuzu/configuration/configure_general.cpp12
-rw-r--r--src/yuzu/configuration/configure_general.h6
-rw-r--r--src/yuzu/configuration/configure_graphics.cpp8
-rw-r--r--src/yuzu/configuration/configure_graphics.h6
-rw-r--r--src/yuzu/configuration/configure_graphics_advanced.cpp20
-rw-r--r--src/yuzu/configuration/configure_graphics_advanced.h9
-rw-r--r--src/yuzu/configuration/configure_system.cpp8
-rw-r--r--src/yuzu/configuration/configure_system.h6
12 files changed, 58 insertions, 49 deletions
diff --git a/src/yuzu/configuration/configuration_shared.cpp b/src/yuzu/configuration/configuration_shared.cpp
index cb47c8eb5..e6141e6a9 100644
--- a/src/yuzu/configuration/configuration_shared.cpp
+++ b/src/yuzu/configuration/configuration_shared.cpp
@@ -10,10 +10,6 @@
#include "yuzu/configuration/configuration_shared.h"
#include "yuzu/configuration/configure_per_game.h"
-namespace ConfigurationShared {
-Trackers trackers = {};
-}
-
void ConfigurationShared::ApplyPerGameSetting(Settings::Setting<bool>* setting,
const QCheckBox* checkbox) {
if (checkbox->checkState() == Qt::PartiallyChecked) {
diff --git a/src/yuzu/configuration/configuration_shared.h b/src/yuzu/configuration/configuration_shared.h
index d3e86c3cf..4cea7406f 100644
--- a/src/yuzu/configuration/configuration_shared.h
+++ b/src/yuzu/configuration/configuration_shared.h
@@ -22,25 +22,6 @@ enum CheckState {
Count,
};
-struct Trackers {
- CheckState use_frame_limit;
- CheckState use_multi_core;
-
- CheckState enable_audio_stretching;
-
- CheckState use_disk_shader_cache;
- CheckState use_asynchronous_gpu_emulation;
-
- CheckState use_vsync;
- CheckState use_assembly_shaders;
- CheckState use_asynchronous_shaders;
- CheckState use_fast_gpu_time;
- CheckState force_30fps_mode;
-
- CheckState use_rng_seed;
- CheckState use_custom_rtc;
-} extern trackers;
-
// Global-aware apply and set functions
void ApplyPerGameSetting(Settings::Setting<bool>* setting, const QCheckBox* checkbox,
diff --git a/src/yuzu/configuration/configure_audio.cpp b/src/yuzu/configuration/configure_audio.cpp
index 2418ca005..1374e4742 100644
--- a/src/yuzu/configuration/configure_audio.cpp
+++ b/src/yuzu/configuration/configure_audio.cpp
@@ -120,7 +120,7 @@ void ConfigureAudio::ApplyConfiguration() {
} else {
ConfigurationShared::ApplyPerGameSetting(
&Settings::values.enable_audio_stretching, ui->toggle_audio_stretching,
- ConfigurationShared::trackers.enable_audio_stretching);
+ trackers.enable_audio_stretching);
if (ui->volume_combo_box->currentIndex() == 0) {
Settings::values.volume.SetGlobal(true);
} else {
@@ -175,7 +175,7 @@ void ConfigureAudio::SetupPerGameUI() {
ConfigurationShared::SetColoredTristate(ui->toggle_audio_stretching, "toggle_audio_stretching",
Settings::values.enable_audio_stretching,
- ConfigurationShared::trackers.enable_audio_stretching);
+ trackers.enable_audio_stretching);
connect(ui->volume_combo_box, static_cast<void (QComboBox::*)(int)>(&QComboBox::activated),
this, [this](int index) {
ui->volume_slider->setEnabled(index == 1);
diff --git a/src/yuzu/configuration/configure_audio.h b/src/yuzu/configuration/configure_audio.h
index d84f4a682..ac541d961 100644
--- a/src/yuzu/configuration/configure_audio.h
+++ b/src/yuzu/configuration/configure_audio.h
@@ -6,6 +6,7 @@
#include <memory>
#include <QWidget>
+#include "yuzu/configuration/configuration_shared.h"
namespace Ui {
class ConfigureAudio;
@@ -37,4 +38,8 @@ private:
void SetupPerGameUI();
std::unique_ptr<Ui::ConfigureAudio> ui;
+
+ struct Trackers {
+ ConfigurationShared::CheckState enable_audio_stretching;
+ } trackers;
};
diff --git a/src/yuzu/configuration/configure_general.cpp b/src/yuzu/configuration/configure_general.cpp
index b4c288ca4..672f9df87 100644
--- a/src/yuzu/configuration/configure_general.cpp
+++ b/src/yuzu/configuration/configure_general.cpp
@@ -45,7 +45,7 @@ void ConfigureGeneral::SetConfiguration() {
ui->frame_limit->setEnabled(Settings::values.use_frame_limit.GetValue());
} else {
ui->frame_limit->setEnabled(Settings::values.use_frame_limit.GetValue() &&
- ConfigurationShared::trackers.use_frame_limit !=
+ trackers.use_frame_limit !=
ConfigurationShared::CheckState::Global);
}
}
@@ -69,9 +69,9 @@ void ConfigureGeneral::ApplyConfiguration() {
} else {
ConfigurationShared::ApplyPerGameSetting(&Settings::values.use_multi_core,
ui->use_multi_core,
- ConfigurationShared::trackers.use_multi_core);
+ trackers.use_multi_core);
- bool global_frame_limit = ConfigurationShared::trackers.use_frame_limit ==
+ bool global_frame_limit = trackers.use_frame_limit ==
ConfigurationShared::CheckState::Global;
Settings::values.use_frame_limit.SetGlobal(global_frame_limit);
Settings::values.frame_limit.SetGlobal(global_frame_limit);
@@ -110,14 +110,14 @@ void ConfigureGeneral::SetupPerGameUI() {
ConfigurationShared::SetColoredTristate(ui->toggle_frame_limit, "toggle_frame_limit",
Settings::values.use_frame_limit,
- ConfigurationShared::trackers.use_frame_limit);
+ trackers.use_frame_limit);
ConfigurationShared::SetColoredTristate(ui->use_multi_core, "use_multi_core",
Settings::values.use_multi_core,
- ConfigurationShared::trackers.use_multi_core);
+ trackers.use_multi_core);
connect(ui->toggle_frame_limit, &QCheckBox::clicked, ui->frame_limit, [this]() {
ui->frame_limit->setEnabled(ui->toggle_frame_limit->isChecked() &&
- (ConfigurationShared::trackers.use_frame_limit !=
+ (trackers.use_frame_limit !=
ConfigurationShared::CheckState::Global));
});
}
diff --git a/src/yuzu/configuration/configure_general.h b/src/yuzu/configuration/configure_general.h
index 9c785c22e..a1758a973 100644
--- a/src/yuzu/configuration/configure_general.h
+++ b/src/yuzu/configuration/configure_general.h
@@ -6,6 +6,7 @@
#include <memory>
#include <QWidget>
+#include "yuzu/configuration/configuration_shared.h"
class HotkeyRegistry;
@@ -31,4 +32,9 @@ private:
void SetupPerGameUI();
std::unique_ptr<Ui::ConfigureGeneral> ui;
+
+ struct Trackers {
+ ConfigurationShared::CheckState use_frame_limit;
+ ConfigurationShared::CheckState use_multi_core;
+ } trackers;
};
diff --git a/src/yuzu/configuration/configure_graphics.cpp b/src/yuzu/configuration/configure_graphics.cpp
index 2867f3717..d419129ad 100644
--- a/src/yuzu/configuration/configure_graphics.cpp
+++ b/src/yuzu/configuration/configure_graphics.cpp
@@ -143,10 +143,10 @@ void ConfigureGraphics::ApplyConfiguration() {
ConfigurationShared::ApplyPerGameSetting(
&Settings::values.use_disk_shader_cache, ui->use_disk_shader_cache,
- ConfigurationShared::trackers.use_disk_shader_cache);
+ trackers.use_disk_shader_cache);
ConfigurationShared::ApplyPerGameSetting(
&Settings::values.use_asynchronous_gpu_emulation, ui->use_asynchronous_gpu_emulation,
- ConfigurationShared::trackers.use_asynchronous_gpu_emulation);
+ trackers.use_asynchronous_gpu_emulation);
if (ui->bg_combobox->currentIndex() == ConfigurationShared::USE_GLOBAL_INDEX) {
Settings::values.bg_red.SetGlobal(true);
@@ -257,11 +257,11 @@ void ConfigureGraphics::SetupPerGameUI() {
ConfigurationShared::SetColoredTristate(ui->use_disk_shader_cache, "use_disk_shader_cache",
Settings::values.use_disk_shader_cache,
- ConfigurationShared::trackers.use_disk_shader_cache);
+ 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);
+ trackers.use_asynchronous_gpu_emulation);
ConfigurationShared::SetColoredComboBox(ui->aspect_ratio_combobox, ui->ar_label, "ar_label",
Settings::values.aspect_ratio.GetValue(true));
diff --git a/src/yuzu/configuration/configure_graphics.h b/src/yuzu/configuration/configure_graphics.h
index 24f01c739..8164d6d75 100644
--- a/src/yuzu/configuration/configure_graphics.h
+++ b/src/yuzu/configuration/configure_graphics.h
@@ -9,6 +9,7 @@
#include <QString>
#include <QWidget>
#include "core/settings.h"
+#include "yuzu/configuration/configuration_shared.h"
namespace Ui {
class ConfigureGraphics;
@@ -42,6 +43,11 @@ private:
std::unique_ptr<Ui::ConfigureGraphics> ui;
QColor bg_color;
+ struct Trackers {
+ ConfigurationShared::CheckState use_disk_shader_cache;
+ ConfigurationShared::CheckState use_asynchronous_gpu_emulation;
+ } trackers;
+
std::vector<QString> vulkan_devices;
u32 vulkan_device{};
};
diff --git a/src/yuzu/configuration/configure_graphics_advanced.cpp b/src/yuzu/configuration/configure_graphics_advanced.cpp
index d02e6c798..8bebc3080 100644
--- a/src/yuzu/configuration/configure_graphics_advanced.cpp
+++ b/src/yuzu/configuration/configure_graphics_advanced.cpp
@@ -89,19 +89,19 @@ void ConfigureGraphicsAdvanced::ApplyConfiguration() {
ConfigurationShared::ApplyPerGameSetting(&Settings::values.max_anisotropy,
ui->anisotropic_filtering_combobox);
ConfigurationShared::ApplyPerGameSetting(&Settings::values.use_vsync, ui->use_vsync,
- ConfigurationShared::trackers.use_vsync);
+ trackers.use_vsync);
ConfigurationShared::ApplyPerGameSetting(
&Settings::values.use_assembly_shaders, ui->use_assembly_shaders,
- ConfigurationShared::trackers.use_assembly_shaders);
+ trackers.use_assembly_shaders);
ConfigurationShared::ApplyPerGameSetting(
&Settings::values.use_asynchronous_shaders, ui->use_asynchronous_shaders,
- ConfigurationShared::trackers.use_asynchronous_shaders);
+ trackers.use_asynchronous_shaders);
ConfigurationShared::ApplyPerGameSetting(&Settings::values.use_fast_gpu_time,
ui->use_fast_gpu_time,
- ConfigurationShared::trackers.use_fast_gpu_time);
+ trackers.use_fast_gpu_time);
ConfigurationShared::ApplyPerGameSetting(&Settings::values.force_30fps_mode,
ui->force_30fps_mode,
- ConfigurationShared::trackers.force_30fps_mode);
+ trackers.force_30fps_mode);
ConfigurationShared::ApplyPerGameSetting(&Settings::values.max_anisotropy,
ui->anisotropic_filtering_combobox);
@@ -143,19 +143,19 @@ void ConfigureGraphicsAdvanced::SetupPerGameUI() {
}
ConfigurationShared::SetColoredTristate(ui->use_vsync, "use_vsync", Settings::values.use_vsync,
- ConfigurationShared::trackers.use_vsync);
+ trackers.use_vsync);
ConfigurationShared::SetColoredTristate(ui->use_assembly_shaders, "use_assembly_shaders",
Settings::values.use_assembly_shaders,
- ConfigurationShared::trackers.use_assembly_shaders);
+ trackers.use_assembly_shaders);
ConfigurationShared::SetColoredTristate(ui->use_assembly_shaders, "use_asynchronous_shaders",
Settings::values.use_asynchronous_shaders,
- ConfigurationShared::trackers.use_asynchronous_shaders);
+ trackers.use_asynchronous_shaders);
ConfigurationShared::SetColoredTristate(ui->use_fast_gpu_time, "use_fast_gpu_time",
Settings::values.use_fast_gpu_time,
- ConfigurationShared::trackers.use_fast_gpu_time);
+ trackers.use_fast_gpu_time);
ConfigurationShared::SetColoredTristate(ui->force_30fps_mode, "force_30fps_mode",
Settings::values.force_30fps_mode,
- ConfigurationShared::trackers.force_30fps_mode);
+ trackers.force_30fps_mode);
ConfigurationShared::SetColoredComboBox(
ui->gpu_accuracy, ui->label_gpu_accuracy, "label_gpu_accuracy",
static_cast<int>(Settings::values.gpu_accuracy.GetValue(true)));
diff --git a/src/yuzu/configuration/configure_graphics_advanced.h b/src/yuzu/configuration/configure_graphics_advanced.h
index c043588ff..86bfe822b 100644
--- a/src/yuzu/configuration/configure_graphics_advanced.h
+++ b/src/yuzu/configuration/configure_graphics_advanced.h
@@ -6,6 +6,7 @@
#include <memory>
#include <QWidget>
+#include "yuzu/configuration/configuration_shared.h"
namespace Ui {
class ConfigureGraphicsAdvanced;
@@ -29,4 +30,12 @@ private:
void SetupPerGameUI();
std::unique_ptr<Ui::ConfigureGraphicsAdvanced> ui;
+
+ struct Trackers {
+ ConfigurationShared::CheckState use_vsync;
+ ConfigurationShared::CheckState use_assembly_shaders;
+ ConfigurationShared::CheckState use_asynchronous_shaders;
+ ConfigurationShared::CheckState use_fast_gpu_time;
+ ConfigurationShared::CheckState force_30fps_mode;
+ } trackers;
};
diff --git a/src/yuzu/configuration/configure_system.cpp b/src/yuzu/configuration/configure_system.cpp
index f5828f062..e1d8ccf97 100644
--- a/src/yuzu/configuration/configure_system.cpp
+++ b/src/yuzu/configuration/configure_system.cpp
@@ -148,7 +148,7 @@ void ConfigureSystem::ApplyConfiguration() {
ui->combo_time_zone);
ConfigurationShared::ApplyPerGameSetting(&Settings::values.sound_index, ui->combo_sound);
- switch (ConfigurationShared::trackers.use_rng_seed) {
+ switch (trackers.use_rng_seed) {
case ConfigurationShared::CheckState::On:
case ConfigurationShared::CheckState::Off:
Settings::values.rng_seed.SetGlobal(false);
@@ -168,7 +168,7 @@ void ConfigureSystem::ApplyConfiguration() {
break;
}
- switch (ConfigurationShared::trackers.use_custom_rtc) {
+ switch (trackers.use_custom_rtc) {
case ConfigurationShared::CheckState::On:
case ConfigurationShared::CheckState::Off:
Settings::values.custom_rtc.SetGlobal(false);
@@ -238,10 +238,10 @@ void ConfigureSystem::SetupPerGameUI() {
Settings::values.rng_seed.UsingGlobal(),
Settings::values.rng_seed.GetValue().has_value(),
Settings::values.rng_seed.GetValue(true).has_value(),
- ConfigurationShared::trackers.use_rng_seed);
+ trackers.use_rng_seed);
ConfigurationShared::SetColoredTristate(ui->custom_rtc_checkbox, "custom_rtc_checkbox",
Settings::values.custom_rtc.UsingGlobal(),
Settings::values.custom_rtc.GetValue().has_value(),
Settings::values.custom_rtc.GetValue(true).has_value(),
- ConfigurationShared::trackers.use_custom_rtc);
+ trackers.use_custom_rtc);
}
diff --git a/src/yuzu/configuration/configure_system.h b/src/yuzu/configuration/configure_system.h
index f317ef8b5..64c492559 100644
--- a/src/yuzu/configuration/configure_system.h
+++ b/src/yuzu/configuration/configure_system.h
@@ -8,6 +8,7 @@
#include <QList>
#include <QWidget>
+#include "yuzu/configuration/configuration_shared.h"
namespace Ui {
class ConfigureSystem;
@@ -41,4 +42,9 @@ private:
int region_index = 0;
int time_zone_index = 0;
int sound_index = 0;
+
+ struct Trackers {
+ ConfigurationShared::CheckState use_rng_seed;
+ ConfigurationShared::CheckState use_custom_rtc;
+ } trackers;
};