diff options
| author | 2021-04-14 16:07:40 -0700 | |
|---|---|---|
| committer | 2021-04-14 16:24:03 -0700 | |
| commit | a4c6712a4be249bf668df7f0ff83a0a5236283b2 (patch) | |
| tree | f05e183692b6b1e4096d285fb77db50f048ae82d /src/common | |
| parent | core: settings: Add setting for debug assertions and disable by default. (diff) | |
| download | yuzu-a4c6712a4be249bf668df7f0ff83a0a5236283b2.tar.gz yuzu-a4c6712a4be249bf668df7f0ff83a0a5236283b2.tar.xz yuzu-a4c6712a4be249bf668df7f0ff83a0a5236283b2.zip | |
common: Move settings to common from core.
- Removes a dependency on core and input_common from common.
Diffstat (limited to '')
| -rw-r--r-- | src/common/CMakeLists.txt | 4 | ||||
| -rw-r--r-- | src/common/assert.cpp | 2 | ||||
| -rw-r--r-- | src/common/logging/backend.cpp | 2 | ||||
| -rw-r--r-- | src/common/settings.cpp (renamed from src/core/settings.cpp) | 15 | ||||
| -rw-r--r-- | src/common/settings.h (renamed from src/core/settings.h) | 14 | ||||
| -rw-r--r-- | src/common/settings_input.cpp (renamed from src/input_common/settings.cpp) | 2 | ||||
| -rw-r--r-- | src/common/settings_input.h (renamed from src/input_common/settings.h) | 1 |
7 files changed, 15 insertions, 25 deletions
diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt index 9f8dafa3b..88644eeb6 100644 --- a/src/common/CMakeLists.txt +++ b/src/common/CMakeLists.txt | |||
| @@ -152,6 +152,10 @@ add_library(common STATIC | |||
| 152 | scm_rev.cpp | 152 | scm_rev.cpp |
| 153 | scm_rev.h | 153 | scm_rev.h |
| 154 | scope_exit.h | 154 | scope_exit.h |
| 155 | settings.cpp | ||
| 156 | settings.h | ||
| 157 | settings_input.cpp | ||
| 158 | settings_input.h | ||
| 155 | spin_lock.cpp | 159 | spin_lock.cpp |
| 156 | spin_lock.h | 160 | spin_lock.h |
| 157 | stream.cpp | 161 | stream.cpp |
diff --git a/src/common/assert.cpp b/src/common/assert.cpp index 4f599af55..72f1121aa 100644 --- a/src/common/assert.cpp +++ b/src/common/assert.cpp | |||
| @@ -5,7 +5,7 @@ | |||
| 5 | #include "common/assert.h" | 5 | #include "common/assert.h" |
| 6 | #include "common/common_funcs.h" | 6 | #include "common/common_funcs.h" |
| 7 | 7 | ||
| 8 | #include "core/settings.h" | 8 | #include "common/settings.h" |
| 9 | 9 | ||
| 10 | void assert_handle_failure() { | 10 | void assert_handle_failure() { |
| 11 | if (Settings::values.use_debug_asserts) { | 11 | if (Settings::values.use_debug_asserts) { |
diff --git a/src/common/logging/backend.cpp b/src/common/logging/backend.cpp index 4575df24d..90ee4f33f 100644 --- a/src/common/logging/backend.cpp +++ b/src/common/logging/backend.cpp | |||
| @@ -21,9 +21,9 @@ | |||
| 21 | #include "common/logging/backend.h" | 21 | #include "common/logging/backend.h" |
| 22 | #include "common/logging/log.h" | 22 | #include "common/logging/log.h" |
| 23 | #include "common/logging/text_formatter.h" | 23 | #include "common/logging/text_formatter.h" |
| 24 | #include "common/settings.h" | ||
| 24 | #include "common/string_util.h" | 25 | #include "common/string_util.h" |
| 25 | #include "common/threadsafe_queue.h" | 26 | #include "common/threadsafe_queue.h" |
| 26 | #include "core/settings.h" | ||
| 27 | 27 | ||
| 28 | namespace Log { | 28 | namespace Log { |
| 29 | 29 | ||
diff --git a/src/core/settings.cpp b/src/common/settings.cpp index 2ae5196e0..702b6598d 100644 --- a/src/core/settings.cpp +++ b/src/common/settings.cpp | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | // Copyright 2014 Citra Emulator Project | 1 | // Copyright 2021 yuzu Emulator Project |
| 2 | // Licensed under GPLv2 or any later version | 2 | // Licensed under GPLv2 or any later version |
| 3 | // Refer to the license.txt file included. | 3 | // Refer to the license.txt file included. |
| 4 | 4 | ||
| @@ -7,10 +7,7 @@ | |||
| 7 | #include "common/assert.h" | 7 | #include "common/assert.h" |
| 8 | #include "common/file_util.h" | 8 | #include "common/file_util.h" |
| 9 | #include "common/logging/log.h" | 9 | #include "common/logging/log.h" |
| 10 | #include "core/core.h" | 10 | #include "common/settings.h" |
| 11 | #include "core/hle/service/hid/hid.h" | ||
| 12 | #include "core/settings.h" | ||
| 13 | #include "video_core/renderer_base.h" | ||
| 14 | 11 | ||
| 15 | namespace Settings { | 12 | namespace Settings { |
| 16 | 13 | ||
| @@ -32,14 +29,6 @@ std::string GetTimeZoneString() { | |||
| 32 | return timezones[time_zone_index]; | 29 | return timezones[time_zone_index]; |
| 33 | } | 30 | } |
| 34 | 31 | ||
| 35 | void Apply(Core::System& system) { | ||
| 36 | if (system.IsPoweredOn()) { | ||
| 37 | system.Renderer().RefreshBaseSettings(); | ||
| 38 | } | ||
| 39 | |||
| 40 | Service::HID::ReloadInputDevices(); | ||
| 41 | } | ||
| 42 | |||
| 43 | void LogSettings() { | 32 | void LogSettings() { |
| 44 | const auto log_setting = [](std::string_view name, const auto& value) { | 33 | const auto log_setting = [](std::string_view name, const auto& value) { |
| 45 | LOG_INFO(Config, "{}: {}", name, value); | 34 | LOG_INFO(Config, "{}: {}", name, value); |
diff --git a/src/core/settings.h b/src/common/settings.h index 0b7d28421..d39b4aa45 100644 --- a/src/core/settings.h +++ b/src/common/settings.h | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | // Copyright 2014 Citra Emulator Project | 1 | // Copyright 2021 yuzu Emulator Project |
| 2 | // Licensed under GPLv2 or any later version | 2 | // Licensed under GPLv2 or any later version |
| 3 | // Refer to the license.txt file included. | 3 | // Refer to the license.txt file included. |
| 4 | 4 | ||
| @@ -11,16 +11,13 @@ | |||
| 11 | #include <optional> | 11 | #include <optional> |
| 12 | #include <string> | 12 | #include <string> |
| 13 | #include <vector> | 13 | #include <vector> |
| 14 | #include "common/common_types.h" | ||
| 15 | #include "input_common/settings.h" | ||
| 16 | 14 | ||
| 17 | namespace Core { | 15 | #include "common/common_types.h" |
| 18 | class System; | 16 | #include "common/settings_input.h" |
| 19 | } | ||
| 20 | 17 | ||
| 21 | namespace Settings { | 18 | namespace Settings { |
| 22 | 19 | ||
| 23 | enum class RendererBackend { | 20 | enum class RendererBackend : u32 { |
| 24 | OpenGL = 0, | 21 | OpenGL = 0, |
| 25 | Vulkan = 1, | 22 | Vulkan = 1, |
| 26 | }; | 23 | }; |
| @@ -31,7 +28,7 @@ enum class GPUAccuracy : u32 { | |||
| 31 | Extreme = 2, | 28 | Extreme = 2, |
| 32 | }; | 29 | }; |
| 33 | 30 | ||
| 34 | enum class CPUAccuracy { | 31 | enum class CPUAccuracy : u32 { |
| 35 | Accurate = 0, | 32 | Accurate = 0, |
| 36 | Unsafe = 1, | 33 | Unsafe = 1, |
| 37 | DebugMode = 2, | 34 | DebugMode = 2, |
| @@ -256,7 +253,6 @@ float Volume(); | |||
| 256 | 253 | ||
| 257 | std::string GetTimeZoneString(); | 254 | std::string GetTimeZoneString(); |
| 258 | 255 | ||
| 259 | void Apply(Core::System& system); | ||
| 260 | void LogSettings(); | 256 | void LogSettings(); |
| 261 | 257 | ||
| 262 | // Restore the global state of all applicable settings in the Values struct | 258 | // Restore the global state of all applicable settings in the Values struct |
diff --git a/src/input_common/settings.cpp b/src/common/settings_input.cpp index 557e7a9a0..bea2b837b 100644 --- a/src/input_common/settings.cpp +++ b/src/common/settings_input.cpp | |||
| @@ -2,7 +2,7 @@ | |||
| 2 | // Licensed under GPLv2 or any later version | 2 | // Licensed under GPLv2 or any later version |
| 3 | // Refer to the license.txt file included. | 3 | // Refer to the license.txt file included. |
| 4 | 4 | ||
| 5 | #include "input_common/settings.h" | 5 | #include "common/settings_input.h" |
| 6 | 6 | ||
| 7 | namespace Settings { | 7 | namespace Settings { |
| 8 | namespace NativeButton { | 8 | namespace NativeButton { |
diff --git a/src/input_common/settings.h b/src/common/settings_input.h index a59f5d461..609600582 100644 --- a/src/input_common/settings.h +++ b/src/common/settings_input.h | |||
| @@ -6,6 +6,7 @@ | |||
| 6 | 6 | ||
| 7 | #include <array> | 7 | #include <array> |
| 8 | #include <string> | 8 | #include <string> |
| 9 | |||
| 9 | #include "common/common_types.h" | 10 | #include "common/common_types.h" |
| 10 | 11 | ||
| 11 | namespace Settings { | 12 | namespace Settings { |