diff options
Diffstat (limited to 'modules')
28 files changed, 332 insertions, 48 deletions
diff --git a/modules/SCsub b/modules/SCsub index fb46c5f877..9155a53eaf 100644 --- a/modules/SCsub +++ b/modules/SCsub @@ -3,6 +3,7 @@ Import("env") import modules_builders +import os env_modules = env.Clone() @@ -13,16 +14,20 @@ env.CommandNoCache("modules_enabled.gen.h", Value(env.module_list), modules_buil vs_sources = [] # libmodule_<name>.a for each active module. -for module in env.module_list: +for name, path in env.module_list.items(): env.modules_sources = [] - SConscript(module + "/SCsub") + + if not os.path.isabs(path): + SConscript(name + "/SCsub") # Built-in. + else: + SConscript(path + "/SCsub") # Custom. # Some modules are not linked automatically but can be enabled optionally # on iOS, so we handle those specially. - if env["platform"] == "iphone" and module in ["arkit", "camera"]: + if env["platform"] == "iphone" and name in ["arkit", "camera"]: continue - lib = env_modules.add_library("module_%s" % module, env.modules_sources) + lib = env_modules.add_library("module_%s" % name, env.modules_sources) env.Prepend(LIBS=[lib]) if env["vsproj"]: vs_sources += env.modules_sources diff --git a/modules/assimp/editor_scene_importer_assimp.cpp b/modules/assimp/editor_scene_importer_assimp.cpp index 9cd2870852..abbd08ae4e 100644 --- a/modules/assimp/editor_scene_importer_assimp.cpp +++ b/modules/assimp/editor_scene_importer_assimp.cpp @@ -145,7 +145,8 @@ Node *EditorSceneImporterAssimp::import_scene(const String &p_path, uint32_t p_f // aiProcess_EmbedTextures | //aiProcess_SplitByBoneCount | 0; - aiScene *scene = (aiScene *)importer.ReadFile(s_path.c_str(), post_process_Steps); + String g_path = ProjectSettings::get_singleton()->globalize_path(p_path); + aiScene *scene = (aiScene *)importer.ReadFile(g_path.utf8().ptr(), post_process_Steps); ERR_FAIL_COND_V_MSG(scene == nullptr, nullptr, String("Open Asset Import failed to open: ") + String(importer.GetErrorString())); diff --git a/modules/bullet/area_bullet.h b/modules/bullet/area_bullet.h index cde889c1ba..c0bcc858fe 100644 --- a/modules/bullet/area_bullet.h +++ b/modules/bullet/area_bullet.h @@ -93,7 +93,7 @@ private: Vector3 spOv_gravityVec = Vector3(0, -1, 0); real_t spOv_gravityMag = 10; real_t spOv_linearDump = 0.1; - real_t spOv_angularDump = 1; + real_t spOv_angularDump = 0.1; int spOv_priority = 0; bool isScratched = false; diff --git a/modules/bullet/shape_bullet.h b/modules/bullet/shape_bullet.h index b24ded574f..a35a1d8a18 100644 --- a/modules/bullet/shape_bullet.h +++ b/modules/bullet/shape_bullet.h @@ -31,7 +31,7 @@ #ifndef SHAPE_BULLET_H #define SHAPE_BULLET_H -#include "core/math/geometry.h" +#include "core/math/geometry_3d.h" #include "core/variant.h" #include "rid_bullet.h" #include "servers/physics_server_3d.h" diff --git a/modules/csg/csg.cpp b/modules/csg/csg.cpp index df798623f9..ded0b970dc 100644 --- a/modules/csg/csg.cpp +++ b/modules/csg/csg.cpp @@ -30,7 +30,7 @@ #include "csg.h" -#include "core/math/geometry.h" +#include "core/math/geometry_2d.h" #include "core/math/math_funcs.h" #include "core/sort_array.h" @@ -964,7 +964,7 @@ void CSGBrushOperation::Build2DFaces::_merge_faces(const Vector<int> &p_segment_ face_points[face_edge_idx], face_points[(face_edge_idx + 1) % 3] }; - Vector2 closest_point = Geometry::get_closest_point_to_segment_2d(point_2D, edge_points); + Vector2 closest_point = Geometry2D::get_closest_point_to_segment(point_2D, edge_points); if ((closest_point - point_2D).length_squared() < vertex_snap2) { int opposite_vertex_idx = face.vertex_idx[(face_edge_idx + 2) % 3]; @@ -1028,7 +1028,7 @@ void CSGBrushOperation::Build2DFaces::_find_edge_intersections(const Vector2 p_s // First check if the ends of the segment are on the edge. bool on_edge = false; for (int edge_point_idx = 0; edge_point_idx < 2; ++edge_point_idx) { - intersection_point = Geometry::get_closest_point_to_segment_2d(p_segment_points[edge_point_idx], edge_points); + intersection_point = Geometry2D::get_closest_point_to_segment(p_segment_points[edge_point_idx], edge_points); if ((intersection_point - p_segment_points[edge_point_idx]).length_squared() < vertex_snap2) { on_edge = true; break; @@ -1036,7 +1036,7 @@ void CSGBrushOperation::Build2DFaces::_find_edge_intersections(const Vector2 p_s } // Else check if the segment intersects the edge. - if (on_edge || Geometry::segment_intersects_segment_2d(p_segment_points[0], p_segment_points[1], edge_points[0], edge_points[1], &intersection_point)) { + if (on_edge || Geometry2D::segment_intersects_segment(p_segment_points[0], p_segment_points[1], edge_points[0], edge_points[1], &intersection_point)) { // Check if intersection point is an edge point. if ((intersection_point - edge_points[0]).length_squared() < vertex_snap2 || (intersection_point - edge_points[1]).length_squared() < vertex_snap2) { @@ -1074,7 +1074,7 @@ void CSGBrushOperation::Build2DFaces::_find_edge_intersections(const Vector2 p_s } // If opposite point is on the segemnt, add its index to segment indices too. - Vector2 closest_point = Geometry::get_closest_point_to_segment_2d(vertices[opposite_vertex_idx].point, p_segment_points); + Vector2 closest_point = Geometry2D::get_closest_point_to_segment(vertices[opposite_vertex_idx].point, p_segment_points); if ((closest_point - vertices[opposite_vertex_idx].point).length_squared() < vertex_snap2) { _add_vertex_idx_sorted(r_segment_indices, opposite_vertex_idx); } @@ -1141,7 +1141,7 @@ int CSGBrushOperation::Build2DFaces::_insert_point(const Vector2 &p_point) { uvs[(face_edge_idx + 1) % 3] }; - Vector2 closest_point = Geometry::get_closest_point_to_segment_2d(p_point, edge_points); + Vector2 closest_point = Geometry2D::get_closest_point_to_segment(p_point, edge_points); if ((closest_point - p_point).length_squared() < vertex_snap2) { on_edge = true; @@ -1192,7 +1192,7 @@ int CSGBrushOperation::Build2DFaces::_insert_point(const Vector2 &p_point) { } // If not on an edge, check if the point is inside the face. - if (!on_edge && Geometry::is_point_in_triangle(p_point, face_vertices[0].point, face_vertices[1].point, face_vertices[2].point)) { + if (!on_edge && Geometry2D::is_point_in_triangle(p_point, face_vertices[0].point, face_vertices[1].point, face_vertices[2].point)) { // Add the point as a new vertex. Vertex2D new_vertex; new_vertex.point = p_point; diff --git a/modules/csg/csg_gizmos.cpp b/modules/csg/csg_gizmos.cpp index 9fa7dc1340..cce72770f5 100644 --- a/modules/csg/csg_gizmos.cpp +++ b/modules/csg/csg_gizmos.cpp @@ -120,7 +120,7 @@ void CSGShape3DGizmoPlugin::set_handle(EditorNode3DGizmo *p_gizmo, int p_idx, Ca CSGSphere3D *s = Object::cast_to<CSGSphere3D>(cs); Vector3 ra, rb; - Geometry::get_closest_points_between_segments(Vector3(), Vector3(4096, 0, 0), sg[0], sg[1], ra, rb); + Geometry3D::get_closest_points_between_segments(Vector3(), Vector3(4096, 0, 0), sg[0], sg[1], ra, rb); float d = ra.x; if (Node3DEditor::get_singleton()->is_snap_enabled()) { d = Math::stepify(d, Node3DEditor::get_singleton()->get_translate_snap()); @@ -139,7 +139,7 @@ void CSGShape3DGizmoPlugin::set_handle(EditorNode3DGizmo *p_gizmo, int p_idx, Ca Vector3 axis; axis[p_idx] = 1.0; Vector3 ra, rb; - Geometry::get_closest_points_between_segments(Vector3(), axis * 4096, sg[0], sg[1], ra, rb); + Geometry3D::get_closest_points_between_segments(Vector3(), axis * 4096, sg[0], sg[1], ra, rb); float d = ra[p_idx]; if (Node3DEditor::get_singleton()->is_snap_enabled()) { d = Math::stepify(d, Node3DEditor::get_singleton()->get_translate_snap()); @@ -168,7 +168,7 @@ void CSGShape3DGizmoPlugin::set_handle(EditorNode3DGizmo *p_gizmo, int p_idx, Ca Vector3 axis; axis[p_idx == 0 ? 0 : 1] = 1.0; Vector3 ra, rb; - Geometry::get_closest_points_between_segments(Vector3(), axis * 4096, sg[0], sg[1], ra, rb); + Geometry3D::get_closest_points_between_segments(Vector3(), axis * 4096, sg[0], sg[1], ra, rb); float d = axis.dot(ra); if (Node3DEditor::get_singleton()->is_snap_enabled()) { d = Math::stepify(d, Node3DEditor::get_singleton()->get_translate_snap()); @@ -191,7 +191,7 @@ void CSGShape3DGizmoPlugin::set_handle(EditorNode3DGizmo *p_gizmo, int p_idx, Ca Vector3 axis; axis[0] = 1.0; Vector3 ra, rb; - Geometry::get_closest_points_between_segments(Vector3(), axis * 4096, sg[0], sg[1], ra, rb); + Geometry3D::get_closest_points_between_segments(Vector3(), axis * 4096, sg[0], sg[1], ra, rb); float d = axis.dot(ra); if (Node3DEditor::get_singleton()->is_snap_enabled()) { d = Math::stepify(d, Node3DEditor::get_singleton()->get_translate_snap()); diff --git a/modules/csg/csg_shape.cpp b/modules/csg/csg_shape.cpp index 7df65b04c4..cea006364f 100644 --- a/modules/csg/csg_shape.cpp +++ b/modules/csg/csg_shape.cpp @@ -29,6 +29,7 @@ /*************************************************************************/ #include "csg_shape.h" +#include "core/math/geometry_2d.h" #include "scene/3d/path_3d.h" void CSGShape3D::set_use_collision(bool p_enable) { @@ -1728,7 +1729,7 @@ CSGBrush *CSGPolygon3D::_build_brush() { final_polygon.invert(); } - Vector<int> triangles = Geometry::triangulate_polygon(final_polygon); + Vector<int> triangles = Geometry2D::triangulate_polygon(final_polygon); if (triangles.size() < 3) { return nullptr; diff --git a/modules/denoise/config.py b/modules/denoise/config.py index 53b8f2f2e3..091d7643c0 100644 --- a/modules/denoise/config.py +++ b/modules/denoise/config.py @@ -1,5 +1,11 @@ def can_build(env, platform): - return env["tools"] + # Thirdparty dependency OpenImage Denoise includes oneDNN library + # which only supports 64-bit architectures. + # It's also only relevant for tools build and desktop platforms, + # as doing lightmap generation and denoising on Android or HTML5 + # would be a bit far-fetched. + desktop_platforms = ["linuxbsd", "osx", "windows"] + return env["tools"] and platform in desktop_platforms and env["bits"] == "64" def configure(env): diff --git a/modules/gdnative/gdnative/packed_arrays.cpp b/modules/gdnative/gdnative/packed_arrays.cpp index 675d66056a..fc71d50289 100644 --- a/modules/gdnative/gdnative/packed_arrays.cpp +++ b/modules/gdnative/gdnative/packed_arrays.cpp @@ -78,6 +78,16 @@ void GDAPI godot_packed_byte_array_new_with_array(godot_packed_byte_array *r_des } } +const uint8_t GDAPI *godot_packed_byte_array_ptr(const godot_packed_byte_array *p_self) { + const Vector<uint8_t> *self = (const Vector<uint8_t> *)p_self; + return self->ptr(); +} + +uint8_t GDAPI *godot_packed_byte_array_ptrw(godot_packed_byte_array *p_self) { + Vector<uint8_t> *self = (Vector<uint8_t> *)p_self; + return self->ptrw(); +} + void GDAPI godot_packed_byte_array_append(godot_packed_byte_array *p_self, const uint8_t p_data) { Vector<uint8_t> *self = (Vector<uint8_t> *)p_self; self->push_back(p_data); @@ -162,6 +172,16 @@ void GDAPI godot_packed_int32_array_new_with_array(godot_packed_int32_array *r_d } } +const int32_t GDAPI *godot_packed_int32_array_ptr(const godot_packed_int32_array *p_self) { + const Vector<int32_t> *self = (const Vector<int32_t> *)p_self; + return self->ptr(); +} + +int32_t GDAPI *godot_packed_int32_array_ptrw(godot_packed_int32_array *p_self) { + Vector<int32_t> *self = (Vector<int32_t> *)p_self; + return self->ptrw(); +} + void GDAPI godot_packed_int32_array_append(godot_packed_int32_array *p_self, const int32_t p_data) { Vector<int32_t> *self = (Vector<int32_t> *)p_self; self->push_back(p_data); @@ -246,6 +266,16 @@ void GDAPI godot_packed_int64_array_new_with_array(godot_packed_int64_array *r_d } } +const int64_t GDAPI *godot_packed_int64_array_ptr(const godot_packed_int64_array *p_self) { + const Vector<int64_t> *self = (const Vector<int64_t> *)p_self; + return self->ptr(); +} + +int64_t GDAPI *godot_packed_int64_array_ptrw(godot_packed_int64_array *p_self) { + Vector<int64_t> *self = (Vector<int64_t> *)p_self; + return self->ptrw(); +} + void GDAPI godot_packed_int64_array_append(godot_packed_int64_array *p_self, const int64_t p_data) { Vector<int64_t> *self = (Vector<int64_t> *)p_self; self->push_back(p_data); @@ -330,6 +360,16 @@ void GDAPI godot_packed_float32_array_new_with_array(godot_packed_float32_array } } +const float GDAPI *godot_packed_float32_array_ptr(const godot_packed_float32_array *p_self) { + const Vector<float> *self = (const Vector<float> *)p_self; + return self->ptr(); +} + +float GDAPI *godot_packed_float32_array_ptrw(godot_packed_float32_array *p_self) { + Vector<float> *self = (Vector<float> *)p_self; + return self->ptrw(); +} + void GDAPI godot_packed_float32_array_append(godot_packed_float32_array *p_self, const float p_data) { Vector<float> *self = (Vector<float> *)p_self; self->push_back(p_data); @@ -414,6 +454,16 @@ void GDAPI godot_packed_float64_array_new_with_array(godot_packed_float64_array } } +const double GDAPI *godot_packed_float64_array_ptr(const godot_packed_float64_array *p_self) { + const Vector<double> *self = (const Vector<double> *)p_self; + return self->ptr(); +} + +double GDAPI *godot_packed_float64_array_ptrw(godot_packed_float64_array *p_self) { + Vector<double> *self = (Vector<double> *)p_self; + return self->ptrw(); +} + void GDAPI godot_packed_float64_array_append(godot_packed_float64_array *p_self, const double p_data) { Vector<double> *self = (Vector<double> *)p_self; self->push_back(p_data); @@ -498,6 +548,16 @@ void GDAPI godot_packed_string_array_new_with_array(godot_packed_string_array *r } } +const godot_string GDAPI *godot_packed_string_array_ptr(const godot_packed_string_array *p_self) { + const Vector<String> *self = (const Vector<String> *)p_self; + return (const godot_string *)self->ptr(); +} + +godot_string GDAPI *godot_packed_string_array_ptrw(godot_packed_string_array *p_self) { + Vector<String> *self = (Vector<String> *)p_self; + return (godot_string *)self->ptrw(); +} + void GDAPI godot_packed_string_array_append(godot_packed_string_array *p_self, const godot_string *p_data) { Vector<String> *self = (Vector<String> *)p_self; String &s = *(String *)p_data; @@ -590,6 +650,16 @@ void GDAPI godot_packed_vector2_array_new_with_array(godot_packed_vector2_array } } +const godot_vector2 GDAPI *godot_packed_vector2_array_ptr(const godot_packed_vector2_array *p_self) { + const Vector<Vector2> *self = (const Vector<Vector2> *)p_self; + return (const godot_vector2 *)self->ptr(); +} + +godot_vector2 GDAPI *godot_packed_vector2_array_ptrw(godot_packed_vector2_array *p_self) { + Vector<Vector2> *self = (Vector<Vector2> *)p_self; + return (godot_vector2 *)self->ptrw(); +} + void GDAPI godot_packed_vector2_array_append(godot_packed_vector2_array *p_self, const godot_vector2 *p_data) { Vector<Vector2> *self = (Vector<Vector2> *)p_self; Vector2 &s = *(Vector2 *)p_data; @@ -681,6 +751,16 @@ void GDAPI godot_packed_vector3_array_new_with_array(godot_packed_vector3_array } } +const godot_vector3 GDAPI *godot_packed_vector3_array_ptr(const godot_packed_vector3_array *p_self) { + const Vector<Vector3> *self = (const Vector<Vector3> *)p_self; + return (const godot_vector3 *)self->ptr(); +} + +godot_vector3 GDAPI *godot_packed_vector3_array_ptrw(godot_packed_vector3_array *p_self) { + Vector<Vector3> *self = (Vector<Vector3> *)p_self; + return (godot_vector3 *)self->ptrw(); +} + void GDAPI godot_packed_vector3_array_append(godot_packed_vector3_array *p_self, const godot_vector3 *p_data) { Vector<Vector3> *self = (Vector<Vector3> *)p_self; Vector3 &s = *(Vector3 *)p_data; @@ -772,6 +852,16 @@ void GDAPI godot_packed_color_array_new_with_array(godot_packed_color_array *r_d } } +const godot_color GDAPI *godot_packed_color_array_ptr(const godot_packed_color_array *p_self) { + const Vector<Color> *self = (const Vector<Color> *)p_self; + return (const godot_color *)self->ptr(); +} + +godot_color GDAPI *godot_packed_color_array_ptrw(godot_packed_color_array *p_self) { + Vector<Color> *self = (Vector<Color> *)p_self; + return (godot_color *)self->ptrw(); +} + void GDAPI godot_packed_color_array_append(godot_packed_color_array *p_self, const godot_color *p_data) { Vector<Color> *self = (Vector<Color> *)p_self; Color &s = *(Color *)p_data; diff --git a/modules/gdnative/gdnative_api.json b/modules/gdnative/gdnative_api.json index 9c38c8b58d..d174b936a8 100644 --- a/modules/gdnative/gdnative_api.json +++ b/modules/gdnative/gdnative_api.json @@ -519,6 +519,34 @@ ] }, { + "name": "godot_packed_int64_array_ptr", + "return_type": "const int64_t *", + "arguments": [ + ["const godot_packed_int64_array *", "p_self"] + ] + }, + { + "name": "godot_packed_int64_array_ptrw", + "return_type": "int64_t *", + "arguments": [ + ["godot_packed_int64_array *", "p_self"] + ] + }, + { + "name": "godot_packed_float64_array_ptr", + "return_type": "const double *", + "arguments": [ + ["const godot_packed_float64_array *", "p_self"] + ] + }, + { + "name": "godot_packed_float64_array_ptrw", + "return_type": "double *", + "arguments": [ + ["godot_packed_float64_array *", "p_self"] + ] + }, + { "name": "godot_rect2_as_rect2i", "return_type": "godot_rect2i", "arguments": [ @@ -2854,6 +2882,20 @@ ] }, { + "name": "godot_packed_byte_array_ptr", + "return_type": "const uint8_t *", + "arguments": [ + ["const godot_packed_byte_array *", "p_self"] + ] + }, + { + "name": "godot_packed_byte_array_ptrw", + "return_type": "uint8_t *", + "arguments": [ + ["godot_packed_byte_array *", "p_self"] + ] + }, + { "name": "godot_packed_byte_array_set", "return_type": "void", "arguments": [ @@ -2964,6 +3006,20 @@ ] }, { + "name": "godot_packed_int32_array_ptr", + "return_type": "const int32_t *", + "arguments": [ + ["const godot_packed_int32_array *", "p_self"] + ] + }, + { + "name": "godot_packed_int32_array_ptrw", + "return_type": "int32_t *", + "arguments": [ + ["godot_packed_int32_array *", "p_self"] + ] + }, + { "name": "godot_packed_int32_array_set", "return_type": "void", "arguments": [ @@ -3074,6 +3130,20 @@ ] }, { + "name": "godot_packed_float32_array_ptr", + "return_type": "const float *", + "arguments": [ + ["const godot_packed_float32_array *", "p_self"] + ] + }, + { + "name": "godot_packed_float32_array_ptrw", + "return_type": "float *", + "arguments": [ + ["godot_packed_float32_array *", "p_self"] + ] + }, + { "name": "godot_packed_float32_array_set", "return_type": "void", "arguments": [ @@ -3184,6 +3254,20 @@ ] }, { + "name": "godot_packed_string_array_ptr", + "return_type": "const godot_string *", + "arguments": [ + ["const godot_packed_string_array *", "p_self"] + ] + }, + { + "name": "godot_packed_string_array_ptrw", + "return_type": "godot_string *", + "arguments": [ + ["godot_packed_string_array *", "p_self"] + ] + }, + { "name": "godot_packed_string_array_set", "return_type": "void", "arguments": [ @@ -3294,6 +3378,20 @@ ] }, { + "name": "godot_packed_vector2_array_ptr", + "return_type": "const godot_vector2 *", + "arguments": [ + ["const godot_packed_vector2_array *", "p_self"] + ] + }, + { + "name": "godot_packed_vector2_array_ptrw", + "return_type": "godot_vector2 *", + "arguments": [ + ["godot_packed_vector2_array *", "p_self"] + ] + }, + { "name": "godot_packed_vector2_array_set", "return_type": "void", "arguments": [ @@ -3404,6 +3502,20 @@ ] }, { + "name": "godot_packed_vector3_array_ptr", + "return_type": "const godot_vector3 *", + "arguments": [ + ["const godot_packed_vector3_array *", "p_self"] + ] + }, + { + "name": "godot_packed_vector3_array_ptrw", + "return_type": "godot_vector3 *", + "arguments": [ + ["godot_packed_vector3_array *", "p_self"] + ] + }, + { "name": "godot_packed_vector3_array_set", "return_type": "void", "arguments": [ @@ -3512,6 +3624,20 @@ ["godot_packed_color_array *", "p_self"], ["const godot_int", "p_size"] ] + }, + { + "name": "godot_packed_color_array_ptr", + "return_type": "const godot_color *", + "arguments": [ + ["const godot_packed_color_array *", "p_self"] + ] + }, + { + "name": "godot_packed_color_array_ptrw", + "return_type": "godot_color *", + "arguments": [ + ["godot_packed_color_array *", "p_self"] + ] }, { "name": "godot_packed_color_array_set", diff --git a/modules/gdnative/include/gdnative/packed_arrays.h b/modules/gdnative/include/gdnative/packed_arrays.h index d5bad70bdc..8cff6d49a5 100644 --- a/modules/gdnative/include/gdnative/packed_arrays.h +++ b/modules/gdnative/include/gdnative/packed_arrays.h @@ -158,6 +158,9 @@ void GDAPI godot_packed_byte_array_new(godot_packed_byte_array *r_dest); void GDAPI godot_packed_byte_array_new_copy(godot_packed_byte_array *r_dest, const godot_packed_byte_array *p_src); void GDAPI godot_packed_byte_array_new_with_array(godot_packed_byte_array *r_dest, const godot_array *p_a); +const uint8_t GDAPI *godot_packed_byte_array_ptr(const godot_packed_byte_array *p_self); +uint8_t GDAPI *godot_packed_byte_array_ptrw(godot_packed_byte_array *p_self); + void GDAPI godot_packed_byte_array_append(godot_packed_byte_array *p_self, const uint8_t p_data); void GDAPI godot_packed_byte_array_append_array(godot_packed_byte_array *p_self, const godot_packed_byte_array *p_array); @@ -187,6 +190,9 @@ void GDAPI godot_packed_int32_array_new(godot_packed_int32_array *r_dest); void GDAPI godot_packed_int32_array_new_copy(godot_packed_int32_array *r_dest, const godot_packed_int32_array *p_src); void GDAPI godot_packed_int32_array_new_with_array(godot_packed_int32_array *r_dest, const godot_array *p_a); +const int32_t GDAPI *godot_packed_int32_array_ptr(const godot_packed_int32_array *p_self); +int32_t GDAPI *godot_packed_int32_array_ptrw(godot_packed_int32_array *p_self); + void GDAPI godot_packed_int32_array_append(godot_packed_int32_array *p_self, const int32_t p_data); void GDAPI godot_packed_int32_array_append_array(godot_packed_int32_array *p_self, const godot_packed_int32_array *p_array); @@ -216,6 +222,9 @@ void GDAPI godot_packed_int64_array_new(godot_packed_int64_array *r_dest); void GDAPI godot_packed_int64_array_new_copy(godot_packed_int64_array *r_dest, const godot_packed_int64_array *p_src); void GDAPI godot_packed_int64_array_new_with_array(godot_packed_int64_array *r_dest, const godot_array *p_a); +const int64_t GDAPI *godot_packed_int64_array_ptr(const godot_packed_int64_array *p_self); +int64_t GDAPI *godot_packed_int64_array_ptrw(godot_packed_int64_array *p_self); + void GDAPI godot_packed_int64_array_append(godot_packed_int64_array *p_self, const int64_t p_data); void GDAPI godot_packed_int64_array_append_array(godot_packed_int64_array *p_self, const godot_packed_int64_array *p_array); @@ -245,6 +254,9 @@ void GDAPI godot_packed_float32_array_new(godot_packed_float32_array *r_dest); void GDAPI godot_packed_float32_array_new_copy(godot_packed_float32_array *r_dest, const godot_packed_float32_array *p_src); void GDAPI godot_packed_float32_array_new_with_array(godot_packed_float32_array *r_dest, const godot_array *p_a); +const float GDAPI *godot_packed_float32_array_ptr(const godot_packed_float32_array *p_self); +float GDAPI *godot_packed_float32_array_ptrw(godot_packed_float32_array *p_self); + void GDAPI godot_packed_float32_array_append(godot_packed_float32_array *p_self, const float p_data); void GDAPI godot_packed_float32_array_append_array(godot_packed_float32_array *p_self, const godot_packed_float32_array *p_array); @@ -274,6 +286,9 @@ void GDAPI godot_packed_float64_array_new(godot_packed_float64_array *r_dest); void GDAPI godot_packed_float64_array_new_copy(godot_packed_float64_array *r_dest, const godot_packed_float64_array *p_src); void GDAPI godot_packed_float64_array_new_with_array(godot_packed_float64_array *r_dest, const godot_array *p_a); +const double GDAPI *godot_packed_float64_array_ptr(const godot_packed_float64_array *p_self); +double GDAPI *godot_packed_float64_array_ptrw(godot_packed_float64_array *p_self); + void GDAPI godot_packed_float64_array_append(godot_packed_float64_array *p_self, const double p_data); void GDAPI godot_packed_float64_array_append_array(godot_packed_float64_array *p_self, const godot_packed_float64_array *p_array); @@ -303,6 +318,9 @@ void GDAPI godot_packed_string_array_new(godot_packed_string_array *r_dest); void GDAPI godot_packed_string_array_new_copy(godot_packed_string_array *r_dest, const godot_packed_string_array *p_src); void GDAPI godot_packed_string_array_new_with_array(godot_packed_string_array *r_dest, const godot_array *p_a); +const godot_string GDAPI *godot_packed_string_array_ptr(const godot_packed_string_array *p_self); +godot_string GDAPI *godot_packed_string_array_ptrw(godot_packed_string_array *p_self); + void GDAPI godot_packed_string_array_append(godot_packed_string_array *p_self, const godot_string *p_data); void GDAPI godot_packed_string_array_append_array(godot_packed_string_array *p_self, const godot_packed_string_array *p_array); @@ -332,6 +350,9 @@ void GDAPI godot_packed_vector2_array_new(godot_packed_vector2_array *r_dest); void GDAPI godot_packed_vector2_array_new_copy(godot_packed_vector2_array *r_dest, const godot_packed_vector2_array *p_src); void GDAPI godot_packed_vector2_array_new_with_array(godot_packed_vector2_array *r_dest, const godot_array *p_a); +const godot_vector2 GDAPI *godot_packed_vector2_array_ptr(const godot_packed_vector2_array *p_self); +godot_vector2 GDAPI *godot_packed_vector2_array_ptrw(godot_packed_vector2_array *p_self); + void GDAPI godot_packed_vector2_array_append(godot_packed_vector2_array *p_self, const godot_vector2 *p_data); void GDAPI godot_packed_vector2_array_append_array(godot_packed_vector2_array *p_self, const godot_packed_vector2_array *p_array); @@ -361,6 +382,9 @@ void GDAPI godot_packed_vector3_array_new(godot_packed_vector3_array *r_dest); void GDAPI godot_packed_vector3_array_new_copy(godot_packed_vector3_array *r_dest, const godot_packed_vector3_array *p_src); void GDAPI godot_packed_vector3_array_new_with_array(godot_packed_vector3_array *r_dest, const godot_array *p_a); +const godot_vector3 GDAPI *godot_packed_vector3_array_ptr(const godot_packed_vector3_array *p_self); +godot_vector3 GDAPI *godot_packed_vector3_array_ptrw(godot_packed_vector3_array *p_self); + void GDAPI godot_packed_vector3_array_append(godot_packed_vector3_array *p_self, const godot_vector3 *p_data); void GDAPI godot_packed_vector3_array_append_array(godot_packed_vector3_array *p_self, const godot_packed_vector3_array *p_array); @@ -390,6 +414,9 @@ void GDAPI godot_packed_color_array_new(godot_packed_color_array *r_dest); void GDAPI godot_packed_color_array_new_copy(godot_packed_color_array *r_dest, const godot_packed_color_array *p_src); void GDAPI godot_packed_color_array_new_with_array(godot_packed_color_array *r_dest, const godot_array *p_a); +const godot_color GDAPI *godot_packed_color_array_ptr(const godot_packed_color_array *p_self); +godot_color GDAPI *godot_packed_color_array_ptrw(godot_packed_color_array *p_self); + void GDAPI godot_packed_color_array_append(godot_packed_color_array *p_self, const godot_color *p_data); void GDAPI godot_packed_color_array_append_array(godot_packed_color_array *p_self, const godot_packed_color_array *p_array); diff --git a/modules/gdnavigation/nav_map.cpp b/modules/gdnavigation/nav_map.cpp index 4bea007104..7919e6a01f 100644 --- a/modules/gdnavigation/nav_map.cpp +++ b/modules/gdnavigation/nav_map.cpp @@ -155,7 +155,7 @@ Vector<Vector3> NavMap::get_path(Vector3 p_origin, Vector3 p_destination, bool p least_cost_poly->poly->points[(i + 1) % least_cost_poly->poly->points.size()].pos }; - const Vector3 new_entry = Geometry::get_closest_point_to_segment(least_cost_poly->entry, edge_line); + const Vector3 new_entry = Geometry3D::get_closest_point_to_segment(least_cost_poly->entry, edge_line); const float new_distance = least_cost_poly->entry.distance_to(new_entry) + least_cost_poly->traveled_distance; #else const float new_distance = least_cost_poly->poly->center.distance_to(edge.other_polygon->center) + least_cost_poly->traveled_distance; @@ -413,7 +413,7 @@ Vector3 NavMap::get_closest_point_to_segment(const Vector3 &p_from, const Vector for (size_t point_id = 0; point_id < p.points.size(); point_id += 1) { Vector3 a, b; - Geometry::get_closest_points_between_segments( + Geometry3D::get_closest_points_between_segments( p_from, p_to, p.points[point_id].pos, diff --git a/modules/gdnavigation/navigation_mesh_generator.cpp b/modules/gdnavigation/navigation_mesh_generator.cpp index 7dc08fbf29..5329600e39 100644 --- a/modules/gdnavigation/navigation_mesh_generator.cpp +++ b/modules/gdnavigation/navigation_mesh_generator.cpp @@ -218,7 +218,7 @@ void NavigationMeshGenerator::_parse_geometry(Transform p_accumulated_transform, ConvexPolygonShape3D *convex_polygon = Object::cast_to<ConvexPolygonShape3D>(*s); if (convex_polygon) { Vector<Vector3> varr = Variant(convex_polygon->get_points()); - Geometry::MeshData md; + Geometry3D::MeshData md; Error err = QuickHull::build(varr, md); @@ -226,7 +226,7 @@ void NavigationMeshGenerator::_parse_geometry(Transform p_accumulated_transform, PackedVector3Array faces; for (int j = 0; j < md.faces.size(); ++j) { - Geometry::MeshData::Face face = md.faces[j]; + Geometry3D::MeshData::Face face = md.faces[j]; for (int k = 2; k < face.indices.size(); ++k) { faces.push_back(md.vertices[face.indices[0]]); diff --git a/modules/gdscript/gdscript_editor.cpp b/modules/gdscript/gdscript_editor.cpp index 7433c4a5bc..50d8289fd1 100644 --- a/modules/gdscript/gdscript_editor.cpp +++ b/modules/gdscript/gdscript_editor.cpp @@ -2082,7 +2082,11 @@ static void _find_identifiers_in_base(const GDScriptCompletionContext &p_context if (!p_only_functions) { List<PropertyInfo> members; - tmp.get_property_list(&members); + if (p_base.value.get_type() != Variant::NIL) { + p_base.value.get_property_list(&members); + } else { + tmp.get_property_list(&members); + } for (List<PropertyInfo>::Element *E = members.front(); E; E = E->next()) { if (String(E->get().name).find("/") == -1) { diff --git a/modules/gdscript/gdscript_function.cpp b/modules/gdscript/gdscript_function.cpp index fc0c4b3138..1aab71d161 100644 --- a/modules/gdscript/gdscript_function.cpp +++ b/modules/gdscript/gdscript_function.cpp @@ -363,6 +363,8 @@ Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_a } } + static_ref = script; + String err_text; #ifdef DEBUG_ENABLED @@ -1430,11 +1432,14 @@ Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_a #ifdef DEBUG_ENABLED GET_VARIANT_PTR(test, 1); - GET_VARIANT_PTR(message, 2); bool result = test->booleanize(); if (!result) { - const String &message_str = *message; + String message_str; + if (_code_ptr[ip + 2] != 0) { + GET_VARIANT_PTR(message, 2); + message_str = *message; + } if (message_str.empty()) { err_text = "Assertion failed."; } else { diff --git a/modules/gdscript/gdscript_parser.cpp b/modules/gdscript/gdscript_parser.cpp index 0e498f6895..a06ecb1ea8 100644 --- a/modules/gdscript/gdscript_parser.cpp +++ b/modules/gdscript/gdscript_parser.cpp @@ -3179,6 +3179,15 @@ void GDScriptParser::_parse_block(BlockNode *p_block, bool p_static) { IdentifierNode *id = alloc_node<IdentifierNode>(); id->name = tokenizer->get_token_identifier(); + BlockNode *check_block = p_block; + while (check_block) { + if (check_block->variables.has(id->name)) { + _set_error("Variable \"" + String(id->name) + "\" already defined in the scope (at line " + itos(check_block->variables[id->name]->line) + ")."); + return; + } + check_block = check_block->parent_block; + } + tokenizer->advance(); if (tokenizer->get_token() != GDScriptTokenizer::TK_OP_IN) { @@ -7336,8 +7345,8 @@ GDScriptParser::DataType GDScriptParser::_reduce_function_call_type(const Operat } else if (!_is_type_compatible(arg_types[i - arg_diff], par_type, true)) { // Supertypes are acceptable for dynamic compliance if (!_is_type_compatible(par_type, arg_types[i - arg_diff])) { - _set_error("At \"" + callee_name + "()\" call, argument " + itos(i - arg_diff + 1) + ". Assigned type (" + - par_type.to_string() + ") doesn't match the function argument's type (" + + _set_error("At \"" + callee_name + "()\" call, argument " + itos(i - arg_diff + 1) + ". The passed argument's type (" + + par_type.to_string() + ") doesn't match the function's expected argument type (" + arg_types[i - arg_diff].to_string() + ").", p_call->line); return DataType(); diff --git a/modules/gridmap/grid_map_editor_plugin.cpp b/modules/gridmap/grid_map_editor_plugin.cpp index 2bae43510a..3b0e78546d 100644 --- a/modules/gridmap/grid_map_editor_plugin.cpp +++ b/modules/gridmap/grid_map_editor_plugin.cpp @@ -35,7 +35,6 @@ #include "editor/plugins/node_3d_editor_plugin.h" #include "scene/3d/camera_3d.h" -#include "core/math/geometry.h" #include "core/os/keyboard.h" #include "scene/main/window.h" diff --git a/modules/lightmapper_rd/lightmapper_rd.cpp b/modules/lightmapper_rd/lightmapper_rd.cpp index b55c73e9bc..4de523baa0 100644 --- a/modules/lightmapper_rd/lightmapper_rd.cpp +++ b/modules/lightmapper_rd/lightmapper_rd.cpp @@ -29,7 +29,7 @@ /*************************************************************************/ #include "lightmapper_rd.h" -#include "core/math/geometry.h" +#include "core/math/geometry_2d.h" #include "core/project_settings.h" #include "lm_blendseams.glsl.gen.h" #include "lm_compute.glsl.gen.h" @@ -137,7 +137,7 @@ void LightmapperRD::_plot_triangle_into_triangle_index_list(int p_size, const Ve { Vector3 qsize = aabb.size * 0.5; //quarter size, for fast aabb test - if (!Geometry::triangle_box_overlap(aabb.position + qsize, qsize, p_points)) { + if (!Geometry3D::triangle_box_overlap(aabb.position + qsize, qsize, p_points)) { //does not fit in child, go on continue; } @@ -198,7 +198,7 @@ Lightmapper::BakeError LightmapperRD::_blit_meshes_into_atlas(int p_max_texture_ int slices = 0; while (source_sizes.size() > 0) { - Vector<Vector3i> offsets = Geometry::partial_pack_rects(source_sizes, atlas_size); + Vector<Vector3i> offsets = Geometry2D::partial_pack_rects(source_sizes, atlas_size); Vector<int> new_indices; Vector<Vector2i> new_sources; for (int i = 0; i < offsets.size(); i++) { @@ -488,9 +488,9 @@ void LightmapperRD::_create_acceleration_structures(RenderingDevice *rd, Size2i } //generate SDF for raytracing - Vector<uint32_t> euclidean_pos = Geometry::generate_edf(solid, Vector3i(grid_size, grid_size, grid_size), false); - Vector<uint32_t> euclidean_neg = Geometry::generate_edf(solid, Vector3i(grid_size, grid_size, grid_size), true); - Vector<int8_t> sdf8 = Geometry::generate_sdf8(euclidean_pos, euclidean_neg); + Vector<uint32_t> euclidean_pos = Geometry3D::generate_edf(solid, Vector3i(grid_size, grid_size, grid_size), false); + Vector<uint32_t> euclidean_neg = Geometry3D::generate_edf(solid, Vector3i(grid_size, grid_size, grid_size), true); + Vector<int8_t> sdf8 = Geometry3D::generate_sdf8(euclidean_pos, euclidean_neg); /*****************************/ /*** CREATE GPU STRUCTURES ***/ diff --git a/modules/mono/csharp_script.cpp b/modules/mono/csharp_script.cpp index 958d72adb1..ae25bd3544 100644 --- a/modules/mono/csharp_script.cpp +++ b/modules/mono/csharp_script.cpp @@ -2688,7 +2688,9 @@ bool CSharpScript::_get_member_export(IMonoClassMember *p_member, bool p_inspect return true; } +#ifdef TOOLS_ENABLED MonoObject *attr = p_member->get_attribute(CACHED_CLASS(ExportAttribute)); +#endif PropertyHint hint = PROPERTY_HINT_NONE; String hint_string; diff --git a/modules/mono/editor/GodotTools/GodotTools/GodotSharpEditor.cs b/modules/mono/editor/GodotTools/GodotTools/GodotSharpEditor.cs index eb7696685f..c874025be0 100644 --- a/modules/mono/editor/GodotTools/GodotTools/GodotSharpEditor.cs +++ b/modules/mono/editor/GodotTools/GodotTools/GodotSharpEditor.cs @@ -421,7 +421,7 @@ namespace GodotTools aboutLabel.Text = "C# support in Godot Engine is in late alpha stage and, while already usable, " + "it is not meant for use in production.\n\n" + - "Projects can be exported to Linux, macOS, Windows and Android, but not yet to iOS, HTML5 or UWP. " + + "Projects can be exported to Linux, macOS, Windows, Android, iOS and HTML5, but not yet to UWP. " + "Bugs and usability issues will be addressed gradually over future releases, " + "potentially including compatibility breaking changes as new features are implemented for a better overall C# experience.\n\n" + "If you experience issues with this Mono build, please report them on Godot's issue tracker with details about your system, MSBuild version, IDE, etc.:\n\n" + diff --git a/modules/mono/mono_gd/gd_mono.cpp b/modules/mono/mono_gd/gd_mono.cpp index 5f518d0613..39c3bd8934 100644 --- a/modules/mono/mono_gd/gd_mono.cpp +++ b/modules/mono/mono_gd/gd_mono.cpp @@ -422,10 +422,10 @@ void GDMono::initialize_load_assemblies() { #if defined(TOOLS_ENABLED) bool tool_assemblies_loaded = _load_tools_assemblies(); CRASH_COND_MSG(!tool_assemblies_loaded, "Mono: Failed to load '" TOOLS_ASM_NAME "' assemblies."); -#endif if (Main::is_project_manager()) return; +#endif // Load the project's main assembly. This doesn't necessarily need to succeed. // The game may not be using .NET at all, or if the project does use .NET and diff --git a/modules/opus/config.py b/modules/opus/config.py index d22f9454ed..9ff7b2dece 100644 --- a/modules/opus/config.py +++ b/modules/opus/config.py @@ -1,5 +1,5 @@ def can_build(env, platform): - return True + return env.module_check_dependencies("opus", ["ogg"]) def configure(env): diff --git a/modules/theora/config.py b/modules/theora/config.py index 413acce2df..b063ed51f9 100644 --- a/modules/theora/config.py +++ b/modules/theora/config.py @@ -1,5 +1,5 @@ def can_build(env, platform): - return True + return env.module_check_dependencies("theora", ["ogg", "vorbis"]) def configure(env): diff --git a/modules/visual_script/visual_script_editor.cpp b/modules/visual_script/visual_script_editor.cpp index fea7d151df..b7ca3c882b 100644 --- a/modules/visual_script/visual_script_editor.cpp +++ b/modules/visual_script/visual_script_editor.cpp @@ -3216,6 +3216,7 @@ void VisualScriptEditor::_move_nodes_with_rescan(const StringName &p_func_from, { List<VisualScript::DataConnection> data_connections; script->get_data_connection_list(p_func_from, &data_connections); + int func_from_node_id = script->get_function_node_id(p_func_from); HashMap<int, Map<int, Pair<int, int>>> connections; @@ -3225,6 +3226,11 @@ void VisualScriptEditor::_move_nodes_with_rescan(const StringName &p_func_from, int out_p = E->get().from_port; int in_p = E->get().to_port; + // skip if the from_node is a function node + if (from == func_from_node_id) { + continue; + } + if (!connections.has(to)) { connections.set(to, Map<int, Pair<int, int>>()); } diff --git a/modules/visual_script/visual_script_property_selector.cpp b/modules/visual_script/visual_script_property_selector.cpp index f14c9ce49d..3c44faab90 100644 --- a/modules/visual_script/visual_script_property_selector.cpp +++ b/modules/visual_script/visual_script_property_selector.cpp @@ -447,7 +447,7 @@ void VisualScriptPropertySelector::_item_selected() { if (E) { for (int i = 0; i < E->get().properties.size(); i++) { if (E->get().properties[i].name == name) { - text = E->get().properties[i].description; + text = DTR(E->get().properties[i].description); } } } @@ -461,7 +461,7 @@ void VisualScriptPropertySelector::_item_selected() { if (C) { for (int i = 0; i < C->get().methods.size(); i++) { if (C->get().methods[i].name == name) { - text = C->get().methods[i].description; + text = DTR(C->get().methods[i].description); } } } @@ -473,7 +473,7 @@ void VisualScriptPropertySelector::_item_selected() { for (int i = 0; i < T->get().methods.size(); i++) { Vector<String> functions = name.rsplit("/", false, 1); if (T->get().methods[i].name == functions[functions.size() - 1]) { - text = T->get().methods[i].description; + text = DTR(T->get().methods[i].description); } } } @@ -492,7 +492,7 @@ void VisualScriptPropertySelector::_item_selected() { if (typecast_node.is_valid()) { Map<String, DocData::ClassDoc>::Element *F = dd->class_list.find(typecast_node->get_class_name()); if (F) { - text = F->get().description; + text = DTR(F->get().description); } } @@ -502,7 +502,7 @@ void VisualScriptPropertySelector::_item_selected() { if (F) { for (int i = 0; i < F->get().constants.size(); i++) { if (F->get().constants[i].value.to_int() == int(builtin_node->get_func())) { - text = F->get().constants[i].description; + text = DTR(F->get().constants[i].description); } } } diff --git a/modules/vorbis/config.py b/modules/vorbis/config.py index d22f9454ed..8a384e3066 100644 --- a/modules/vorbis/config.py +++ b/modules/vorbis/config.py @@ -1,5 +1,5 @@ def can_build(env, platform): - return True + return env.module_check_dependencies("vorbis", ["ogg"]) def configure(env): diff --git a/modules/webm/config.py b/modules/webm/config.py index 93b49d177a..99f8ace114 100644 --- a/modules/webm/config.py +++ b/modules/webm/config.py @@ -1,5 +1,8 @@ def can_build(env, platform): - return platform not in ["iphone"] + if platform in ["iphone"]: + return False + + return env.module_check_dependencies("webm", ["ogg", "opus", "vorbis"]) def configure(env): diff --git a/modules/webrtc/doc_classes/WebRTCPeerConnection.xml b/modules/webrtc/doc_classes/WebRTCPeerConnection.xml index 504b4705d8..2054276655 100644 --- a/modules/webrtc/doc_classes/WebRTCPeerConnection.xml +++ b/modules/webrtc/doc_classes/WebRTCPeerConnection.xml @@ -120,7 +120,7 @@ </argument> <description> Sets the SDP description of the local peer. This should be called in response to [signal session_description_created]. - If [code]type[/code] is [code]answer[/code] the peer will start emitting [signal ice_candidate_created]. + After calling this function the peer will start emitting [signal ice_candidate_created] (unless an [enum Error] different from [constant OK] is returned). </description> </method> <method name="set_remote_description"> |