mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Use setting groups for NoiseParams
Add format example to minetest.conf.example Add Settings::setU16() Throw exception on attempted access of NULL settings groups
This commit is contained in:
parent
78103e622c
commit
68c799bf99
5 changed files with 103 additions and 10 deletions
15
src/noise.h
15
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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue