Remove redundant size property from NoiseTexture

This commit is contained in:
JFonS 2018-10-02 16:01:24 +02:00
parent 6e619ccb24
commit e14ead32dd
4 changed files with 8 additions and 19 deletions

View File

@ -7,7 +7,7 @@ def configure(env):
def get_doc_classes():
return [
"NoiseTexture",
"SimplexNoise"
"OpenSimplexNoise"
]
def get_doc_path():

View File

@ -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>

View File

@ -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;

View File

@ -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;