summaryrefslogtreecommitdiff
path: root/src/common/settings.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/settings.cpp')
-rw-r--r--src/common/settings.cpp52
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
19namespace Settings { 26namespace Settings {
20 27
28#define SETTING(TYPE, RANGED) template class Setting<TYPE, RANGED>
29#define SWITCHABLE(TYPE, RANGED) template class SwitchableSetting<TYPE, RANGED>
30
31SETTING(AudioEngine, false);
32SETTING(bool, false);
33SETTING(int, false);
34SETTING(std::string, false);
35SETTING(u16, false);
36SWITCHABLE(AnisotropyMode, true);
37SWITCHABLE(AntiAliasing, false);
38SWITCHABLE(AspectRatio, true);
39SWITCHABLE(AstcDecodeMode, true);
40SWITCHABLE(AstcRecompression, true);
41SWITCHABLE(AudioMode, true);
42SWITCHABLE(CpuAccuracy, true);
43SWITCHABLE(FullscreenMode, true);
44SWITCHABLE(GpuAccuracy, true);
45SWITCHABLE(Language, true);
46SWITCHABLE(NvdecEmulation, false);
47SWITCHABLE(Region, true);
48SWITCHABLE(RendererBackend, true);
49SWITCHABLE(ScalingFilter, false);
50SWITCHABLE(ShaderBackend, true);
51SWITCHABLE(TimeZone, true);
52SETTING(VSyncMode, true);
53SWITCHABLE(bool, false);
54SWITCHABLE(int, false);
55SWITCHABLE(int, true);
56SWITCHABLE(s64, false);
57SWITCHABLE(u16, true);
58SWITCHABLE(u32, false);
59SWITCHABLE(u8, false);
60SWITCHABLE(u8, true);
61
62#undef SETTING
63#undef SWITCHABLE
64
21Values values; 65Values values;
22static bool configuring_global = true; 66static 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
285std::string BasicSetting::ToStringGlobal() const {
286 return {};
287}
288
289bool BasicSetting::UsingGlobal() const {
290 return true;
291}
292
241void RestoreGlobalState(bool is_powered_on) { 293void 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) {