diff options
Diffstat (limited to 'src/common/settings.cpp')
| -rw-r--r-- | src/common/settings.cpp | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/src/common/settings.cpp b/src/common/settings.cpp index 84e90f893..10cdea844 100644 --- a/src/common/settings.cpp +++ b/src/common/settings.cpp | |||
| @@ -7,10 +7,17 @@ | |||
| 7 | #include <exception> | 7 | #include <exception> |
| 8 | #include <stdexcept> | 8 | #include <stdexcept> |
| 9 | #endif | 9 | #endif |
| 10 | #include <compare> | ||
| 11 | #include <cstddef> | ||
| 12 | #include <filesystem> | ||
| 13 | #include <forward_list> | ||
| 10 | #include <functional> | 14 | #include <functional> |
| 11 | #include <string_view> | 15 | #include <string_view> |
| 16 | #include <type_traits> | ||
| 17 | #include <fmt/core.h> | ||
| 12 | 18 | ||
| 13 | #include "common/assert.h" | 19 | #include "common/assert.h" |
| 20 | #include "common/fs/fs_util.h" | ||
| 14 | #include "common/fs/path_util.h" | 21 | #include "common/fs/path_util.h" |
| 15 | #include "common/logging/log.h" | 22 | #include "common/logging/log.h" |
| 16 | #include "common/settings.h" | 23 | #include "common/settings.h" |
| @@ -18,6 +25,43 @@ | |||
| 18 | 25 | ||
| 19 | namespace Settings { | 26 | namespace Settings { |
| 20 | 27 | ||
| 28 | #define SETTING(TYPE, RANGED) template class Setting<TYPE, RANGED> | ||
| 29 | #define SWITCHABLE(TYPE, RANGED) template class SwitchableSetting<TYPE, RANGED> | ||
| 30 | |||
| 31 | SETTING(AudioEngine, false); | ||
| 32 | SETTING(bool, false); | ||
| 33 | SETTING(int, false); | ||
| 34 | SETTING(std::string, false); | ||
| 35 | SETTING(u16, false); | ||
| 36 | SWITCHABLE(AnisotropyMode, true); | ||
| 37 | SWITCHABLE(AntiAliasing, false); | ||
| 38 | SWITCHABLE(AspectRatio, true); | ||
| 39 | SWITCHABLE(AstcDecodeMode, true); | ||
| 40 | SWITCHABLE(AstcRecompression, true); | ||
| 41 | SWITCHABLE(AudioMode, true); | ||
| 42 | SWITCHABLE(CpuAccuracy, true); | ||
| 43 | SWITCHABLE(FullscreenMode, true); | ||
| 44 | SWITCHABLE(GpuAccuracy, true); | ||
| 45 | SWITCHABLE(Language, true); | ||
| 46 | SWITCHABLE(NvdecEmulation, false); | ||
| 47 | SWITCHABLE(Region, true); | ||
| 48 | SWITCHABLE(RendererBackend, true); | ||
| 49 | SWITCHABLE(ScalingFilter, false); | ||
| 50 | SWITCHABLE(ShaderBackend, true); | ||
| 51 | SWITCHABLE(TimeZone, true); | ||
| 52 | SETTING(VSyncMode, true); | ||
| 53 | SWITCHABLE(bool, false); | ||
| 54 | SWITCHABLE(int, false); | ||
| 55 | SWITCHABLE(int, true); | ||
| 56 | SWITCHABLE(s64, false); | ||
| 57 | SWITCHABLE(u16, true); | ||
| 58 | SWITCHABLE(u32, false); | ||
| 59 | SWITCHABLE(u8, false); | ||
| 60 | SWITCHABLE(u8, true); | ||
| 61 | |||
| 62 | #undef SETTING | ||
| 63 | #undef SWITCHABLE | ||
| 64 | |||
| 21 | Values values; | 65 | Values values; |
| 22 | static bool configuring_global = true; | 66 | static bool configuring_global = true; |
| 23 | 67 | ||
| @@ -238,6 +282,14 @@ void UpdateRescalingInfo() { | |||
| 238 | info.active = info.up_scale != 1 || info.down_shift != 0; | 282 | info.active = info.up_scale != 1 || info.down_shift != 0; |
| 239 | } | 283 | } |
| 240 | 284 | ||
| 285 | std::string BasicSetting::ToStringGlobal() const { | ||
| 286 | return {}; | ||
| 287 | } | ||
| 288 | |||
| 289 | bool BasicSetting::UsingGlobal() const { | ||
| 290 | return true; | ||
| 291 | } | ||
| 292 | |||
| 241 | void RestoreGlobalState(bool is_powered_on) { | 293 | void RestoreGlobalState(bool is_powered_on) { |
| 242 | // If a game is running, DO NOT restore the global settings state | 294 | // If a game is running, DO NOT restore the global settings state |
| 243 | if (is_powered_on) { | 295 | if (is_powered_on) { |