summaryrefslogtreecommitdiff
path: root/src/noise.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/noise.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/noise.h')
-rw-r--r--src/noise.h15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/noise.h b/src/noise.h
index 3c726f17f..7d055d2e1 100644
--- a/src/noise.h
+++ b/src/noise.h
@@ -70,8 +70,8 @@ struct NoiseParams {
float offset;
float scale;
v3f spread;
- int seed;
- int octaves;
+ s32 seed;
+ u16 octaves;
float persist;
bool eased;
@@ -91,12 +91,11 @@ struct NoiseParams {
};
-// Convenience macros for getting/setting NoiseParams in Settings
-
-#define NOISEPARAMS_FMT_STR "f,f,v3,s32,s32,f"
-
-#define getNoiseParams(x, y) getStruct((x), NOISEPARAMS_FMT_STR, &(y), sizeof(y))
-#define setNoiseParams(x, y) setStruct((x), NOISEPARAMS_FMT_STR, &(y))
+// Convenience macros for getting/setting NoiseParams in Settings as a string
+// WARNING: Deprecated, use Settings::getNoiseParamsFromValue() instead
+#define NOISEPARAMS_FMT_STR "f,f,v3,s32,u16,f"
+//#define getNoiseParams(x, y) getStruct((x), NOISEPARAMS_FMT_STR, &(y), sizeof(y))
+//#define setNoiseParams(x, y) setStruct((x), NOISEPARAMS_FMT_STR, &(y))
class Noise {
public: