summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJFonS <joan.fonssanchez@gmail.com>2018-10-02 16:01:24 +0200
committerJFonS <joan.fonssanchez@gmail.com>2018-10-03 10:27:24 +0200
commite14ead32dd90575e43e021bec1d171b8f60245b6 (patch)
treed543b0d850c7233a58b36a01fc4dfb25b922af8b
parent6e619ccb240e81d673fc361a63a8107e0a9858d7 (diff)
Remove redundant size property from NoiseTexture
-rw-r--r--modules/opensimplex/config.py2
-rw-r--r--modules/opensimplex/doc_classes/NoiseTexture.xml7
-rw-r--r--modules/opensimplex/noise_texture.cpp15
-rw-r--r--modules/opensimplex/noise_texture.h3
4 files changed, 8 insertions, 19 deletions
diff --git a/modules/opensimplex/config.py b/modules/opensimplex/config.py
index c91c9e5c80..c1010ad433 100644
--- a/modules/opensimplex/config.py
+++ b/modules/opensimplex/config.py
@@ -7,7 +7,7 @@ def configure(env):
def get_doc_classes():
return [
"NoiseTexture",
- "SimplexNoise"
+ "OpenSimplexNoise"
]
def get_doc_path():
diff --git a/modules/opensimplex/doc_classes/NoiseTexture.xml b/modules/opensimplex/doc_classes/NoiseTexture.xml
index 6af58e7a6b..9642865c43 100644
--- a/modules/opensimplex/doc_classes/NoiseTexture.xml
+++ b/modules/opensimplex/doc_classes/NoiseTexture.xml
@@ -41,8 +41,11 @@
<member name="seamless" type="bool" setter="set_seamless" getter="get_seamless">
Whether the texture can be tiled without visible seams or not. Seamless textures take longer to generate.
</member>
- <member name="size" type="Vector2" setter="set_size" getter="get_size">
- Size of the generated texture.
+ <member name="width" type="int" setter="set_width" getter="get_width">
+ Width of the generated texture.
+ </member>
+ <member name="height" type="int" setter="set_height" getter="get_height">
+ Height of the generated texture.
</member>
</members>
<constants>
diff --git a/modules/opensimplex/noise_texture.cpp b/modules/opensimplex/noise_texture.cpp
index 6f2723e43b..be522a9ab1 100644
--- a/modules/opensimplex/noise_texture.cpp
+++ b/modules/opensimplex/noise_texture.cpp
@@ -58,7 +58,6 @@ void NoiseTexture::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_width", "width"), &NoiseTexture::set_width);
ClassDB::bind_method(D_METHOD("set_height", "height"), &NoiseTexture::set_height);
- ClassDB::bind_method(D_METHOD("set_size", "size"), &NoiseTexture::set_size);
ClassDB::bind_method(D_METHOD("set_noise", "noise"), &NoiseTexture::set_noise);
ClassDB::bind_method(D_METHOD("get_noise"), &NoiseTexture::get_noise);
@@ -73,7 +72,8 @@ void NoiseTexture::_bind_methods() {
ClassDB::bind_method(D_METHOD("_generate_texture"), &NoiseTexture::_generate_texture);
ClassDB::bind_method(D_METHOD("_thread_done", "image"), &NoiseTexture::_thread_done);
- ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "size"), "set_size", "get_size");
+ ADD_PROPERTY(PropertyInfo(Variant::INT, "width", PROPERTY_HINT_RANGE, "1,2048,1,or_greater"), "set_width", "get_width");
+ ADD_PROPERTY(PropertyInfo(Variant::INT, "height", PROPERTY_HINT_RANGE, "1,2048,1,or_greater"), "set_height", "get_height");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "seamless"), "set_seamless", "get_seamless");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "as_normalmap"), "set_as_normalmap", "is_normalmap");
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "noise", PROPERTY_HINT_RESOURCE_TYPE, "OpenSimplexNoise"), "set_noise", "get_noise");
@@ -208,17 +208,6 @@ bool NoiseTexture::is_normalmap() {
return as_normalmap;
}
-void NoiseTexture::set_size(Vector2 p_size) {
- if (p_size == size) return;
- size = p_size;
- _queue_update();
-}
-
-Vector2 NoiseTexture::get_size() {
-
- return size;
-}
-
int NoiseTexture::get_width() const {
return size.x;
diff --git a/modules/opensimplex/noise_texture.h b/modules/opensimplex/noise_texture.h
index 78a02cda9f..2a4c32d633 100644
--- a/modules/opensimplex/noise_texture.h
+++ b/modules/opensimplex/noise_texture.h
@@ -83,9 +83,6 @@ public:
void set_as_normalmap(bool p_seamless);
bool is_normalmap();
- void set_size(Vector2 p_size);
- Vector2 get_size();
-
int get_width() const;
int get_height() const;