aboutsummaryrefslogtreecommitdiff
path: root/src/core/settings.cpp
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2020-11-04 04:16:34 -0500
committerLioncash <mathew1800@gmail.com>2020-11-04 04:16:37 -0500
commitb1de33af75e93e17d4d31b5b7e21a1ca13bc2140 (patch)
treece40aa9bdfb1a7e6c1827681b68dee50c6f47623 /src/core/settings.cpp
parent6e1fb8d4c12af6a1c24df36e6fea218e0dd2a7cf (diff)
core/settings: Move configuring_global behind an API
Rather than have directly modified global state here, we can make it an implementation detail and have an interface that changes are queried through.
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 e14c020458..a99d3cf5ac 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()) {