summaryrefslogtreecommitdiff
path: root/modules/opensimplex/noise_texture.h
diff options
context:
space:
mode:
Diffstat (limited to 'modules/opensimplex/noise_texture.h')
-rw-r--r--modules/opensimplex/noise_texture.h42
1 files changed, 21 insertions, 21 deletions
diff --git a/modules/opensimplex/noise_texture.h b/modules/opensimplex/noise_texture.h
index b1d7d3fac9..e89479d962 100644
--- a/modules/opensimplex/noise_texture.h
+++ b/modules/opensimplex/noise_texture.h
@@ -5,8 +5,8 @@
/* GODOT ENGINE */
/* https://godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
-/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
+/* Copyright (c) 2007-2021 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2021 Godot Engine contributors (cf. AUTHORS.md). */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -33,8 +33,8 @@
#include "open_simplex_noise.h"
-#include "core/image.h"
-#include "core/reference.h"
+#include "core/io/image.h"
+#include "core/object/reference.h"
#include "editor/editor_node.h"
#include "editor/editor_plugin.h"
#include "editor/property_editor.h"
@@ -45,20 +45,20 @@ class NoiseTexture : public Texture2D {
private:
Ref<Image> data;
- Thread *noise_thread;
+ 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_normalmap;
- 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);
@@ -70,7 +70,7 @@ private:
protected:
static void _bind_methods();
- virtual void _validate_property(PropertyInfo &property) const;
+ virtual void _validate_property(PropertyInfo &property) const override;
public:
void set_noise(Ref<OpenSimplexNoise> p_noise);
@@ -82,19 +82,19 @@ public:
void set_seamless(bool p_seamless);
bool get_seamless();
- void set_as_normalmap(bool p_as_normalmap);
- bool is_normalmap();
+ void set_as_normal_map(bool p_as_normal_map);
+ bool is_normal_map();
void set_bump_strength(float p_bump_strength);
float get_bump_strength();
- int get_width() const;
- int get_height() const;
+ int get_width() const override;
+ int get_height() const override;
- virtual RID get_rid() const;
- virtual bool has_alpha() const { return false; }
+ virtual RID get_rid() const override;
+ virtual bool has_alpha() const override { return false; }
- virtual Ref<Image> get_data() const;
+ virtual Ref<Image> get_data() const override;
NoiseTexture();
virtual ~NoiseTexture();