diff options
| author | Yuri Sizov <11782833+YuriSizov@users.noreply.github.com> | 2023-03-14 16:00:02 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-03-14 16:00:02 +0100 |
| commit | fc7adaab7b3856a7831d402ea2bbb27efe7b7d8a (patch) | |
| tree | 23902b836784f4c823d69f200b6aa2c1cffbc9f6 /scene | |
| parent | 258ea41ffa00a71bbb6ba9844840f18ba5802816 (diff) | |
| parent | 38c0ad7c6c6b70f1ecac0a7962a60c3105b3d8e8 (diff) | |
Merge pull request #74907 from YuriSizov/4.0-cherrypicks
Cherry-picks for the 4.0 branch (future 4.0.1) - 3rd batch
Diffstat (limited to 'scene')
| -rw-r--r-- | scene/3d/cpu_particles_3d.cpp | 2 | ||||
| -rw-r--r-- | scene/3d/mesh_instance_3d.cpp | 4 | ||||
| -rw-r--r-- | scene/gui/link_button.cpp | 5 | ||||
| -rw-r--r-- | scene/gui/menu_bar.cpp | 2 | ||||
| -rw-r--r-- | scene/resources/sky_material.cpp | 4 |
5 files changed, 10 insertions, 7 deletions
diff --git a/scene/3d/cpu_particles_3d.cpp b/scene/3d/cpu_particles_3d.cpp index c88eb033de..23855b2d8e 100644 --- a/scene/3d/cpu_particles_3d.cpp +++ b/scene/3d/cpu_particles_3d.cpp @@ -1207,7 +1207,7 @@ void CPUParticles3D::_update_particle_data_buffer() { ptr[10] = t.basis.rows[2][2]; ptr[11] = t.origin.z; } else { - memset(ptr, 0, sizeof(Transform3D)); + memset(ptr, 0, sizeof(float) * 12); } Color c = r[idx].color; diff --git a/scene/3d/mesh_instance_3d.cpp b/scene/3d/mesh_instance_3d.cpp index 10a7a4e78b..86301ee53f 100644 --- a/scene/3d/mesh_instance_3d.cpp +++ b/scene/3d/mesh_instance_3d.cpp @@ -117,8 +117,10 @@ void MeshInstance3D::set_mesh(const Ref<Mesh> &p_mesh) { mesh = p_mesh; if (mesh.is_valid()) { - mesh->connect(CoreStringNames::get_singleton()->changed, callable_mp(this, &MeshInstance3D::_mesh_changed)); + // If mesh is a PrimitiveMesh, calling get_rid on it can trigger a changed callback + // so do this before connecting _mesh_changed. set_base(mesh->get_rid()); + mesh->connect(CoreStringNames::get_singleton()->changed, callable_mp(this, &MeshInstance3D::_mesh_changed)); _mesh_changed(); } else { blend_shape_tracks.clear(); diff --git a/scene/gui/link_button.cpp b/scene/gui/link_button.cpp index e6c3ca3b5f..b579791990 100644 --- a/scene/gui/link_button.cpp +++ b/scene/gui/link_button.cpp @@ -243,11 +243,12 @@ void LinkButton::_notification(int p_what) { if (do_underline) { int underline_spacing = theme_cache.underline_spacing + text_buf->get_line_underline_position(); int y = text_buf->get_line_ascent() + underline_spacing; + int underline_thickness = MAX(1, text_buf->get_line_underline_thickness()); if (is_layout_rtl()) { - draw_line(Vector2(size.width - width, y), Vector2(size.width, y), color, text_buf->get_line_underline_thickness()); + draw_line(Vector2(size.width - width, y), Vector2(size.width, y), color, underline_thickness); } else { - draw_line(Vector2(0, y), Vector2(width, y), color, text_buf->get_line_underline_thickness()); + draw_line(Vector2(0, y), Vector2(width, y), color, underline_thickness); } } } break; diff --git a/scene/gui/menu_bar.cpp b/scene/gui/menu_bar.cpp index 5b27983851..0c12b98ad7 100644 --- a/scene/gui/menu_bar.cpp +++ b/scene/gui/menu_bar.cpp @@ -666,7 +666,7 @@ void MenuBar::_bind_methods() { ClassDB::bind_method(D_METHOD("get_menu_popup", "menu"), &MenuBar::get_menu_popup); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "flat"), "set_flat", "is_flat"); - ADD_PROPERTY(PropertyInfo(Variant::BOOL, "start_index"), "set_start_index", "get_start_index"); + ADD_PROPERTY(PropertyInfo(Variant::INT, "start_index"), "set_start_index", "get_start_index"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "switch_on_hover"), "set_switch_on_hover", "is_switch_on_hover"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "prefer_global_menu"), "set_prefer_global_menu", "is_prefer_global_menu"); diff --git a/scene/resources/sky_material.cpp b/scene/resources/sky_material.cpp index 9528b23e32..065132516b 100644 --- a/scene/resources/sky_material.cpp +++ b/scene/resources/sky_material.cpp @@ -269,7 +269,7 @@ uniform vec4 sky_top_color : source_color = vec4(0.385, 0.454, 0.55, 1.0); uniform vec4 sky_horizon_color : source_color = vec4(0.646, 0.656, 0.67, 1.0); uniform float sky_curve : hint_range(0, 1) = 0.15; uniform float sky_energy = 1.0; // In Lux. -uniform sampler2D sky_cover : source_color, hint_default_black; +uniform sampler2D sky_cover : filter_linear, source_color, hint_default_black; uniform vec4 sky_cover_modulate : source_color = vec4(1.0, 1.0, 1.0, 1.0); uniform vec4 ground_bottom_color : source_color = vec4(0.2, 0.169, 0.133, 1.0); uniform vec4 ground_horizon_color : source_color = vec4(0.646, 0.656, 0.67, 1.0); @@ -676,7 +676,7 @@ uniform float sun_disk_scale : hint_range(0, 360) = 1.0; uniform vec4 ground_color : source_color = vec4(0.1, 0.07, 0.034, 1.0); uniform float exposure : hint_range(0, 128) = 1.0; -uniform sampler2D night_sky : source_color, hint_default_black; +uniform sampler2D night_sky : filter_linear, source_color, hint_default_black; const vec3 UP = vec3( 0.0, 1.0, 0.0 ); |