diff options
Diffstat (limited to 'modules/opensimplex')
-rw-r--r-- | modules/opensimplex/icons/NoiseTexture.svg | 4 | ||||
-rw-r--r-- | modules/opensimplex/noise_texture.h | 16 | ||||
-rw-r--r-- | modules/opensimplex/open_simplex_noise.cpp | 2 | ||||
-rw-r--r-- | modules/opensimplex/open_simplex_noise.h | 4 |
4 files changed, 12 insertions, 14 deletions
diff --git a/modules/opensimplex/icons/NoiseTexture.svg b/modules/opensimplex/icons/NoiseTexture.svg index 5908c2b2d4..479684cde2 100644 --- a/modules/opensimplex/icons/NoiseTexture.svg +++ b/modules/opensimplex/icons/NoiseTexture.svg @@ -1,3 +1 @@ -<svg width="16" height="16" version="1.1" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"> -<path d="m2 1c-0.55228 0-1 0.44772-1 1v12c0 0.55228 0.44772 1 1 1h12c0.55228 0 1-0.44772 1-1v-12c0-0.55228-0.44772-1-1-1zm1 2h10v8h-10zm3 1v2h2v-2zm2 2v2h2v2h2v-6h-2v2zm0 2h-2v-2h-2v4h4z" fill="#e0e0e0" fill-opacity=".99608"/> -</svg> +<svg height="16" viewBox="0 0 16 16" width="16" xmlns="http://www.w3.org/2000/svg"><path d="m2 1c-.55228 0-1 .44772-1 1v12c0 .55228.44772 1 1 1h12c.55228 0 1-.44772 1-1v-12c0-.55228-.44772-1-1-1zm1 2h10v8h-10zm3 1v2h2v-2zm2 2v2h2v2h2v-6h-2v2zm0 2h-2v-2h-2v4h4z" fill="#e0e0e0" fill-opacity=".99608"/></svg> diff --git a/modules/opensimplex/noise_texture.h b/modules/opensimplex/noise_texture.h index b1d7d3fac9..73960ba85f 100644 --- a/modules/opensimplex/noise_texture.h +++ b/modules/opensimplex/noise_texture.h @@ -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" @@ -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); @@ -88,13 +88,13 @@ public: 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(); diff --git a/modules/opensimplex/open_simplex_noise.cpp b/modules/opensimplex/open_simplex_noise.cpp index 00b3d47db9..b08219d258 100644 --- a/modules/opensimplex/open_simplex_noise.cpp +++ b/modules/opensimplex/open_simplex_noise.cpp @@ -110,7 +110,7 @@ Ref<Image> OpenSimplexNoise::get_image(int p_width, int p_height) { for (int i = 0; i < p_height; i++) { for (int j = 0; j < p_width; j++) { - float v = get_noise_2d(i, j); + float v = get_noise_2d(j, i); v = v * 0.5 + 0.5; // Normalize [0..1] uint8_t value = uint8_t(CLAMP(v * 255.0, 0, 255)); wd8[(i * p_width + j) * 4 + 0] = value; diff --git a/modules/opensimplex/open_simplex_noise.h b/modules/opensimplex/open_simplex_noise.h index dce62bc1f9..835f8ed35e 100644 --- a/modules/opensimplex/open_simplex_noise.h +++ b/modules/opensimplex/open_simplex_noise.h @@ -31,8 +31,8 @@ #ifndef OPEN_SIMPLEX_NOISE_H #define OPEN_SIMPLEX_NOISE_H -#include "core/image.h" -#include "core/reference.h" +#include "core/io/image.h" +#include "core/object/reference.h" #include "scene/resources/texture.h" #include "thirdparty/misc/open-simplex-noise.h" |