From e14ead32dd90575e43e021bec1d171b8f60245b6 Mon Sep 17 00:00:00 2001 From: JFonS Date: Tue, 2 Oct 2018 16:01:24 +0200 Subject: Remove redundant size property from NoiseTexture --- modules/opensimplex/config.py | 2 +- modules/opensimplex/doc_classes/NoiseTexture.xml | 7 +++++-- modules/opensimplex/noise_texture.cpp | 15 ++------------- modules/opensimplex/noise_texture.h | 3 --- 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 @@ Whether the texture can be tiled without visible seams or not. Seamless textures take longer to generate. - - Size of the generated texture. + + Width of the generated texture. + + + Height of the generated texture. 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; -- cgit v1.2.3