summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorGravatar bunnei2020-11-04 17:09:19 -0800
committerGravatar GitHub2020-11-04 17:09:19 -0800
commitd62d28522b7ac49dcf76b82337d0963152d04feb (patch)
tree95f6d17dc15443b9870c03ea7930d9c9866873c2 /src/core
parentMerge pull request #4858 from lioncash/initializer (diff)
parentcore/settings: Move configuring_global behind an API (diff)
downloadyuzu-d62d28522b7ac49dcf76b82337d0963152d04feb.tar.gz
yuzu-d62d28522b7ac49dcf76b82337d0963152d04feb.tar.xz
yuzu-d62d28522b7ac49dcf76b82337d0963152d04feb.zip
Merge pull request #4889 from lioncash/setting-global
core/settings: Move configuring_global behind an API
Diffstat (limited to '')
-rw-r--r--src/core/settings.cpp20
-rw-r--r--src/core/settings.h11
2 files changed, 21 insertions, 10 deletions
diff --git a/src/core/settings.cpp b/src/core/settings.cpp
index e14c02045..a99d3cf5a 100644
--- a/src/core/settings.cpp
+++ b/src/core/settings.cpp
@@ -14,7 +14,7 @@
14namespace Settings { 14namespace Settings {
15 15
16Values values = {}; 16Values values = {};
17bool configuring_global = true; 17static bool configuring_global = true;
18 18
19std::string GetTimeZoneString() { 19std::string GetTimeZoneString() {
20 static constexpr std::array timezones{ 20 static constexpr std::array timezones{
@@ -81,11 +81,12 @@ void LogSettings() {
81 log_setting("Services_BCATBoxcatLocal", values.bcat_boxcat_local); 81 log_setting("Services_BCATBoxcatLocal", values.bcat_boxcat_local);
82} 82}
83 83
84float Volume() { 84bool IsConfiguringGlobal() {
85 if (values.audio_muted) { 85 return configuring_global;
86 return 0.0f; 86}
87 } 87
88 return values.volume.GetValue(); 88void SetConfiguringGlobal(bool is_global) {
89 configuring_global = is_global;
89} 90}
90 91
91bool IsGPULevelExtreme() { 92bool IsGPULevelExtreme() {
@@ -97,6 +98,13 @@ bool IsGPULevelHigh() {
97 values.gpu_accuracy.GetValue() == GPUAccuracy::High; 98 values.gpu_accuracy.GetValue() == GPUAccuracy::High;
98} 99}
99 100
101float Volume() {
102 if (values.audio_muted) {
103 return 0.0f;
104 }
105 return values.volume.GetValue();
106}
107
100void RestoreGlobalState() { 108void RestoreGlobalState() {
101 // If a game is running, DO NOT restore the global settings state 109 // If a game is running, DO NOT restore the global settings state
102 if (Core::System::GetInstance().IsPoweredOn()) { 110 if (Core::System::GetInstance().IsPoweredOn()) {
diff --git a/src/core/settings.h b/src/core/settings.h
index 604805615..dcb1dbb31 100644
--- a/src/core/settings.h
+++ b/src/core/settings.h
@@ -33,8 +33,6 @@ enum class CPUAccuracy {
33 DebugMode = 2, 33 DebugMode = 2,
34}; 34};
35 35
36extern bool configuring_global;
37
38template <typename Type> 36template <typename Type>
39class Setting final { 37class Setting final {
40public: 38public:
@@ -198,13 +196,18 @@ struct Values {
198 196
199 // Add-Ons 197 // Add-Ons
200 std::map<u64, std::vector<std::string>> disabled_addons; 198 std::map<u64, std::vector<std::string>> disabled_addons;
201} extern values; 199};
202 200
203float Volume(); 201extern Values values;
202
203bool IsConfiguringGlobal();
204void SetConfiguringGlobal(bool is_global);
204 205
205bool IsGPULevelExtreme(); 206bool IsGPULevelExtreme();
206bool IsGPULevelHigh(); 207bool IsGPULevelHigh();
207 208
209float Volume();
210
208std::string GetTimeZoneString(); 211std::string GetTimeZoneString();
209 212
210void Apply(); 213void Apply();