diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/yuzu_cmd/config.cpp | 8 | ||||
| -rw-r--r-- | src/yuzu_cmd/config.h | 8 |
2 files changed, 11 insertions, 5 deletions
diff --git a/src/yuzu_cmd/config.cpp b/src/yuzu_cmd/config.cpp index 2c8d3f683..325584a1a 100644 --- a/src/yuzu_cmd/config.cpp +++ b/src/yuzu_cmd/config.cpp | |||
| @@ -242,19 +242,19 @@ static const std::array<int, 8> keyboard_mods{ | |||
| 242 | }; | 242 | }; |
| 243 | 243 | ||
| 244 | template <> | 244 | template <> |
| 245 | void Config::ReadSetting(const std::string& group, Settings::BasicSetting<float> setting) { | 245 | void Config::ReadSetting(const std::string& group, Settings::BasicSetting<float>& setting) { |
| 246 | setting = sdl2_config->GetReal(group, setting.GetLabel(), setting.GetDefault()); | 246 | setting = sdl2_config->GetReal(group, setting.GetLabel(), setting.GetDefault()); |
| 247 | } | 247 | } |
| 248 | template <> | 248 | template <> |
| 249 | void Config::ReadSetting(const std::string& group, Settings::BasicSetting<std::string> setting) { | 249 | void Config::ReadSetting(const std::string& group, Settings::BasicSetting<std::string>& setting) { |
| 250 | setting = sdl2_config->Get(group, setting.GetLabel(), setting.GetDefault()); | 250 | setting = sdl2_config->Get(group, setting.GetLabel(), setting.GetDefault()); |
| 251 | } | 251 | } |
| 252 | template <> | 252 | template <> |
| 253 | void Config::ReadSetting(const std::string& group, Settings::BasicSetting<bool> setting) { | 253 | void Config::ReadSetting(const std::string& group, Settings::BasicSetting<bool>& setting) { |
| 254 | setting = sdl2_config->GetBoolean(group, setting.GetLabel(), setting.GetDefault()); | 254 | setting = sdl2_config->GetBoolean(group, setting.GetLabel(), setting.GetDefault()); |
| 255 | } | 255 | } |
| 256 | template <typename Type> | 256 | template <typename Type> |
| 257 | void Config::ReadSetting(const std::string& group, Settings::BasicSetting<Type> setting) { | 257 | void Config::ReadSetting(const std::string& group, Settings::BasicSetting<Type>& setting) { |
| 258 | setting = static_cast<Type>(sdl2_config->GetInteger(group, setting.GetLabel(), | 258 | setting = static_cast<Type>(sdl2_config->GetInteger(group, setting.GetLabel(), |
| 259 | static_cast<long>(setting.GetDefault()))); | 259 | static_cast<long>(setting.GetDefault()))); |
| 260 | } | 260 | } |
diff --git a/src/yuzu_cmd/config.h b/src/yuzu_cmd/config.h index bf0103dee..1ee932be2 100644 --- a/src/yuzu_cmd/config.h +++ b/src/yuzu_cmd/config.h | |||
| @@ -26,6 +26,12 @@ public: | |||
| 26 | void Reload(); | 26 | void Reload(); |
| 27 | 27 | ||
| 28 | private: | 28 | private: |
| 29 | /** | ||
| 30 | * Applies a value read from the sdl2_config to a BasicSetting. | ||
| 31 | * | ||
| 32 | * @param group The name of the INI group | ||
| 33 | * @param setting The yuzu setting to modify | ||
| 34 | */ | ||
| 29 | template <typename Type> | 35 | template <typename Type> |
| 30 | void ReadSetting(const std::string& group, Settings::BasicSetting<Type> setting); | 36 | void ReadSetting(const std::string& group, Settings::BasicSetting<Type>& setting); |
| 31 | }; | 37 | }; |