summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorlat9nq <22451773+lat9nq@users.noreply.github.com>2021-07-01 02:16:01 +0200
committerlat9nq <22451773+lat9nq@users.noreply.github.com>2021-07-01 02:16:01 +0200
commit299c5594e6b36cef70b164e00eb671ed32c0d705 (patch)
tree57401c13a8758e699e241d0708a79fd5d2ecd30d /src
parentcore, input_common: Miscellaneous fixes (diff)
downloadyuzu-299c5594e6b36cef70b164e00eb671ed32c0d705.tar
yuzu-299c5594e6b36cef70b164e00eb671ed32c0d705.tar.gz
yuzu-299c5594e6b36cef70b164e00eb671ed32c0d705.tar.bz2
yuzu-299c5594e6b36cef70b164e00eb671ed32c0d705.tar.lz
yuzu-299c5594e6b36cef70b164e00eb671ed32c0d705.tar.xz
yuzu-299c5594e6b36cef70b164e00eb671ed32c0d705.tar.zst
yuzu-299c5594e6b36cef70b164e00eb671ed32c0d705.zip
Diffstat (limited to '')
-rw-r--r--src/yuzu_cmd/config.cpp8
-rw-r--r--src/yuzu_cmd/config.h8
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{
};
template <>
-void Config::ReadSetting(const std::string& group, Settings::BasicSetting<float> setting) {
+void Config::ReadSetting(const std::string& group, Settings::BasicSetting<float>& setting) {
setting = sdl2_config->GetReal(group, setting.GetLabel(), setting.GetDefault());
}
template <>
-void Config::ReadSetting(const std::string& group, Settings::BasicSetting<std::string> setting) {
+void Config::ReadSetting(const std::string& group, Settings::BasicSetting<std::string>& setting) {
setting = sdl2_config->Get(group, setting.GetLabel(), setting.GetDefault());
}
template <>
-void Config::ReadSetting(const std::string& group, Settings::BasicSetting<bool> setting) {
+void Config::ReadSetting(const std::string& group, Settings::BasicSetting<bool>& setting) {
setting = sdl2_config->GetBoolean(group, setting.GetLabel(), setting.GetDefault());
}
template <typename Type>
-void Config::ReadSetting(const std::string& group, Settings::BasicSetting<Type> setting) {
+void Config::ReadSetting(const std::string& group, Settings::BasicSetting<Type>& setting) {
setting = static_cast<Type>(sdl2_config->GetInteger(group, setting.GetLabel(),
static_cast<long>(setting.GetDefault())));
}
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:
void Reload();
private:
+ /**
+ * Applies a value read from the sdl2_config to a BasicSetting.
+ *
+ * @param group The name of the INI group
+ * @param setting The yuzu setting to modify
+ */
template <typename Type>
- void ReadSetting(const std::string& group, Settings::BasicSetting<Type> setting);
+ void ReadSetting(const std::string& group, Settings::BasicSetting<Type>& setting);
};