diff options
-rw-r--r-- | doc/classes/ClassDB.xml | 1 | ||||
-rw-r--r-- | editor/editor_properties.cpp | 4 | ||||
-rw-r--r-- | modules/opensimplex/doc_classes/OpenSimplexNoise.xml | 4 | ||||
-rw-r--r-- | modules/opensimplex/open_simplex_noise.cpp | 20 |
4 files changed, 11 insertions, 18 deletions
diff --git a/doc/classes/ClassDB.xml b/doc/classes/ClassDB.xml index 2a6a2ddd91..860bdc7c8f 100644 --- a/doc/classes/ClassDB.xml +++ b/doc/classes/ClassDB.xml @@ -67,6 +67,7 @@ </argument> <description> Returns an array with all the methods of [code]class[/code] or its ancestry if [code]no_inheritance[/code] is [code]false[/code]. Every element of the array is a [Dictionary] with the following keys: [code]args[/code], [code]default_args[/code], [code]flags[/code], [code]id[/code], [code]name[/code], [code]return: (class_name, hint, hint_string, name, type, usage)[/code]. + [b]Note:[/code] In exported release builds the debug info is not available, so the returned dictionaries will contain only method names. </description> </method> <method name="class_get_property" qualifiers="const"> diff --git a/editor/editor_properties.cpp b/editor/editor_properties.cpp index 143eea88e1..a358cddfae 100644 --- a/editor/editor_properties.cpp +++ b/editor/editor_properties.cpp @@ -68,9 +68,9 @@ void EditorPropertyText::_text_changed(const String &p_string) { } if (string_name) { - emit_changed(get_edited_property(), StringName(p_string), "", false); + emit_changed(get_edited_property(), StringName(p_string), "", true); } else { - emit_changed(get_edited_property(), p_string, "", false); + emit_changed(get_edited_property(), p_string, "", true); } } diff --git a/modules/opensimplex/doc_classes/OpenSimplexNoise.xml b/modules/opensimplex/doc_classes/OpenSimplexNoise.xml index 9fe4c9c249..dcda5c2324 100644 --- a/modules/opensimplex/doc_classes/OpenSimplexNoise.xml +++ b/modules/opensimplex/doc_classes/OpenSimplexNoise.xml @@ -32,7 +32,7 @@ <argument index="1" name="height" type="int"> </argument> <description> - Generate a noise image with the requested [code]width[/code] and [code]height[/code], based on the current noise parameters. + Generate a noise image in [constant Image.FORMAT_L8] format with the requested [code]width[/code] and [code]height[/code], based on the current noise parameters. </description> </method> <method name="get_noise_1d" qualifiers="const"> @@ -108,7 +108,7 @@ <argument index="0" name="size" type="int"> </argument> <description> - Generate a tileable noise image, based on the current noise parameters. Generated seamless images are always square ([code]size[/code] × [code]size[/code]). + Generate a tileable noise image in [constant Image.FORMAT_L8] format, based on the current noise parameters. Generated seamless images are always square ([code]size[/code] × [code]size[/code]). </description> </method> </methods> diff --git a/modules/opensimplex/open_simplex_noise.cpp b/modules/opensimplex/open_simplex_noise.cpp index 403340e39c..e4e2e0613a 100644 --- a/modules/opensimplex/open_simplex_noise.cpp +++ b/modules/opensimplex/open_simplex_noise.cpp @@ -104,7 +104,7 @@ void OpenSimplexNoise::set_lacunarity(float p_lacunarity) { Ref<Image> OpenSimplexNoise::get_image(int p_width, int p_height) const { Vector<uint8_t> data; - data.resize(p_width * p_height * 4); + data.resize(p_width * p_height); uint8_t *wd8 = data.ptrw(); @@ -112,21 +112,17 @@ Ref<Image> OpenSimplexNoise::get_image(int p_width, int p_height) const { for (int j = 0; j < p_width; 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; - wd8[(i * p_width + j) * 4 + 1] = value; - wd8[(i * p_width + j) * 4 + 2] = value; - wd8[(i * p_width + j) * 4 + 3] = 255; + wd8[(i * p_width + j)] = uint8_t(CLAMP(v * 255.0, 0, 255)); } } - Ref<Image> image = memnew(Image(p_width, p_height, false, Image::FORMAT_RGBA8, data)); + Ref<Image> image = memnew(Image(p_width, p_height, false, Image::FORMAT_L8, data)); return image; } Ref<Image> OpenSimplexNoise::get_seamless_image(int p_size) const { Vector<uint8_t> data; - data.resize(p_size * p_size * 4); + data.resize(p_size * p_size); uint8_t *wd8 = data.ptrw(); @@ -147,15 +143,11 @@ Ref<Image> OpenSimplexNoise::get_seamless_image(int p_size) const { float v = get_noise_4d(x, y, z, w); v = v * 0.5 + 0.5; // Normalize [0..1] - uint8_t value = uint8_t(CLAMP(v * 255.0, 0, 255)); - wd8[(i * p_size + j) * 4 + 0] = value; - wd8[(i * p_size + j) * 4 + 1] = value; - wd8[(i * p_size + j) * 4 + 2] = value; - wd8[(i * p_size + j) * 4 + 3] = 255; + wd8[(i * p_size + j)] = uint8_t(CLAMP(v * 255.0, 0, 255)); } } - Ref<Image> image = memnew(Image(p_size, p_size, false, Image::FORMAT_RGBA8, data)); + Ref<Image> image = memnew(Image(p_size, p_size, false, Image::FORMAT_L8, data)); return image; } |