diff options
author | Lioncash <mathew1800@gmail.com> | 2020-11-04 10:16:34 +0100 |
---|---|---|
committer | Lioncash <mathew1800@gmail.com> | 2020-11-04 10:16:37 +0100 |
commit | 7aae6d6d2bd9784cba5df5b98cd29198456dcbeb (patch) | |
tree | ce40aa9bdfb1a7e6c1827681b68dee50c6f47623 /src/core | |
parent | Merge pull request #4887 from lioncash/common-build (diff) | |
download | yuzu-7aae6d6d2bd9784cba5df5b98cd29198456dcbeb.tar yuzu-7aae6d6d2bd9784cba5df5b98cd29198456dcbeb.tar.gz yuzu-7aae6d6d2bd9784cba5df5b98cd29198456dcbeb.tar.bz2 yuzu-7aae6d6d2bd9784cba5df5b98cd29198456dcbeb.tar.lz yuzu-7aae6d6d2bd9784cba5df5b98cd29198456dcbeb.tar.xz yuzu-7aae6d6d2bd9784cba5df5b98cd29198456dcbeb.tar.zst yuzu-7aae6d6d2bd9784cba5df5b98cd29198456dcbeb.zip |
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/settings.cpp | 20 | ||||
-rw-r--r-- | src/core/settings.h | 11 |
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 @@ namespace Settings { Values values = {}; -bool configuring_global = true; +static bool configuring_global = true; std::string GetTimeZoneString() { static constexpr std::array timezones{ @@ -81,11 +81,12 @@ void LogSettings() { log_setting("Services_BCATBoxcatLocal", values.bcat_boxcat_local); } -float Volume() { - if (values.audio_muted) { - return 0.0f; - } - return values.volume.GetValue(); +bool IsConfiguringGlobal() { + return configuring_global; +} + +void SetConfiguringGlobal(bool is_global) { + configuring_global = is_global; } bool IsGPULevelExtreme() { @@ -97,6 +98,13 @@ bool IsGPULevelHigh() { values.gpu_accuracy.GetValue() == GPUAccuracy::High; } +float Volume() { + if (values.audio_muted) { + return 0.0f; + } + return values.volume.GetValue(); +} + void RestoreGlobalState() { // If a game is running, DO NOT restore the global settings state 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 { DebugMode = 2, }; -extern bool configuring_global; - template <typename Type> class Setting final { public: @@ -198,13 +196,18 @@ struct Values { // Add-Ons std::map<u64, std::vector<std::string>> disabled_addons; -} extern values; +}; -float Volume(); +extern Values values; + +bool IsConfiguringGlobal(); +void SetConfiguringGlobal(bool is_global); bool IsGPULevelExtreme(); bool IsGPULevelHigh(); +float Volume(); + std::string GetTimeZoneString(); void Apply(); |