summaryrefslogtreecommitdiff
path: root/src/settings.h
diff options
context:
space:
mode:
authorkwolekr <kwolekr@minetest.net>2014-12-02 03:58:57 -0500
committerkwolekr <kwolekr@minetest.net>2014-12-02 04:03:37 -0500
commit68c799bf99bbf624401500e116663d2326331473 (patch)
tree62dae903915798f182754d3de2a8aec6677d0d2d /src/settings.h
parent78103e622c45cf59130a98de9d9cec2078a70856 (diff)
downloadminetest-68c799bf99bbf624401500e116663d2326331473.tar.gz
minetest-68c799bf99bbf624401500e116663d2326331473.tar.bz2
minetest-68c799bf99bbf624401500e116663d2326331473.zip
Use setting groups for NoiseParams
Add format example to minetest.conf.example Add Settings::setU16() Throw exception on attempted access of NULL settings groups
Diffstat (limited to 'src/settings.h')
-rw-r--r--src/settings.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/settings.h b/src/settings.h
index 542fae2a4..cc7ea365d 100644
--- a/src/settings.h
+++ b/src/settings.h
@@ -29,6 +29,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include <set>
class Settings;
+struct NoiseParams;
/** function type to register a changed callback */
typedef void (*setting_changed_callback)(const std::string);
@@ -142,6 +143,9 @@ public:
// the behavior is undefined.
bool getStruct(const std::string &name, const std::string &format,
void *out, size_t olen) const;
+ bool getNoiseParams(const std::string &name, NoiseParams &np) const;
+ bool getNoiseParamsFromValue(const std::string &name, NoiseParams &np) const;
+ bool getNoiseParamsFromGroup(const std::string &name, NoiseParams &np) const;
// return all keys used
std::vector<std::string> getNames() const;
@@ -181,6 +185,7 @@ public:
void setGroupDefault(const std::string &name, Settings *group);
void setBool(const std::string &name, bool value);
void setS16(const std::string &name, s16 value);
+ void setU16(const std::string &name, u16 value);
void setS32(const std::string &name, s32 value);
void setU64(const std::string &name, u64 value);
void setFloat(const std::string &name, float value);
@@ -188,6 +193,7 @@ public:
void setV3F(const std::string &name, v3f value);
void setFlagStr(const std::string &name, u32 flags,
const FlagDesc *flagdesc, u32 flagmask);
+ void setNoiseParams(const std::string &name, const NoiseParams &np);
// N.B. if setStruct() is used to write a non-POD aggregate type,
// the behavior is undefined.
bool setStruct(const std::string &name, const std::string &format, void *value);