diff options
Diffstat (limited to 'src/common/settings_enums.h')
| -rw-r--r-- | src/common/settings_enums.h | 237 |
1 files changed, 237 insertions, 0 deletions
diff --git a/src/common/settings_enums.h b/src/common/settings_enums.h new file mode 100644 index 000000000..f48fb7bd4 --- /dev/null +++ b/src/common/settings_enums.h | |||
| @@ -0,0 +1,237 @@ | |||
| 1 | // SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project | ||
| 2 | // SPDX-License-Identifier: GPL-2.0-or-later | ||
| 3 | |||
| 4 | #pragma once | ||
| 5 | |||
| 6 | #include <map> | ||
| 7 | #include <string> | ||
| 8 | #include <type_traits> | ||
| 9 | #include <typeindex> | ||
| 10 | #include "common/common_types.h" | ||
| 11 | |||
| 12 | namespace Settings { | ||
| 13 | |||
| 14 | enum class AudioEngine : u32 { | ||
| 15 | Auto, | ||
| 16 | Cubeb, | ||
| 17 | Sdl2, | ||
| 18 | Null, | ||
| 19 | }; | ||
| 20 | |||
| 21 | enum class AudioMode : u32 { | ||
| 22 | Mono, | ||
| 23 | Stereo, | ||
| 24 | Surround, | ||
| 25 | }; | ||
| 26 | |||
| 27 | enum class Language : u32 { | ||
| 28 | Japanese, | ||
| 29 | EnglishAmerican, | ||
| 30 | French, | ||
| 31 | German, | ||
| 32 | Italian, | ||
| 33 | Spanish, | ||
| 34 | Chinese, | ||
| 35 | Korean, | ||
| 36 | Dutch, | ||
| 37 | Portuguese, | ||
| 38 | Russian, | ||
| 39 | Taiwanese, | ||
| 40 | EnglishBritish, | ||
| 41 | FrenchCanadian, | ||
| 42 | SpanishLatin, | ||
| 43 | ChineseSimplified, | ||
| 44 | ChineseTraditional, | ||
| 45 | PortugueseBrazilian, | ||
| 46 | }; | ||
| 47 | |||
| 48 | enum class Region : u32 { | ||
| 49 | Japan, | ||
| 50 | USA, | ||
| 51 | Europe, | ||
| 52 | Australia, | ||
| 53 | China, | ||
| 54 | Korea, | ||
| 55 | Taiwan, | ||
| 56 | }; | ||
| 57 | |||
| 58 | enum class TimeZone : u32 { | ||
| 59 | Auto, | ||
| 60 | Default, | ||
| 61 | CET, | ||
| 62 | CST6CDT, | ||
| 63 | Cuba, | ||
| 64 | EET, | ||
| 65 | Egypt, | ||
| 66 | Eire, | ||
| 67 | EST, | ||
| 68 | EST5EDT, | ||
| 69 | GB, | ||
| 70 | GBEire, | ||
| 71 | GMT, | ||
| 72 | GMTPlusZero, | ||
| 73 | GMTMinusZero, | ||
| 74 | GMTZero, | ||
| 75 | Greenwich, | ||
| 76 | Hongkong, | ||
| 77 | HST, | ||
| 78 | Iceland, | ||
| 79 | Iran, | ||
| 80 | Israel, | ||
| 81 | Jamaica, | ||
| 82 | Japan, | ||
| 83 | Kwajalein, | ||
| 84 | Libya, | ||
| 85 | MET, | ||
| 86 | MST, | ||
| 87 | MST7MDT, | ||
| 88 | Navajo, | ||
| 89 | NZ, | ||
| 90 | NZCHAT, | ||
| 91 | Poland, | ||
| 92 | Portugal, | ||
| 93 | PRC, | ||
| 94 | PST8PDT, | ||
| 95 | ROC, | ||
| 96 | ROK, | ||
| 97 | Singapore, | ||
| 98 | Turkey, | ||
| 99 | UCT, | ||
| 100 | Universal, | ||
| 101 | UTC, | ||
| 102 | W_SU, | ||
| 103 | WET, | ||
| 104 | Zulu, | ||
| 105 | }; | ||
| 106 | |||
| 107 | enum class AnisotropyMode : u32 { | ||
| 108 | Automatic = 0, | ||
| 109 | Default = 1, | ||
| 110 | X2 = 2, | ||
| 111 | X4 = 3, | ||
| 112 | X8 = 4, | ||
| 113 | X16 = 5, | ||
| 114 | }; | ||
| 115 | |||
| 116 | enum class AstcDecodeMode : u32 { | ||
| 117 | CPU = 0, | ||
| 118 | GPU = 1, | ||
| 119 | CPUAsynchronous = 2, | ||
| 120 | }; | ||
| 121 | |||
| 122 | enum class AstcRecompression : u32 { | ||
| 123 | Uncompressed = 0, | ||
| 124 | Bc1 = 1, | ||
| 125 | Bc3 = 2, | ||
| 126 | }; | ||
| 127 | |||
| 128 | enum class VSyncMode : u32 { | ||
| 129 | Immediate = 0, | ||
| 130 | Mailbox = 1, | ||
| 131 | FIFO = 2, | ||
| 132 | FIFORelaxed = 3, | ||
| 133 | }; | ||
| 134 | |||
| 135 | enum class RendererBackend : u32 { | ||
| 136 | OpenGL = 0, | ||
| 137 | Vulkan = 1, | ||
| 138 | Null = 2, | ||
| 139 | }; | ||
| 140 | |||
| 141 | enum class ShaderBackend : u32 { | ||
| 142 | GLSL = 0, | ||
| 143 | GLASM = 1, | ||
| 144 | SPIRV = 2, | ||
| 145 | }; | ||
| 146 | |||
| 147 | enum class GPUAccuracy : u32 { | ||
| 148 | Normal = 0, | ||
| 149 | High = 1, | ||
| 150 | Extreme = 2, | ||
| 151 | MaxEnum = 3, | ||
| 152 | }; | ||
| 153 | |||
| 154 | enum class CPUAccuracy : u32 { | ||
| 155 | Auto = 0, | ||
| 156 | Accurate = 1, | ||
| 157 | Unsafe = 2, | ||
| 158 | Paranoid = 3, | ||
| 159 | }; | ||
| 160 | |||
| 161 | enum class FullscreenMode : u32 { | ||
| 162 | Borderless = 0, | ||
| 163 | Exclusive = 1, | ||
| 164 | }; | ||
| 165 | |||
| 166 | enum class NvdecEmulation : u32 { | ||
| 167 | Off = 0, | ||
| 168 | CPU = 1, | ||
| 169 | GPU = 2, | ||
| 170 | }; | ||
| 171 | |||
| 172 | enum class ResolutionSetup : u32 { | ||
| 173 | Res1_2X = 0, | ||
| 174 | Res3_4X = 1, | ||
| 175 | Res1X = 2, | ||
| 176 | Res3_2X = 3, | ||
| 177 | Res2X = 4, | ||
| 178 | Res3X = 5, | ||
| 179 | Res4X = 6, | ||
| 180 | Res5X = 7, | ||
| 181 | Res6X = 8, | ||
| 182 | Res7X = 9, | ||
| 183 | Res8X = 10, | ||
| 184 | }; | ||
| 185 | |||
| 186 | enum class ScalingFilter : u32 { | ||
| 187 | NearestNeighbor = 0, | ||
| 188 | Bilinear = 1, | ||
| 189 | Bicubic = 2, | ||
| 190 | Gaussian = 3, | ||
| 191 | ScaleForce = 4, | ||
| 192 | Fsr = 5, | ||
| 193 | LastFilter = Fsr, | ||
| 194 | }; | ||
| 195 | |||
| 196 | enum class AntiAliasing : u32 { | ||
| 197 | None = 0, | ||
| 198 | Fxaa = 1, | ||
| 199 | Smaa = 2, | ||
| 200 | LastAA = Smaa, | ||
| 201 | }; | ||
| 202 | |||
| 203 | enum class AspectRatio : u32 { | ||
| 204 | R16_9, | ||
| 205 | R4_3, | ||
| 206 | R21_9, | ||
| 207 | R16_10, | ||
| 208 | Stretch, | ||
| 209 | }; | ||
| 210 | |||
| 211 | static std::map<std::type_index, std::map<std::string, u32>> translations = { | ||
| 212 | {typeid(AudioEngine), | ||
| 213 | { | ||
| 214 | {"auto", static_cast<u32>(AudioEngine::Auto)}, | ||
| 215 | {"cubeb", static_cast<u32>(AudioEngine::Cubeb)}, | ||
| 216 | {"sdl2", static_cast<u32>(AudioEngine::Sdl2)}, | ||
| 217 | {"null", static_cast<u32>(AudioEngine::Null)}, | ||
| 218 | }}}; | ||
| 219 | |||
| 220 | static std::string empty_string{}; | ||
| 221 | |||
| 222 | template <typename Type> | ||
| 223 | const std::string& TranslateEnum(Type id) { | ||
| 224 | auto& group = translations.at(typeid(Type)); | ||
| 225 | for (auto& [name, value] : group) { | ||
| 226 | if (static_cast<Type>(value) == id) { | ||
| 227 | return name; | ||
| 228 | } | ||
| 229 | } | ||
| 230 | return empty_string; | ||
| 231 | } | ||
| 232 | |||
| 233 | template <typename Type> | ||
| 234 | static Type ToEnum(const std::string& text) { | ||
| 235 | return static_cast<Type>(translations.at(typeid(Type)).at(text)); | ||
| 236 | } | ||
| 237 | } // namespace Settings | ||