1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Cpp11 patchset 11: continue working on constructor style migration (#6004)

This commit is contained in:
Loïc Blot 2017-06-18 19:55:15 +02:00 committed by GitHub
parent 8f7785771b
commit 4faaadc8d5
39 changed files with 200 additions and 396 deletions

View file

@ -102,26 +102,16 @@ private:
#define NOISE_FLAG_SIMPLEX 0x10
struct NoiseParams {
float offset;
float scale;
v3f spread;
s32 seed;
u16 octaves;
float persist;
float lacunarity;
u32 flags;
float offset = 0.0f;
float scale = 1.0f;
v3f spread = v3f(250, 250, 250);
s32 seed = 12345;
u16 octaves = 3;
float persist = 0.6f;
float lacunarity = 2.0f;
u32 flags = NOISE_FLAG_DEFAULTS;
NoiseParams()
{
offset = 0.0f;
scale = 1.0f;
spread = v3f(250, 250, 250);
seed = 12345;
octaves = 3;
persist = 0.6f;
lacunarity = 2.0f;
flags = NOISE_FLAG_DEFAULTS;
}
NoiseParams() {}
NoiseParams(float offset_, float scale_, v3f spread_, s32 seed_,
u16 octaves_, float persist_, float lacunarity_,
@ -138,13 +128,6 @@ struct NoiseParams {
}
};
// 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:
NoiseParams np;
@ -152,10 +135,10 @@ public:
u32 sx;
u32 sy;
u32 sz;
float *noise_buf;
float *gradient_buf;
float *persist_buf;
float *result;
float *noise_buf = nullptr;
float *gradient_buf = nullptr;
float *persist_buf = nullptr;
float *result = nullptr;
Noise(NoiseParams *np, s32 seed, u32 sx, u32 sy, u32 sz=1);
~Noise();