diff options
-rw-r--r-- | core/extension/gdextension.cpp | 16 | ||||
-rw-r--r-- | core/math/geometry_2d.h | 8 | ||||
-rw-r--r-- | doc/classes/NavigationAgent3D.xml | 2 | ||||
-rw-r--r-- | drivers/gles3/storage/particles_storage.cpp | 2 | ||||
-rw-r--r-- | editor/filesystem_dock.cpp | 26 | ||||
-rw-r--r-- | editor/plugins/canvas_item_editor_plugin.cpp | 15 | ||||
-rw-r--r-- | scene/3d/navigation_agent_3d.cpp | 8 | ||||
-rw-r--r-- | servers/rendering/renderer_rd/renderer_canvas_render_rd.cpp | 2 | ||||
-rw-r--r-- | servers/rendering_server.cpp | 2 |
9 files changed, 38 insertions, 43 deletions
diff --git a/core/extension/gdextension.cpp b/core/extension/gdextension.cpp index 26512d0c56..136a5bfbb2 100644 --- a/core/extension/gdextension.cpp +++ b/core/extension/gdextension.cpp @@ -959,13 +959,15 @@ Ref<Resource> GDExtensionResourceLoader::load(const String &p_path, const String // object if one has already been loaded (even if caching is disabled at the resource // loader level). GDExtensionManager *manager = GDExtensionManager::get_singleton(); - Ref<GDExtension> lib = manager->get_extension(p_path); - if (lib.is_null()) { - Error err = load_gdextension_resource(p_path, lib); - if (err != OK && r_error) { - // Errors already logged in load_gdextension_resource(). - *r_error = err; - } + if (manager->is_extension_loaded(p_path)) { + return manager->get_extension(p_path); + } + + Ref<GDExtension> lib; + Error err = load_gdextension_resource(p_path, lib); + if (err != OK && r_error) { + // Errors already logged in load_gdextension_resource(). + *r_error = err; } return lib; } diff --git a/core/math/geometry_2d.h b/core/math/geometry_2d.h index 0e5702e0af..b37fce9e9c 100644 --- a/core/math/geometry_2d.h +++ b/core/math/geometry_2d.h @@ -306,10 +306,12 @@ public: Vector<Delaunay2D::Triangle> tr = Delaunay2D::triangulate(p_points); Vector<int> triangles; + triangles.resize(3 * tr.size()); + int *ptr = triangles.ptrw(); for (int i = 0; i < tr.size(); i++) { - triangles.push_back(tr[i].points[0]); - triangles.push_back(tr[i].points[1]); - triangles.push_back(tr[i].points[2]); + *ptr++ = tr[i].points[0]; + *ptr++ = tr[i].points[1]; + *ptr++ = tr[i].points[2]; } return triangles; } diff --git a/doc/classes/NavigationAgent3D.xml b/doc/classes/NavigationAgent3D.xml index 24325b4a01..ec9f679307 100644 --- a/doc/classes/NavigationAgent3D.xml +++ b/doc/classes/NavigationAgent3D.xml @@ -168,7 +168,7 @@ The height of the avoidance agent. Agents will ignore other agents or obstacles that are above or below their current position + height in 2D avoidance. Does nothing in 3D avoidance which uses radius spheres alone. </member> <member name="keep_y_velocity" type="bool" setter="set_keep_y_velocity" getter="get_keep_y_velocity" default="true"> - If [code]true[/code] and the agent uses 2D avoidance it will remember the set y-axis velocity and reapply it after the avoidance step. While 2D avoidance has no y-axis and simulates on a flat plane this setting can help mitigate the most obvious clipping on uneven 3D geometry. + If [code]true[/code], and the agent uses 2D avoidance, it will remember the set y-axis velocity and reapply it after the avoidance step. While 2D avoidance has no y-axis and simulates on a flat plane this setting can help mitigate the most obvious clipping on uneven 3D geometry. </member> <member name="max_neighbors" type="int" setter="set_max_neighbors" getter="get_max_neighbors" default="10"> The maximum number of neighbors for the agent to consider. diff --git a/drivers/gles3/storage/particles_storage.cpp b/drivers/gles3/storage/particles_storage.cpp index 1caa3bbe35..e263acf88b 100644 --- a/drivers/gles3/storage/particles_storage.cpp +++ b/drivers/gles3/storage/particles_storage.cpp @@ -818,6 +818,7 @@ void ParticlesStorage::particles_set_view_axis(RID p_particles, const Vector3 &p } glEnable(GL_RASTERIZER_DISCARD); + glBindFramebuffer(GL_FRAMEBUFFER, 0); _particles_update_instance_buffer(particles, axis, p_up_axis); glDisable(GL_RASTERIZER_DISCARD); } @@ -1001,6 +1002,7 @@ void ParticlesStorage::_particles_update_instance_buffer(Particles *particles, c void ParticlesStorage::update_particles() { glEnable(GL_RASTERIZER_DISCARD); + glBindFramebuffer(GL_FRAMEBUFFER, 0); GLuint global_buffer = GLES3::MaterialStorage::get_singleton()->global_shader_parameters_get_uniform_buffer(); diff --git a/editor/filesystem_dock.cpp b/editor/filesystem_dock.cpp index c5feb71c9e..a1a0f68778 100644 --- a/editor/filesystem_dock.cpp +++ b/editor/filesystem_dock.cpp @@ -1528,6 +1528,8 @@ void FileSystemDock::_try_duplicate_item(const FileOrFolder &p_item, const Strin } } } else { + da->make_dir(new_path); + // Recursively duplicate all files inside the folder. Ref<DirAccess> old_dir = DirAccess::open(old_path); ERR_FAIL_COND(old_dir.is_null()); @@ -1894,22 +1896,15 @@ void FileSystemDock::_move_operation_confirm(const String &p_to_path, bool p_cop if (p_overwrite == OVERWRITE_RENAME) { new_paths.write[i] = _get_unique_name(to_move[i], p_to_path); } else { - new_paths.write[i] = p_to_path.path_join(to_move[i].path.get_file()); + new_paths.write[i] = p_to_path.path_join(to_move[i].path.trim_suffix("/").get_file()); } } if (p_copy) { bool is_copied = false; for (int i = 0; i < to_move.size(); i++) { - String old_path = to_move[i].path; - String new_path = new_paths[i]; - - if (!to_move[i].is_file) { - new_path = new_path.path_join(old_path.trim_suffix("/").get_file()); - } - - if (old_path != new_path) { - _try_duplicate_item(to_move[i], new_path); + if (to_move[i].path != new_paths[i]) { + _try_duplicate_item(to_move[i], new_paths[i]); is_copied = true; } } @@ -1934,15 +1929,8 @@ void FileSystemDock::_move_operation_confirm(const String &p_to_path, bool p_cop HashMap<String, String> folder_renames; for (int i = 0; i < to_move.size(); i++) { - String old_path = to_move[i].path; - String new_path = new_paths[i]; - - if (!to_move[i].is_file) { - new_path = new_path.path_join(old_path.trim_suffix("/").get_file()); - } - - if (old_path != new_path) { - _try_move_item(to_move[i], new_path, file_renames, folder_renames); + if (to_move[i].path != new_paths[i]) { + _try_move_item(to_move[i], new_paths[i], file_renames, folder_renames); is_moved = true; } } diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp index 55d45fdd2e..85846d7bc6 100644 --- a/editor/plugins/canvas_item_editor_plugin.cpp +++ b/editor/plugins/canvas_item_editor_plugin.cpp @@ -2057,8 +2057,8 @@ bool CanvasItemEditor::_gui_input_move(const Ref<InputEvent> &p_event) { drag_to = transform.affine_inverse().xform(m->get_position()); Point2 previous_pos; if (drag_selection.size() == 1) { - Transform2D xform = drag_selection[0]->get_global_transform_with_canvas() * drag_selection[0]->get_transform().affine_inverse(); - previous_pos = xform.xform(drag_selection[0]->_edit_get_position()); + Transform2D parent_xform = drag_selection[0]->get_global_transform_with_canvas() * drag_selection[0]->get_transform().affine_inverse(); + previous_pos = parent_xform.xform(drag_selection[0]->_edit_get_position()); } else { previous_pos = _get_encompassing_rect_from_list(drag_selection).position; } @@ -2066,14 +2066,17 @@ bool CanvasItemEditor::_gui_input_move(const Ref<InputEvent> &p_event) { Point2 drag_delta = drag_to - drag_from; if (drag_selection.size() == 1 && (drag_type == DRAG_MOVE_X || drag_type == DRAG_MOVE_Y)) { const CanvasItem *selected = drag_selection.front()->get(); - drag_delta = selected->get_transform().affine_inverse().basis_xform(drag_delta); + Transform2D parent_xform = selected->get_global_transform_with_canvas() * selected->get_transform().affine_inverse(); + Transform2D unscaled_transform = (transform * parent_xform * selected->_edit_get_transform()).orthonormalized(); + Transform2D simple_xform = viewport->get_transform() * unscaled_transform; + drag_delta = simple_xform.affine_inverse().basis_xform(drag_delta); if (drag_type == DRAG_MOVE_X) { drag_delta.y = 0; } else { drag_delta.x = 0; } - drag_delta = selected->get_transform().basis_xform(drag_delta); + drag_delta = simple_xform.basis_xform(drag_delta); } Point2 new_pos = snap_point(previous_pos + drag_delta, SNAP_GRID | SNAP_GUIDES | SNAP_PIXEL | SNAP_NODE_PARENT | SNAP_NODE_ANCHORS | SNAP_OTHER_NODES, 0, nullptr, drag_selection); @@ -2087,8 +2090,8 @@ bool CanvasItemEditor::_gui_input_move(const Ref<InputEvent> &p_event) { } for (CanvasItem *ci : drag_selection) { - Transform2D xform = ci->get_global_transform_with_canvas().affine_inverse() * ci->get_transform(); - ci->_edit_set_position(ci->_edit_get_position() + xform.xform(new_pos) - xform.xform(previous_pos)); + Transform2D parent_xform_inv = ci->get_transform() * ci->get_global_transform_with_canvas().affine_inverse(); + ci->_edit_set_position(ci->_edit_get_position() + parent_xform_inv.basis_xform(new_pos - previous_pos)); } return true; } diff --git a/scene/3d/navigation_agent_3d.cpp b/scene/3d/navigation_agent_3d.cpp index 87b8087e44..b311495a7f 100644 --- a/scene/3d/navigation_agent_3d.cpp +++ b/scene/3d/navigation_agent_3d.cpp @@ -311,11 +311,9 @@ void NavigationAgent3D::_notification(int p_what) { } void NavigationAgent3D::_validate_property(PropertyInfo &p_property) const { - if (p_property.name == "keep_y_velocity") { - if (use_3d_avoidance) { - p_property.usage = PROPERTY_USAGE_NONE; - return; - } + if (p_property.name == "keep_y_velocity" && use_3d_avoidance) { + p_property.usage = PROPERTY_USAGE_NONE; + return; } } diff --git a/servers/rendering/renderer_rd/renderer_canvas_render_rd.cpp b/servers/rendering/renderer_rd/renderer_canvas_render_rd.cpp index ecf2c29956..0b1561939e 100644 --- a/servers/rendering/renderer_rd/renderer_canvas_render_rd.cpp +++ b/servers/rendering/renderer_rd/renderer_canvas_render_rd.cpp @@ -2759,7 +2759,7 @@ bool RendererCanvasRenderRD::free(RID p_rid) { } void RendererCanvasRenderRD::set_shadow_texture_size(int p_size) { - p_size = nearest_power_of_2_templated(p_size); + p_size = MAX(1, nearest_power_of_2_templated(p_size)); if (p_size == state.shadow_texture_size) { return; } diff --git a/servers/rendering_server.cpp b/servers/rendering_server.cpp index ccddaae131..2b4fe6e01b 100644 --- a/servers/rendering_server.cpp +++ b/servers/rendering_server.cpp @@ -3345,7 +3345,7 @@ void RenderingServer::init() { GLOBAL_DEF(PropertyInfo(Variant::INT, "rendering/lights_and_shadows/positional_shadow/soft_shadow_filter_quality", PROPERTY_HINT_ENUM, "Hard (Fastest),Soft Very Low (Faster),Soft Low (Fast),Soft Medium (Average),Soft High (Slow),Soft Ultra (Slowest)"), 2); GLOBAL_DEF("rendering/lights_and_shadows/positional_shadow/soft_shadow_filter_quality.mobile", 0); - GLOBAL_DEF("rendering/2d/shadow_atlas/size", 2048); + GLOBAL_DEF(PropertyInfo(Variant::INT, "rendering/2d/shadow_atlas/size", PROPERTY_HINT_RANGE, "128,16384"), 2048); // Number of commands that can be drawn per frame. GLOBAL_DEF_RST(PropertyInfo(Variant::INT, "rendering/gl_compatibility/item_buffer_size", PROPERTY_HINT_RANGE, "128,1048576,1"), 16384); |