aboutsummaryrefslogtreecommitdiff
path: root/src/settings.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/settings.cpp')
-rw-r--r--src/settings.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/settings.cpp b/src/settings.cpp
index 0e44ee0bc..a0225bc2c 100644
--- a/src/settings.cpp
+++ b/src/settings.cpp
@@ -21,6 +21,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "irrlichttypes_bloated.h"
#include "exceptions.h"
#include "threading/mutex_auto_lock.h"
+#include "util/numeric.h" // rangelim
#include "util/strfnd.h"
#include <iostream>
#include <fstream>
@@ -534,6 +535,13 @@ float Settings::getFloat(const std::string &name) const
}
+float Settings::getFloat(const std::string &name, float min, float max) const
+{
+ float val = stof(get(name));
+ return rangelim(val, min, max);
+}
+
+
u64 Settings::getU64(const std::string &name) const
{
std::string s = get(name);