Initialize class/struct variables with default values in modules/
This commit is contained in:
@@ -33,15 +33,6 @@
|
||||
#include "core/core_string_names.h"
|
||||
|
||||
NoiseTexture::NoiseTexture() {
|
||||
update_queued = false;
|
||||
regen_queued = false;
|
||||
first_time = true;
|
||||
|
||||
size = Vector2i(512, 512);
|
||||
seamless = false;
|
||||
as_normal_map = false;
|
||||
bump_strength = 8.0;
|
||||
|
||||
noise = Ref<OpenSimplexNoise>();
|
||||
|
||||
_queue_update();
|
||||
|
||||
@@ -47,18 +47,18 @@ private:
|
||||
|
||||
Thread noise_thread;
|
||||
|
||||
bool first_time;
|
||||
bool update_queued;
|
||||
bool regen_queued;
|
||||
bool first_time = true;
|
||||
bool update_queued = false;
|
||||
bool regen_queued = false;
|
||||
|
||||
mutable RID texture;
|
||||
uint32_t flags;
|
||||
uint32_t flags = 0;
|
||||
|
||||
Ref<OpenSimplexNoise> noise;
|
||||
Vector2i size;
|
||||
bool seamless;
|
||||
bool as_normal_map;
|
||||
float bump_strength;
|
||||
Vector2i size = Vector2i(512, 512);
|
||||
bool seamless = false;
|
||||
bool as_normal_map = false;
|
||||
float bump_strength = 8.0;
|
||||
|
||||
void _thread_done(const Ref<Image> &p_image);
|
||||
static void _thread_function(void *p_ud);
|
||||
|
||||
@@ -33,12 +33,6 @@
|
||||
#include "core/core_string_names.h"
|
||||
|
||||
OpenSimplexNoise::OpenSimplexNoise() {
|
||||
seed = 0;
|
||||
persistence = 0.5;
|
||||
octaves = 3;
|
||||
period = 64;
|
||||
lacunarity = 2.0;
|
||||
|
||||
_init_seeds();
|
||||
}
|
||||
|
||||
|
||||
@@ -48,11 +48,11 @@ class OpenSimplexNoise : public Resource {
|
||||
|
||||
osn_context contexts[MAX_OCTAVES];
|
||||
|
||||
int seed;
|
||||
float persistence; // Controls details, value in [0,1]. Higher increases grain, lower increases smoothness.
|
||||
int octaves; // Number of noise layers
|
||||
float period; // Distance above which we start to see similarities. The higher, the longer "hills" will be on a terrain.
|
||||
float lacunarity; // Controls period change across octaves. 2 is usually a good value to address all detail levels.
|
||||
int seed = 0;
|
||||
float persistence = 0.5; // Controls details, value in [0,1]. Higher increases grain, lower increases smoothness.
|
||||
int octaves = 3; // Number of noise layers
|
||||
float period = 64.0; // Distance above which we start to see similarities. The higher, the longer "hills" will be on a terrain.
|
||||
float lacunarity = 2.0; // Controls period change across octaves. 2 is usually a good value to address all detail levels.
|
||||
|
||||
public:
|
||||
OpenSimplexNoise();
|
||||
|
||||
Reference in New Issue
Block a user