diff options
| author | 2020-11-04 17:09:19 -0800 | |
|---|---|---|
| committer | 2020-11-04 17:09:19 -0800 | |
| commit | d62d28522b7ac49dcf76b82337d0963152d04feb (patch) | |
| tree | 95f6d17dc15443b9870c03ea7930d9c9866873c2 /src/core/settings.cpp | |
| parent | Merge pull request #4858 from lioncash/initializer (diff) | |
| parent | core/settings: Move configuring_global behind an API (diff) | |
| download | yuzu-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.cpp | 20 |
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 @@ | |||
| 14 | namespace Settings { | 14 | namespace Settings { |
| 15 | 15 | ||
| 16 | Values values = {}; | 16 | Values values = {}; |
| 17 | bool configuring_global = true; | 17 | static bool configuring_global = true; |
| 18 | 18 | ||
| 19 | std::string GetTimeZoneString() { | 19 | std::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 | ||
| 84 | float Volume() { | 84 | bool IsConfiguringGlobal() { |
| 85 | if (values.audio_muted) { | 85 | return configuring_global; |
| 86 | return 0.0f; | 86 | } |
| 87 | } | 87 | |
| 88 | return values.volume.GetValue(); | 88 | void SetConfiguringGlobal(bool is_global) { |
| 89 | configuring_global = is_global; | ||
| 89 | } | 90 | } |
| 90 | 91 | ||
| 91 | bool IsGPULevelExtreme() { | 92 | bool 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 | ||
| 101 | float Volume() { | ||
| 102 | if (values.audio_muted) { | ||
| 103 | return 0.0f; | ||
| 104 | } | ||
| 105 | return values.volume.GetValue(); | ||
| 106 | } | ||
| 107 | |||
| 100 | void RestoreGlobalState() { | 108 | void 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()) { |