summaryrefslogtreecommitdiff
path: root/src/core/settings.cpp
diff options
context:
space:
mode:
authorGravatar Lioncash2020-11-27 10:50:48 -0500
committerGravatar Lioncash2020-11-27 11:40:45 -0500
commit5bc4eabe36b7ef4dcd5ad8db1e944705655be432 (patch)
tree285ffb3801aa773cb3537f77153a9e432390f6b8 /src/core/settings.cpp
parentMerge pull request #5023 from lioncash/save-global (diff)
downloadyuzu-5bc4eabe36b7ef4dcd5ad8db1e944705655be432.tar.gz
yuzu-5bc4eabe36b7ef4dcd5ad8db1e944705655be432.tar.xz
yuzu-5bc4eabe36b7ef4dcd5ad8db1e944705655be432.zip
core: Eliminate remaining usages of the global system instance
Removes all remaining usages of the global system instance. After this, migration can begin to migrate to being constructed and managed entirely by the various frontends.
Diffstat (limited to 'src/core/settings.cpp')
-rw-r--r--src/core/settings.cpp17
1 files changed, 7 insertions, 10 deletions
diff --git a/src/core/settings.cpp b/src/core/settings.cpp
index aadbc3932..e9997a263 100644
--- a/src/core/settings.cpp
+++ b/src/core/settings.cpp
@@ -4,9 +4,10 @@
4 4
5#include <string_view> 5#include <string_view>
6 6
7#include "common/assert.h"
7#include "common/file_util.h" 8#include "common/file_util.h"
9#include "common/logging/log.h"
8#include "core/core.h" 10#include "core/core.h"
9#include "core/gdbstub/gdbstub.h"
10#include "core/hle/service/hid/hid.h" 11#include "core/hle/service/hid/hid.h"
11#include "core/settings.h" 12#include "core/settings.h"
12#include "video_core/renderer_base.h" 13#include "video_core/renderer_base.h"
@@ -31,13 +32,9 @@ std::string GetTimeZoneString() {
31 return timezones[time_zone_index]; 32 return timezones[time_zone_index];
32} 33}
33 34
34void Apply() { 35void Apply(Core::System& system) {
35 GDBStub::SetServerPort(values.gdbstub_port); 36 if (system.IsPoweredOn()) {
36 GDBStub::ToggleServer(values.use_gdbstub); 37 system.Renderer().RefreshBaseSettings();
37
38 auto& system_instance = Core::System::GetInstance();
39 if (system_instance.IsPoweredOn()) {
40 system_instance.Renderer().RefreshBaseSettings();
41 } 38 }
42 39
43 Service::HID::ReloadInputDevices(); 40 Service::HID::ReloadInputDevices();
@@ -106,9 +103,9 @@ float Volume() {
106 return values.volume.GetValue(); 103 return values.volume.GetValue();
107} 104}
108 105
109void RestoreGlobalState() { 106void RestoreGlobalState(bool is_powered_on) {
110 // If a game is running, DO NOT restore the global settings state 107 // If a game is running, DO NOT restore the global settings state
111 if (Core::System::GetInstance().IsPoweredOn()) { 108 if (is_powered_on) {
112 return; 109 return;
113 } 110 }
114 111