summaryrefslogtreecommitdiff
path: root/src/core/settings.cpp
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/settings.cpp
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 'src/core/settings.cpp')
-rw-r--r--src/core/settings.cpp20
1 files changed, 14 insertions, 6 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()) {