From 68c799bf99bbf624401500e116663d2326331473 Mon Sep 17 00:00:00 2001 From: kwolekr Date: Tue, 2 Dec 2014 03:58:57 -0500 Subject: Use setting groups for NoiseParams Add format example to minetest.conf.example Add Settings::setU16() Throw exception on attempted access of NULL settings groups --- src/noise.h | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'src/noise.h') 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: -- cgit v1.2.3