summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/math/a_star.cpp12
-rw-r--r--core/os/input_event.cpp2
-rw-r--r--core/ustring.cpp4
-rw-r--r--doc/classes/EditorScript.xml2
-rw-r--r--doc/classes/Image.xml2
-rw-r--r--doc/classes/InputEvent.xml4
-rw-r--r--doc/classes/ProjectSettings.xml3
-rw-r--r--doc/classes/SceneTree.xml2
-rw-r--r--doc/classes/TouchScreenButton.xml2
-rw-r--r--doc/classes/VScrollBar.xml2
-rw-r--r--drivers/gles2/rasterizer_scene_gles2.cpp20
-rw-r--r--drivers/gles2/rasterizer_storage_gles2.cpp26
-rw-r--r--editor/editor_audio_buses.cpp3
-rw-r--r--editor/plugins/canvas_item_editor_plugin.cpp2
-rw-r--r--editor/plugins/visual_shader_editor_plugin.cpp4
-rw-r--r--platform/uwp/export/export.cpp10
-rw-r--r--scene/2d/touch_screen_button.cpp8
-rw-r--r--scene/gui/text_edit.cpp2
-rw-r--r--scene/resources/particles_material.cpp2
-rw-r--r--scene/resources/theme.cpp49
20 files changed, 95 insertions, 66 deletions
diff --git a/core/math/a_star.cpp b/core/math/a_star.cpp
index 810e290922..bfa8b90344 100644
--- a/core/math/a_star.cpp
+++ b/core/math/a_star.cpp
@@ -184,11 +184,11 @@ void AStar::disconnect_points(int p_id, int p_with_id, bool bidirectional) {
Point *a;
bool a_exists = points.lookup(p_id, a);
- CRASH_COND(!a_exists);
+ ERR_FAIL_COND(!a_exists);
Point *b;
bool b_exists = points.lookup(p_with_id, b);
- CRASH_COND(!b_exists);
+ ERR_FAIL_COND(!b_exists);
Segment s(p_id, p_with_id);
int remove_direction = bidirectional ? (int)Segment::BIDIRECTIONAL : s.direction;
@@ -406,11 +406,11 @@ float AStar::_estimate_cost(int p_from_id, int p_to_id) {
Point *from_point;
bool from_exists = points.lookup(p_from_id, from_point);
- CRASH_COND(!from_exists);
+ ERR_FAIL_COND_V(!from_exists, 0);
Point *to_point;
bool to_exists = points.lookup(p_to_id, to_point);
- CRASH_COND(!to_exists);
+ ERR_FAIL_COND_V(!to_exists, 0);
return from_point->pos.distance_to(to_point->pos);
}
@@ -422,11 +422,11 @@ float AStar::_compute_cost(int p_from_id, int p_to_id) {
Point *from_point;
bool from_exists = points.lookup(p_from_id, from_point);
- CRASH_COND(!from_exists);
+ ERR_FAIL_COND_V(!from_exists, 0);
Point *to_point;
bool to_exists = points.lookup(p_to_id, to_point);
- CRASH_COND(!to_exists);
+ ERR_FAIL_COND_V(!to_exists, 0);
return from_point->pos.distance_to(to_point->pos);
}
diff --git a/core/os/input_event.cpp b/core/os/input_event.cpp
index 8f1eb93fe6..f09a904953 100644
--- a/core/os/input_event.cpp
+++ b/core/os/input_event.cpp
@@ -112,7 +112,7 @@ void InputEvent::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_device"), &InputEvent::get_device);
ClassDB::bind_method(D_METHOD("is_action", "action"), &InputEvent::is_action);
- ClassDB::bind_method(D_METHOD("is_action_pressed", "action"), &InputEvent::is_action_pressed, DEFVAL(false));
+ ClassDB::bind_method(D_METHOD("is_action_pressed", "action", "allow_echo"), &InputEvent::is_action_pressed, DEFVAL(false));
ClassDB::bind_method(D_METHOD("is_action_released", "action"), &InputEvent::is_action_released);
ClassDB::bind_method(D_METHOD("get_action_strength", "action"), &InputEvent::get_action_strength);
diff --git a/core/ustring.cpp b/core/ustring.cpp
index 7850c6774c..0f82ca7e15 100644
--- a/core/ustring.cpp
+++ b/core/ustring.cpp
@@ -1338,13 +1338,13 @@ String String::num_scientific(double p_num) {
#if defined(__GNUC__) || defined(_MSC_VER)
-#if (defined(__MINGW32__) || (defined(_MSC_VER) && _MSC_VER < 1900)) && defined(_TWO_DIGIT_EXPONENT)
+#if (defined(__MINGW32__) || (defined(_MSC_VER) && _MSC_VER < 1900)) && defined(_TWO_DIGIT_EXPONENT) && !defined(_UCRT)
// MinGW and old MSC require _set_output_format() to conform to C99 output for printf
unsigned int old_exponent_format = _set_output_format(_TWO_DIGIT_EXPONENT);
#endif
snprintf(buf, 256, "%lg", p_num);
-#if (defined(__MINGW32__) || (defined(_MSC_VER) && _MSC_VER < 1900)) && defined(_TWO_DIGIT_EXPONENT)
+#if (defined(__MINGW32__) || (defined(_MSC_VER) && _MSC_VER < 1900)) && defined(_TWO_DIGIT_EXPONENT) && !defined(_UCRT)
_set_output_format(old_exponent_format);
#endif
diff --git a/doc/classes/EditorScript.xml b/doc/classes/EditorScript.xml
index 5c49e227be..981e0a6180 100644
--- a/doc/classes/EditorScript.xml
+++ b/doc/classes/EditorScript.xml
@@ -5,7 +5,7 @@
</brief_description>
<description>
Scripts extending this class and implementing its [method _run] method can be executed from the Script Editor's [b]File &gt; Run[/b] menu option (or by pressing [code]Ctrl+Shift+X[/code]) while the editor is running. This is useful for adding custom in-editor functionality to Godot. For more complex additions, consider using [EditorPlugin]s instead.
- [b]Note:[/b] Extending scripts need to have [code]tool mode[/code] enabled.
+ [b]Note:[/b] Extending scripts need to have [code]tool[/code] mode enabled.
[b]Example script:[/b]
[codeblock]
tool
diff --git a/doc/classes/Image.xml b/doc/classes/Image.xml
index d37ab64cb3..c6d63035d1 100644
--- a/doc/classes/Image.xml
+++ b/doc/classes/Image.xml
@@ -415,7 +415,7 @@
<argument index="1" name="grayscale" type="bool" default="false">
</argument>
<description>
- Saves the image as an EXR file to [code]path[/code]. If grayscale is [code]true[/code] and the image has only one channel, it will be saved explicitly as monochrome rather than one red channel. This function will return [constant ERR_UNAVAILABLE] if Godot was compiled without the TinyEXR module.
+ Saves the image as an EXR file to [code]path[/code]. If [code]grayscale[/code] is [code]true[/code] and the image has only one channel, it will be saved explicitly as monochrome rather than one red channel. This function will return [constant ERR_UNAVAILABLE] if Godot was compiled without the TinyEXR module.
</description>
</method>
<method name="save_png" qualifiers="const">
diff --git a/doc/classes/InputEvent.xml b/doc/classes/InputEvent.xml
index 4c8d83adba..d412ce09e2 100644
--- a/doc/classes/InputEvent.xml
+++ b/doc/classes/InputEvent.xml
@@ -51,8 +51,10 @@
</return>
<argument index="0" name="action" type="String">
</argument>
+ <argument index="1" name="allow_echo" type="bool" default="false">
+ </argument>
<description>
- Returns [code]true[/code] if the given action is being pressed (and is not an echo event for [InputEventKey] events). Not relevant for events of type [InputEventMouseMotion] or [InputEventScreenDrag].
+ Returns [code]true[/code] if the given action is being pressed (and is not an echo event for [InputEventKey] events, unless [code]allow_echo[/code] is [code]true[/code]). Not relevant for events of type [InputEventMouseMotion] or [InputEventScreenDrag].
</description>
</method>
<method name="is_action_released" qualifiers="const">
diff --git a/doc/classes/ProjectSettings.xml b/doc/classes/ProjectSettings.xml
index ec7cf14571..772c2f5073 100644
--- a/doc/classes/ProjectSettings.xml
+++ b/doc/classes/ProjectSettings.xml
@@ -282,6 +282,9 @@
<member name="debug/gdscript/warnings/enable" type="bool" setter="" getter="" default="true">
If [code]true[/code], enables specific GDScript warnings (see [code]debug/gdscript/warnings/*[/code] settings). If [code]false[/code], disables all GDScript warnings.
</member>
+ <member name="debug/gdscript/warnings/exclude_addons" type="bool" setter="" getter="" default="true">
+ If [code]true[/code], scripts in the [code]res://addons[/code] folder will not generate warnings.
+ </member>
<member name="debug/gdscript/warnings/function_conflicts_constant" type="bool" setter="" getter="" default="true">
If [code]true[/code], enables warnings when a function is declared with the same name as a constant.
</member>
diff --git a/doc/classes/SceneTree.xml b/doc/classes/SceneTree.xml
index bd81a48ff5..b6e2303d2a 100644
--- a/doc/classes/SceneTree.xml
+++ b/doc/classes/SceneTree.xml
@@ -204,6 +204,7 @@
</argument>
<description>
If [code]true[/code], the application automatically accepts quitting. Enabled by default.
+ For mobile platforms, see [method set_quit_on_go_back].
</description>
</method>
<method name="set_group">
@@ -248,6 +249,7 @@
</argument>
<description>
If [code]true[/code], the application quits automatically on going back (e.g. on Android). Enabled by default.
+ To handle 'Go Back' button when this option is disabled, use [constant MainLoop.NOTIFICATION_WM_GO_BACK_REQUEST].
</description>
</method>
<method name="set_screen_stretch">
diff --git a/doc/classes/TouchScreenButton.xml b/doc/classes/TouchScreenButton.xml
index fccfb4cd6d..3d18534a68 100644
--- a/doc/classes/TouchScreenButton.xml
+++ b/doc/classes/TouchScreenButton.xml
@@ -37,7 +37,7 @@
The button's shape.
</member>
<member name="shape_centered" type="bool" setter="set_shape_centered" getter="is_shape_centered" default="true">
- If [code]true[/code], the button's shape is centered.
+ If [code]true[/code], the button's shape is centered in the provided texture. If no texture is used, this property has no effect.
</member>
<member name="shape_visible" type="bool" setter="set_shape_visible" getter="is_shape_visible" default="true">
If [code]true[/code], the button's shape is visible.
diff --git a/doc/classes/VScrollBar.xml b/doc/classes/VScrollBar.xml
index 4c06195d5c..6240178b82 100644
--- a/doc/classes/VScrollBar.xml
+++ b/doc/classes/VScrollBar.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="VScrollBar" inherits="ScrollBar" category="Core" version="3.2">
<brief_description>
- Vertical version of [ScrollBar], which goes from left (min) to right (max).
+ Vertical version of [ScrollBar], which goes from top (min) to bottom (max).
</brief_description>
<description>
</description>
diff --git a/drivers/gles2/rasterizer_scene_gles2.cpp b/drivers/gles2/rasterizer_scene_gles2.cpp
index f712219a64..6bcda62e7f 100644
--- a/drivers/gles2/rasterizer_scene_gles2.cpp
+++ b/drivers/gles2/rasterizer_scene_gles2.cpp
@@ -2767,6 +2767,8 @@ void RasterizerSceneGLES2::_post_process(Environment *env, const CameraMatrix &p
if (use_post_process) {
next_buffer = storage->frame.current_rt->mip_maps[0].sizes[0].fbo;
+ } else if (storage->frame.current_rt->external.fbo != 0) {
+ next_buffer = storage->frame.current_rt->external.fbo;
} else {
// set next_buffer to front buffer so multisample blit can happen if needed
next_buffer = storage->frame.current_rt->fbo;
@@ -2795,9 +2797,15 @@ void RasterizerSceneGLES2::_post_process(Environment *env, const CameraMatrix &p
// In GLES2 Android Blit is not available, so just copy color texture manually
_copy_texture_to_buffer(storage->frame.current_rt->multisample_color, next_buffer);
+#else
+ // TODO: any other platform not supported? this will fail.. maybe we should just call _copy_texture_to_buffer here as well?
#endif
} else if (use_post_process) {
- _copy_texture_to_buffer(storage->frame.current_rt->color, storage->frame.current_rt->mip_maps[0].sizes[0].fbo);
+ if (storage->frame.current_rt->external.fbo != 0) {
+ _copy_texture_to_buffer(storage->frame.current_rt->external.color, storage->frame.current_rt->mip_maps[0].sizes[0].fbo);
+ } else {
+ _copy_texture_to_buffer(storage->frame.current_rt->color, storage->frame.current_rt->mip_maps[0].sizes[0].fbo);
+ }
}
if (!use_post_process) {
@@ -3220,14 +3228,12 @@ void RasterizerSceneGLES2::render_scene(const Transform &p_cam_transform, const
} else {
state.render_no_shadows = false;
- if (storage->frame.current_rt->external.fbo != 0) {
+ if (storage->frame.current_rt->multisample_active) {
+ current_fb = storage->frame.current_rt->multisample_fbo;
+ } else if (storage->frame.current_rt->external.fbo != 0) {
current_fb = storage->frame.current_rt->external.fbo;
} else {
- if (storage->frame.current_rt->multisample_active) {
- current_fb = storage->frame.current_rt->multisample_fbo;
- } else {
- current_fb = storage->frame.current_rt->fbo;
- }
+ current_fb = storage->frame.current_rt->fbo;
}
env = environment_owner.getornull(p_environment);
diff --git a/drivers/gles2/rasterizer_storage_gles2.cpp b/drivers/gles2/rasterizer_storage_gles2.cpp
index b101a091fe..9d9bceb243 100644
--- a/drivers/gles2/rasterizer_storage_gles2.cpp
+++ b/drivers/gles2/rasterizer_storage_gles2.cpp
@@ -5156,26 +5156,14 @@ void RasterizerStorageGLES2::render_target_set_external_texture(RID p_render_tar
// is there a point to setting the internal formats? we don't know them..
- // check if MSAA is active to set the correct depth buffer and target texture for android
- if (rt->multisample_active) {
-#if defined(GLES_OVER_GL) || defined(IPHONE_ENABLED)
- glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, p_texture_id);
-#elif ANDROID_ENABLED
- static const int msaa_value[] = { 0, 2, 4, 8, 16 };
- int msaa = msaa_value[rt->msaa];
- glFramebufferTexture2DMultisample(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, p_texture_id, 0, msaa);
-#endif
- glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, rt->multisample_depth);
- } else {
- // set our texture as the destination for our framebuffer
- glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, p_texture_id, 0);
+ // set our texture as the destination for our framebuffer
+ glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, p_texture_id, 0);
- // seeing we're rendering into this directly, better also use our depth buffer, just use our existing one :)
- if (config.support_depth_texture) {
- glFramebufferTexture2D(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_TEXTURE_2D, rt->depth, 0);
- } else {
- glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, rt->depth);
- }
+ // seeing we're rendering into this directly, better also use our depth buffer, just use our existing one :)
+ if (config.support_depth_texture) {
+ glFramebufferTexture2D(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_TEXTURE_2D, rt->depth, 0);
+ } else {
+ glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, rt->depth);
}
// check status and unbind
diff --git a/editor/editor_audio_buses.cpp b/editor/editor_audio_buses.cpp
index b331a39535..acfdea28e2 100644
--- a/editor/editor_audio_buses.cpp
+++ b/editor/editor_audio_buses.cpp
@@ -1329,7 +1329,8 @@ EditorAudioBuses::EditorAudioBuses() {
add_child(top_hb);
file = memnew(Label);
- file->set_text(String(TTR("Layout")) + ": " + "default_bus_layout.tres");
+ String layout_path = ProjectSettings::get_singleton()->get("audio/default_bus_layout");
+ file->set_text(String(TTR("Layout")) + ": " + layout_path.get_file());
file->set_clip_text(true);
file->set_h_size_flags(SIZE_EXPAND_FILL);
top_hb->add_child(file);
diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp
index 9e338186f2..c9dde5d54d 100644
--- a/editor/plugins/canvas_item_editor_plugin.cpp
+++ b/editor/plugins/canvas_item_editor_plugin.cpp
@@ -5618,7 +5618,7 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) {
key_auto_insert_button->set_toggle_mode(true);
key_auto_insert_button->set_focus_mode(FOCUS_NONE);
//key_auto_insert_button->connect("pressed", this, "_popup_callback", varray(ANIM_INSERT_KEY));
- key_auto_insert_button->set_tooltip(TTR("Auto insert keys when objects are translated, rotated on scaled (based on mask).\nKeys are only added to existing tracks, no new tracks will be created.\nKeys must be inserted manually for the first time."));
+ key_auto_insert_button->set_tooltip(TTR("Auto insert keys when objects are translated, rotated or scaled (based on mask).\nKeys are only added to existing tracks, no new tracks will be created.\nKeys must be inserted manually for the first time."));
key_auto_insert_button->set_shortcut(ED_SHORTCUT("canvas_item_editor/anim_auto_insert_key", TTR("Auto Insert Key")));
animation_hb->add_child(key_auto_insert_button);
diff --git a/editor/plugins/visual_shader_editor_plugin.cpp b/editor/plugins/visual_shader_editor_plugin.cpp
index 90eb3045df..1a74779fb5 100644
--- a/editor/plugins/visual_shader_editor_plugin.cpp
+++ b/editor/plugins/visual_shader_editor_plugin.cpp
@@ -2462,7 +2462,7 @@ VisualShaderEditor::VisualShaderEditor() {
add_options.push_back(AddOption("Darken", "Color", "Operators", "VisualShaderNodeColorOp", TTR("Darken operator."), VisualShaderNodeColorOp::OP_DARKEN, VisualShaderNode::PORT_TYPE_VECTOR));
add_options.push_back(AddOption("Difference", "Color", "Operators", "VisualShaderNodeColorOp", TTR("Difference operator."), VisualShaderNodeColorOp::OP_DIFFERENCE, VisualShaderNode::PORT_TYPE_VECTOR));
add_options.push_back(AddOption("Dodge", "Color", "Operators", "VisualShaderNodeColorOp", TTR("Dodge operator."), VisualShaderNodeColorOp::OP_DODGE, VisualShaderNode::PORT_TYPE_VECTOR));
- add_options.push_back(AddOption("HardLight", "Color", "Operators", "VisualShaderNodeColorOp", TTR("HardLight operator"), VisualShaderNodeColorOp::OP_HARD_LIGHT, VisualShaderNode::PORT_TYPE_VECTOR));
+ add_options.push_back(AddOption("HardLight", "Color", "Operators", "VisualShaderNodeColorOp", TTR("HardLight operator."), VisualShaderNodeColorOp::OP_HARD_LIGHT, VisualShaderNode::PORT_TYPE_VECTOR));
add_options.push_back(AddOption("Lighten", "Color", "Operators", "VisualShaderNodeColorOp", TTR("Lighten operator."), VisualShaderNodeColorOp::OP_LIGHTEN, VisualShaderNode::PORT_TYPE_VECTOR));
add_options.push_back(AddOption("Overlay", "Color", "Operators", "VisualShaderNodeColorOp", TTR("Overlay operator."), VisualShaderNodeColorOp::OP_OVERLAY, VisualShaderNode::PORT_TYPE_VECTOR));
add_options.push_back(AddOption("Screen", "Color", "Operators", "VisualShaderNodeColorOp", TTR("Screen operator."), VisualShaderNodeColorOp::OP_SCREEN, VisualShaderNode::PORT_TYPE_VECTOR));
@@ -2780,7 +2780,7 @@ VisualShaderEditor::VisualShaderEditor() {
add_options.push_back(AddOption("Expression", "Special", "", "VisualShaderNodeExpression", TTR("Custom Godot Shader Language expression, with custom amount of input and output ports. This is a direct injection of code into the vertex/fragment/light function, do not use it to write the function declarations inside.")));
add_options.push_back(AddOption("Fresnel", "Special", "", "VisualShaderNodeFresnel", TTR("Returns falloff based on the dot product of surface normal and view direction of camera (pass associated inputs to it)."), -1, VisualShaderNode::PORT_TYPE_SCALAR));
- add_options.push_back(AddOption("GlobalExpression", "Special", "", "VisualShaderNodeGlobalExpression", TTR("Custom Godot Shader Language expression, which placed on top of the resulted shader. You can place various function definitions inside and call it later in the Expressions. You can also declare varyings, uniforms and constants.")));
+ add_options.push_back(AddOption("GlobalExpression", "Special", "", "VisualShaderNodeGlobalExpression", TTR("Custom Godot Shader Language expression, which is placed on top of the resulted shader. You can place various function definitions inside and call it later in the Expressions. You can also declare varyings, uniforms and constants.")));
add_options.push_back(AddOption("ScalarDerivativeFunc", "Special", "Common", "VisualShaderNodeScalarDerivativeFunc", TTR("(Fragment/Light mode only) Scalar derivative function."), -1, VisualShaderNode::PORT_TYPE_SCALAR, VisualShader::TYPE_FRAGMENT | VisualShader::TYPE_LIGHT, -1, -1, true));
add_options.push_back(AddOption("VectorDerivativeFunc", "Special", "Common", "VisualShaderNodeVectorDerivativeFunc", TTR("(Fragment/Light mode only) Vector derivative function."), -1, VisualShaderNode::PORT_TYPE_VECTOR, VisualShader::TYPE_FRAGMENT | VisualShader::TYPE_LIGHT, -1, -1, true));
diff --git a/platform/uwp/export/export.cpp b/platform/uwp/export/export.cpp
index fefad3584b..557699cf37 100644
--- a/platform/uwp/export/export.cpp
+++ b/platform/uwp/export/export.cpp
@@ -1144,11 +1144,21 @@ public:
return valid;
}
+ if (!_valid_resource_name(p_preset->get("package/short_name"))) {
+ valid = false;
+ err += TTR("Invalid package short name.") + "\n";
+ }
+
if (!_valid_resource_name(p_preset->get("package/unique_name"))) {
valid = false;
err += TTR("Invalid package unique name.") + "\n";
}
+ if (!_valid_resource_name(p_preset->get("package/publisher_display_name"))) {
+ valid = false;
+ err += TTR("Invalid package publisher display name.") + "\n";
+ }
+
if (!_valid_guid(p_preset->get("identity/product_guid"))) {
valid = false;
err += TTR("Invalid product GUID.") + "\n";
diff --git a/scene/2d/touch_screen_button.cpp b/scene/2d/touch_screen_button.cpp
index cf68528388..9a1a759e72 100644
--- a/scene/2d/touch_screen_button.cpp
+++ b/scene/2d/touch_screen_button.cpp
@@ -325,12 +325,8 @@ void TouchScreenButton::_release(bool p_exiting_tree) {
}
Rect2 TouchScreenButton::_edit_get_rect() const {
- if (texture.is_null()) {
- if (shape.is_valid())
- return shape->get_rect();
- else
- return CanvasItem::_edit_get_rect();
- }
+ if (texture.is_null())
+ return CanvasItem::_edit_get_rect();
return Rect2(Size2(), texture->get_size());
}
diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp
index c818633f48..8ddc31745e 100644
--- a/scene/gui/text_edit.cpp
+++ b/scene/gui/text_edit.cpp
@@ -4585,7 +4585,7 @@ void TextEdit::_scroll_moved(double p_to_val) {
int v_scroll_i = floor(get_v_scroll());
int sc = 0;
int n_line;
- for (n_line = 0; n_line < text.size() - 1; n_line++) {
+ for (n_line = 0; n_line < text.size(); n_line++) {
if (!is_line_hidden(n_line)) {
sc++;
sc += times_line_wraps(n_line);
diff --git a/scene/resources/particles_material.cpp b/scene/resources/particles_material.cpp
index 969743f78c..c5956d9bc2 100644
--- a/scene/resources/particles_material.cpp
+++ b/scene/resources/particles_material.cpp
@@ -332,7 +332,7 @@ void ParticlesMaterial::_update_shader() {
code += " float base_angle = (initial_angle + tex_angle) * mix(1.0, angle_rand, initial_angle_random);\n";
code += " CUSTOM.x = base_angle * degree_to_rad;\n"; // angle
code += " CUSTOM.y = 0.0;\n"; // phase
- code += " CUSTOM.w = LIFETIME * (1.0 - lifetime_randomness * rand_from_seed(alt_seed));\n";
+ code += " CUSTOM.w = (1.0 - lifetime_randomness * rand_from_seed(alt_seed));\n";
code += " CUSTOM.z = (anim_offset + tex_anim_offset) * mix(1.0, anim_offset_rand, anim_offset_random);\n"; // animation offset (0-1)
switch (emission_shape) {
diff --git a/scene/resources/theme.cpp b/scene/resources/theme.cpp
index f1429a7d7b..c897365b21 100644
--- a/scene/resources/theme.cpp
+++ b/scene/resources/theme.cpp
@@ -44,8 +44,11 @@ PoolVector<String> Theme::_get_icon_list(const String &p_type) const {
get_icon_list(p_type, &il);
ilret.resize(il.size());
- for (List<StringName>::Element *E = il.front(); E; E = E->next()) {
- ilret.push_back(E->get());
+
+ int i = 0;
+ PoolVector<String>::Write w = ilret.write();
+ for (List<StringName>::Element *E = il.front(); E; E = E->next(), i++) {
+ w[i] = E->get();
}
return ilret;
}
@@ -57,8 +60,11 @@ PoolVector<String> Theme::_get_stylebox_list(const String &p_type) const {
get_stylebox_list(p_type, &il);
ilret.resize(il.size());
- for (List<StringName>::Element *E = il.front(); E; E = E->next()) {
- ilret.push_back(E->get());
+
+ int i = 0;
+ PoolVector<String>::Write w = ilret.write();
+ for (List<StringName>::Element *E = il.front(); E; E = E->next(), i++) {
+ w[i] = E->get();
}
return ilret;
}
@@ -70,8 +76,11 @@ PoolVector<String> Theme::_get_stylebox_types(void) const {
get_stylebox_types(&il);
ilret.resize(il.size());
- for (List<StringName>::Element *E = il.front(); E; E = E->next()) {
- ilret.push_back(E->get());
+
+ int i = 0;
+ PoolVector<String>::Write w = ilret.write();
+ for (List<StringName>::Element *E = il.front(); E; E = E->next(), i++) {
+ w[i] = E->get();
}
return ilret;
}
@@ -83,8 +92,11 @@ PoolVector<String> Theme::_get_font_list(const String &p_type) const {
get_font_list(p_type, &il);
ilret.resize(il.size());
- for (List<StringName>::Element *E = il.front(); E; E = E->next()) {
- ilret.push_back(E->get());
+
+ int i = 0;
+ PoolVector<String>::Write w = ilret.write();
+ for (List<StringName>::Element *E = il.front(); E; E = E->next(), i++) {
+ w[i] = E->get();
}
return ilret;
}
@@ -96,8 +108,11 @@ PoolVector<String> Theme::_get_color_list(const String &p_type) const {
get_color_list(p_type, &il);
ilret.resize(il.size());
- for (List<StringName>::Element *E = il.front(); E; E = E->next()) {
- ilret.push_back(E->get());
+
+ int i = 0;
+ PoolVector<String>::Write w = ilret.write();
+ for (List<StringName>::Element *E = il.front(); E; E = E->next(), i++) {
+ w[i] = E->get();
}
return ilret;
}
@@ -109,8 +124,11 @@ PoolVector<String> Theme::_get_constant_list(const String &p_type) const {
get_constant_list(p_type, &il);
ilret.resize(il.size());
- for (List<StringName>::Element *E = il.front(); E; E = E->next()) {
- ilret.push_back(E->get());
+
+ int i = 0;
+ PoolVector<String>::Write w = ilret.write();
+ for (List<StringName>::Element *E = il.front(); E; E = E->next(), i++) {
+ w[i] = E->get();
}
return ilret;
}
@@ -122,8 +140,11 @@ PoolVector<String> Theme::_get_type_list(const String &p_type) const {
get_type_list(&il);
ilret.resize(il.size());
- for (List<StringName>::Element *E = il.front(); E; E = E->next()) {
- ilret.push_back(E->get());
+
+ int i = 0;
+ PoolVector<String>::Write w = ilret.write();
+ for (List<StringName>::Element *E = il.front(); E; E = E->next(), i++) {
+ w[i] = E->get();
}
return ilret;
}