diff options
Diffstat (limited to 'modules')
126 files changed, 6924 insertions, 3210 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/arkit/SCsub b/modules/arkit/SCsub index 61c0a8248c..7e103d6565 100644 --- a/modules/arkit/SCsub +++ b/modules/arkit/SCsub @@ -5,6 +5,9 @@ Import("env_modules") env_arkit = env_modules.Clone() +# (iOS) Enable module support +env_arkit.Append(CCFLAGS=["-fmodules", "-fcxx-modules"]) + # (iOS) Build as separate static library modules_sources = [] env_arkit.add_source_files(modules_sources, "*.cpp") diff --git a/modules/assimp/editor_scene_importer_assimp.cpp b/modules/assimp/editor_scene_importer_assimp.cpp index 9c90faf66b..aedc4b690a 100644 --- a/modules/assimp/editor_scene_importer_assimp.cpp +++ b/modules/assimp/editor_scene_importer_assimp.cpp @@ -44,7 +44,6 @@ #include <assimp/scene.h> #include <assimp/Importer.hpp> #include <assimp/LogStream.hpp> -#include <string> // move into assimp aiBone *get_bone_by_name(const aiScene *scene, aiString bone_name) { @@ -102,8 +101,6 @@ void EditorSceneImporterAssimp::_bind_methods() { Node *EditorSceneImporterAssimp::import_scene(const String &p_path, uint32_t p_flags, int p_bake_fps, List<String> *r_missing_deps, Error *r_err) { Assimp::Importer importer; - std::wstring w_path = ProjectSettings::get_singleton()->globalize_path(p_path).c_str(); - std::string s_path(w_path.begin(), w_path.end()); importer.SetPropertyBool(AI_CONFIG_PP_FD_REMOVE, true); // Cannot remove pivot points because the static mesh will be in the wrong place importer.SetPropertyBool(AI_CONFIG_IMPORT_FBX_PRESERVE_PIVOTS, false); @@ -145,7 +142,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())); @@ -298,6 +296,7 @@ EditorSceneImporterAssimp::_generate_scene(const String &p_path, aiScene *scene, state.assimp_scene = scene; state.max_bone_weights = p_max_bone_weights; state.animation_player = nullptr; + state.import_flags = p_flags; // populate light map for (unsigned int l = 0; l < scene->mNumLights; l++) { @@ -829,6 +828,8 @@ EditorSceneImporterAssimp::_generate_mesh_from_surface_indices(ImportState &stat Ref<ArrayMesh> mesh; mesh.instance(); bool has_uvs = false; + bool compress_vert_data = state.import_flags & IMPORT_USE_COMPRESSION; + uint32_t mesh_flags = compress_vert_data ? Mesh::ARRAY_COMPRESS_DEFAULT : 0; Map<String, uint32_t> morph_mesh_string_lookup; @@ -1266,7 +1267,7 @@ EditorSceneImporterAssimp::_generate_mesh_from_surface_indices(ImportState &stat morphs[j] = array_copy; } - mesh->add_surface_from_arrays(primitive, array_mesh, morphs); + mesh->add_surface_from_arrays(primitive, array_mesh, morphs, Dictionary(), mesh_flags); mesh->surface_set_material(i, mat); mesh->surface_set_name(i, AssimpUtils::get_assimp_string(ai_mesh->mName)); } diff --git a/modules/assimp/import_state.h b/modules/assimp/import_state.h index 4a3bd17acb..ee22800ac4 100644 --- a/modules/assimp/import_state.h +++ b/modules/assimp/import_state.h @@ -87,6 +87,9 @@ struct ImportState { // this means we can detect // what bones are for other armatures List<aiBone *> bone_stack; + + // EditorSceneImporter::ImportFlags + uint32_t import_flags; }; struct AssimpImageData { diff --git a/modules/bullet/SCsub b/modules/bullet/SCsub index b853ebfc63..21bdcca18e 100644 --- a/modules/bullet/SCsub +++ b/modules/bullet/SCsub @@ -201,8 +201,8 @@ if env["builtin_bullet"]: env_bullet.Append(CPPFLAGS=["-isystem", Dir(thirdparty_dir).path]) else: env_bullet.Prepend(CPPPATH=[thirdparty_dir]) - # if env['target'] == "debug" or env['target'] == "release_debug": - # env_bullet.Append(CPPDEFINES=['BT_DEBUG']) + if env["target"] == "debug" or env["target"] == "release_debug": + env_bullet.Append(CPPDEFINES=["DEBUG"]) env_bullet.Append(CPPDEFINES=["BT_USE_OLD_DAMPING_METHOD"]) 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/rigid_body_bullet.cpp b/modules/bullet/rigid_body_bullet.cpp index 2fca7fe633..9aac7ba9e4 100644 --- a/modules/bullet/rigid_body_bullet.cpp +++ b/modules/bullet/rigid_body_bullet.cpp @@ -445,11 +445,6 @@ void RigidBodyBullet::assert_no_constraints() { if (btBody->getNumConstraintRefs()) { WARN_PRINT("A body with a joints is destroyed. Please check the implementation in order to destroy the joint before the body."); } - /*for(int i = btBody->getNumConstraintRefs()-1; 0<=i; --i){ - btTypedConstraint* btConst = btBody->getConstraintRef(i); - JointBullet* joint = static_cast<JointBullet*>( btConst->getUserConstraintPtr() ); - space->removeConstraint(joint); - }*/ } void RigidBodyBullet::set_activation_state(bool p_active) { 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/bullet/space_bullet.cpp b/modules/bullet/space_bullet.cpp index 99f58e7059..cfe8cd5322 100644 --- a/modules/bullet/space_bullet.cpp +++ b/modules/bullet/space_bullet.cpp @@ -123,6 +123,7 @@ int BulletPhysicsDirectSpaceState::intersect_shape(const RID &p_shape, const Tra } ShapeBullet *shape = space->get_physics_server()->get_shape_owner()->getornull(p_shape); + ERR_FAIL_COND_V(!shape, 0); btCollisionShape *btShape = shape->create_bt_shape(p_xform.basis.get_scale_abs(), p_margin); if (!btShape->isConvex()) { @@ -152,7 +153,17 @@ int BulletPhysicsDirectSpaceState::intersect_shape(const RID &p_shape, const Tra } bool BulletPhysicsDirectSpaceState::cast_motion(const RID &p_shape, const Transform &p_xform, const Vector3 &p_motion, float p_margin, float &r_closest_safe, float &r_closest_unsafe, const Set<RID> &p_exclude, uint32_t p_collision_mask, bool p_collide_with_bodies, bool p_collide_with_areas, ShapeRestInfo *r_info) { + r_closest_safe = 0.0f; + r_closest_unsafe = 0.0f; + btVector3 bt_motion; + G_TO_B(p_motion, bt_motion); + + if (bt_motion.fuzzyZero()) { + return false; + } + ShapeBullet *shape = space->get_physics_server()->get_shape_owner()->getornull(p_shape); + ERR_FAIL_COND_V(!shape, false); btCollisionShape *btShape = shape->create_bt_shape(p_xform.basis.get_scale(), p_margin); if (!btShape->isConvex()) { @@ -162,9 +173,6 @@ bool BulletPhysicsDirectSpaceState::cast_motion(const RID &p_shape, const Transf } btConvexShape *bt_convex_shape = static_cast<btConvexShape *>(btShape); - btVector3 bt_motion; - G_TO_B(p_motion, bt_motion); - btTransform bt_xform_from; G_TO_B(p_xform, bt_xform_from); UNSCALE_BT_BASIS(bt_xform_from); @@ -178,9 +186,6 @@ bool BulletPhysicsDirectSpaceState::cast_motion(const RID &p_shape, const Transf space->dynamicsWorld->convexSweepTest(bt_convex_shape, bt_xform_from, bt_xform_to, btResult, space->dynamicsWorld->getDispatchInfo().m_allowedCcdPenetration); - r_closest_unsafe = 1.0; - r_closest_safe = 1.0; - if (btResult.hasHit()) { const btScalar l = bt_motion.length(); r_closest_unsafe = btResult.m_closestHitFraction; @@ -196,6 +201,9 @@ bool BulletPhysicsDirectSpaceState::cast_motion(const RID &p_shape, const Transf r_info->collider_id = collision_object->get_instance_id(); r_info->shape = btResult.m_shapeId; } + } else { + r_closest_safe = 1.0f; + r_closest_unsafe = 1.0f; } bulletdelete(bt_convex_shape); @@ -209,6 +217,7 @@ bool BulletPhysicsDirectSpaceState::collide_shape(RID p_shape, const Transform & } ShapeBullet *shape = space->get_physics_server()->get_shape_owner()->getornull(p_shape); + ERR_FAIL_COND_V(!shape, false); btCollisionShape *btShape = shape->create_bt_shape(p_shape_xform.basis.get_scale_abs(), p_margin); if (!btShape->isConvex()) { @@ -240,6 +249,7 @@ bool BulletPhysicsDirectSpaceState::collide_shape(RID p_shape, const Transform & bool BulletPhysicsDirectSpaceState::rest_info(RID p_shape, const Transform &p_shape_xform, float p_margin, ShapeRestInfo *r_info, const Set<RID> &p_exclude, uint32_t p_collision_mask, bool p_collide_with_bodies, bool p_collide_with_areas) { ShapeBullet *shape = space->get_physics_server()->get_shape_owner()->getornull(p_shape); + ERR_FAIL_COND_V(!shape, false); btCollisionShape *btShape = shape->create_bt_shape(p_shape_xform.basis.get_scale_abs(), p_margin); if (!btShape->isConvex()) { diff --git a/modules/camera/SCsub b/modules/camera/SCsub index 63c4e9fbab..631a65bde2 100644 --- a/modules/camera/SCsub +++ b/modules/camera/SCsub @@ -6,6 +6,9 @@ Import("env_modules") env_camera = env_modules.Clone() if env["platform"] == "iphone": + # (iOS) Enable module support + env_camera.Append(CCFLAGS=["-fmodules", "-fcxx-modules"]) + # (iOS) Build as separate static library modules_sources = [] env_camera.add_source_files(modules_sources, "register_types.cpp") diff --git a/modules/camera/camera_win.cpp b/modules/camera/camera_win.cpp index 875f0b26bc..1646644be3 100644 --- a/modules/camera/camera_win.cpp +++ b/modules/camera/camera_win.cpp @@ -53,9 +53,9 @@ public: void deactivate_feed(); }; -CameraFeedWindows::CameraFeedWindows(){ +CameraFeedWindows::CameraFeedWindows() { ///@TODO implement this, should store information about our available camera -}; +} CameraFeedWindows::~CameraFeedWindows() { // make sure we stop recording if we are! @@ -75,16 +75,16 @@ bool CameraFeedWindows::activate_feed() { ///@TODO we should probably have a callback method here that is being called by the // camera API which provides frames and call back into the CameraServer to update our texture -void CameraFeedWindows::deactivate_feed(){ +void CameraFeedWindows::deactivate_feed() { ///@TODO this should deactivate our camera and stop the process of capturing frames -}; +} ////////////////////////////////////////////////////////////////////////// // CameraWindows - Subclass for our camera server on windows -void CameraWindows::add_active_cameras(){ +void CameraWindows::add_active_cameras() { ///@TODO scan through any active cameras and create CameraFeedWindows objects for them -}; +} CameraWindows::CameraWindows() { // Find cameras active right now @@ -92,7 +92,3 @@ CameraWindows::CameraWindows() { // need to add something that will react to devices being connected/removed... }; - -CameraWindows::~CameraWindows(){ - -}; diff --git a/modules/camera/camera_win.h b/modules/camera/camera_win.h index 39a1b0b86f..bbc8880c12 100644 --- a/modules/camera/camera_win.h +++ b/modules/camera/camera_win.h @@ -40,7 +40,7 @@ private: public: CameraWindows(); - ~CameraWindows(); + ~CameraWindows() {} }; #endif /* CAMERAWIN_H */ diff --git a/modules/csg/csg.cpp b/modules/csg/csg.cpp index df798623f9..6c0a3a4ca3 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" @@ -523,7 +523,7 @@ void CSGBrushOperation::MeshMerge::_add_distance(List<real_t> &r_intersectionsA, // Check if distance exists. for (const List<real_t>::Element *E = intersections.front(); E; E = E->next()) { - if (Math::abs(**E - p_distance) < vertex_snap) { + if (Math::is_equal_approx(**E, p_distance)) { return; } } @@ -904,8 +904,12 @@ void CSGBrushOperation::Build2DFaces::_merge_faces(const Vector<int> &p_segment_ vertices[p_segment_indices[closest_idx]].point }; if (are_segements_parallel(edge1, edge2, vertex_snap2)) { - degenerate_points.push_back(outer_edge_idx[0]); - degenerate_points.push_back(outer_edge_idx[1]); + if (!degenerate_points.find(outer_edge_idx[0])) { + degenerate_points.push_back(outer_edge_idx[0]); + } + if (!degenerate_points.find(outer_edge_idx[1])) { + degenerate_points.push_back(outer_edge_idx[1]); + } continue; } @@ -964,7 +968,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 +1032,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 +1040,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) { @@ -1064,17 +1068,8 @@ void CSGBrushOperation::Build2DFaces::_find_edge_intersections(const Vector2 p_s break; } - // Don't create degenerate triangles. - Vector2 split_edge1[2] = { vertices[new_vertex_idx].point, edge_points[0] }; - Vector2 split_edge2[2] = { vertices[new_vertex_idx].point, edge_points[1] }; - Vector2 new_edge[2] = { vertices[new_vertex_idx].point, vertices[opposite_vertex_idx].point }; - if (are_segements_parallel(split_edge1, new_edge, vertex_snap2) && - are_segements_parallel(split_edge2, new_edge, vertex_snap2)) { - break; - } - // 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 +1136,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 +1187,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/dds/texture_loader_dds.cpp b/modules/dds/texture_loader_dds.cpp index ba425371a8..2f4f7d7a4c 100644 --- a/modules/dds/texture_loader_dds.cpp +++ b/modules/dds/texture_loader_dds.cpp @@ -29,14 +29,15 @@ /*************************************************************************/ #include "texture_loader_dds.h" + #include "core/os/file_access.h" #define PF_FOURCC(s) ((uint32_t)(((s)[3] << 24U) | ((s)[2] << 16U) | ((s)[1] << 8U) | ((s)[0]))) +// Reference: https://docs.microsoft.com/en-us/windows/win32/direct3ddds/dds-header + enum { DDS_MAGIC = 0x20534444, - DDSD_CAPS = 0x00000001, - DDSD_PIXELFORMAT = 0x00001000, DDSD_PITCH = 0x00000008, DDSD_LINEARSIZE = 0x00080000, DDSD_MIPMAPCOUNT = 0x00020000, @@ -47,7 +48,6 @@ enum { }; enum DDSFormat { - DDS_DXT1, DDS_DXT3, DDS_DXT5, @@ -128,7 +128,9 @@ RES ResourceFormatDDS::load(const String &p_path, const String &p_original_path, //validate - if (magic != DDS_MAGIC || hsize != 124 || !(flags & DDSD_PIXELFORMAT) || !(flags & DDSD_CAPS)) { + // We don't check DDSD_CAPS or DDSD_PIXELFORMAT, as they're mandatory when writing, + // but non-mandatory when reading (as some writers don't set them)... + if (magic != DDS_MAGIC || hsize != 124) { ERR_FAIL_V_MSG(RES(), "Invalid or unsupported DDS texture file '" + p_path + "'."); } 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/config.py b/modules/gdnative/config.py index 4b997e4bfe..7603e7d69d 100644 --- a/modules/gdnative/config.py +++ b/modules/gdnative/config.py @@ -8,7 +8,6 @@ def configure(env): def get_doc_classes(): return [ - "@NativeScript", "XRInterfaceGDNative", "GDNative", "GDNativeLibrary", diff --git a/modules/gdnative/doc_classes/@NativeScript.xml b/modules/gdnative/doc_classes/@NativeScript.xml deleted file mode 100644 index 809b225e21..0000000000 --- a/modules/gdnative/doc_classes/@NativeScript.xml +++ /dev/null @@ -1,13 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" ?> -<class name="@NativeScript" version="4.0"> - <brief_description> - </brief_description> - <description> - </description> - <tutorials> - </tutorials> - <methods> - </methods> - <constants> - </constants> -</class> diff --git a/modules/gdnative/gdnative/array.cpp b/modules/gdnative/gdnative/array.cpp index fb23863dc9..59953f5182 100644 --- a/modules/gdnative/gdnative/array.cpp +++ b/modules/gdnative/gdnative/array.cpp @@ -102,9 +102,9 @@ void GDAPI godot_array_new_packed_string_array(godot_array *r_dest, const godot_ } } -void GDAPI godot_array_new_packed_real_array(godot_array *r_dest, const godot_packed_real_array *p_pra) { +void GDAPI godot_array_new_packed_float32_array(godot_array *r_dest, const godot_packed_float32_array *p_pra) { Array *dest = (Array *)r_dest; - Vector<godot_real> *pca = (Vector<godot_real> *)p_pra; + Vector<float> *pca = (Vector<float> *)p_pra; memnew_placement(dest, Array); dest->resize(pca->size()); @@ -114,9 +114,33 @@ void GDAPI godot_array_new_packed_real_array(godot_array *r_dest, const godot_pa } } -void GDAPI godot_array_new_packed_int_array(godot_array *r_dest, const godot_packed_int_array *p_pia) { +void GDAPI godot_array_new_packed_float64_array(godot_array *r_dest, const godot_packed_float64_array *p_pra) { Array *dest = (Array *)r_dest; - Vector<godot_int> *pca = (Vector<godot_int> *)p_pia; + Vector<double> *pca = (Vector<double> *)p_pra; + memnew_placement(dest, Array); + dest->resize(pca->size()); + + for (int i = 0; i < dest->size(); i++) { + Variant v = pca->operator[](i); + dest->operator[](i) = v; + } +} + +void GDAPI godot_array_new_packed_int32_array(godot_array *r_dest, const godot_packed_int32_array *p_pia) { + Array *dest = (Array *)r_dest; + Vector<int32_t> *pca = (Vector<int32_t> *)p_pia; + memnew_placement(dest, Array); + dest->resize(pca->size()); + + for (int i = 0; i < dest->size(); i++) { + Variant v = pca->operator[](i); + dest->operator[](i) = v; + } +} + +void GDAPI godot_array_new_packed_int64_array(godot_array *r_dest, const godot_packed_int64_array *p_pia) { + Array *dest = (Array *)r_dest; + Vector<int64_t> *pca = (Vector<int64_t> *)p_pia; memnew_placement(dest, Array); dest->resize(pca->size()); diff --git a/modules/gdnative/gdnative/callable.cpp b/modules/gdnative/gdnative/callable.cpp new file mode 100644 index 0000000000..868b324227 --- /dev/null +++ b/modules/gdnative/gdnative/callable.cpp @@ -0,0 +1,252 @@ +/*************************************************************************/ +/* callable.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* https://godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/*************************************************************************/ + +#include "gdnative/callable.h" + +#include "core/callable.h" +#include "core/resource.h" +#include "core/variant.h" + +#ifdef __cplusplus +extern "C" { +#endif + +static_assert(sizeof(godot_callable) == sizeof(Callable), "Callable size mismatch"); +static_assert(sizeof(godot_signal) == sizeof(Signal), "Signal size mismatch"); + +// Callable + +void GDAPI godot_callable_new_with_object(godot_callable *r_dest, const godot_object *p_object, const godot_string_name *p_method) { + Callable *dest = (Callable *)r_dest; + const Object *object = (const Object *)p_object; + const StringName *method = (const StringName *)p_method; + memnew_placement(dest, Callable(object, *method)); +} + +void GDAPI godot_callable_new_with_object_id(godot_callable *r_dest, uint64_t p_objectid, const godot_string_name *p_method) { + Callable *dest = (Callable *)r_dest; + const StringName *method = (const StringName *)p_method; + memnew_placement(dest, Callable(ObjectID(p_objectid), *method)); +} + +void GDAPI godot_callable_new_copy(godot_callable *r_dest, const godot_callable *p_src) { + Callable *dest = (Callable *)r_dest; + const Callable *src = (const Callable *)p_src; + memnew_placement(dest, Callable(*src)); +} + +void GDAPI godot_callable_destroy(godot_callable *p_self) { + Callable *self = (Callable *)p_self; + self->~Callable(); +} + +godot_int GDAPI godot_callable_call(const godot_callable *p_self, const godot_variant **p_arguments, godot_int p_argcount, godot_variant *r_return_value) { + const Callable *self = (const Callable *)p_self; + const Variant **arguments = (const Variant **)p_arguments; + Variant *return_value = (Variant *)r_return_value; + Variant ret; + Callable::CallError err; + self->call(arguments, p_argcount, ret, err); + if (return_value) + (*return_value) = ret; + return (godot_int)err.error; +} + +void GDAPI godot_callable_call_deferred(const godot_callable *p_self, const godot_variant **p_arguments, godot_int p_argcount) { + const Callable *self = (const Callable *)p_self; + const Variant **arguments = (const Variant **)p_arguments; + self->call_deferred(arguments, p_argcount); +} + +godot_bool GDAPI godot_callable_is_null(const godot_callable *p_self) { + const Callable *self = (const Callable *)p_self; + return self->is_null(); +} + +godot_bool GDAPI godot_callable_is_custom(const godot_callable *p_self) { + const Callable *self = (const Callable *)p_self; + return self->is_custom(); +} + +godot_bool GDAPI godot_callable_is_standard(const godot_callable *p_self) { + const Callable *self = (const Callable *)p_self; + return self->is_standard(); +} + +godot_object GDAPI *godot_callable_get_object(const godot_callable *p_self) { + const Callable *self = (const Callable *)p_self; + return (godot_object *)self->get_object(); +} + +uint64_t GDAPI godot_callable_get_object_id(const godot_callable *p_self) { + const Callable *self = (const Callable *)p_self; + return (uint64_t)self->get_object_id(); +} + +godot_string_name GDAPI godot_callable_get_method(const godot_callable *p_self) { + godot_string_name raw_dest; + const Callable *self = (const Callable *)p_self; + StringName *dest = (StringName *)&raw_dest; + memnew_placement(dest, StringName(self->get_method())); + return raw_dest; +} + +uint32_t GDAPI godot_callable_hash(const godot_callable *p_self) { + const Callable *self = (const Callable *)p_self; + return self->hash(); +} + +godot_string GDAPI godot_callable_as_string(const godot_callable *p_self) { + godot_string ret; + const Callable *self = (const Callable *)p_self; + memnew_placement(&ret, String(*self)); + return ret; +} + +godot_bool GDAPI godot_callable_operator_equal(const godot_callable *p_self, const godot_callable *p_other) { + const Callable *self = (const Callable *)p_self; + const Callable *other = (const Callable *)p_other; + return *self == *other; +} + +godot_bool GDAPI godot_callable_operator_less(const godot_callable *p_self, const godot_callable *p_other) { + const Callable *self = (const Callable *)p_self; + const Callable *other = (const Callable *)p_other; + return *self < *other; +} + +// Signal + +void GDAPI godot_signal_new_with_object(godot_signal *r_dest, const godot_object *p_object, const godot_string_name *p_name) { + Signal *dest = (Signal *)r_dest; + const Object *object = (const Object *)p_object; + const StringName *name = (const StringName *)p_name; + memnew_placement(dest, Signal(object, *name)); +} + +void GDAPI godot_signal_new_with_object_id(godot_signal *r_dest, uint64_t p_objectid, const godot_string_name *p_name) { + Signal *dest = (Signal *)r_dest; + const StringName *name = (const StringName *)p_name; + memnew_placement(dest, Signal(ObjectID(p_objectid), *name)); +} + +void GDAPI godot_signal_new_copy(godot_signal *r_dest, const godot_signal *p_src) { + Signal *dest = (Signal *)r_dest; + const Signal *src = (const Signal *)p_src; + memnew_placement(dest, Signal(*src)); +} + +void GDAPI godot_signal_destroy(godot_signal *p_self) { + Signal *self = (Signal *)p_self; + self->~Signal(); +} + +godot_int GDAPI godot_signal_emit(const godot_signal *p_self, const godot_variant **p_arguments, godot_int p_argcount) { + const Signal *self = (const Signal *)p_self; + const Variant **arguments = (const Variant **)p_arguments; + return (godot_int)self->emit(arguments, p_argcount); +} + +godot_int GDAPI godot_signal_connect(godot_signal *p_self, const godot_callable *p_callable, const godot_array *p_binds, uint32_t p_flags) { + Signal *self = (Signal *)p_self; + const Callable *callable = (const Callable *)p_callable; + const Array *binds_ar = (const Array *)p_binds; + Vector<Variant> binds; + for (int i = 0; i < binds_ar->size(); i++) { + binds.push_back(binds_ar->get(i)); + } + return (godot_int)self->connect(*callable, binds, p_flags); +} + +void GDAPI godot_signal_disconnect(godot_signal *p_self, const godot_callable *p_callable) { + Signal *self = (Signal *)p_self; + const Callable *callable = (const Callable *)p_callable; + self->disconnect(*callable); +} + +godot_bool GDAPI godot_signal_is_null(const godot_signal *p_self) { + const Signal *self = (const Signal *)p_self; + return self->is_null(); +} + +godot_bool GDAPI godot_signal_is_connected(const godot_signal *p_self, const godot_callable *p_callable) { + const Signal *self = (const Signal *)p_self; + const Callable *callable = (const Callable *)p_callable; + return self->is_connected(*callable); +} + +godot_array GDAPI godot_signal_get_connections(const godot_signal *p_self) { + godot_array raw_dest; + const Signal *self = (const Signal *)p_self; + Array *dest = (Array *)&raw_dest; + memnew_placement(dest, Array(self->get_connections())); + return raw_dest; +} + +godot_object GDAPI *godot_signal_get_object(const godot_signal *p_self) { + const Signal *self = (const Signal *)p_self; + return (godot_object *)self->get_object(); +} + +uint64_t GDAPI godot_signal_get_object_id(const godot_signal *p_self) { + const Signal *self = (const Signal *)p_self; + return (uint64_t)self->get_object_id(); +} + +godot_string_name GDAPI godot_signal_get_name(const godot_signal *p_self) { + godot_string_name raw_dest; + const Signal *self = (const Signal *)p_self; + StringName *dest = (StringName *)&raw_dest; + memnew_placement(dest, StringName(self->get_name())); + return raw_dest; +} + +godot_string GDAPI godot_signal_as_string(const godot_signal *p_self) { + godot_string ret; + const Signal *self = (const Signal *)p_self; + memnew_placement(&ret, String(*self)); + return ret; +} + +godot_bool GDAPI godot_signal_operator_equal(const godot_signal *p_self, const godot_signal *p_other) { + const Signal *self = (const Signal *)p_self; + const Signal *other = (const Signal *)p_other; + return *self == *other; +} + +godot_bool GDAPI godot_signal_operator_less(const godot_signal *p_self, const godot_signal *p_other) { + const Signal *self = (const Signal *)p_self; + const Signal *other = (const Signal *)p_other; + return *self < *other; +} + +#ifdef __cplusplus +} +#endif diff --git a/modules/gdnative/gdnative/gdnative.cpp b/modules/gdnative/gdnative/gdnative.cpp index 6b2b5b80a4..e94190b07b 100644 --- a/modules/gdnative/gdnative/gdnative.cpp +++ b/modules/gdnative/gdnative/gdnative.cpp @@ -165,7 +165,7 @@ void _gdnative_report_loading_error(const godot_object *p_library, const char *p _err_print_error("gdnative_init", library->get_current_library_path().utf8().ptr(), 0, message.utf8().ptr()); } -godot_object GDAPI *godot_instance_from_id(godot_int p_instance_id) { +godot_object GDAPI *godot_instance_from_id(uint64_t p_instance_id) { return (godot_object *)ObjectDB::get_instance(ObjectID(p_instance_id)); } @@ -184,6 +184,11 @@ godot_object *godot_object_cast_to(const godot_object *p_object, void *p_class_t return o->is_class_ptr(p_class_tag) ? (godot_object *)o : nullptr; } +uint64_t GDAPI godot_object_get_instance_id(const godot_object *p_object) { + const Object *o = (const Object *)p_object; + return (uint64_t)o->get_instance_id(); +} + #ifdef __cplusplus } #endif diff --git a/modules/gdnative/gdnative/pool_arrays.cpp b/modules/gdnative/gdnative/packed_arrays.cpp index 652f59cd07..fc71d50289 100644 --- a/modules/gdnative/gdnative/pool_arrays.cpp +++ b/modules/gdnative/gdnative/packed_arrays.cpp @@ -1,5 +1,5 @@ /*************************************************************************/ -/* pool_arrays.cpp */ +/* packed_arrays.cpp */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ @@ -28,7 +28,7 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -#include "gdnative/pool_arrays.h" +#include "gdnative/packed_arrays.h" #include "core/array.h" @@ -43,8 +43,10 @@ extern "C" { #endif static_assert(sizeof(godot_packed_byte_array) == sizeof(Vector<uint8_t>), "Vector<uint8_t> size mismatch"); -static_assert(sizeof(godot_packed_int_array) == sizeof(Vector<godot_int>), "Vector<godot_int> size mismatch"); -static_assert(sizeof(godot_packed_real_array) == sizeof(Vector<godot_real>), "Vector<godot_real> size mismatch"); +static_assert(sizeof(godot_packed_int32_array) == sizeof(Vector<int32_t>), "Vector<int32_t> size mismatch"); +static_assert(sizeof(godot_packed_int64_array) == sizeof(Vector<int64_t>), "Vector<int64_t> size mismatch"); +static_assert(sizeof(godot_packed_float32_array) == sizeof(Vector<float>), "Vector<float> size mismatch"); +static_assert(sizeof(godot_packed_float64_array) == sizeof(Vector<double>), "Vector<double> size mismatch"); static_assert(sizeof(godot_packed_string_array) == sizeof(Vector<String>), "Vector<String> size mismatch"); static_assert(sizeof(godot_packed_vector2_array) == sizeof(Vector<Vector2>), "Vector<Vector2> size mismatch"); static_assert(sizeof(godot_packed_vector3_array) == sizeof(Vector<Vector3>), "Vector<Vector3> size mismatch"); @@ -76,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); @@ -136,23 +148,211 @@ void GDAPI godot_packed_byte_array_destroy(godot_packed_byte_array *p_self) { ((Vector<uint8_t> *)p_self)->~Vector(); } -// int +// int32 + +void GDAPI godot_packed_int32_array_new(godot_packed_int32_array *r_dest) { + Vector<int32_t> *dest = (Vector<int32_t> *)r_dest; + memnew_placement(dest, Vector<int32_t>); +} + +void GDAPI godot_packed_int32_array_new_copy(godot_packed_int32_array *r_dest, const godot_packed_int32_array *p_src) { + Vector<int32_t> *dest = (Vector<int32_t> *)r_dest; + const Vector<int32_t> *src = (const Vector<int32_t> *)p_src; + memnew_placement(dest, Vector<int32_t>(*src)); +} + +void GDAPI godot_packed_int32_array_new_with_array(godot_packed_int32_array *r_dest, const godot_array *p_a) { + Vector<int32_t> *dest = (Vector<int32_t> *)r_dest; + Array *a = (Array *)p_a; + memnew_placement(dest, Vector<int32_t>); + + dest->resize(a->size()); + for (int i = 0; i < a->size(); i++) { + dest->set(i, (*a)[i]); + } +} + +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); +} + +void GDAPI godot_packed_int32_array_append_array(godot_packed_int32_array *p_self, const godot_packed_int32_array *p_array) { + Vector<int32_t> *self = (Vector<int32_t> *)p_self; + Vector<int32_t> *array = (Vector<int32_t> *)p_array; + self->append_array(*array); +} + +godot_error GDAPI godot_packed_int32_array_insert(godot_packed_int32_array *p_self, const godot_int p_idx, const int32_t p_data) { + Vector<int32_t> *self = (Vector<int32_t> *)p_self; + return (godot_error)self->insert(p_idx, p_data); +} + +void GDAPI godot_packed_int32_array_invert(godot_packed_int32_array *p_self) { + Vector<int32_t> *self = (Vector<int32_t> *)p_self; + self->invert(); +} + +void GDAPI godot_packed_int32_array_push_back(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); +} + +void GDAPI godot_packed_int32_array_remove(godot_packed_int32_array *p_self, const godot_int p_idx) { + Vector<int32_t> *self = (Vector<int32_t> *)p_self; + self->remove(p_idx); +} + +void GDAPI godot_packed_int32_array_resize(godot_packed_int32_array *p_self, const godot_int p_size) { + Vector<int32_t> *self = (Vector<int32_t> *)p_self; + self->resize(p_size); +} + +void GDAPI godot_packed_int32_array_set(godot_packed_int32_array *p_self, const godot_int p_idx, const int32_t p_data) { + Vector<int32_t> *self = (Vector<int32_t> *)p_self; + self->set(p_idx, p_data); +} + +int32_t GDAPI godot_packed_int32_array_get(const godot_packed_int32_array *p_self, const godot_int p_idx) { + const Vector<int32_t> *self = (const Vector<int32_t> *)p_self; + return self->get(p_idx); +} + +godot_int GDAPI godot_packed_int32_array_size(const godot_packed_int32_array *p_self) { + const Vector<int32_t> *self = (const Vector<int32_t> *)p_self; + return self->size(); +} + +godot_bool GDAPI godot_packed_int32_array_empty(const godot_packed_int32_array *p_self) { + const Vector<int32_t> *self = (const Vector<int32_t> *)p_self; + return self->empty(); +} + +void GDAPI godot_packed_int32_array_destroy(godot_packed_int32_array *p_self) { + ((Vector<int32_t> *)p_self)->~Vector(); +} + +// int64 + +void GDAPI godot_packed_int64_array_new(godot_packed_int64_array *r_dest) { + Vector<int64_t> *dest = (Vector<int64_t> *)r_dest; + memnew_placement(dest, Vector<int64_t>); +} + +void GDAPI godot_packed_int64_array_new_copy(godot_packed_int64_array *r_dest, const godot_packed_int64_array *p_src) { + Vector<int64_t> *dest = (Vector<int64_t> *)r_dest; + const Vector<int64_t> *src = (const Vector<int64_t> *)p_src; + memnew_placement(dest, Vector<int64_t>(*src)); +} + +void GDAPI godot_packed_int64_array_new_with_array(godot_packed_int64_array *r_dest, const godot_array *p_a) { + Vector<int64_t> *dest = (Vector<int64_t> *)r_dest; + Array *a = (Array *)p_a; + memnew_placement(dest, Vector<int64_t>); + + dest->resize(a->size()); + for (int i = 0; i < a->size(); i++) { + dest->set(i, (*a)[i]); + } +} + +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); +} + +void GDAPI godot_packed_int64_array_append_array(godot_packed_int64_array *p_self, const godot_packed_int64_array *p_array) { + Vector<int64_t> *self = (Vector<int64_t> *)p_self; + Vector<int64_t> *array = (Vector<int64_t> *)p_array; + self->append_array(*array); +} + +godot_error GDAPI godot_packed_int64_array_insert(godot_packed_int64_array *p_self, const godot_int p_idx, const int64_t p_data) { + Vector<int64_t> *self = (Vector<int64_t> *)p_self; + return (godot_error)self->insert(p_idx, p_data); +} + +void GDAPI godot_packed_int64_array_invert(godot_packed_int64_array *p_self) { + Vector<int64_t> *self = (Vector<int64_t> *)p_self; + self->invert(); +} + +void GDAPI godot_packed_int64_array_push_back(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); +} -void GDAPI godot_packed_int_array_new(godot_packed_int_array *r_dest) { - Vector<godot_int> *dest = (Vector<godot_int> *)r_dest; - memnew_placement(dest, Vector<godot_int>); +void GDAPI godot_packed_int64_array_remove(godot_packed_int64_array *p_self, const godot_int p_idx) { + Vector<int64_t> *self = (Vector<int64_t> *)p_self; + self->remove(p_idx); +} + +void GDAPI godot_packed_int64_array_resize(godot_packed_int64_array *p_self, const godot_int p_size) { + Vector<int64_t> *self = (Vector<int64_t> *)p_self; + self->resize(p_size); +} + +void GDAPI godot_packed_int64_array_set(godot_packed_int64_array *p_self, const godot_int p_idx, const int64_t p_data) { + Vector<int64_t> *self = (Vector<int64_t> *)p_self; + self->set(p_idx, p_data); +} + +int64_t GDAPI godot_packed_int64_array_get(const godot_packed_int64_array *p_self, const godot_int p_idx) { + const Vector<int64_t> *self = (const Vector<int64_t> *)p_self; + return self->get(p_idx); } -void GDAPI godot_packed_int_array_new_copy(godot_packed_int_array *r_dest, const godot_packed_int_array *p_src) { - Vector<godot_int> *dest = (Vector<godot_int> *)r_dest; - const Vector<godot_int> *src = (const Vector<godot_int> *)p_src; - memnew_placement(dest, Vector<godot_int>(*src)); +godot_int GDAPI godot_packed_int64_array_size(const godot_packed_int64_array *p_self) { + const Vector<int64_t> *self = (const Vector<int64_t> *)p_self; + return self->size(); +} + +godot_bool GDAPI godot_packed_int64_array_empty(const godot_packed_int64_array *p_self) { + const Vector<int64_t> *self = (const Vector<int64_t> *)p_self; + return self->empty(); } -void GDAPI godot_packed_int_array_new_with_array(godot_packed_int_array *r_dest, const godot_array *p_a) { - Vector<godot_int> *dest = (Vector<godot_int> *)r_dest; +void GDAPI godot_packed_int64_array_destroy(godot_packed_int64_array *p_self) { + ((Vector<int64_t> *)p_self)->~Vector(); +} + +// float32 + +void GDAPI godot_packed_float32_array_new(godot_packed_float32_array *r_dest) { + Vector<float> *dest = (Vector<float> *)r_dest; + memnew_placement(dest, Vector<float>); +} + +void GDAPI godot_packed_float32_array_new_copy(godot_packed_float32_array *r_dest, const godot_packed_float32_array *p_src) { + Vector<float> *dest = (Vector<float> *)r_dest; + const Vector<float> *src = (const Vector<float> *)p_src; + memnew_placement(dest, Vector<float>(*src)); +} + +void GDAPI godot_packed_float32_array_new_with_array(godot_packed_float32_array *r_dest, const godot_array *p_a) { + Vector<float> *dest = (Vector<float> *)r_dest; Array *a = (Array *)p_a; - memnew_placement(dest, Vector<godot_int>); + memnew_placement(dest, Vector<float>); dest->resize(a->size()); for (int i = 0; i < a->size(); i++) { @@ -160,83 +360,93 @@ void GDAPI godot_packed_int_array_new_with_array(godot_packed_int_array *r_dest, } } -void GDAPI godot_packed_int_array_append(godot_packed_int_array *p_self, const godot_int p_data) { - Vector<godot_int> *self = (Vector<godot_int> *)p_self; +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); } -void GDAPI godot_packed_int_array_append_array(godot_packed_int_array *p_self, const godot_packed_int_array *p_array) { - Vector<godot_int> *self = (Vector<godot_int> *)p_self; - Vector<godot_int> *array = (Vector<godot_int> *)p_array; +void GDAPI godot_packed_float32_array_append_array(godot_packed_float32_array *p_self, const godot_packed_float32_array *p_array) { + Vector<float> *self = (Vector<float> *)p_self; + Vector<float> *array = (Vector<float> *)p_array; self->append_array(*array); } -godot_error GDAPI godot_packed_int_array_insert(godot_packed_int_array *p_self, const godot_int p_idx, const godot_int p_data) { - Vector<godot_int> *self = (Vector<godot_int> *)p_self; +godot_error GDAPI godot_packed_float32_array_insert(godot_packed_float32_array *p_self, const godot_int p_idx, const float p_data) { + Vector<float> *self = (Vector<float> *)p_self; return (godot_error)self->insert(p_idx, p_data); } -void GDAPI godot_packed_int_array_invert(godot_packed_int_array *p_self) { - Vector<godot_int> *self = (Vector<godot_int> *)p_self; +void GDAPI godot_packed_float32_array_invert(godot_packed_float32_array *p_self) { + Vector<float> *self = (Vector<float> *)p_self; self->invert(); } -void GDAPI godot_packed_int_array_push_back(godot_packed_int_array *p_self, const godot_int p_data) { - Vector<godot_int> *self = (Vector<godot_int> *)p_self; +void GDAPI godot_packed_float32_array_push_back(godot_packed_float32_array *p_self, const float p_data) { + Vector<float> *self = (Vector<float> *)p_self; self->push_back(p_data); } -void GDAPI godot_packed_int_array_remove(godot_packed_int_array *p_self, const godot_int p_idx) { - Vector<godot_int> *self = (Vector<godot_int> *)p_self; +void GDAPI godot_packed_float32_array_remove(godot_packed_float32_array *p_self, const godot_int p_idx) { + Vector<float> *self = (Vector<float> *)p_self; self->remove(p_idx); } -void GDAPI godot_packed_int_array_resize(godot_packed_int_array *p_self, const godot_int p_size) { - Vector<godot_int> *self = (Vector<godot_int> *)p_self; +void GDAPI godot_packed_float32_array_resize(godot_packed_float32_array *p_self, const godot_int p_size) { + Vector<float> *self = (Vector<float> *)p_self; self->resize(p_size); } -void GDAPI godot_packed_int_array_set(godot_packed_int_array *p_self, const godot_int p_idx, const godot_int p_data) { - Vector<godot_int> *self = (Vector<godot_int> *)p_self; +void GDAPI godot_packed_float32_array_set(godot_packed_float32_array *p_self, const godot_int p_idx, const float p_data) { + Vector<float> *self = (Vector<float> *)p_self; self->set(p_idx, p_data); } -godot_int GDAPI godot_packed_int_array_get(const godot_packed_int_array *p_self, const godot_int p_idx) { - const Vector<godot_int> *self = (const Vector<godot_int> *)p_self; +float GDAPI godot_packed_float32_array_get(const godot_packed_float32_array *p_self, const godot_int p_idx) { + const Vector<float> *self = (const Vector<float> *)p_self; return self->get(p_idx); } -godot_int GDAPI godot_packed_int_array_size(const godot_packed_int_array *p_self) { - const Vector<godot_int> *self = (const Vector<godot_int> *)p_self; +godot_int GDAPI godot_packed_float32_array_size(const godot_packed_float32_array *p_self) { + const Vector<float> *self = (const Vector<float> *)p_self; return self->size(); } -godot_bool GDAPI godot_packed_int_array_empty(const godot_packed_int_array *p_self) { - const Vector<godot_int> *self = (const Vector<godot_int> *)p_self; +godot_bool GDAPI godot_packed_float32_array_empty(const godot_packed_float32_array *p_self) { + const Vector<float> *self = (const Vector<float> *)p_self; return self->empty(); } -void GDAPI godot_packed_int_array_destroy(godot_packed_int_array *p_self) { - ((Vector<godot_int> *)p_self)->~Vector(); +void GDAPI godot_packed_float32_array_destroy(godot_packed_float32_array *p_self) { + ((Vector<float> *)p_self)->~Vector(); } -// real +// float64 -void GDAPI godot_packed_real_array_new(godot_packed_real_array *r_dest) { - Vector<godot_real> *dest = (Vector<godot_real> *)r_dest; - memnew_placement(dest, Vector<godot_real>); +void GDAPI godot_packed_float64_array_new(godot_packed_float64_array *r_dest) { + Vector<double> *dest = (Vector<double> *)r_dest; + memnew_placement(dest, Vector<double>); } -void GDAPI godot_packed_real_array_new_copy(godot_packed_real_array *r_dest, const godot_packed_real_array *p_src) { - Vector<godot_real> *dest = (Vector<godot_real> *)r_dest; - const Vector<godot_real> *src = (const Vector<godot_real> *)p_src; - memnew_placement(dest, Vector<godot_real>(*src)); +void GDAPI godot_packed_float64_array_new_copy(godot_packed_float64_array *r_dest, const godot_packed_float64_array *p_src) { + Vector<double> *dest = (Vector<double> *)r_dest; + const Vector<double> *src = (const Vector<double> *)p_src; + memnew_placement(dest, Vector<double>(*src)); } -void GDAPI godot_packed_real_array_new_with_array(godot_packed_real_array *r_dest, const godot_array *p_a) { - Vector<godot_real> *dest = (Vector<godot_real> *)r_dest; +void GDAPI godot_packed_float64_array_new_with_array(godot_packed_float64_array *r_dest, const godot_array *p_a) { + Vector<double> *dest = (Vector<double> *)r_dest; Array *a = (Array *)p_a; - memnew_placement(dest, Vector<godot_real>); + memnew_placement(dest, Vector<double>); dest->resize(a->size()); for (int i = 0; i < a->size(); i++) { @@ -244,64 +454,74 @@ void GDAPI godot_packed_real_array_new_with_array(godot_packed_real_array *r_des } } -void GDAPI godot_packed_real_array_append(godot_packed_real_array *p_self, const godot_real p_data) { - Vector<godot_real> *self = (Vector<godot_real> *)p_self; +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); } -void GDAPI godot_packed_real_array_append_array(godot_packed_real_array *p_self, const godot_packed_real_array *p_array) { - Vector<godot_real> *self = (Vector<godot_real> *)p_self; - Vector<godot_real> *array = (Vector<godot_real> *)p_array; +void GDAPI godot_packed_float64_array_append_array(godot_packed_float64_array *p_self, const godot_packed_float64_array *p_array) { + Vector<double> *self = (Vector<double> *)p_self; + Vector<double> *array = (Vector<double> *)p_array; self->append_array(*array); } -godot_error GDAPI godot_packed_real_array_insert(godot_packed_real_array *p_self, const godot_int p_idx, const godot_real p_data) { - Vector<godot_real> *self = (Vector<godot_real> *)p_self; +godot_error GDAPI godot_packed_float64_array_insert(godot_packed_float64_array *p_self, const godot_int p_idx, const double p_data) { + Vector<double> *self = (Vector<double> *)p_self; return (godot_error)self->insert(p_idx, p_data); } -void GDAPI godot_packed_real_array_invert(godot_packed_real_array *p_self) { - Vector<godot_real> *self = (Vector<godot_real> *)p_self; +void GDAPI godot_packed_float64_array_invert(godot_packed_float64_array *p_self) { + Vector<double> *self = (Vector<double> *)p_self; self->invert(); } -void GDAPI godot_packed_real_array_push_back(godot_packed_real_array *p_self, const godot_real p_data) { - Vector<godot_real> *self = (Vector<godot_real> *)p_self; +void GDAPI godot_packed_float64_array_push_back(godot_packed_float64_array *p_self, const double p_data) { + Vector<double> *self = (Vector<double> *)p_self; self->push_back(p_data); } -void GDAPI godot_packed_real_array_remove(godot_packed_real_array *p_self, const godot_int p_idx) { - Vector<godot_real> *self = (Vector<godot_real> *)p_self; +void GDAPI godot_packed_float64_array_remove(godot_packed_float64_array *p_self, const godot_int p_idx) { + Vector<double> *self = (Vector<double> *)p_self; self->remove(p_idx); } -void GDAPI godot_packed_real_array_resize(godot_packed_real_array *p_self, const godot_int p_size) { - Vector<godot_real> *self = (Vector<godot_real> *)p_self; +void GDAPI godot_packed_float64_array_resize(godot_packed_float64_array *p_self, const godot_int p_size) { + Vector<double> *self = (Vector<double> *)p_self; self->resize(p_size); } -void GDAPI godot_packed_real_array_set(godot_packed_real_array *p_self, const godot_int p_idx, const godot_real p_data) { - Vector<godot_real> *self = (Vector<godot_real> *)p_self; +void GDAPI godot_packed_float64_array_set(godot_packed_float64_array *p_self, const godot_int p_idx, const double p_data) { + Vector<double> *self = (Vector<double> *)p_self; self->set(p_idx, p_data); } -godot_real GDAPI godot_packed_real_array_get(const godot_packed_real_array *p_self, const godot_int p_idx) { - const Vector<godot_real> *self = (const Vector<godot_real> *)p_self; +double GDAPI godot_packed_float64_array_get(const godot_packed_float64_array *p_self, const godot_int p_idx) { + const Vector<double> *self = (const Vector<double> *)p_self; return self->get(p_idx); } -godot_int GDAPI godot_packed_real_array_size(const godot_packed_real_array *p_self) { - const Vector<godot_real> *self = (const Vector<godot_real> *)p_self; +godot_int GDAPI godot_packed_float64_array_size(const godot_packed_float64_array *p_self) { + const Vector<double> *self = (const Vector<double> *)p_self; return self->size(); } -godot_bool GDAPI godot_packed_real_array_empty(const godot_packed_real_array *p_self) { - const Vector<godot_real> *self = (const Vector<godot_real> *)p_self; +godot_bool GDAPI godot_packed_float64_array_empty(const godot_packed_float64_array *p_self) { + const Vector<double> *self = (const Vector<double> *)p_self; return self->empty(); } -void GDAPI godot_packed_real_array_destroy(godot_packed_real_array *p_self) { - ((Vector<godot_real> *)p_self)->~Vector(); +void GDAPI godot_packed_float64_array_destroy(godot_packed_float64_array *p_self) { + ((Vector<double> *)p_self)->~Vector(); } // string @@ -328,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; @@ -420,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; @@ -511,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; @@ -602,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/rect2.cpp b/modules/gdnative/gdnative/rect2.cpp index 63cbbaa3cf..516f4d75ce 100644 --- a/modules/gdnative/gdnative/rect2.cpp +++ b/modules/gdnative/gdnative/rect2.cpp @@ -38,6 +38,9 @@ extern "C" { #endif static_assert(sizeof(godot_rect2) == sizeof(Rect2), "Rect2 size mismatch"); +static_assert(sizeof(godot_rect2i) == sizeof(Rect2i), "Rect2i size mismatch"); + +// Rect2 void GDAPI godot_rect2_new_with_position_and_size(godot_rect2 *r_dest, const godot_vector2 *p_pos, const godot_vector2 *p_size) { const Vector2 *position = (const Vector2 *)p_pos; @@ -58,6 +61,13 @@ godot_string GDAPI godot_rect2_as_string(const godot_rect2 *p_self) { return ret; } +godot_rect2i GDAPI godot_rect2_as_rect2i(const godot_rect2 *p_self) { + godot_rect2i dest; + const Rect2 *self = (const Rect2 *)p_self; + *((Rect2i *)&dest) = Rect2i(*self); + return dest; +} + godot_real GDAPI godot_rect2_get_area(const godot_rect2 *p_self) { const Rect2 *self = (const Rect2 *)p_self; return self->get_area(); @@ -173,6 +183,149 @@ void GDAPI godot_rect2_set_size(godot_rect2 *p_self, const godot_vector2 *p_size self->set_size(*size); } +// Rect2i + +void GDAPI godot_rect2i_new_with_position_and_size(godot_rect2i *r_dest, const godot_vector2i *p_pos, const godot_vector2i *p_size) { + const Vector2i *position = (const Vector2i *)p_pos; + const Vector2i *size = (const Vector2i *)p_size; + Rect2i *dest = (Rect2i *)r_dest; + *dest = Rect2i(*position, *size); +} + +void GDAPI godot_rect2i_new(godot_rect2i *r_dest, const godot_int p_x, const godot_int p_y, const godot_int p_width, const godot_int p_height) { + Rect2i *dest = (Rect2i *)r_dest; + *dest = Rect2i(p_x, p_y, p_width, p_height); +} + +godot_string GDAPI godot_rect2i_as_string(const godot_rect2i *p_self) { + godot_string ret; + const Rect2i *self = (const Rect2i *)p_self; + memnew_placement(&ret, String(*self)); + return ret; +} + +godot_rect2 GDAPI godot_rect2i_as_rect2(const godot_rect2i *p_self) { + godot_rect2 dest; + const Rect2i *self = (const Rect2i *)p_self; + *((Rect2 *)&dest) = Rect2(*self); + return dest; +} + +godot_int GDAPI godot_rect2i_get_area(const godot_rect2i *p_self) { + const Rect2i *self = (const Rect2i *)p_self; + return self->get_area(); +} + +godot_bool GDAPI godot_rect2i_intersects(const godot_rect2i *p_self, const godot_rect2i *p_b) { + const Rect2i *self = (const Rect2i *)p_self; + const Rect2i *b = (const Rect2i *)p_b; + return self->intersects(*b); +} + +godot_bool GDAPI godot_rect2i_encloses(const godot_rect2i *p_self, const godot_rect2i *p_b) { + const Rect2i *self = (const Rect2i *)p_self; + const Rect2i *b = (const Rect2i *)p_b; + return self->encloses(*b); +} + +godot_bool GDAPI godot_rect2i_has_no_area(const godot_rect2i *p_self) { + const Rect2i *self = (const Rect2i *)p_self; + return self->has_no_area(); +} + +godot_rect2i GDAPI godot_rect2i_clip(const godot_rect2i *p_self, const godot_rect2i *p_b) { + godot_rect2i dest; + const Rect2i *self = (const Rect2i *)p_self; + const Rect2i *b = (const Rect2i *)p_b; + *((Rect2i *)&dest) = self->clip(*b); + return dest; +} + +godot_rect2i GDAPI godot_rect2i_merge(const godot_rect2i *p_self, const godot_rect2i *p_b) { + godot_rect2i dest; + const Rect2i *self = (const Rect2i *)p_self; + const Rect2i *b = (const Rect2i *)p_b; + *((Rect2i *)&dest) = self->merge(*b); + return dest; +} + +godot_bool GDAPI godot_rect2i_has_point(const godot_rect2i *p_self, const godot_vector2i *p_point) { + const Rect2i *self = (const Rect2i *)p_self; + const Vector2i *point = (const Vector2i *)p_point; + return self->has_point(*point); +} + +godot_rect2i GDAPI godot_rect2i_grow(const godot_rect2i *p_self, const godot_int p_by) { + godot_rect2i dest; + const Rect2i *self = (const Rect2i *)p_self; + + *((Rect2i *)&dest) = self->grow(p_by); + return dest; +} + +godot_rect2i GDAPI godot_rect2i_grow_individual(const godot_rect2i *p_self, const godot_int p_left, const godot_int p_top, const godot_int p_right, const godot_int p_bottom) { + godot_rect2i dest; + const Rect2i *self = (const Rect2i *)p_self; + *((Rect2i *)&dest) = self->grow_individual(p_left, p_top, p_right, p_bottom); + return dest; +} + +godot_rect2i GDAPI godot_rect2i_grow_margin(const godot_rect2i *p_self, const godot_int p_margin, const godot_int p_by) { + godot_rect2i dest; + const Rect2i *self = (const Rect2i *)p_self; + *((Rect2i *)&dest) = self->grow_margin((Margin)p_margin, p_by); + return dest; +} + +godot_rect2i GDAPI godot_rect2i_abs(const godot_rect2i *p_self) { + godot_rect2i dest; + const Rect2i *self = (const Rect2i *)p_self; + *((Rect2i *)&dest) = self->abs(); + return dest; +} + +godot_rect2i GDAPI godot_rect2i_expand(const godot_rect2i *p_self, const godot_vector2i *p_to) { + godot_rect2i dest; + const Rect2i *self = (const Rect2i *)p_self; + const Vector2i *to = (const Vector2i *)p_to; + *((Rect2i *)&dest) = self->expand(*to); + return dest; +} + +godot_bool GDAPI godot_rect2i_operator_equal(const godot_rect2i *p_self, const godot_rect2i *p_b) { + const Rect2i *self = (const Rect2i *)p_self; + const Rect2i *b = (const Rect2i *)p_b; + return *self == *b; +} + +godot_vector2i GDAPI godot_rect2i_get_position(const godot_rect2i *p_self) { + godot_vector2i dest; + Vector2i *d = (Vector2i *)&dest; + const Rect2i *self = (const Rect2i *)p_self; + *d = self->get_position(); + return dest; +} + +godot_vector2i GDAPI godot_rect2i_get_size(const godot_rect2i *p_self) { + godot_vector2i dest; + Vector2i *d = (Vector2i *)&dest; + const Rect2i *self = (const Rect2i *)p_self; + *d = self->get_size(); + return dest; +} + +void GDAPI godot_rect2i_set_position(godot_rect2i *p_self, const godot_vector2i *p_pos) { + Rect2i *self = (Rect2i *)p_self; + const Vector2i *position = (const Vector2i *)p_pos; + self->set_position(*position); +} + +void GDAPI godot_rect2i_set_size(godot_rect2i *p_self, const godot_vector2i *p_size) { + Rect2i *self = (Rect2i *)p_self; + const Vector2i *size = (const Vector2i *)p_size; + self->set_size(*size); +} + #ifdef __cplusplus } #endif diff --git a/modules/gdnative/gdnative/variant.cpp b/modules/gdnative/gdnative/variant.cpp index 29d0f96b97..dac4feb0e5 100644 --- a/modules/gdnative/gdnative/variant.cpp +++ b/modules/gdnative/gdnative/variant.cpp @@ -99,24 +99,48 @@ void GDAPI godot_variant_new_string(godot_variant *r_dest, const godot_string *p memnew_placement_custom(dest, Variant, Variant(*s)); } +void GDAPI godot_variant_new_string_name(godot_variant *r_dest, const godot_string_name *p_s) { + Variant *dest = (Variant *)r_dest; + StringName *s = (StringName *)p_s; + memnew_placement_custom(dest, Variant, Variant(*s)); +} + void GDAPI godot_variant_new_vector2(godot_variant *r_dest, const godot_vector2 *p_v2) { Variant *dest = (Variant *)r_dest; Vector2 *v2 = (Vector2 *)p_v2; memnew_placement_custom(dest, Variant, Variant(*v2)); } +void GDAPI godot_variant_new_vector2i(godot_variant *r_dest, const godot_vector2i *p_v2) { + Variant *dest = (Variant *)r_dest; + Vector2i *v2 = (Vector2i *)p_v2; + memnew_placement_custom(dest, Variant, Variant(*v2)); +} + void GDAPI godot_variant_new_rect2(godot_variant *r_dest, const godot_rect2 *p_rect2) { Variant *dest = (Variant *)r_dest; Rect2 *rect2 = (Rect2 *)p_rect2; memnew_placement_custom(dest, Variant, Variant(*rect2)); } +void GDAPI godot_variant_new_rect2i(godot_variant *r_dest, const godot_rect2i *p_rect2) { + Variant *dest = (Variant *)r_dest; + Rect2i *rect2 = (Rect2i *)p_rect2; + memnew_placement_custom(dest, Variant, Variant(*rect2)); +} + void GDAPI godot_variant_new_vector3(godot_variant *r_dest, const godot_vector3 *p_v3) { Variant *dest = (Variant *)r_dest; Vector3 *v3 = (Vector3 *)p_v3; memnew_placement_custom(dest, Variant, Variant(*v3)); } +void GDAPI godot_variant_new_vector3i(godot_variant *r_dest, const godot_vector3i *p_v3) { + Variant *dest = (Variant *)r_dest; + Vector3i *v3 = (Vector3i *)p_v3; + memnew_placement_custom(dest, Variant, Variant(*v3)); +} + void GDAPI godot_variant_new_transform2d(godot_variant *r_dest, const godot_transform2d *p_t2d) { Variant *dest = (Variant *)r_dest; Transform2D *t2d = (Transform2D *)p_t2d; @@ -171,6 +195,18 @@ void GDAPI godot_variant_new_rid(godot_variant *r_dest, const godot_rid *p_rid) memnew_placement_custom(dest, Variant, Variant(*rid)); } +void GDAPI godot_variant_new_callable(godot_variant *r_dest, const godot_callable *p_cb) { + Variant *dest = (Variant *)r_dest; + Callable *cb = (Callable *)p_cb; + memnew_placement_custom(dest, Variant, Variant(*cb)); +} + +void GDAPI godot_variant_new_signal(godot_variant *r_dest, const godot_signal *p_signal) { + Variant *dest = (Variant *)r_dest; + Signal *signal = (Signal *)p_signal; + memnew_placement_custom(dest, Variant, Variant(*signal)); +} + void GDAPI godot_variant_new_object(godot_variant *r_dest, const godot_object *p_obj) { Variant *dest = (Variant *)r_dest; Object *obj = (Object *)p_obj; @@ -209,18 +245,30 @@ void GDAPI godot_variant_new_packed_byte_array(godot_variant *r_dest, const godo memnew_placement_custom(dest, Variant, Variant(*pba)); } -void GDAPI godot_variant_new_packed_int_array(godot_variant *r_dest, const godot_packed_int_array *p_pia) { +void GDAPI godot_variant_new_packed_int32_array(godot_variant *r_dest, const godot_packed_int32_array *p_pia) { Variant *dest = (Variant *)r_dest; PackedInt32Array *pia = (PackedInt32Array *)p_pia; memnew_placement_custom(dest, Variant, Variant(*pia)); } -void GDAPI godot_variant_new_packed_real_array(godot_variant *r_dest, const godot_packed_real_array *p_pra) { +void GDAPI godot_variant_new_packed_int64_array(godot_variant *r_dest, const godot_packed_int64_array *p_pia) { + Variant *dest = (Variant *)r_dest; + PackedInt64Array *pia = (PackedInt64Array *)p_pia; + memnew_placement_custom(dest, Variant, Variant(*pia)); +} + +void GDAPI godot_variant_new_packed_float32_array(godot_variant *r_dest, const godot_packed_float32_array *p_pra) { Variant *dest = (Variant *)r_dest; PackedFloat32Array *pra = (PackedFloat32Array *)p_pra; memnew_placement_custom(dest, Variant, Variant(*pra)); } +void GDAPI godot_variant_new_packed_float64_array(godot_variant *r_dest, const godot_packed_float64_array *p_pra) { + Variant *dest = (Variant *)r_dest; + PackedFloat64Array *pra = (PackedFloat64Array *)p_pra; + memnew_placement_custom(dest, Variant, Variant(*pra)); +} + void GDAPI godot_variant_new_packed_string_array(godot_variant *r_dest, const godot_packed_string_array *p_psa) { Variant *dest = (Variant *)r_dest; PackedStringArray *psa = (PackedStringArray *)p_psa; @@ -273,6 +321,14 @@ godot_string GDAPI godot_variant_as_string(const godot_variant *p_self) { return raw_dest; } +godot_string_name GDAPI godot_variant_as_string_name(const godot_variant *p_self) { + godot_string_name raw_dest; + const Variant *self = (const Variant *)p_self; + StringName *dest = (StringName *)&raw_dest; + memnew_placement(dest, StringName(self->operator StringName())); // operator = is overloaded by StringName + return raw_dest; +} + godot_vector2 GDAPI godot_variant_as_vector2(const godot_variant *p_self) { godot_vector2 raw_dest; const Variant *self = (const Variant *)p_self; @@ -281,6 +337,14 @@ godot_vector2 GDAPI godot_variant_as_vector2(const godot_variant *p_self) { return raw_dest; } +godot_vector2i GDAPI godot_variant_as_vector2i(const godot_variant *p_self) { + godot_vector2i raw_dest; + const Variant *self = (const Variant *)p_self; + Vector2i *dest = (Vector2i *)&raw_dest; + *dest = *self; + return raw_dest; +} + godot_rect2 GDAPI godot_variant_as_rect2(const godot_variant *p_self) { godot_rect2 raw_dest; const Variant *self = (const Variant *)p_self; @@ -289,6 +353,14 @@ godot_rect2 GDAPI godot_variant_as_rect2(const godot_variant *p_self) { return raw_dest; } +godot_rect2i GDAPI godot_variant_as_rect2i(const godot_variant *p_self) { + godot_rect2i raw_dest; + const Variant *self = (const Variant *)p_self; + Rect2i *dest = (Rect2i *)&raw_dest; + *dest = *self; + return raw_dest; +} + godot_vector3 GDAPI godot_variant_as_vector3(const godot_variant *p_self) { godot_vector3 raw_dest; const Variant *self = (const Variant *)p_self; @@ -297,6 +369,14 @@ godot_vector3 GDAPI godot_variant_as_vector3(const godot_variant *p_self) { return raw_dest; } +godot_vector3i GDAPI godot_variant_as_vector3i(const godot_variant *p_self) { + godot_vector3i raw_dest; + const Variant *self = (const Variant *)p_self; + Vector3i *dest = (Vector3i *)&raw_dest; + *dest = *self; + return raw_dest; +} + godot_transform2d GDAPI godot_variant_as_transform2d(const godot_variant *p_self) { godot_transform2d raw_dest; const Variant *self = (const Variant *)p_self; @@ -369,6 +449,22 @@ godot_rid GDAPI godot_variant_as_rid(const godot_variant *p_self) { return raw_dest; } +godot_callable GDAPI godot_variant_as_callable(const godot_variant *p_self) { + godot_callable raw_dest; + const Variant *self = (const Variant *)p_self; + Callable *dest = (Callable *)&raw_dest; + *dest = *self; + return raw_dest; +} + +godot_signal GDAPI godot_variant_as_signal(const godot_variant *p_self) { + godot_signal raw_dest; + const Variant *self = (const Variant *)p_self; + Signal *dest = (Signal *)&raw_dest; + *dest = *self; + return raw_dest; +} + godot_object GDAPI *godot_variant_as_object(const godot_variant *p_self) { const Variant *self = (const Variant *)p_self; Object *dest; @@ -401,8 +497,8 @@ godot_packed_byte_array GDAPI godot_variant_as_packed_byte_array(const godot_var return raw_dest; } -godot_packed_int_array GDAPI godot_variant_as_packed_int_array(const godot_variant *p_self) { - godot_packed_int_array raw_dest; +godot_packed_int32_array GDAPI godot_variant_as_packed_int32_array(const godot_variant *p_self) { + godot_packed_int32_array raw_dest; const Variant *self = (const Variant *)p_self; PackedInt32Array *dest = (PackedInt32Array *)&raw_dest; memnew_placement(dest, PackedInt32Array(self->operator PackedInt32Array())); // operator = is overloaded by PackedInt32Array @@ -410,8 +506,17 @@ godot_packed_int_array GDAPI godot_variant_as_packed_int_array(const godot_varia return raw_dest; } -godot_packed_real_array GDAPI godot_variant_as_packed_real_array(const godot_variant *p_self) { - godot_packed_real_array raw_dest; +godot_packed_int64_array GDAPI godot_variant_as_packed_int64_array(const godot_variant *p_self) { + godot_packed_int64_array raw_dest; + const Variant *self = (const Variant *)p_self; + PackedInt64Array *dest = (PackedInt64Array *)&raw_dest; + memnew_placement(dest, PackedInt64Array(self->operator PackedInt64Array())); // operator = is overloaded by PackedInt64Array + *dest = *self; + return raw_dest; +} + +godot_packed_float32_array GDAPI godot_variant_as_packed_float32_array(const godot_variant *p_self) { + godot_packed_float32_array raw_dest; const Variant *self = (const Variant *)p_self; PackedFloat32Array *dest = (PackedFloat32Array *)&raw_dest; memnew_placement(dest, PackedFloat32Array(self->operator PackedFloat32Array())); // operator = is overloaded by PackedFloat32Array @@ -419,6 +524,15 @@ godot_packed_real_array GDAPI godot_variant_as_packed_real_array(const godot_var return raw_dest; } +godot_packed_float64_array GDAPI godot_variant_as_packed_float64_array(const godot_variant *p_self) { + godot_packed_float64_array raw_dest; + const Variant *self = (const Variant *)p_self; + PackedFloat64Array *dest = (PackedFloat64Array *)&raw_dest; + memnew_placement(dest, PackedFloat64Array(self->operator PackedFloat64Array())); // operator = is overloaded by PackedFloat64Array + *dest = *self; + return raw_dest; +} + godot_packed_string_array GDAPI godot_variant_as_packed_string_array(const godot_variant *p_self) { godot_packed_string_array raw_dest; const Variant *self = (const Variant *)p_self; @@ -489,6 +603,11 @@ godot_bool GDAPI godot_variant_operator_less(const godot_variant *p_self, const return self->operator<(*other); } +uint32_t GDAPI godot_variant_hash(const godot_variant *p_self) { + const Variant *self = (const Variant *)p_self; + return self->hash(); +} + godot_bool GDAPI godot_variant_hash_compare(const godot_variant *p_self, const godot_variant *p_other) { const Variant *self = (const Variant *)p_self; const Variant *other = (const Variant *)p_other; diff --git a/modules/gdnative/gdnative/vector2.cpp b/modules/gdnative/gdnative/vector2.cpp index 72c3c0ec35..1ee716df86 100644 --- a/modules/gdnative/gdnative/vector2.cpp +++ b/modules/gdnative/gdnative/vector2.cpp @@ -38,6 +38,9 @@ extern "C" { #endif static_assert(sizeof(godot_vector2) == sizeof(Vector2), "Vector2 size mismatch"); +static_assert(sizeof(godot_vector2i) == sizeof(Vector2i), "Vector2i size mismatch"); + +// Vector2 void GDAPI godot_vector2_new(godot_vector2 *r_dest, const godot_real p_x, const godot_real p_y) { Vector2 *dest = (Vector2 *)r_dest; @@ -51,6 +54,13 @@ godot_string GDAPI godot_vector2_as_string(const godot_vector2 *p_self) { return ret; } +godot_vector2i GDAPI godot_vector2_as_vector2i(const godot_vector2 *p_self) { + godot_vector2i dest; + const Vector2 *self = (const Vector2 *)p_self; + *((Vector2i *)&dest) = Vector2i(*self); + return dest; +} + godot_vector2 GDAPI godot_vector2_normalized(const godot_vector2 *p_self) { godot_vector2 dest; const Vector2 *self = (const Vector2 *)p_self; @@ -158,6 +168,13 @@ godot_vector2 GDAPI godot_vector2_floor(const godot_vector2 *p_self) { return dest; } +godot_vector2 GDAPI godot_vector2_sign(const godot_vector2 *p_self) { + godot_vector2 dest; + const Vector2 *self = (const Vector2 *)p_self; + *((Vector2 *)&dest) = self->sign(); + return dest; +} + godot_vector2 GDAPI godot_vector2_snapped(const godot_vector2 *p_self, const godot_vector2 *p_by) { godot_vector2 dest; const Vector2 *self = (const Vector2 *)p_self; @@ -308,6 +325,138 @@ godot_real GDAPI godot_vector2_get_y(const godot_vector2 *p_self) { return self->y; } +// Vector2i + +void GDAPI godot_vector2i_new(godot_vector2i *r_dest, const godot_int p_x, const godot_int p_y) { + Vector2i *dest = (Vector2i *)r_dest; + *dest = Vector2i(p_x, p_y); +} + +godot_string GDAPI godot_vector2i_as_string(const godot_vector2i *p_self) { + godot_string ret; + const Vector2i *self = (const Vector2i *)p_self; + memnew_placement(&ret, String(*self)); + return ret; +} + +godot_vector2 GDAPI godot_vector2i_as_vector2(const godot_vector2i *p_self) { + godot_vector2 dest; + const Vector2i *self = (const Vector2i *)p_self; + *((Vector2 *)&dest) = Vector2(*self); + return dest; +} + +godot_real GDAPI godot_vector2i_aspect(const godot_vector2i *p_self) { + const Vector2i *self = (const Vector2i *)p_self; + return self->aspect(); +} + +godot_vector2i GDAPI godot_vector2i_abs(const godot_vector2i *p_self) { + godot_vector2i dest; + const Vector2i *self = (const Vector2i *)p_self; + *((Vector2i *)&dest) = self->abs(); + return dest; +} + +godot_vector2i GDAPI godot_vector2i_sign(const godot_vector2i *p_self) { + godot_vector2i dest; + const Vector2i *self = (const Vector2i *)p_self; + *((Vector2i *)&dest) = self->sign(); + return dest; +} + +godot_vector2i GDAPI godot_vector2i_operator_add(const godot_vector2i *p_self, const godot_vector2i *p_b) { + godot_vector2i raw_dest; + Vector2i *dest = (Vector2i *)&raw_dest; + const Vector2i *self = (const Vector2i *)p_self; + const Vector2i *b = (const Vector2i *)p_b; + *dest = *self + *b; + return raw_dest; +} + +godot_vector2i GDAPI godot_vector2i_operator_subtract(const godot_vector2i *p_self, const godot_vector2i *p_b) { + godot_vector2i raw_dest; + Vector2i *dest = (Vector2i *)&raw_dest; + const Vector2i *self = (const Vector2i *)p_self; + const Vector2i *b = (const Vector2i *)p_b; + *dest = *self - *b; + return raw_dest; +} + +godot_vector2i GDAPI godot_vector2i_operator_multiply_vector(const godot_vector2i *p_self, const godot_vector2i *p_b) { + godot_vector2i raw_dest; + Vector2i *dest = (Vector2i *)&raw_dest; + const Vector2i *self = (const Vector2i *)p_self; + const Vector2i *b = (const Vector2i *)p_b; + *dest = *self * *b; + return raw_dest; +} + +godot_vector2i GDAPI godot_vector2i_operator_multiply_scalar(const godot_vector2i *p_self, const godot_int p_b) { + godot_vector2i raw_dest; + Vector2i *dest = (Vector2i *)&raw_dest; + const Vector2i *self = (const Vector2i *)p_self; + *dest = *self * p_b; + return raw_dest; +} + +godot_vector2i GDAPI godot_vector2i_operator_divide_vector(const godot_vector2i *p_self, const godot_vector2i *p_b) { + godot_vector2i raw_dest; + Vector2i *dest = (Vector2i *)&raw_dest; + const Vector2i *self = (const Vector2i *)p_self; + const Vector2i *b = (const Vector2i *)p_b; + *dest = *self / *b; + return raw_dest; +} + +godot_vector2i GDAPI godot_vector2i_operator_divide_scalar(const godot_vector2i *p_self, const godot_int p_b) { + godot_vector2i raw_dest; + Vector2i *dest = (Vector2i *)&raw_dest; + const Vector2i *self = (const Vector2i *)p_self; + *dest = *self / p_b; + return raw_dest; +} + +godot_bool GDAPI godot_vector2i_operator_equal(const godot_vector2i *p_self, const godot_vector2i *p_b) { + const Vector2i *self = (const Vector2i *)p_self; + const Vector2i *b = (const Vector2i *)p_b; + return *self == *b; +} + +godot_bool GDAPI godot_vector2i_operator_less(const godot_vector2i *p_self, const godot_vector2i *p_b) { + const Vector2i *self = (const Vector2i *)p_self; + const Vector2i *b = (const Vector2i *)p_b; + return *self < *b; +} + +godot_vector2i GDAPI godot_vector2i_operator_neg(const godot_vector2i *p_self) { + godot_vector2i raw_dest; + Vector2i *dest = (Vector2i *)&raw_dest; + const Vector2i *self = (const Vector2i *)p_self; + *dest = -(*self); + return raw_dest; +} + +void GDAPI godot_vector2i_set_x(godot_vector2i *p_self, const godot_int p_x) { + Vector2i *self = (Vector2i *)p_self; + self->x = p_x; +} + +void GDAPI godot_vector2i_set_y(godot_vector2i *p_self, const godot_int p_y) { + Vector2i *self = (Vector2i *)p_self; + self->y = p_y; +} + +godot_int GDAPI godot_vector2i_get_x(const godot_vector2i *p_self) { + const Vector2i *self = (const Vector2i *)p_self; + return self->x; +} + +godot_int GDAPI godot_vector2i_get_y(const godot_vector2i *p_self) { + const Vector2i *self = (const Vector2i *)p_self; + return self->y; +} + #ifdef __cplusplus } #endif diff --git a/modules/gdnative/gdnative/vector3.cpp b/modules/gdnative/gdnative/vector3.cpp index 16fbdf353a..32cad30c17 100644 --- a/modules/gdnative/gdnative/vector3.cpp +++ b/modules/gdnative/gdnative/vector3.cpp @@ -38,6 +38,9 @@ extern "C" { #endif static_assert(sizeof(godot_vector3) == sizeof(Vector3), "Vector3 size mismatch"); +static_assert(sizeof(godot_vector3i) == sizeof(Vector3i), "Vector3i size mismatch"); + +// Vector3 void GDAPI godot_vector3_new(godot_vector3 *r_dest, const godot_real p_x, const godot_real p_y, const godot_real p_z) { Vector3 *dest = (Vector3 *)r_dest; @@ -51,6 +54,13 @@ godot_string GDAPI godot_vector3_as_string(const godot_vector3 *p_self) { return ret; } +godot_vector3i GDAPI godot_vector3_as_vector3i(const godot_vector3 *p_self) { + godot_vector3i dest; + const Vector3 *self = (const Vector3 *)p_self; + *((Vector3i *)&dest) = Vector3i(*self); + return dest; +} + godot_int GDAPI godot_vector3_min_axis(const godot_vector3 *p_self) { const Vector3 *self = (const Vector3 *)p_self; return self->min_axis(); @@ -169,6 +179,13 @@ godot_vector3 GDAPI godot_vector3_abs(const godot_vector3 *p_self) { return dest; } +godot_vector3 GDAPI godot_vector3_sign(const godot_vector3 *p_self) { + godot_vector3 dest; + const Vector3 *self = (const Vector3 *)p_self; + *((Vector3 *)&dest) = self->sign(); + return dest; +} + godot_vector3 GDAPI godot_vector3_floor(const godot_vector3 *p_self) { godot_vector3 dest; const Vector3 *self = (const Vector3 *)p_self; @@ -315,6 +332,133 @@ godot_real GDAPI godot_vector3_get_axis(const godot_vector3 *p_self, const godot return self->get_axis(p_axis); } +// Vector3i + +void GDAPI godot_vector3i_new(godot_vector3i *r_dest, const godot_int p_x, const godot_int p_y, const godot_int p_z) { + Vector3i *dest = (Vector3i *)r_dest; + *dest = Vector3i(p_x, p_y, p_z); +} + +godot_string GDAPI godot_vector3i_as_string(const godot_vector3i *p_self) { + godot_string ret; + const Vector3i *self = (const Vector3i *)p_self; + memnew_placement(&ret, String(*self)); + return ret; +} + +godot_vector3 GDAPI godot_vector3i_as_vector3(const godot_vector3i *p_self) { + godot_vector3 dest; + const Vector3i *self = (const Vector3i *)p_self; + *((Vector3 *)&dest) = Vector3(*self); + return dest; +} + +godot_int GDAPI godot_vector3i_min_axis(const godot_vector3i *p_self) { + const Vector3i *self = (const Vector3i *)p_self; + return self->min_axis(); +} + +godot_int GDAPI godot_vector3i_max_axis(const godot_vector3i *p_self) { + const Vector3i *self = (const Vector3i *)p_self; + return self->max_axis(); +} + +godot_vector3i GDAPI godot_vector3i_abs(const godot_vector3i *p_self) { + godot_vector3i dest; + const Vector3i *self = (const Vector3i *)p_self; + *((Vector3i *)&dest) = self->abs(); + return dest; +} + +godot_vector3i GDAPI godot_vector3i_sign(const godot_vector3i *p_self) { + godot_vector3i dest; + const Vector3i *self = (const Vector3i *)p_self; + *((Vector3i *)&dest) = self->sign(); + return dest; +} + +godot_vector3i GDAPI godot_vector3i_operator_add(const godot_vector3i *p_self, const godot_vector3i *p_b) { + godot_vector3i raw_dest; + Vector3i *dest = (Vector3i *)&raw_dest; + Vector3i *self = (Vector3i *)p_self; + const Vector3i *b = (const Vector3i *)p_b; + *dest = *self + *b; + return raw_dest; +} + +godot_vector3i GDAPI godot_vector3i_operator_subtract(const godot_vector3i *p_self, const godot_vector3i *p_b) { + godot_vector3i raw_dest; + Vector3i *dest = (Vector3i *)&raw_dest; + Vector3i *self = (Vector3i *)p_self; + const Vector3i *b = (const Vector3i *)p_b; + *dest = *self - *b; + return raw_dest; +} + +godot_vector3i GDAPI godot_vector3i_operator_multiply_vector(const godot_vector3i *p_self, const godot_vector3i *p_b) { + godot_vector3i raw_dest; + Vector3i *dest = (Vector3i *)&raw_dest; + Vector3i *self = (Vector3i *)p_self; + const Vector3i *b = (const Vector3i *)p_b; + *dest = *self * *b; + return raw_dest; +} + +godot_vector3i GDAPI godot_vector3i_operator_multiply_scalar(const godot_vector3i *p_self, const godot_int p_b) { + godot_vector3i raw_dest; + Vector3i *dest = (Vector3i *)&raw_dest; + Vector3i *self = (Vector3i *)p_self; + *dest = *self * p_b; + return raw_dest; +} + +godot_vector3i GDAPI godot_vector3i_operator_divide_vector(const godot_vector3i *p_self, const godot_vector3i *p_b) { + godot_vector3i raw_dest; + Vector3i *dest = (Vector3i *)&raw_dest; + Vector3i *self = (Vector3i *)p_self; + const Vector3i *b = (const Vector3i *)p_b; + *dest = *self / *b; + return raw_dest; +} + +godot_vector3i GDAPI godot_vector3i_operator_divide_scalar(const godot_vector3i *p_self, const godot_int p_b) { + godot_vector3i raw_dest; + Vector3i *dest = (Vector3i *)&raw_dest; + Vector3i *self = (Vector3i *)p_self; + *dest = *self / p_b; + return raw_dest; +} + +godot_bool GDAPI godot_vector3i_operator_equal(const godot_vector3i *p_self, const godot_vector3i *p_b) { + Vector3i *self = (Vector3i *)p_self; + const Vector3i *b = (const Vector3i *)p_b; + return *self == *b; +} + +godot_bool GDAPI godot_vector3i_operator_less(const godot_vector3i *p_self, const godot_vector3i *p_b) { + Vector3i *self = (Vector3i *)p_self; + const Vector3i *b = (const Vector3i *)p_b; + return *self < *b; +} + +godot_vector3i GDAPI godot_vector3i_operator_neg(const godot_vector3i *p_self) { + godot_vector3i raw_dest; + Vector3i *dest = (Vector3i *)&raw_dest; + const Vector3i *self = (const Vector3i *)p_self; + *dest = -(*self); + return raw_dest; +} + +void GDAPI godot_vector3i_set_axis(godot_vector3i *p_self, const godot_vector3_axis p_axis, const godot_int p_val) { + Vector3i *self = (Vector3i *)p_self; + self->set_axis(p_axis, p_val); +} + +godot_int GDAPI godot_vector3i_get_axis(const godot_vector3i *p_self, const godot_vector3_axis p_axis) { + const Vector3i *self = (const Vector3i *)p_self; + return self->get_axis(p_axis); +} + #ifdef __cplusplus } #endif diff --git a/modules/gdnative/gdnative_api.json b/modules/gdnative/gdnative_api.json index d5ab62dc61..ccd8d2041c 100644 --- a/modules/gdnative/gdnative_api.json +++ b/modules/gdnative/gdnative_api.json @@ -2,1130 +2,580 @@ "core": { "type": "CORE", "version": { - "major": 1, + "major": 4, "minor": 0 }, - "next": { - "type": "CORE", - "version": { - "major": 1, - "minor": 1 - }, - "next": { - "type": "CORE", - "version": { - "major": 1, - "minor": 2 - }, - "next": null, - "api": [ - { - "name": "godot_dictionary_duplicate", - "return_type": "godot_dictionary", - "arguments": [ - ["const godot_dictionary *", "p_self"], - ["const godot_bool", "p_deep"] - ] - }, - { - "name": "godot_vector3_move_toward", - "return_type": "godot_vector3", - "arguments": [ - ["const godot_vector3 *", "p_self"], - ["const godot_vector3 *", "p_to"], - ["const godot_real", "p_delta"] - ] - }, - { - "name": "godot_vector2_move_toward", - "return_type": "godot_vector2", - "arguments": [ - ["const godot_vector2 *", "p_self"], - ["const godot_vector2 *", "p_to"], - ["const godot_real", "p_delta"] - ] - }, - { - "name": "godot_string_count", - "return_type": "godot_int", - "arguments": [ - ["const godot_string *", "p_self"], - ["godot_string", "p_what"], - ["godot_int", "p_from"], - ["godot_int", "p_to"] - ] - }, - { - "name": "godot_string_countn", - "return_type": "godot_int", - "arguments": [ - ["const godot_string *", "p_self"], - ["godot_string", "p_what"], - ["godot_int", "p_from"], - ["godot_int", "p_to"] - ] - }, - { - "name": "godot_vector3_direction_to", - "return_type": "godot_vector3", - "arguments": [ - ["const godot_vector3 *", "p_self"], - ["const godot_vector3 *", "p_to"] - ] - }, - { - "name": "godot_vector2_direction_to", - "return_type": "godot_vector2", - "arguments": [ - ["const godot_vector2 *", "p_self"], - ["const godot_vector2 *", "p_to"] - ] - }, - { - "name": "godot_array_slice", - "return_type": "godot_array", - "arguments": [ - ["const godot_array *", "p_self"], - ["const godot_int", "p_begin"], - ["const godot_int", "p_end"], - ["const godot_int", "p_step"], - ["const godot_bool", "p_deep"] - ] - }, - { - "name": "godot_packed_byte_array_empty", - "return_type": "godot_bool", - "arguments": [ - ["const godot_packed_byte_array *", "p_self"] - ] - }, - { - "name": "godot_packed_int_array_empty", - "return_type": "godot_bool", - "arguments": [ - ["const godot_packed_int_array *", "p_self"] - ] - }, - { - "name": "godot_packed_real_array_empty", - "return_type": "godot_bool", - "arguments": [ - ["const godot_packed_real_array *", "p_self"] - ] - }, - { - "name": "godot_packed_string_array_empty", - "return_type": "godot_bool", - "arguments": [ - ["const godot_packed_string_array *", "p_self"] - ] - }, - { - "name": "godot_packed_vector2_array_empty", - "return_type": "godot_bool", - "arguments": [ - ["const godot_packed_vector2_array *", "p_self"] - ] - }, - { - "name": "godot_packed_vector3_array_empty", - "return_type": "godot_bool", - "arguments": [ - ["const godot_packed_vector3_array *", "p_self"] - ] - }, - { - "name": "godot_packed_color_array_empty", - "return_type": "godot_bool", - "arguments": [ - ["const godot_packed_color_array *", "p_self"] - ] - }, - { - "name": "godot_get_class_tag", - "return_type": "void *", - "arguments": [ - ["const godot_string_name *", "p_class"] - ] - }, - { - "name": "godot_object_cast_to", - "return_type": "godot_object *", - "arguments": [ - ["const godot_object *", "p_object"], - ["void *", "p_class_tag"] - ] - }, - { - "name": "godot_instance_from_id", - "return_type": "godot_object *", - "arguments": [ - ["godot_int", "p_instance_id"] - ] - } - ] - }, - "api": [ - { - "name": "godot_color_to_abgr32", - "return_type": "godot_int", - "arguments": [ - ["const godot_color *", "p_self"] - ] - }, - { - "name": "godot_color_to_abgr64", - "return_type": "godot_int", - "arguments": [ - ["const godot_color *", "p_self"] - ] - }, - { - "name": "godot_color_to_argb64", - "return_type": "godot_int", - "arguments": [ - ["const godot_color *", "p_self"] - ] - }, - { - "name": "godot_color_to_rgba64", - "return_type": "godot_int", - "arguments": [ - ["const godot_color *", "p_self"] - ] - }, - { - "name": "godot_color_darkened", - "return_type": "godot_color", - "arguments": [ - ["const godot_color *", "p_self"], - ["const godot_real", "p_amount"] - ] - }, - { - "name": "godot_color_from_hsv", - "return_type": "godot_color", - "arguments": [ - ["const godot_color *", "p_self"], - ["const godot_real", "p_h"], - ["const godot_real", "p_s"], - ["const godot_real", "p_v"], - ["const godot_real", "p_a"] - ] - }, - { - "name": "godot_color_lightened", - "return_type": "godot_color", - "arguments": [ - ["const godot_color *", "p_self"], - ["const godot_real", "p_amount"] - ] - }, - { - "name": "godot_array_duplicate", - "return_type": "godot_array", - "arguments": [ - ["const godot_array *", "p_self"], - ["const godot_bool", "p_deep"] - ] - }, - { - "name": "godot_array_max", - "return_type": "godot_variant", - "arguments": [ - ["const godot_array *", "p_self"] - ] - }, - { - "name": "godot_array_min", - "return_type": "godot_variant", - "arguments": [ - ["const godot_array *", "p_self"] - ] - }, - { - "name": "godot_array_shuffle", - "return_type": "void", - "arguments": [ - ["godot_array *", "p_self"] - ] - }, - { - "name": "godot_basis_slerp", - "return_type": "godot_basis", - "arguments": [ - ["const godot_basis *", "p_self"], - ["const godot_basis *", "p_b"], - ["const godot_real", "p_t"] - ] - }, - { - "name": "godot_dictionary_get_with_default", - "return_type": "godot_variant", - "arguments": [ - ["const godot_dictionary *", "p_self"], - ["const godot_variant *", "p_key"], - ["const godot_variant *", "p_default"] - ] - }, - { - "name": "godot_dictionary_erase_with_return", - "return_type": "bool", - "arguments": [ - ["godot_dictionary *", "p_self"], - ["const godot_variant *", "p_key"] - ] - }, - { - "name": "godot_node_path_get_as_property_path", - "return_type": "godot_node_path", - "arguments": [ - ["const godot_node_path *", "p_self"] - ] - }, - { - "name": "godot_quat_set_axis_angle", - "return_type": "void", - "arguments": [ - ["godot_quat *", "p_self"], - ["const godot_vector3 *", "p_axis"], - ["const godot_real", "p_angle"] - ] - }, - { - "name": "godot_rect2_grow_individual", - "return_type": "godot_rect2", - "arguments": [ - ["const godot_rect2 *", "p_self"], - ["const godot_real", "p_left"], - ["const godot_real", "p_top"], - ["const godot_real", "p_right"], - ["const godot_real", "p_bottom"] - ] - }, - { - "name": "godot_rect2_grow_margin", - "return_type": "godot_rect2", - "arguments": [ - ["const godot_rect2 *", "p_self"], - ["const godot_int", "p_margin"], - ["const godot_real", "p_by"] - ] - }, - { - "name": "godot_rect2_abs", - "return_type": "godot_rect2", - "arguments": [ - ["const godot_rect2 *", "p_self"] - ] - }, - { - "name": "godot_string_dedent", - "return_type": "godot_string", - "arguments": [ - ["const godot_string *", "p_self"] - ] - }, - { - "name": "godot_string_trim_prefix", - "return_type": "godot_string", - "arguments": [ - ["const godot_string *", "p_self"], - ["const godot_string *", "p_prefix"] - ] - }, - { - "name": "godot_string_trim_suffix", - "return_type": "godot_string", - "arguments": [ - ["const godot_string *", "p_self"], - ["const godot_string *", "p_suffix"] - ] - }, - { - "name": "godot_string_rstrip", - "return_type": "godot_string", - "arguments": [ - ["const godot_string *", "p_self"], - ["const godot_string *", "p_chars"] - ] - }, - { - "name": "godot_string_rsplit", - "return_type": "godot_packed_string_array", - "arguments": [ - ["const godot_string *", "p_self"], - ["const godot_string *", "p_divisor"], - ["const godot_bool", "p_allow_empty"], - ["const godot_int", "p_maxsplit"] - ] - }, - { - "name": "godot_basis_get_quat", - "return_type": "godot_quat", - "arguments": [ - ["const godot_basis *", "p_self"] - ] - }, - { - "name": "godot_basis_set_quat", - "return_type": "void", - "arguments": [ - ["godot_basis *", "p_self"], - ["const godot_quat *", "p_quat"] - ] - }, - { - "name": "godot_basis_set_axis_angle_scale", - "return_type": "void", - "arguments": [ - ["godot_basis *", "p_self"], - ["const godot_vector3 *", "p_axis"], - ["godot_real", "p_phi"], - ["const godot_vector3 *", "p_scale"] - ] - }, - { - "name": "godot_basis_set_euler_scale", - "return_type": "void", - "arguments": [ - ["godot_basis *", "p_self"], - ["const godot_vector3 *", "p_euler"], - ["const godot_vector3 *", "p_scale"] - ] - }, - { - "name": "godot_basis_set_quat_scale", - "return_type": "void", - "arguments": [ - ["godot_basis *", "p_self"], - ["const godot_quat *", "p_quat"], - ["const godot_vector3 *", "p_scale"] - ] - }, - { - "name": "godot_quat_new_with_basis", - "return_type": "void", - "arguments": [ - ["godot_quat *", "r_dest"], - ["const godot_basis *", "p_basis"] - ] - }, - { - "name": "godot_quat_new_with_euler", - "return_type": "void", - "arguments": [ - ["godot_quat *", "r_dest"], - ["const godot_vector3 *", "p_euler"] - ] - }, - { - "name": "godot_transform_new_with_quat", - "return_type": "void", - "arguments": [ - ["godot_transform *", "r_dest"], - ["const godot_quat *", "p_quat"] - ] - }, - { - "name": "godot_variant_get_operator_name", - "return_type": "godot_string", - "arguments": [ - ["godot_variant_operator", "p_op"] - ] - }, - { - "name": "godot_variant_evaluate", - "return_type": "void", - "arguments": [ - ["godot_variant_operator", "p_op"], - ["const godot_variant *", "p_a"], - ["const godot_variant *", "p_b"], - ["godot_variant *", "r_ret"], - ["godot_bool *", "r_valid"] - ] - } - ] - }, + "next": null, "api": [ { - "name": "godot_color_new_rgba", - "return_type": "void", - "arguments": [ - ["godot_color *", "r_dest"], - ["const godot_real", "p_r"], - ["const godot_real", "p_g"], - ["const godot_real", "p_b"], - ["const godot_real", "p_a"] - ] - }, - { - "name": "godot_color_new_rgb", - "return_type": "void", - "arguments": [ - ["godot_color *", "r_dest"], - ["const godot_real", "p_r"], - ["const godot_real", "p_g"], - ["const godot_real", "p_b"] - ] - }, - { - "name": "godot_color_get_r", - "return_type": "godot_real", - "arguments": [ - ["const godot_color *", "p_self"] - ] - }, - { - "name": "godot_color_set_r", - "return_type": "void", - "arguments": [ - ["godot_color *", "p_self"], - ["const godot_real", "r"] - ] - }, - { - "name": "godot_color_get_g", - "return_type": "godot_real", - "arguments": [ - ["const godot_color *", "p_self"] - ] - }, - { - "name": "godot_color_set_g", + "name": "godot_aabb_new", "return_type": "void", "arguments": [ - ["godot_color *", "p_self"], - ["const godot_real", "g"] + ["godot_aabb *", "r_dest"], + ["const godot_vector3 *", "p_pos"], + ["const godot_vector3 *", "p_size"] ] }, { - "name": "godot_color_get_b", - "return_type": "godot_real", + "name": "godot_aabb_get_position", + "return_type": "godot_vector3", "arguments": [ - ["const godot_color *", "p_self"] + ["const godot_aabb *", "p_self"] ] }, { - "name": "godot_color_set_b", + "name": "godot_aabb_set_position", "return_type": "void", "arguments": [ - ["godot_color *", "p_self"], - ["const godot_real", "b"] + ["const godot_aabb *", "p_self"], + ["const godot_vector3 *", "p_v"] ] }, { - "name": "godot_color_get_a", - "return_type": "godot_real", + "name": "godot_aabb_get_size", + "return_type": "godot_vector3", "arguments": [ - ["const godot_color *", "p_self"] + ["const godot_aabb *", "p_self"] ] }, { - "name": "godot_color_set_a", + "name": "godot_aabb_set_size", "return_type": "void", "arguments": [ - ["godot_color *", "p_self"], - ["const godot_real", "a"] - ] - }, - { - "name": "godot_color_get_h", - "return_type": "godot_real", - "arguments": [ - ["const godot_color *", "p_self"] - ] - }, - { - "name": "godot_color_get_s", - "return_type": "godot_real", - "arguments": [ - ["const godot_color *", "p_self"] - ] - }, - { - "name": "godot_color_get_v", - "return_type": "godot_real", - "arguments": [ - ["const godot_color *", "p_self"] + ["const godot_aabb *", "p_self"], + ["const godot_vector3 *", "p_v"] ] }, { - "name": "godot_color_as_string", + "name": "godot_aabb_as_string", "return_type": "godot_string", "arguments": [ - ["const godot_color *", "p_self"] - ] - }, - { - "name": "godot_color_to_rgba32", - "return_type": "godot_int", - "arguments": [ - ["const godot_color *", "p_self"] - ] - }, - { - "name": "godot_color_to_argb32", - "return_type": "godot_int", - "arguments": [ - ["const godot_color *", "p_self"] - ] - }, - { - "name": "godot_color_inverted", - "return_type": "godot_color", - "arguments": [ - ["const godot_color *", "p_self"] - ] - }, - { - "name": "godot_color_contrasted", - "return_type": "godot_color", - "arguments": [ - ["const godot_color *", "p_self"] - ] - }, - { - "name": "godot_color_lerp", - "return_type": "godot_color", - "arguments": [ - ["const godot_color *", "p_self"], - ["const godot_color *", "p_b"], - ["const godot_real", "p_t"] - ] - }, - { - "name": "godot_color_blend", - "return_type": "godot_color", - "arguments": [ - ["const godot_color *", "p_self"], - ["const godot_color *", "p_over"] + ["const godot_aabb *", "p_self"] ] }, { - "name": "godot_color_to_html", - "return_type": "godot_string", + "name": "godot_aabb_get_area", + "return_type": "godot_real", "arguments": [ - ["const godot_color *", "p_self"], - ["const godot_bool", "p_with_alpha"] + ["const godot_aabb *", "p_self"] ] }, { - "name": "godot_color_operator_equal", + "name": "godot_aabb_has_no_area", "return_type": "godot_bool", "arguments": [ - ["const godot_color *", "p_self"], - ["const godot_color *", "p_b"] + ["const godot_aabb *", "p_self"] ] }, { - "name": "godot_color_operator_less", + "name": "godot_aabb_has_no_surface", "return_type": "godot_bool", "arguments": [ - ["const godot_color *", "p_self"], - ["const godot_color *", "p_b"] + ["const godot_aabb *", "p_self"] ] }, { - "name": "godot_vector2_new", - "return_type": "void", + "name": "godot_aabb_intersects", + "return_type": "godot_bool", "arguments": [ - ["godot_vector2 *", "r_dest"], - ["const godot_real", "p_x"], - ["const godot_real", "p_y"] + ["const godot_aabb *", "p_self"], + ["const godot_aabb *", "p_with"] ] }, { - "name": "godot_vector2_as_string", - "return_type": "godot_string", + "name": "godot_aabb_encloses", + "return_type": "godot_bool", "arguments": [ - ["const godot_vector2 *", "p_self"] + ["const godot_aabb *", "p_self"], + ["const godot_aabb *", "p_with"] ] }, { - "name": "godot_vector2_normalized", - "return_type": "godot_vector2", + "name": "godot_aabb_merge", + "return_type": "godot_aabb", "arguments": [ - ["const godot_vector2 *", "p_self"] + ["const godot_aabb *", "p_self"], + ["const godot_aabb *", "p_with"] ] }, { - "name": "godot_vector2_length", - "return_type": "godot_real", + "name": "godot_aabb_intersection", + "return_type": "godot_aabb", "arguments": [ - ["const godot_vector2 *", "p_self"] + ["const godot_aabb *", "p_self"], + ["const godot_aabb *", "p_with"] ] }, { - "name": "godot_vector2_angle", - "return_type": "godot_real", + "name": "godot_aabb_intersects_plane", + "return_type": "godot_bool", "arguments": [ - ["const godot_vector2 *", "p_self"] + ["const godot_aabb *", "p_self"], + ["const godot_plane *", "p_plane"] ] }, { - "name": "godot_vector2_length_squared", - "return_type": "godot_real", + "name": "godot_aabb_intersects_segment", + "return_type": "godot_bool", "arguments": [ - ["const godot_vector2 *", "p_self"] + ["const godot_aabb *", "p_self"], + ["const godot_vector3 *", "p_from"], + ["const godot_vector3 *", "p_to"] ] }, { - "name": "godot_vector2_is_normalized", + "name": "godot_aabb_has_point", "return_type": "godot_bool", "arguments": [ - ["const godot_vector2 *", "p_self"] + ["const godot_aabb *", "p_self"], + ["const godot_vector3 *", "p_point"] ] }, { - "name": "godot_vector2_distance_to", - "return_type": "godot_real", + "name": "godot_aabb_get_support", + "return_type": "godot_vector3", "arguments": [ - ["const godot_vector2 *", "p_self"], - ["const godot_vector2 *", "p_to"] + ["const godot_aabb *", "p_self"], + ["const godot_vector3 *", "p_dir"] ] }, { - "name": "godot_vector2_distance_squared_to", - "return_type": "godot_real", + "name": "godot_aabb_get_longest_axis", + "return_type": "godot_vector3", "arguments": [ - ["const godot_vector2 *", "p_self"], - ["const godot_vector2 *", "p_to"] + ["const godot_aabb *", "p_self"] ] }, { - "name": "godot_vector2_angle_to", - "return_type": "godot_real", + "name": "godot_aabb_get_longest_axis_index", + "return_type": "godot_int", "arguments": [ - ["const godot_vector2 *", "p_self"], - ["const godot_vector2 *", "p_to"] + ["const godot_aabb *", "p_self"] ] }, { - "name": "godot_vector2_angle_to_point", + "name": "godot_aabb_get_longest_axis_size", "return_type": "godot_real", "arguments": [ - ["const godot_vector2 *", "p_self"], - ["const godot_vector2 *", "p_to"] + ["const godot_aabb *", "p_self"] ] }, { - "name": "godot_vector2_lerp", - "return_type": "godot_vector2", + "name": "godot_aabb_get_shortest_axis", + "return_type": "godot_vector3", "arguments": [ - ["const godot_vector2 *", "p_self"], - ["const godot_vector2 *", "p_b"], - ["const godot_real", "p_t"] + ["const godot_aabb *", "p_self"] ] }, { - "name": "godot_vector2_cubic_interpolate", - "return_type": "godot_vector2", + "name": "godot_aabb_get_shortest_axis_index", + "return_type": "godot_int", "arguments": [ - ["const godot_vector2 *", "p_self"], - ["const godot_vector2 *", "p_b"], - ["const godot_vector2 *", "p_pre_a"], - ["const godot_vector2 *", "p_post_b"], - ["const godot_real", "p_t"] + ["const godot_aabb *", "p_self"] ] }, { - "name": "godot_vector2_rotated", - "return_type": "godot_vector2", + "name": "godot_aabb_get_shortest_axis_size", + "return_type": "godot_real", "arguments": [ - ["const godot_vector2 *", "p_self"], - ["const godot_real", "p_phi"] + ["const godot_aabb *", "p_self"] ] }, { - "name": "godot_vector2_tangent", - "return_type": "godot_vector2", + "name": "godot_aabb_expand", + "return_type": "godot_aabb", "arguments": [ - ["const godot_vector2 *", "p_self"] + ["const godot_aabb *", "p_self"], + ["const godot_vector3 *", "p_to_point"] ] }, { - "name": "godot_vector2_floor", - "return_type": "godot_vector2", + "name": "godot_aabb_grow", + "return_type": "godot_aabb", "arguments": [ - ["const godot_vector2 *", "p_self"] + ["const godot_aabb *", "p_self"], + ["const godot_real", "p_by"] ] }, { - "name": "godot_vector2_snapped", - "return_type": "godot_vector2", + "name": "godot_aabb_get_endpoint", + "return_type": "godot_vector3", "arguments": [ - ["const godot_vector2 *", "p_self"], - ["const godot_vector2 *", "p_by"] + ["const godot_aabb *", "p_self"], + ["const godot_int", "p_idx"] ] }, { - "name": "godot_vector2_aspect", - "return_type": "godot_real", + "name": "godot_aabb_operator_equal", + "return_type": "godot_bool", "arguments": [ - ["const godot_vector2 *", "p_self"] + ["const godot_aabb *", "p_self"], + ["const godot_aabb *", "p_b"] ] }, { - "name": "godot_vector2_dot", - "return_type": "godot_real", + "name": "godot_array_new", + "return_type": "void", "arguments": [ - ["const godot_vector2 *", "p_self"], - ["const godot_vector2 *", "p_with"] + ["godot_array *", "r_dest"] ] }, { - "name": "godot_vector2_slide", - "return_type": "godot_vector2", + "name": "godot_array_new_copy", + "return_type": "void", "arguments": [ - ["const godot_vector2 *", "p_self"], - ["const godot_vector2 *", "p_n"] + ["godot_array *", "r_dest"], + ["const godot_array *", "p_src"] ] }, { - "name": "godot_vector2_bounce", - "return_type": "godot_vector2", + "name": "godot_array_new_packed_color_array", + "return_type": "void", "arguments": [ - ["const godot_vector2 *", "p_self"], - ["const godot_vector2 *", "p_n"] + ["godot_array *", "r_dest"], + ["const godot_packed_color_array *", "p_pca"] ] }, { - "name": "godot_vector2_reflect", - "return_type": "godot_vector2", + "name": "godot_array_new_packed_vector3_array", + "return_type": "void", "arguments": [ - ["const godot_vector2 *", "p_self"], - ["const godot_vector2 *", "p_n"] + ["godot_array *", "r_dest"], + ["const godot_packed_vector3_array *", "p_pv3a"] ] }, { - "name": "godot_vector2_abs", - "return_type": "godot_vector2", + "name": "godot_array_new_packed_vector2_array", + "return_type": "void", "arguments": [ - ["const godot_vector2 *", "p_self"] + ["godot_array *", "r_dest"], + ["const godot_packed_vector2_array *", "p_pv2a"] ] }, { - "name": "godot_vector2_clamped", - "return_type": "godot_vector2", + "name": "godot_array_new_packed_string_array", + "return_type": "void", "arguments": [ - ["const godot_vector2 *", "p_self"], - ["const godot_real", "p_length"] + ["godot_array *", "r_dest"], + ["const godot_packed_string_array *", "p_psa"] ] }, { - "name": "godot_vector2_operator_add", - "return_type": "godot_vector2", + "name": "godot_array_new_packed_float32_array", + "return_type": "void", "arguments": [ - ["const godot_vector2 *", "p_self"], - ["const godot_vector2 *", "p_b"] + ["godot_array *", "r_dest"], + ["const godot_packed_float32_array *", "p_pra"] ] }, { - "name": "godot_vector2_operator_subtract", - "return_type": "godot_vector2", + "name": "godot_array_new_packed_float64_array", + "return_type": "void", "arguments": [ - ["const godot_vector2 *", "p_self"], - ["const godot_vector2 *", "p_b"] + ["godot_array *", "r_dest"], + ["const godot_packed_float64_array *", "p_pra"] ] }, { - "name": "godot_vector2_operator_multiply_vector", - "return_type": "godot_vector2", + "name": "godot_array_new_packed_int32_array", + "return_type": "void", "arguments": [ - ["const godot_vector2 *", "p_self"], - ["const godot_vector2 *", "p_b"] + ["godot_array *", "r_dest"], + ["const godot_packed_int32_array *", "p_pia"] ] }, { - "name": "godot_vector2_operator_multiply_scalar", - "return_type": "godot_vector2", + "name": "godot_array_new_packed_int64_array", + "return_type": "void", "arguments": [ - ["const godot_vector2 *", "p_self"], - ["const godot_real", "p_b"] + ["godot_array *", "r_dest"], + ["const godot_packed_int64_array *", "p_pia"] ] }, { - "name": "godot_vector2_operator_divide_vector", - "return_type": "godot_vector2", + "name": "godot_array_new_packed_byte_array", + "return_type": "void", "arguments": [ - ["const godot_vector2 *", "p_self"], - ["const godot_vector2 *", "p_b"] + ["godot_array *", "r_dest"], + ["const godot_packed_byte_array *", "p_pba"] ] }, { - "name": "godot_vector2_operator_divide_scalar", - "return_type": "godot_vector2", + "name": "godot_array_set", + "return_type": "void", "arguments": [ - ["const godot_vector2 *", "p_self"], - ["const godot_real", "p_b"] + ["godot_array *", "p_self"], + ["const godot_int", "p_idx"], + ["const godot_variant *", "p_value"] ] }, { - "name": "godot_vector2_operator_equal", - "return_type": "godot_bool", + "name": "godot_array_get", + "return_type": "godot_variant", "arguments": [ - ["const godot_vector2 *", "p_self"], - ["const godot_vector2 *", "p_b"] + ["const godot_array *", "p_self"], + ["const godot_int", "p_idx"] ] }, { - "name": "godot_vector2_operator_less", - "return_type": "godot_bool", + "name": "godot_array_operator_index", + "return_type": "godot_variant *", "arguments": [ - ["const godot_vector2 *", "p_self"], - ["const godot_vector2 *", "p_b"] + ["godot_array *", "p_self"], + ["const godot_int", "p_idx"] ] }, { - "name": "godot_vector2_operator_neg", - "return_type": "godot_vector2", + "name": "godot_array_operator_index_const", + "return_type": "const godot_variant *", "arguments": [ - ["const godot_vector2 *", "p_self"] + ["const godot_array *", "p_self"], + ["const godot_int", "p_idx"] ] }, { - "name": "godot_vector2_set_x", + "name": "godot_array_append", "return_type": "void", "arguments": [ - ["godot_vector2 *", "p_self"], - ["const godot_real", "p_x"] + ["godot_array *", "p_self"], + ["const godot_variant *", "p_value"] ] }, { - "name": "godot_vector2_set_y", + "name": "godot_array_clear", "return_type": "void", "arguments": [ - ["godot_vector2 *", "p_self"], - ["const godot_real", "p_y"] + ["godot_array *", "p_self"] ] }, { - "name": "godot_vector2_get_x", - "return_type": "godot_real", + "name": "godot_array_count", + "return_type": "godot_int", "arguments": [ - ["const godot_vector2 *", "p_self"] + ["const godot_array *", "p_self"], + ["const godot_variant *", "p_value"] ] }, { - "name": "godot_vector2_get_y", - "return_type": "godot_real", + "name": "godot_array_duplicate", + "return_type": "godot_array", "arguments": [ - ["const godot_vector2 *", "p_self"] + ["const godot_array *", "p_self"], + ["const godot_bool", "p_deep"] ] }, { - "name": "godot_quat_new", - "return_type": "void", + "name": "godot_array_empty", + "return_type": "godot_bool", "arguments": [ - ["godot_quat *", "r_dest"], - ["const godot_real", "p_x"], - ["const godot_real", "p_y"], - ["const godot_real", "p_z"], - ["const godot_real", "p_w"] + ["const godot_array *", "p_self"] ] }, { - "name": "godot_quat_new_with_axis_angle", + "name": "godot_array_erase", "return_type": "void", "arguments": [ - ["godot_quat *", "r_dest"], - ["const godot_vector3 *", "p_axis"], - ["const godot_real", "p_angle"] + ["godot_array *", "p_self"], + ["const godot_variant *", "p_value"] ] }, { - "name": "godot_quat_get_x", - "return_type": "godot_real", + "name": "godot_array_front", + "return_type": "godot_variant", "arguments": [ - ["const godot_quat *", "p_self"] + ["const godot_array *", "p_self"] ] }, { - "name": "godot_quat_set_x", - "return_type": "void", + "name": "godot_array_back", + "return_type": "godot_variant", "arguments": [ - ["godot_quat *", "p_self"], - ["const godot_real", "val"] + ["const godot_array *", "p_self"] ] }, { - "name": "godot_quat_get_y", - "return_type": "godot_real", + "name": "godot_array_find", + "return_type": "godot_int", "arguments": [ - ["const godot_quat *", "p_self"] + ["const godot_array *", "p_self"], + ["const godot_variant *", "p_what"], + ["const godot_int", "p_from"] ] }, { - "name": "godot_quat_set_y", - "return_type": "void", + "name": "godot_array_find_last", + "return_type": "godot_int", "arguments": [ - ["godot_quat *", "p_self"], - ["const godot_real", "val"] + ["const godot_array *", "p_self"], + ["const godot_variant *", "p_what"] ] }, { - "name": "godot_quat_get_z", - "return_type": "godot_real", + "name": "godot_array_has", + "return_type": "godot_bool", "arguments": [ - ["const godot_quat *", "p_self"] + ["const godot_array *", "p_self"], + ["const godot_variant *", "p_value"] ] }, { - "name": "godot_quat_set_z", - "return_type": "void", + "name": "godot_array_hash", + "return_type": "godot_int", "arguments": [ - ["godot_quat *", "p_self"], - ["const godot_real", "val"] + ["const godot_array *", "p_self"] ] }, { - "name": "godot_quat_get_w", - "return_type": "godot_real", + "name": "godot_array_insert", + "return_type": "void", "arguments": [ - ["const godot_quat *", "p_self"] + ["godot_array *", "p_self"], + ["const godot_int", "p_pos"], + ["const godot_variant *", "p_value"] ] }, { - "name": "godot_quat_set_w", + "name": "godot_array_invert", "return_type": "void", "arguments": [ - ["godot_quat *", "p_self"], - ["const godot_real", "val"] + ["godot_array *", "p_self"] ] }, { - "name": "godot_quat_as_string", - "return_type": "godot_string", + "name": "godot_array_max", + "return_type": "godot_variant", "arguments": [ - ["const godot_quat *", "p_self"] + ["const godot_array *", "p_self"] ] }, { - "name": "godot_quat_length", - "return_type": "godot_real", + "name": "godot_array_min", + "return_type": "godot_variant", "arguments": [ - ["const godot_quat *", "p_self"] + ["const godot_array *", "p_self"] ] }, { - "name": "godot_quat_length_squared", - "return_type": "godot_real", + "name": "godot_array_pop_back", + "return_type": "godot_variant", "arguments": [ - ["const godot_quat *", "p_self"] + ["godot_array *", "p_self"] ] }, { - "name": "godot_quat_normalized", - "return_type": "godot_quat", + "name": "godot_array_pop_front", + "return_type": "godot_variant", "arguments": [ - ["const godot_quat *", "p_self"] + ["godot_array *", "p_self"] ] }, { - "name": "godot_quat_is_normalized", - "return_type": "godot_bool", + "name": "godot_array_push_back", + "return_type": "void", "arguments": [ - ["const godot_quat *", "p_self"] + ["godot_array *", "p_self"], + ["const godot_variant *", "p_value"] ] }, { - "name": "godot_quat_inverse", - "return_type": "godot_quat", + "name": "godot_array_push_front", + "return_type": "void", "arguments": [ - ["const godot_quat *", "p_self"] + ["godot_array *", "p_self"], + ["const godot_variant *", "p_value"] ] }, { - "name": "godot_quat_dot", - "return_type": "godot_real", + "name": "godot_array_remove", + "return_type": "void", "arguments": [ - ["const godot_quat *", "p_self"], - ["const godot_quat *", "p_b"] + ["godot_array *", "p_self"], + ["const godot_int", "p_idx"] ] }, { - "name": "godot_quat_xform", - "return_type": "godot_vector3", + "name": "godot_array_resize", + "return_type": "void", "arguments": [ - ["const godot_quat *", "p_self"], - ["const godot_vector3 *", "p_v"] + ["godot_array *", "p_self"], + ["const godot_int", "p_size"] ] }, { - "name": "godot_quat_slerp", - "return_type": "godot_quat", + "name": "godot_array_rfind", + "return_type": "godot_int", "arguments": [ - ["const godot_quat *", "p_self"], - ["const godot_quat *", "p_b"], - ["const godot_real", "p_t"] + ["const godot_array *", "p_self"], + ["const godot_variant *", "p_what"], + ["const godot_int", "p_from"] ] }, { - "name": "godot_quat_slerpni", - "return_type": "godot_quat", + "name": "godot_array_size", + "return_type": "godot_int", "arguments": [ - ["const godot_quat *", "p_self"], - ["const godot_quat *", "p_b"], - ["const godot_real", "p_t"] + ["const godot_array *", "p_self"] ] }, { - "name": "godot_quat_cubic_slerp", - "return_type": "godot_quat", + "name": "godot_array_shuffle", + "return_type": "void", "arguments": [ - ["const godot_quat *", "p_self"], - ["const godot_quat *", "p_b"], - ["const godot_quat *", "p_pre_a"], - ["const godot_quat *", "p_post_b"], - ["const godot_real", "p_t"] + ["godot_array *", "p_self"] ] }, { - "name": "godot_quat_operator_multiply", - "return_type": "godot_quat", + "name": "godot_array_slice", + "return_type": "godot_array", "arguments": [ - ["const godot_quat *", "p_self"], - ["const godot_real", "p_b"] + ["const godot_array *", "p_self"], + ["const godot_int", "p_begin"], + ["const godot_int", "p_end"], + ["const godot_int", "p_step"], + ["const godot_bool", "p_deep"] ] }, { - "name": "godot_quat_operator_add", - "return_type": "godot_quat", + "name": "godot_array_sort", + "return_type": "void", "arguments": [ - ["const godot_quat *", "p_self"], - ["const godot_quat *", "p_b"] + ["godot_array *", "p_self"] ] }, { - "name": "godot_quat_operator_subtract", - "return_type": "godot_quat", + "name": "godot_array_sort_custom", + "return_type": "void", "arguments": [ - ["const godot_quat *", "p_self"], - ["const godot_quat *", "p_b"] + ["godot_array *", "p_self"], + ["godot_object *", "p_obj"], + ["const godot_string *", "p_func"] ] }, { - "name": "godot_quat_operator_divide", - "return_type": "godot_quat", + "name": "godot_array_bsearch", + "return_type": "godot_int", "arguments": [ - ["const godot_quat *", "p_self"], - ["const godot_real", "p_b"] + ["godot_array *", "p_self"], + ["const godot_variant *", "p_value"], + ["const godot_bool", "p_before"] ] }, { - "name": "godot_quat_operator_equal", - "return_type": "godot_bool", + "name": "godot_array_bsearch_custom", + "return_type": "godot_int", "arguments": [ - ["const godot_quat *", "p_self"], - ["const godot_quat *", "p_b"] + ["godot_array *", "p_self"], + ["const godot_variant *", "p_value"], + ["godot_object *", "p_obj"], + ["const godot_string *", "p_func"], + ["const godot_bool", "p_before"] ] }, { - "name": "godot_quat_operator_neg", - "return_type": "godot_quat", + "name": "godot_array_destroy", + "return_type": "void", "arguments": [ - ["const godot_quat *", "p_self"] + ["godot_array *", "p_self"] ] }, { @@ -1366,294 +816,803 @@ ] }, { - "name": "godot_vector3_new", + "name": "godot_basis_slerp", + "return_type": "godot_basis", + "arguments": [ + ["const godot_basis *", "p_self"], + ["const godot_basis *", "p_b"], + ["const godot_real", "p_t"] + ] + }, + { + "name": "godot_basis_get_quat", + "return_type": "godot_quat", + "arguments": [ + ["const godot_basis *", "p_self"] + ] + }, + { + "name": "godot_basis_set_quat", "return_type": "void", "arguments": [ - ["godot_vector3 *", "r_dest"], - ["const godot_real", "p_x"], - ["const godot_real", "p_y"], - ["const godot_real", "p_z"] + ["godot_basis *", "p_self"], + ["const godot_quat *", "p_quat"] ] }, { - "name": "godot_vector3_as_string", + "name": "godot_basis_set_axis_angle_scale", + "return_type": "void", + "arguments": [ + ["godot_basis *", "p_self"], + ["const godot_vector3 *", "p_axis"], + ["godot_real", "p_phi"], + ["const godot_vector3 *", "p_scale"] + ] + }, + { + "name": "godot_basis_set_euler_scale", + "return_type": "void", + "arguments": [ + ["godot_basis *", "p_self"], + ["const godot_vector3 *", "p_euler"], + ["const godot_vector3 *", "p_scale"] + ] + }, + { + "name": "godot_basis_set_quat_scale", + "return_type": "void", + "arguments": [ + ["godot_basis *", "p_self"], + ["const godot_quat *", "p_quat"], + ["const godot_vector3 *", "p_scale"] + ] + }, + { + "name": "godot_callable_new_with_object", + "return_type": "void", + "arguments": [ + ["godot_callable *", "r_dest"], + ["const godot_object *", "p_object"], + ["const godot_string_name *", "p_method"] + ] + }, + { + "name": "godot_callable_new_with_object_id", + "return_type": "void", + "arguments": [ + ["godot_callable *", "r_dest"], + ["uint64_t", "p_objectid"], + ["const godot_string_name *", "p_method"] + ] + }, + { + "name": "godot_callable_new_copy", + "return_type": "void", + "arguments": [ + ["godot_callable *", "r_dest"], + ["const godot_callable *", "p_src"] + ] + }, + { + "name": "godot_callable_destroy", + "return_type": "void", + "arguments": [ + ["godot_callable *", "p_self"] + ] + }, + { + "name": "godot_callable_call", + "return_type": "godot_int", + "arguments": [ + ["const godot_callable *", "p_self"], + ["const godot_variant **", "p_arguments"], + ["godot_int", "p_argcount"], + ["godot_variant *", "r_return_value"] + ] + }, + { + "name": "godot_callable_call_deferred", + "return_type": "void", + "arguments": [ + ["const godot_callable *", "p_self"], + ["const godot_variant **", "p_arguments"], + ["godot_int", "p_argcount"] + ] + }, + { + "name": "godot_callable_is_null", + "return_type": "godot_bool", + "arguments": [ + ["const godot_callable *", "p_self"] + ] + }, + { + "name": "godot_callable_is_custom", + "return_type": "godot_bool", + "arguments": [ + ["const godot_callable *", "p_self"] + ] + }, + { + "name": "godot_callable_is_standard", + "return_type": "godot_bool", + "arguments": [ + ["const godot_callable *", "p_self"] + ] + }, + { + "name": "godot_callable_get_object", + "return_type": "godot_object *", + "arguments": [ + ["const godot_callable *", "p_self"] + ] + }, + { + "name": "godot_callable_get_object_id", + "return_type": "uint64_t", + "arguments": [ + ["const godot_callable *", "p_self"] + ] + }, + { + "name": "godot_callable_get_method", + "return_type": "godot_string_name", + "arguments": [ + ["const godot_callable *", "p_self"] + ] + }, + { + "name": "godot_callable_hash", + "return_type": "uint32_t", + "arguments": [ + ["const godot_callable *", "p_self"] + ] + }, + { + "name": "godot_callable_as_string", "return_type": "godot_string", "arguments": [ - ["const godot_vector3 *", "p_self"] + ["const godot_callable *", "p_self"] ] }, { - "name": "godot_vector3_min_axis", + "name": "godot_callable_operator_equal", + "return_type": "godot_bool", + "arguments": [ + ["const godot_callable *", "p_self"], + ["const godot_callable *", "p_other"] + ] + }, + { + "name": "godot_callable_operator_less", + "return_type": "godot_bool", + "arguments": [ + ["const godot_callable *", "p_self"], + ["const godot_callable *", "p_other"] + ] + }, + { + "name": "godot_signal_new_with_object", + "return_type": "void", + "arguments": [ + ["godot_signal *", "r_dest"], + ["const godot_object *", "p_object"], + ["const godot_string_name *", "p_method"] + ] + }, + { + "name": "godot_signal_new_with_object_id", + "return_type": "void", + "arguments": [ + ["godot_signal *", "r_dest"], + ["uint64_t", "p_objectid"], + ["const godot_string_name *", "p_method"] + ] + }, + { + "name": "godot_signal_new_copy", + "return_type": "void", + "arguments": [ + ["godot_signal *", "r_dest"], + ["const godot_signal *", "p_src"] + ] + }, + { + "name": "godot_signal_destroy", + "return_type": "void", + "arguments": [ + ["godot_signal *", "p_self"] + ] + }, + { + "name": "godot_signal_emit", "return_type": "godot_int", "arguments": [ - ["const godot_vector3 *", "p_self"] + ["const godot_signal *", "p_self"], + ["const godot_variant **", "p_arguments"], + ["godot_int", "p_argcount"] ] }, { - "name": "godot_vector3_max_axis", + "name": "godot_signal_connect", "return_type": "godot_int", "arguments": [ - ["const godot_vector3 *", "p_self"] + ["godot_signal *", "p_self"], + ["const godot_callable *", "p_callable"], + ["const godot_array *", "p_binds"], + ["uint32_t", "p_flags"] ] }, { - "name": "godot_vector3_length", - "return_type": "godot_real", + "name": "godot_signal_disconnect", + "return_type": "void", "arguments": [ - ["const godot_vector3 *", "p_self"] + ["godot_signal *", "p_self"], + ["const godot_callable *", "p_callable"] ] }, { - "name": "godot_vector3_length_squared", - "return_type": "godot_real", + "name": "godot_signal_is_null", + "return_type": "godot_bool", "arguments": [ - ["const godot_vector3 *", "p_self"] + ["const godot_signal *", "p_self"] ] }, { - "name": "godot_vector3_is_normalized", + "name": "godot_signal_is_connected", "return_type": "godot_bool", "arguments": [ - ["const godot_vector3 *", "p_self"] + ["const godot_signal *", "p_self"], + ["const godot_callable *", "p_callable"] ] }, { - "name": "godot_vector3_normalized", - "return_type": "godot_vector3", + "name": "godot_signal_get_connections", + "return_type": "godot_array", "arguments": [ - ["const godot_vector3 *", "p_self"] + ["const godot_signal *", "p_self"] ] }, { - "name": "godot_vector3_inverse", - "return_type": "godot_vector3", + "name": "godot_signal_get_object", + "return_type": "godot_object *", "arguments": [ - ["const godot_vector3 *", "p_self"] + ["const godot_signal *", "p_self"] ] }, { - "name": "godot_vector3_snapped", - "return_type": "godot_vector3", + "name": "godot_signal_get_object_id", + "return_type": "uint64_t", "arguments": [ - ["const godot_vector3 *", "p_self"], - ["const godot_vector3 *", "p_by"] + ["const godot_signal *", "p_self"] ] }, { - "name": "godot_vector3_rotated", - "return_type": "godot_vector3", + "name": "godot_signal_get_name", + "return_type": "godot_string_name", "arguments": [ - ["const godot_vector3 *", "p_self"], - ["const godot_vector3 *", "p_axis"], - ["const godot_real", "p_phi"] + ["const godot_signal *", "p_self"] + ] + }, + { + "name": "godot_signal_as_string", + "return_type": "godot_string", + "arguments": [ + ["const godot_signal *", "p_self"] + ] + }, + { + "name": "godot_signal_operator_equal", + "return_type": "godot_bool", + "arguments": [ + ["const godot_signal *", "p_self"], + ["const godot_signal *", "p_other"] + ] + }, + { + "name": "godot_signal_operator_less", + "return_type": "godot_bool", + "arguments": [ + ["const godot_signal *", "p_self"], + ["const godot_signal *", "p_other"] ] }, { - "name": "godot_vector3_lerp", - "return_type": "godot_vector3", + "name": "godot_color_new_rgba", + "return_type": "void", "arguments": [ - ["const godot_vector3 *", "p_self"], - ["const godot_vector3 *", "p_b"], - ["const godot_real", "p_t"] + ["godot_color *", "r_dest"], + ["const godot_real", "p_r"], + ["const godot_real", "p_g"], + ["const godot_real", "p_b"], + ["const godot_real", "p_a"] ] }, { - "name": "godot_vector3_cubic_interpolate", - "return_type": "godot_vector3", + "name": "godot_color_new_rgb", + "return_type": "void", "arguments": [ - ["const godot_vector3 *", "p_self"], - ["const godot_vector3 *", "p_b"], - ["const godot_vector3 *", "p_pre_a"], - ["const godot_vector3 *", "p_post_b"], - ["const godot_real", "p_t"] + ["godot_color *", "r_dest"], + ["const godot_real", "p_r"], + ["const godot_real", "p_g"], + ["const godot_real", "p_b"] ] }, { - "name": "godot_vector3_dot", + "name": "godot_color_get_r", "return_type": "godot_real", "arguments": [ - ["const godot_vector3 *", "p_self"], - ["const godot_vector3 *", "p_b"] + ["const godot_color *", "p_self"] ] }, { - "name": "godot_vector3_cross", - "return_type": "godot_vector3", + "name": "godot_color_set_r", + "return_type": "void", "arguments": [ - ["const godot_vector3 *", "p_self"], - ["const godot_vector3 *", "p_b"] + ["godot_color *", "p_self"], + ["const godot_real", "r"] ] }, { - "name": "godot_vector3_outer", - "return_type": "godot_basis", + "name": "godot_color_get_g", + "return_type": "godot_real", "arguments": [ - ["const godot_vector3 *", "p_self"], - ["const godot_vector3 *", "p_b"] + ["const godot_color *", "p_self"] ] }, { - "name": "godot_vector3_to_diagonal_matrix", - "return_type": "godot_basis", + "name": "godot_color_set_g", + "return_type": "void", "arguments": [ - ["const godot_vector3 *", "p_self"] + ["godot_color *", "p_self"], + ["const godot_real", "g"] ] }, { - "name": "godot_vector3_abs", - "return_type": "godot_vector3", + "name": "godot_color_get_b", + "return_type": "godot_real", "arguments": [ - ["const godot_vector3 *", "p_self"] + ["const godot_color *", "p_self"] ] }, { - "name": "godot_vector3_floor", - "return_type": "godot_vector3", + "name": "godot_color_set_b", + "return_type": "void", "arguments": [ - ["const godot_vector3 *", "p_self"] + ["godot_color *", "p_self"], + ["const godot_real", "b"] ] }, { - "name": "godot_vector3_ceil", - "return_type": "godot_vector3", + "name": "godot_color_get_a", + "return_type": "godot_real", "arguments": [ - ["const godot_vector3 *", "p_self"] + ["const godot_color *", "p_self"] ] }, { - "name": "godot_vector3_distance_to", + "name": "godot_color_set_a", + "return_type": "void", + "arguments": [ + ["godot_color *", "p_self"], + ["const godot_real", "a"] + ] + }, + { + "name": "godot_color_get_h", "return_type": "godot_real", "arguments": [ - ["const godot_vector3 *", "p_self"], - ["const godot_vector3 *", "p_b"] + ["const godot_color *", "p_self"] ] }, { - "name": "godot_vector3_distance_squared_to", + "name": "godot_color_get_s", "return_type": "godot_real", "arguments": [ - ["const godot_vector3 *", "p_self"], - ["const godot_vector3 *", "p_b"] + ["const godot_color *", "p_self"] ] }, { - "name": "godot_vector3_angle_to", + "name": "godot_color_get_v", "return_type": "godot_real", "arguments": [ - ["const godot_vector3 *", "p_self"], - ["const godot_vector3 *", "p_to"] + ["const godot_color *", "p_self"] ] }, { - "name": "godot_vector3_slide", - "return_type": "godot_vector3", + "name": "godot_color_as_string", + "return_type": "godot_string", "arguments": [ - ["const godot_vector3 *", "p_self"], - ["const godot_vector3 *", "p_n"] + ["const godot_color *", "p_self"] ] }, { - "name": "godot_vector3_bounce", - "return_type": "godot_vector3", + "name": "godot_color_to_rgba32", + "return_type": "godot_int", "arguments": [ - ["const godot_vector3 *", "p_self"], - ["const godot_vector3 *", "p_n"] + ["const godot_color *", "p_self"] ] }, { - "name": "godot_vector3_reflect", - "return_type": "godot_vector3", + "name": "godot_color_to_argb32", + "return_type": "godot_int", "arguments": [ - ["const godot_vector3 *", "p_self"], - ["const godot_vector3 *", "p_n"] + ["const godot_color *", "p_self"] ] }, { - "name": "godot_vector3_operator_add", - "return_type": "godot_vector3", + "name": "godot_color_inverted", + "return_type": "godot_color", "arguments": [ - ["const godot_vector3 *", "p_self"], - ["const godot_vector3 *", "p_b"] + ["const godot_color *", "p_self"] ] }, { - "name": "godot_vector3_operator_subtract", - "return_type": "godot_vector3", + "name": "godot_color_contrasted", + "return_type": "godot_color", "arguments": [ - ["const godot_vector3 *", "p_self"], - ["const godot_vector3 *", "p_b"] + ["const godot_color *", "p_self"] ] }, { - "name": "godot_vector3_operator_multiply_vector", - "return_type": "godot_vector3", + "name": "godot_color_lerp", + "return_type": "godot_color", "arguments": [ - ["const godot_vector3 *", "p_self"], - ["const godot_vector3 *", "p_b"] + ["const godot_color *", "p_self"], + ["const godot_color *", "p_b"], + ["const godot_real", "p_t"] ] }, { - "name": "godot_vector3_operator_multiply_scalar", - "return_type": "godot_vector3", + "name": "godot_color_blend", + "return_type": "godot_color", "arguments": [ - ["const godot_vector3 *", "p_self"], - ["const godot_real", "p_b"] + ["const godot_color *", "p_self"], + ["const godot_color *", "p_over"] ] }, { - "name": "godot_vector3_operator_divide_vector", - "return_type": "godot_vector3", + "name": "godot_color_to_html", + "return_type": "godot_string", "arguments": [ - ["const godot_vector3 *", "p_self"], - ["const godot_vector3 *", "p_b"] + ["const godot_color *", "p_self"], + ["const godot_bool", "p_with_alpha"] ] }, { - "name": "godot_vector3_operator_divide_scalar", - "return_type": "godot_vector3", + "name": "godot_color_operator_equal", + "return_type": "godot_bool", "arguments": [ - ["const godot_vector3 *", "p_self"], - ["const godot_real", "p_b"] + ["const godot_color *", "p_self"], + ["const godot_color *", "p_b"] ] }, { - "name": "godot_vector3_operator_equal", + "name": "godot_color_operator_less", "return_type": "godot_bool", "arguments": [ - ["const godot_vector3 *", "p_self"], - ["const godot_vector3 *", "p_b"] + ["const godot_color *", "p_self"], + ["const godot_color *", "p_b"] ] }, { - "name": "godot_vector3_operator_less", + "name": "godot_color_to_abgr32", + "return_type": "godot_int", + "arguments": [ + ["const godot_color *", "p_self"] + ] + }, + { + "name": "godot_color_to_abgr64", + "return_type": "godot_int", + "arguments": [ + ["const godot_color *", "p_self"] + ] + }, + { + "name": "godot_color_to_argb64", + "return_type": "godot_int", + "arguments": [ + ["const godot_color *", "p_self"] + ] + }, + { + "name": "godot_color_to_rgba64", + "return_type": "godot_int", + "arguments": [ + ["const godot_color *", "p_self"] + ] + }, + { + "name": "godot_color_darkened", + "return_type": "godot_color", + "arguments": [ + ["const godot_color *", "p_self"], + ["const godot_real", "p_amount"] + ] + }, + { + "name": "godot_color_from_hsv", + "return_type": "godot_color", + "arguments": [ + ["const godot_color *", "p_self"], + ["const godot_real", "p_h"], + ["const godot_real", "p_s"], + ["const godot_real", "p_v"], + ["const godot_real", "p_a"] + ] + }, + { + "name": "godot_color_lightened", + "return_type": "godot_color", + "arguments": [ + ["const godot_color *", "p_self"], + ["const godot_real", "p_amount"] + ] + }, + { + "name": "godot_dictionary_new", + "return_type": "void", + "arguments": [ + ["godot_dictionary *", "r_dest"] + ] + }, + { + "name": "godot_dictionary_new_copy", + "return_type": "void", + "arguments": [ + ["godot_dictionary *", "r_dest"], + ["const godot_dictionary *", "p_src"] + ] + }, + { + "name": "godot_dictionary_destroy", + "return_type": "void", + "arguments": [ + ["godot_dictionary *", "p_self"] + ] + }, + { + "name": "godot_dictionary_size", + "return_type": "godot_int", + "arguments": [ + ["const godot_dictionary *", "p_self"] + ] + }, + { + "name": "godot_dictionary_empty", "return_type": "godot_bool", "arguments": [ - ["const godot_vector3 *", "p_self"], - ["const godot_vector3 *", "p_b"] + ["const godot_dictionary *", "p_self"] ] }, { - "name": "godot_vector3_operator_neg", - "return_type": "godot_vector3", + "name": "godot_dictionary_clear", + "return_type": "void", "arguments": [ - ["const godot_vector3 *", "p_self"] + ["godot_dictionary *", "p_self"] ] }, { - "name": "godot_vector3_set_axis", + "name": "godot_dictionary_has", + "return_type": "godot_bool", + "arguments": [ + ["const godot_dictionary *", "p_self"], + ["const godot_variant *", "p_key"] + ] + }, + { + "name": "godot_dictionary_has_all", + "return_type": "godot_bool", + "arguments": [ + ["const godot_dictionary *", "p_self"], + ["const godot_array *", "p_keys"] + ] + }, + { + "name": "godot_dictionary_erase", "return_type": "void", "arguments": [ - ["godot_vector3 *", "p_self"], - ["const godot_vector3_axis", "p_axis"], - ["const godot_real", "p_val"] + ["godot_dictionary *", "p_self"], + ["const godot_variant *", "p_key"] ] }, { - "name": "godot_vector3_get_axis", - "return_type": "godot_real", + "name": "godot_dictionary_hash", + "return_type": "godot_int", "arguments": [ - ["const godot_vector3 *", "p_self"], - ["const godot_vector3_axis", "p_axis"] + ["const godot_dictionary *", "p_self"] + ] + }, + { + "name": "godot_dictionary_keys", + "return_type": "godot_array", + "arguments": [ + ["const godot_dictionary *", "p_self"] + ] + }, + { + "name": "godot_dictionary_values", + "return_type": "godot_array", + "arguments": [ + ["const godot_dictionary *", "p_self"] + ] + }, + { + "name": "godot_dictionary_get", + "return_type": "godot_variant", + "arguments": [ + ["const godot_dictionary *", "p_self"], + ["const godot_variant *", "p_key"] + ] + }, + { + "name": "godot_dictionary_set", + "return_type": "void", + "arguments": [ + ["godot_dictionary *", "p_self"], + ["const godot_variant *", "p_key"], + ["const godot_variant *", "p_value"] + ] + }, + { + "name": "godot_dictionary_operator_index", + "return_type": "godot_variant *", + "arguments": [ + ["godot_dictionary *", "p_self"], + ["const godot_variant *", "p_key"] + ] + }, + { + "name": "godot_dictionary_operator_index_const", + "return_type": "const godot_variant *", + "arguments": [ + ["const godot_dictionary *", "p_self"], + ["const godot_variant *", "p_key"] + ] + }, + { + "name": "godot_dictionary_next", + "return_type": "godot_variant *", + "arguments": [ + ["const godot_dictionary *", "p_self"], + ["const godot_variant *", "p_key"] + ] + }, + { + "name": "godot_dictionary_operator_equal", + "return_type": "godot_bool", + "arguments": [ + ["const godot_dictionary *", "p_self"], + ["const godot_dictionary *", "p_b"] + ] + }, + { + "name": "godot_dictionary_to_json", + "return_type": "godot_string", + "arguments": [ + ["const godot_dictionary *", "p_self"] + ] + }, + { + "name": "godot_dictionary_duplicate", + "return_type": "godot_dictionary", + "arguments": [ + ["const godot_dictionary *", "p_self"], + ["const godot_bool", "p_deep"] + ] + }, + { + "name": "godot_dictionary_get_with_default", + "return_type": "godot_variant", + "arguments": [ + ["const godot_dictionary *", "p_self"], + ["const godot_variant *", "p_key"], + ["const godot_variant *", "p_default"] + ] + }, + { + "name": "godot_dictionary_erase_with_return", + "return_type": "bool", + "arguments": [ + ["godot_dictionary *", "p_self"], + ["const godot_variant *", "p_key"] + ] + }, + { + "name": "godot_node_path_new", + "return_type": "void", + "arguments": [ + ["godot_node_path *", "r_dest"], + ["const godot_string *", "p_from"] + ] + }, + { + "name": "godot_node_path_new_copy", + "return_type": "void", + "arguments": [ + ["godot_node_path *", "r_dest"], + ["const godot_node_path *", "p_src"] + ] + }, + { + "name": "godot_node_path_destroy", + "return_type": "void", + "arguments": [ + ["godot_node_path *", "p_self"] + ] + }, + { + "name": "godot_node_path_as_string", + "return_type": "godot_string", + "arguments": [ + ["const godot_node_path *", "p_self"] + ] + }, + { + "name": "godot_node_path_is_absolute", + "return_type": "godot_bool", + "arguments": [ + ["const godot_node_path *", "p_self"] + ] + }, + { + "name": "godot_node_path_get_name_count", + "return_type": "godot_int", + "arguments": [ + ["const godot_node_path *", "p_self"] + ] + }, + { + "name": "godot_node_path_get_name", + "return_type": "godot_string", + "arguments": [ + ["const godot_node_path *", "p_self"], + ["const godot_int", "p_idx"] + ] + }, + { + "name": "godot_node_path_get_subname_count", + "return_type": "godot_int", + "arguments": [ + ["const godot_node_path *", "p_self"] + ] + }, + { + "name": "godot_node_path_get_subname", + "return_type": "godot_string", + "arguments": [ + ["const godot_node_path *", "p_self"], + ["const godot_int", "p_idx"] + ] + }, + { + "name": "godot_node_path_get_concatenated_subnames", + "return_type": "godot_string", + "arguments": [ + ["const godot_node_path *", "p_self"] + ] + }, + { + "name": "godot_node_path_is_empty", + "return_type": "godot_bool", + "arguments": [ + ["const godot_node_path *", "p_self"] + ] + }, + { + "name": "godot_node_path_operator_equal", + "return_type": "godot_bool", + "arguments": [ + ["const godot_node_path *", "p_self"], + ["const godot_node_path *", "p_b"] + ] + }, + { + "name": "godot_node_path_get_as_property_path", + "return_type": "godot_node_path", + "arguments": [ + ["const godot_node_path *", "p_self"] ] }, { @@ -1680,6 +1639,13 @@ ] }, { + "name": "godot_packed_byte_array_empty", + "return_type": "godot_bool", + "arguments": [ + ["const godot_packed_byte_array *", "p_self"] + ] + }, + { "name": "godot_packed_byte_array_append", "return_type": "void", "arguments": [ @@ -1736,6 +1702,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": [ @@ -1767,223 +1747,527 @@ ] }, { - "name": "godot_packed_int_array_new", + "name": "godot_packed_int32_array_new", + "return_type": "void", + "arguments": [ + ["godot_packed_int32_array *", "r_dest"] + ] + }, + { + "name": "godot_packed_int32_array_new_copy", + "return_type": "void", + "arguments": [ + ["godot_packed_int32_array *", "r_dest"], + ["const godot_packed_int32_array *", "p_src"] + ] + }, + { + "name": "godot_packed_int32_array_new_with_array", + "return_type": "void", + "arguments": [ + ["godot_packed_int32_array *", "r_dest"], + ["const godot_array *", "p_a"] + ] + }, + { + "name": "godot_packed_int32_array_empty", + "return_type": "godot_bool", + "arguments": [ + ["const godot_packed_int32_array *", "p_self"] + ] + }, + { + "name": "godot_packed_int32_array_append", + "return_type": "void", + "arguments": [ + ["godot_packed_int32_array *", "p_self"], + ["const int32_t", "p_data"] + ] + }, + { + "name": "godot_packed_int32_array_append_array", + "return_type": "void", + "arguments": [ + ["godot_packed_int32_array *", "p_self"], + ["const godot_packed_int32_array *", "p_array"] + ] + }, + { + "name": "godot_packed_int32_array_insert", + "return_type": "godot_error", + "arguments": [ + ["godot_packed_int32_array *", "p_self"], + ["const godot_int", "p_idx"], + ["const int32_t", "p_data"] + ] + }, + { + "name": "godot_packed_int32_array_invert", + "return_type": "void", + "arguments": [ + ["godot_packed_int32_array *", "p_self"] + ] + }, + { + "name": "godot_packed_int32_array_push_back", + "return_type": "void", + "arguments": [ + ["godot_packed_int32_array *", "p_self"], + ["const int32_t", "p_data"] + ] + }, + { + "name": "godot_packed_int32_array_remove", "return_type": "void", "arguments": [ - ["godot_packed_int_array *", "r_dest"] + ["godot_packed_int32_array *", "p_self"], + ["const godot_int", "p_idx"] + ] + }, + { + "name": "godot_packed_int32_array_resize", + "return_type": "void", + "arguments": [ + ["godot_packed_int32_array *", "p_self"], + ["const godot_int", "p_size"] + ] + }, + { + "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": [ + ["godot_packed_int32_array *", "p_self"], + ["const godot_int", "p_idx"], + ["const int32_t", "p_data"] + ] + }, + { + "name": "godot_packed_int32_array_get", + "return_type": "int32_t", + "arguments": [ + ["const godot_packed_int32_array *", "p_self"], + ["const godot_int", "p_idx"] ] }, { - "name": "godot_packed_int_array_new_copy", + "name": "godot_packed_int32_array_size", + "return_type": "godot_int", + "arguments": [ + ["const godot_packed_int32_array *", "p_self"] + ] + }, + { + "name": "godot_packed_int32_array_destroy", "return_type": "void", "arguments": [ - ["godot_packed_int_array *", "r_dest"], - ["const godot_packed_int_array *", "p_src"] + ["godot_packed_int32_array *", "p_self"] ] }, { - "name": "godot_packed_int_array_new_with_array", + "name": "godot_packed_int64_array_new", "return_type": "void", "arguments": [ - ["godot_packed_int_array *", "r_dest"], + ["godot_packed_int64_array *", "r_dest"] + ] + }, + { + "name": "godot_packed_int64_array_new_copy", + "return_type": "void", + "arguments": [ + ["godot_packed_int64_array *", "r_dest"], + ["const godot_packed_int64_array *", "p_src"] + ] + }, + { + "name": "godot_packed_int64_array_new_with_array", + "return_type": "void", + "arguments": [ + ["godot_packed_int64_array *", "r_dest"], ["const godot_array *", "p_a"] ] }, { - "name": "godot_packed_int_array_append", + "name": "godot_packed_int64_array_empty", + "return_type": "godot_bool", + "arguments": [ + ["const godot_packed_int64_array *", "p_self"] + ] + }, + { + "name": "godot_packed_int64_array_append", "return_type": "void", "arguments": [ - ["godot_packed_int_array *", "p_self"], - ["const godot_int", "p_data"] + ["godot_packed_int64_array *", "p_self"], + ["const int64_t", "p_data"] ] }, { - "name": "godot_packed_int_array_append_array", + "name": "godot_packed_int64_array_append_array", "return_type": "void", "arguments": [ - ["godot_packed_int_array *", "p_self"], - ["const godot_packed_int_array *", "p_array"] + ["godot_packed_int64_array *", "p_self"], + ["const godot_packed_int64_array *", "p_array"] ] }, { - "name": "godot_packed_int_array_insert", + "name": "godot_packed_int64_array_insert", "return_type": "godot_error", "arguments": [ - ["godot_packed_int_array *", "p_self"], + ["godot_packed_int64_array *", "p_self"], ["const godot_int", "p_idx"], - ["const godot_int", "p_data"] + ["const int64_t", "p_data"] ] }, { - "name": "godot_packed_int_array_invert", + "name": "godot_packed_int64_array_invert", "return_type": "void", "arguments": [ - ["godot_packed_int_array *", "p_self"] + ["godot_packed_int64_array *", "p_self"] ] }, { - "name": "godot_packed_int_array_push_back", + "name": "godot_packed_int64_array_push_back", "return_type": "void", "arguments": [ - ["godot_packed_int_array *", "p_self"], - ["const godot_int", "p_data"] + ["godot_packed_int64_array *", "p_self"], + ["const int64_t", "p_data"] ] }, { - "name": "godot_packed_int_array_remove", + "name": "godot_packed_int64_array_remove", "return_type": "void", "arguments": [ - ["godot_packed_int_array *", "p_self"], + ["godot_packed_int64_array *", "p_self"], ["const godot_int", "p_idx"] ] }, { - "name": "godot_packed_int_array_resize", + "name": "godot_packed_int64_array_resize", "return_type": "void", "arguments": [ - ["godot_packed_int_array *", "p_self"], + ["godot_packed_int64_array *", "p_self"], ["const godot_int", "p_size"] ] }, { - "name": "godot_packed_int_array_set", + "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_int64_array_set", "return_type": "void", "arguments": [ - ["godot_packed_int_array *", "p_self"], + ["godot_packed_int64_array *", "p_self"], ["const godot_int", "p_idx"], - ["const godot_int", "p_data"] + ["const int64_t", "p_data"] ] }, { - "name": "godot_packed_int_array_get", + "name": "godot_packed_int64_array_get", + "return_type": "int64_t", + "arguments": [ + ["const godot_packed_int64_array *", "p_self"], + ["const godot_int", "p_idx"] + ] + }, + { + "name": "godot_packed_int64_array_size", "return_type": "godot_int", "arguments": [ - ["const godot_packed_int_array *", "p_self"], + ["const godot_packed_int64_array *", "p_self"] + ] + }, + { + "name": "godot_packed_int64_array_destroy", + "return_type": "void", + "arguments": [ + ["godot_packed_int64_array *", "p_self"] + ] + }, + { + "name": "godot_packed_float32_array_new", + "return_type": "void", + "arguments": [ + ["godot_packed_float32_array *", "r_dest"] + ] + }, + { + "name": "godot_packed_float32_array_new_copy", + "return_type": "void", + "arguments": [ + ["godot_packed_float32_array *", "r_dest"], + ["const godot_packed_float32_array *", "p_src"] + ] + }, + { + "name": "godot_packed_float32_array_new_with_array", + "return_type": "void", + "arguments": [ + ["godot_packed_float32_array *", "r_dest"], + ["const godot_array *", "p_a"] + ] + }, + { + "name": "godot_packed_float32_array_empty", + "return_type": "godot_bool", + "arguments": [ + ["const godot_packed_float32_array *", "p_self"] + ] + }, + { + "name": "godot_packed_float32_array_append", + "return_type": "void", + "arguments": [ + ["godot_packed_float32_array *", "p_self"], + ["const float", "p_data"] + ] + }, + { + "name": "godot_packed_float32_array_append_array", + "return_type": "void", + "arguments": [ + ["godot_packed_float32_array *", "p_self"], + ["const godot_packed_float32_array *", "p_array"] + ] + }, + { + "name": "godot_packed_float32_array_insert", + "return_type": "godot_error", + "arguments": [ + ["godot_packed_float32_array *", "p_self"], + ["const godot_int", "p_idx"], + ["const float", "p_data"] + ] + }, + { + "name": "godot_packed_float32_array_invert", + "return_type": "void", + "arguments": [ + ["godot_packed_float32_array *", "p_self"] + ] + }, + { + "name": "godot_packed_float32_array_push_back", + "return_type": "void", + "arguments": [ + ["godot_packed_float32_array *", "p_self"], + ["const float", "p_data"] + ] + }, + { + "name": "godot_packed_float32_array_remove", + "return_type": "void", + "arguments": [ + ["godot_packed_float32_array *", "p_self"], ["const godot_int", "p_idx"] ] }, { - "name": "godot_packed_int_array_size", + "name": "godot_packed_float32_array_resize", + "return_type": "void", + "arguments": [ + ["godot_packed_float32_array *", "p_self"], + ["const godot_int", "p_size"] + ] + }, + { + "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": [ + ["godot_packed_float32_array *", "p_self"], + ["const godot_int", "p_idx"], + ["const float", "p_data"] + ] + }, + { + "name": "godot_packed_float32_array_get", + "return_type": "float", + "arguments": [ + ["const godot_packed_float32_array *", "p_self"], + ["const godot_int", "p_idx"] + ] + }, + { + "name": "godot_packed_float32_array_size", "return_type": "godot_int", "arguments": [ - ["const godot_packed_int_array *", "p_self"] + ["const godot_packed_float32_array *", "p_self"] ] }, { - "name": "godot_packed_int_array_destroy", + "name": "godot_packed_float32_array_destroy", "return_type": "void", "arguments": [ - ["godot_packed_int_array *", "p_self"] + ["godot_packed_float32_array *", "p_self"] ] }, { - "name": "godot_packed_real_array_new", + "name": "godot_packed_float64_array_new", "return_type": "void", "arguments": [ - ["godot_packed_real_array *", "r_dest"] + ["godot_packed_float64_array *", "r_dest"] ] }, { - "name": "godot_packed_real_array_new_copy", + "name": "godot_packed_float64_array_new_copy", "return_type": "void", "arguments": [ - ["godot_packed_real_array *", "r_dest"], - ["const godot_packed_real_array *", "p_src"] + ["godot_packed_float64_array *", "r_dest"], + ["const godot_packed_float64_array *", "p_src"] ] }, { - "name": "godot_packed_real_array_new_with_array", + "name": "godot_packed_float64_array_new_with_array", "return_type": "void", "arguments": [ - ["godot_packed_real_array *", "r_dest"], + ["godot_packed_float64_array *", "r_dest"], ["const godot_array *", "p_a"] ] }, { - "name": "godot_packed_real_array_append", + "name": "godot_packed_float64_array_empty", + "return_type": "godot_bool", + "arguments": [ + ["const godot_packed_float64_array *", "p_self"] + ] + }, + { + "name": "godot_packed_float64_array_append", "return_type": "void", "arguments": [ - ["godot_packed_real_array *", "p_self"], - ["const godot_real", "p_data"] + ["godot_packed_float64_array *", "p_self"], + ["const double", "p_data"] ] }, { - "name": "godot_packed_real_array_append_array", + "name": "godot_packed_float64_array_append_array", "return_type": "void", "arguments": [ - ["godot_packed_real_array *", "p_self"], - ["const godot_packed_real_array *", "p_array"] + ["godot_packed_float64_array *", "p_self"], + ["const godot_packed_float64_array *", "p_array"] ] }, { - "name": "godot_packed_real_array_insert", + "name": "godot_packed_float64_array_insert", "return_type": "godot_error", "arguments": [ - ["godot_packed_real_array *", "p_self"], + ["godot_packed_float64_array *", "p_self"], ["const godot_int", "p_idx"], - ["const godot_real", "p_data"] + ["const double", "p_data"] ] }, { - "name": "godot_packed_real_array_invert", + "name": "godot_packed_float64_array_invert", "return_type": "void", "arguments": [ - ["godot_packed_real_array *", "p_self"] + ["godot_packed_float64_array *", "p_self"] ] }, { - "name": "godot_packed_real_array_push_back", + "name": "godot_packed_float64_array_push_back", "return_type": "void", "arguments": [ - ["godot_packed_real_array *", "p_self"], - ["const godot_real", "p_data"] + ["godot_packed_float64_array *", "p_self"], + ["const double", "p_data"] ] }, { - "name": "godot_packed_real_array_remove", + "name": "godot_packed_float64_array_remove", "return_type": "void", "arguments": [ - ["godot_packed_real_array *", "p_self"], + ["godot_packed_float64_array *", "p_self"], ["const godot_int", "p_idx"] ] }, { - "name": "godot_packed_real_array_resize", + "name": "godot_packed_float64_array_resize", "return_type": "void", "arguments": [ - ["godot_packed_real_array *", "p_self"], + ["godot_packed_float64_array *", "p_self"], ["const godot_int", "p_size"] ] }, { - "name": "godot_packed_real_array_set", + "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_packed_float64_array_set", "return_type": "void", "arguments": [ - ["godot_packed_real_array *", "p_self"], + ["godot_packed_float64_array *", "p_self"], ["const godot_int", "p_idx"], - ["const godot_real", "p_data"] + ["const double", "p_data"] ] }, { - "name": "godot_packed_real_array_get", - "return_type": "godot_real", + "name": "godot_packed_float64_array_get", + "return_type": "double", "arguments": [ - ["const godot_packed_real_array *", "p_self"], + ["const godot_packed_float64_array *", "p_self"], ["const godot_int", "p_idx"] ] }, { - "name": "godot_packed_real_array_size", + "name": "godot_packed_float64_array_size", "return_type": "godot_int", "arguments": [ - ["const godot_packed_real_array *", "p_self"] + ["const godot_packed_float64_array *", "p_self"] ] }, { - "name": "godot_packed_real_array_destroy", + "name": "godot_packed_float64_array_destroy", "return_type": "void", "arguments": [ - ["godot_packed_real_array *", "p_self"] + ["godot_packed_float64_array *", "p_self"] ] }, { @@ -2010,6 +2294,13 @@ ] }, { + "name": "godot_packed_string_array_empty", + "return_type": "godot_bool", + "arguments": [ + ["const godot_packed_string_array *", "p_self"] + ] + }, + { "name": "godot_packed_string_array_append", "return_type": "void", "arguments": [ @@ -2066,6 +2357,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": [ @@ -2120,6 +2425,13 @@ ] }, { + "name": "godot_packed_vector2_array_empty", + "return_type": "godot_bool", + "arguments": [ + ["const godot_packed_vector2_array *", "p_self"] + ] + }, + { "name": "godot_packed_vector2_array_append", "return_type": "void", "arguments": [ @@ -2176,6 +2488,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": [ @@ -2230,6 +2556,13 @@ ] }, { + "name": "godot_packed_vector3_array_empty", + "return_type": "godot_bool", + "arguments": [ + ["const godot_packed_vector3_array *", "p_self"] + ] + }, + { "name": "godot_packed_vector3_array_append", "return_type": "void", "arguments": [ @@ -2286,6 +2619,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": [ @@ -2340,6 +2687,13 @@ ] }, { + "name": "godot_packed_color_array_empty", + "return_type": "godot_bool", + "arguments": [ + ["const godot_packed_color_array *", "p_self"] + ] + }, + { "name": "godot_packed_color_array_append", "return_type": "void", "arguments": [ @@ -2394,6 +2748,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", @@ -2427,1090 +2795,2064 @@ ] }, { - "name": "godot_array_new", + "name": "godot_plane_new_with_reals", "return_type": "void", "arguments": [ - ["godot_array *", "r_dest"] + ["godot_plane *", "r_dest"], + ["const godot_real", "p_a"], + ["const godot_real", "p_b"], + ["const godot_real", "p_c"], + ["const godot_real", "p_d"] ] }, { - "name": "godot_array_new_copy", + "name": "godot_plane_new_with_vectors", "return_type": "void", "arguments": [ - ["godot_array *", "r_dest"], - ["const godot_array *", "p_src"] + ["godot_plane *", "r_dest"], + ["const godot_vector3 *", "p_v1"], + ["const godot_vector3 *", "p_v2"], + ["const godot_vector3 *", "p_v3"] ] }, { - "name": "godot_array_new_packed_color_array", + "name": "godot_plane_new_with_normal", "return_type": "void", "arguments": [ - ["godot_array *", "r_dest"], - ["const godot_packed_color_array *", "p_pca"] + ["godot_plane *", "r_dest"], + ["const godot_vector3 *", "p_normal"], + ["const godot_real", "p_d"] ] }, { - "name": "godot_array_new_packed_vector3_array", + "name": "godot_plane_as_string", + "return_type": "godot_string", + "arguments": [ + ["const godot_plane *", "p_self"] + ] + }, + { + "name": "godot_plane_normalized", + "return_type": "godot_plane", + "arguments": [ + ["const godot_plane *", "p_self"] + ] + }, + { + "name": "godot_plane_center", + "return_type": "godot_vector3", + "arguments": [ + ["const godot_plane *", "p_self"] + ] + }, + { + "name": "godot_plane_get_any_point", + "return_type": "godot_vector3", + "arguments": [ + ["const godot_plane *", "p_self"] + ] + }, + { + "name": "godot_plane_is_point_over", + "return_type": "godot_bool", + "arguments": [ + ["const godot_plane *", "p_self"], + ["const godot_vector3 *", "p_point"] + ] + }, + { + "name": "godot_plane_distance_to", + "return_type": "godot_real", + "arguments": [ + ["const godot_plane *", "p_self"], + ["const godot_vector3 *", "p_point"] + ] + }, + { + "name": "godot_plane_has_point", + "return_type": "godot_bool", + "arguments": [ + ["const godot_plane *", "p_self"], + ["const godot_vector3 *", "p_point"], + ["const godot_real", "p_epsilon"] + ] + }, + { + "name": "godot_plane_project", + "return_type": "godot_vector3", + "arguments": [ + ["const godot_plane *", "p_self"], + ["const godot_vector3 *", "p_point"] + ] + }, + { + "name": "godot_plane_intersect_3", + "return_type": "godot_bool", + "arguments": [ + ["const godot_plane *", "p_self"], + ["godot_vector3 *", "r_dest"], + ["const godot_plane *", "p_b"], + ["const godot_plane *", "p_c"] + ] + }, + { + "name": "godot_plane_intersects_ray", + "return_type": "godot_bool", + "arguments": [ + ["const godot_plane *", "p_self"], + ["godot_vector3 *", "r_dest"], + ["const godot_vector3 *", "p_from"], + ["const godot_vector3 *", "p_dir"] + ] + }, + { + "name": "godot_plane_intersects_segment", + "return_type": "godot_bool", + "arguments": [ + ["const godot_plane *", "p_self"], + ["godot_vector3 *", "r_dest"], + ["const godot_vector3 *", "p_begin"], + ["const godot_vector3 *", "p_end"] + ] + }, + { + "name": "godot_plane_operator_neg", + "return_type": "godot_plane", + "arguments": [ + ["const godot_plane *", "p_self"] + ] + }, + { + "name": "godot_plane_operator_equal", + "return_type": "godot_bool", + "arguments": [ + ["const godot_plane *", "p_self"], + ["const godot_plane *", "p_b"] + ] + }, + { + "name": "godot_plane_set_normal", "return_type": "void", "arguments": [ - ["godot_array *", "r_dest"], - ["const godot_packed_vector3_array *", "p_pv3a"] + ["godot_plane *", "p_self"], + ["const godot_vector3 *", "p_normal"] ] }, { - "name": "godot_array_new_packed_vector2_array", + "name": "godot_plane_get_normal", + "return_type": "godot_vector3", + "arguments": [ + ["const godot_plane *", "p_self"] + ] + }, + { + "name": "godot_plane_get_d", + "return_type": "godot_real", + "arguments": [ + ["const godot_plane *", "p_self"] + ] + }, + { + "name": "godot_plane_set_d", "return_type": "void", "arguments": [ - ["godot_array *", "r_dest"], - ["const godot_packed_vector2_array *", "p_pv2a"] + ["godot_plane *", "p_self"], + ["const godot_real", "p_d"] ] }, { - "name": "godot_array_new_packed_string_array", + "name": "godot_quat_new", "return_type": "void", "arguments": [ - ["godot_array *", "r_dest"], - ["const godot_packed_string_array *", "p_psa"] + ["godot_quat *", "r_dest"], + ["const godot_real", "p_x"], + ["const godot_real", "p_y"], + ["const godot_real", "p_z"], + ["const godot_real", "p_w"] ] }, { - "name": "godot_array_new_packed_real_array", + "name": "godot_quat_new_with_axis_angle", "return_type": "void", "arguments": [ - ["godot_array *", "r_dest"], - ["const godot_packed_real_array *", "p_pra"] + ["godot_quat *", "r_dest"], + ["const godot_vector3 *", "p_axis"], + ["const godot_real", "p_angle"] ] }, { - "name": "godot_array_new_packed_int_array", + "name": "godot_quat_new_with_basis", "return_type": "void", "arguments": [ - ["godot_array *", "r_dest"], - ["const godot_packed_int_array *", "p_pia"] + ["godot_quat *", "r_dest"], + ["const godot_basis *", "p_basis"] ] }, { - "name": "godot_array_new_packed_byte_array", + "name": "godot_quat_new_with_euler", "return_type": "void", "arguments": [ - ["godot_array *", "r_dest"], - ["const godot_packed_byte_array *", "p_pba"] + ["godot_quat *", "r_dest"], + ["const godot_vector3 *", "p_euler"] ] }, { - "name": "godot_array_set", + "name": "godot_quat_get_x", + "return_type": "godot_real", + "arguments": [ + ["const godot_quat *", "p_self"] + ] + }, + { + "name": "godot_quat_set_x", "return_type": "void", "arguments": [ - ["godot_array *", "p_self"], - ["const godot_int", "p_idx"], - ["const godot_variant *", "p_value"] + ["godot_quat *", "p_self"], + ["const godot_real", "val"] ] }, { - "name": "godot_array_get", - "return_type": "godot_variant", + "name": "godot_quat_get_y", + "return_type": "godot_real", "arguments": [ - ["const godot_array *", "p_self"], - ["const godot_int", "p_idx"] + ["const godot_quat *", "p_self"] ] }, { - "name": "godot_array_operator_index", - "return_type": "godot_variant *", + "name": "godot_quat_set_y", + "return_type": "void", "arguments": [ - ["godot_array *", "p_self"], - ["const godot_int", "p_idx"] + ["godot_quat *", "p_self"], + ["const godot_real", "val"] ] }, { - "name": "godot_array_operator_index_const", - "return_type": "const godot_variant *", + "name": "godot_quat_get_z", + "return_type": "godot_real", "arguments": [ - ["const godot_array *", "p_self"], - ["const godot_int", "p_idx"] + ["const godot_quat *", "p_self"] ] }, { - "name": "godot_array_append", + "name": "godot_quat_set_z", "return_type": "void", "arguments": [ - ["godot_array *", "p_self"], - ["const godot_variant *", "p_value"] + ["godot_quat *", "p_self"], + ["const godot_real", "val"] ] }, { - "name": "godot_array_clear", + "name": "godot_quat_get_w", + "return_type": "godot_real", + "arguments": [ + ["const godot_quat *", "p_self"] + ] + }, + { + "name": "godot_quat_set_w", "return_type": "void", "arguments": [ - ["godot_array *", "p_self"] + ["godot_quat *", "p_self"], + ["const godot_real", "val"] ] }, { - "name": "godot_array_count", - "return_type": "godot_int", + "name": "godot_quat_set_axis_angle", + "return_type": "void", "arguments": [ - ["const godot_array *", "p_self"], - ["const godot_variant *", "p_value"] + ["godot_quat *", "p_self"], + ["const godot_vector3 *", "p_axis"], + ["const godot_real", "p_angle"] ] }, { - "name": "godot_array_empty", + "name": "godot_quat_as_string", + "return_type": "godot_string", + "arguments": [ + ["const godot_quat *", "p_self"] + ] + }, + { + "name": "godot_quat_length", + "return_type": "godot_real", + "arguments": [ + ["const godot_quat *", "p_self"] + ] + }, + { + "name": "godot_quat_length_squared", + "return_type": "godot_real", + "arguments": [ + ["const godot_quat *", "p_self"] + ] + }, + { + "name": "godot_quat_normalized", + "return_type": "godot_quat", + "arguments": [ + ["const godot_quat *", "p_self"] + ] + }, + { + "name": "godot_quat_is_normalized", "return_type": "godot_bool", "arguments": [ - ["const godot_array *", "p_self"] + ["const godot_quat *", "p_self"] ] }, { - "name": "godot_array_erase", - "return_type": "void", + "name": "godot_quat_inverse", + "return_type": "godot_quat", "arguments": [ - ["godot_array *", "p_self"], - ["const godot_variant *", "p_value"] + ["const godot_quat *", "p_self"] ] }, { - "name": "godot_array_front", - "return_type": "godot_variant", + "name": "godot_quat_dot", + "return_type": "godot_real", "arguments": [ - ["const godot_array *", "p_self"] + ["const godot_quat *", "p_self"], + ["const godot_quat *", "p_b"] ] }, { - "name": "godot_array_back", - "return_type": "godot_variant", + "name": "godot_quat_xform", + "return_type": "godot_vector3", "arguments": [ - ["const godot_array *", "p_self"] + ["const godot_quat *", "p_self"], + ["const godot_vector3 *", "p_v"] ] }, { - "name": "godot_array_find", - "return_type": "godot_int", + "name": "godot_quat_slerp", + "return_type": "godot_quat", "arguments": [ - ["const godot_array *", "p_self"], - ["const godot_variant *", "p_what"], - ["const godot_int", "p_from"] + ["const godot_quat *", "p_self"], + ["const godot_quat *", "p_b"], + ["const godot_real", "p_t"] ] }, { - "name": "godot_array_find_last", - "return_type": "godot_int", + "name": "godot_quat_slerpni", + "return_type": "godot_quat", "arguments": [ - ["const godot_array *", "p_self"], - ["const godot_variant *", "p_what"] + ["const godot_quat *", "p_self"], + ["const godot_quat *", "p_b"], + ["const godot_real", "p_t"] ] }, { - "name": "godot_array_has", + "name": "godot_quat_cubic_slerp", + "return_type": "godot_quat", + "arguments": [ + ["const godot_quat *", "p_self"], + ["const godot_quat *", "p_b"], + ["const godot_quat *", "p_pre_a"], + ["const godot_quat *", "p_post_b"], + ["const godot_real", "p_t"] + ] + }, + { + "name": "godot_quat_operator_multiply", + "return_type": "godot_quat", + "arguments": [ + ["const godot_quat *", "p_self"], + ["const godot_real", "p_b"] + ] + }, + { + "name": "godot_quat_operator_add", + "return_type": "godot_quat", + "arguments": [ + ["const godot_quat *", "p_self"], + ["const godot_quat *", "p_b"] + ] + }, + { + "name": "godot_quat_operator_subtract", + "return_type": "godot_quat", + "arguments": [ + ["const godot_quat *", "p_self"], + ["const godot_quat *", "p_b"] + ] + }, + { + "name": "godot_quat_operator_divide", + "return_type": "godot_quat", + "arguments": [ + ["const godot_quat *", "p_self"], + ["const godot_real", "p_b"] + ] + }, + { + "name": "godot_quat_operator_equal", "return_type": "godot_bool", "arguments": [ - ["const godot_array *", "p_self"], - ["const godot_variant *", "p_value"] + ["const godot_quat *", "p_self"], + ["const godot_quat *", "p_b"] ] }, { - "name": "godot_array_hash", - "return_type": "godot_int", + "name": "godot_quat_operator_neg", + "return_type": "godot_quat", "arguments": [ - ["const godot_array *", "p_self"] + ["const godot_quat *", "p_self"] ] }, { - "name": "godot_array_insert", + "name": "godot_rect2_new_with_position_and_size", "return_type": "void", "arguments": [ - ["godot_array *", "p_self"], - ["const godot_int", "p_pos"], - ["const godot_variant *", "p_value"] + ["godot_rect2 *", "r_dest"], + ["const godot_vector2 *", "p_pos"], + ["const godot_vector2 *", "p_size"] ] }, { - "name": "godot_array_invert", + "name": "godot_rect2_new", "return_type": "void", "arguments": [ - ["godot_array *", "p_self"] + ["godot_rect2 *", "r_dest"], + ["const godot_real", "p_x"], + ["const godot_real", "p_y"], + ["const godot_real", "p_width"], + ["const godot_real", "p_height"] ] }, { - "name": "godot_array_pop_back", - "return_type": "godot_variant", + "name": "godot_rect2_as_rect2i", + "return_type": "godot_rect2i", "arguments": [ - ["godot_array *", "p_self"] + ["const godot_rect2 *", "p_self"] ] }, { - "name": "godot_array_pop_front", - "return_type": "godot_variant", + "name": "godot_rect2_as_string", + "return_type": "godot_string", "arguments": [ - ["godot_array *", "p_self"] + ["const godot_rect2 *", "p_self"] ] }, { - "name": "godot_array_push_back", + "name": "godot_rect2_get_area", + "return_type": "godot_real", + "arguments": [ + ["const godot_rect2 *", "p_self"] + ] + }, + { + "name": "godot_rect2_grow_individual", + "return_type": "godot_rect2", + "arguments": [ + ["const godot_rect2 *", "p_self"], + ["const godot_real", "p_left"], + ["const godot_real", "p_top"], + ["const godot_real", "p_right"], + ["const godot_real", "p_bottom"] + ] + }, + { + "name": "godot_rect2_grow_margin", + "return_type": "godot_rect2", + "arguments": [ + ["const godot_rect2 *", "p_self"], + ["const godot_int", "p_margin"], + ["const godot_real", "p_by"] + ] + }, + { + "name": "godot_rect2_abs", + "return_type": "godot_rect2", + "arguments": [ + ["const godot_rect2 *", "p_self"] + ] + }, + { + "name": "godot_rect2_intersects", + "return_type": "godot_bool", + "arguments": [ + ["const godot_rect2 *", "p_self"], + ["const godot_rect2 *", "p_b"] + ] + }, + { + "name": "godot_rect2_encloses", + "return_type": "godot_bool", + "arguments": [ + ["const godot_rect2 *", "p_self"], + ["const godot_rect2 *", "p_b"] + ] + }, + { + "name": "godot_rect2_has_no_area", + "return_type": "godot_bool", + "arguments": [ + ["const godot_rect2 *", "p_self"] + ] + }, + { + "name": "godot_rect2_clip", + "return_type": "godot_rect2", + "arguments": [ + ["const godot_rect2 *", "p_self"], + ["const godot_rect2 *", "p_b"] + ] + }, + { + "name": "godot_rect2_merge", + "return_type": "godot_rect2", + "arguments": [ + ["const godot_rect2 *", "p_self"], + ["const godot_rect2 *", "p_b"] + ] + }, + { + "name": "godot_rect2_has_point", + "return_type": "godot_bool", + "arguments": [ + ["const godot_rect2 *", "p_self"], + ["const godot_vector2 *", "p_point"] + ] + }, + { + "name": "godot_rect2_grow", + "return_type": "godot_rect2", + "arguments": [ + ["const godot_rect2 *", "p_self"], + ["const godot_real", "p_by"] + ] + }, + { + "name": "godot_rect2_expand", + "return_type": "godot_rect2", + "arguments": [ + ["const godot_rect2 *", "p_self"], + ["const godot_vector2 *", "p_to"] + ] + }, + { + "name": "godot_rect2_operator_equal", + "return_type": "godot_bool", + "arguments": [ + ["const godot_rect2 *", "p_self"], + ["const godot_rect2 *", "p_b"] + ] + }, + { + "name": "godot_rect2_get_position", + "return_type": "godot_vector2", + "arguments": [ + ["const godot_rect2 *", "p_self"] + ] + }, + { + "name": "godot_rect2_get_size", + "return_type": "godot_vector2", + "arguments": [ + ["const godot_rect2 *", "p_self"] + ] + }, + { + "name": "godot_rect2_set_position", "return_type": "void", "arguments": [ - ["godot_array *", "p_self"], - ["const godot_variant *", "p_value"] + ["godot_rect2 *", "p_self"], + ["const godot_vector2 *", "p_pos"] ] }, { - "name": "godot_array_push_front", + "name": "godot_rect2_set_size", "return_type": "void", "arguments": [ - ["godot_array *", "p_self"], - ["const godot_variant *", "p_value"] + ["godot_rect2 *", "p_self"], + ["const godot_vector2 *", "p_size"] ] }, { - "name": "godot_array_remove", + "name": "godot_rect2i_new_with_position_and_size", "return_type": "void", "arguments": [ - ["godot_array *", "p_self"], - ["const godot_int", "p_idx"] + ["godot_rect2i *", "r_dest"], + ["const godot_vector2i *", "p_pos"], + ["const godot_vector2i *", "p_size"] ] }, { - "name": "godot_array_resize", + "name": "godot_rect2i_new", "return_type": "void", "arguments": [ - ["godot_array *", "p_self"], - ["const godot_int", "p_size"] + ["godot_rect2i *", "r_dest"], + ["const godot_int", "p_x"], + ["const godot_int", "p_y"], + ["const godot_int", "p_width"], + ["const godot_int", "p_height"] ] }, { - "name": "godot_array_rfind", - "return_type": "godot_int", + "name": "godot_rect2i_as_string", + "return_type": "godot_string", "arguments": [ - ["const godot_array *", "p_self"], - ["const godot_variant *", "p_what"], - ["const godot_int", "p_from"] + ["const godot_rect2i *", "p_self"] ] }, { - "name": "godot_array_size", + "name": "godot_rect2i_as_rect2", + "return_type": "godot_rect2", + "arguments": [ + ["const godot_rect2i *", "p_self"] + ] + }, + { + "name": "godot_rect2i_get_area", "return_type": "godot_int", "arguments": [ - ["const godot_array *", "p_self"] + ["const godot_rect2i *", "p_self"] ] }, { - "name": "godot_array_sort", + "name": "godot_rect2i_intersects", + "return_type": "godot_bool", + "arguments": [ + ["const godot_rect2i *", "p_self"], + ["const godot_rect2i *", "p_b"] + ] + }, + { + "name": "godot_rect2i_encloses", + "return_type": "godot_bool", + "arguments": [ + ["const godot_rect2i *", "p_self"], + ["const godot_rect2i *", "p_b"] + ] + }, + { + "name": "godot_rect2i_has_no_area", + "return_type": "godot_bool", + "arguments": [ + ["const godot_rect2i *", "p_self"] + ] + }, + { + "name": "godot_rect2i_clip", + "return_type": "godot_rect2i", + "arguments": [ + ["const godot_rect2i *", "p_self"], + ["const godot_rect2i *", "p_b"] + ] + }, + { + "name": "godot_rect2i_merge", + "return_type": "godot_rect2i", + "arguments": [ + ["const godot_rect2i *", "p_self"], + ["const godot_rect2i *", "p_b"] + ] + }, + { + "name": "godot_rect2i_has_point", + "return_type": "godot_bool", + "arguments": [ + ["const godot_rect2i *", "p_self"], + ["const godot_vector2i *", "p_point"] + ] + }, + { + "name": "godot_rect2i_grow", + "return_type": "godot_rect2i", + "arguments": [ + ["const godot_rect2i *", "p_self"], + ["const godot_int", "p_by"] + ] + }, + { + "name": "godot_rect2i_grow_individual", + "return_type": "godot_rect2i", + "arguments": [ + ["const godot_rect2i *", "p_self"], + ["const godot_int", "p_left"], + ["const godot_int", "p_top"], + ["const godot_int", "p_right"], + ["const godot_int", "p_bottom"] + ] + }, + { + "name": "godot_rect2i_grow_margin", + "return_type": "godot_rect2i", + "arguments": [ + ["const godot_rect2i *", "p_self"], + ["const godot_int", "p_margin"], + ["const godot_int", "p_by"] + ] + }, + { + "name": "godot_rect2i_abs", + "return_type": "godot_rect2i", + "arguments": [ + ["const godot_rect2i *", "p_self"] + ] + }, + { + "name": "godot_rect2i_expand", + "return_type": "godot_rect2i", + "arguments": [ + ["const godot_rect2i *", "p_self"], + ["const godot_vector2i *", "p_to"] + ] + }, + { + "name": "godot_rect2i_operator_equal", + "return_type": "godot_bool", + "arguments": [ + ["const godot_rect2i *", "p_self"], + ["const godot_rect2i *", "p_b"] + ] + }, + { + "name": "godot_rect2i_get_position", + "return_type": "godot_vector2i", + "arguments": [ + ["const godot_rect2i *", "p_self"] + ] + }, + { + "name": "godot_rect2i_get_size", + "return_type": "godot_vector2i", + "arguments": [ + ["const godot_rect2i *", "p_self"] + ] + }, + { + "name": "godot_rect2i_set_position", "return_type": "void", "arguments": [ - ["godot_array *", "p_self"] + ["godot_rect2i *", "p_self"], + ["const godot_vector2i *", "p_pos"] ] }, { - "name": "godot_array_sort_custom", + "name": "godot_rect2i_set_size", "return_type": "void", "arguments": [ - ["godot_array *", "p_self"], - ["godot_object *", "p_obj"], - ["const godot_string *", "p_func"] + ["godot_rect2i *", "p_self"], + ["const godot_vector2i *", "p_size"] ] }, { - "name": "godot_array_bsearch", + "name": "godot_rid_new", + "return_type": "void", + "arguments": [ + ["godot_rid *", "r_dest"] + ] + }, + { + "name": "godot_rid_get_id", "return_type": "godot_int", "arguments": [ - ["godot_array *", "p_self"], - ["const godot_variant *", "p_value"], - ["const godot_bool", "p_before"] + ["const godot_rid *", "p_self"] ] }, { - "name": "godot_array_bsearch_custom", + "name": "godot_rid_new_with_resource", + "return_type": "void", + "arguments": [ + ["godot_rid *", "r_dest"], + ["const godot_object *", "p_from"] + ] + }, + { + "name": "godot_rid_operator_equal", + "return_type": "godot_bool", + "arguments": [ + ["const godot_rid *", "p_self"], + ["const godot_rid *", "p_b"] + ] + }, + { + "name": "godot_rid_operator_less", + "return_type": "godot_bool", + "arguments": [ + ["const godot_rid *", "p_self"], + ["const godot_rid *", "p_b"] + ] + }, + { + "name": "godot_char_string_length", "return_type": "godot_int", "arguments": [ - ["godot_array *", "p_self"], - ["const godot_variant *", "p_value"], - ["godot_object *", "p_obj"], - ["const godot_string *", "p_func"], - ["const godot_bool", "p_before"] + ["const godot_char_string *", "p_cs"] ] }, { - "name": "godot_array_destroy", + "name": "godot_char_string_get_data", + "return_type": "const char *", + "arguments": [ + ["const godot_char_string *", "p_cs"] + ] + }, + { + "name": "godot_char_string_destroy", "return_type": "void", "arguments": [ - ["godot_array *", "p_self"] + ["godot_char_string *", "p_cs"] ] }, { - "name": "godot_dictionary_new", + "name": "godot_string_new", "return_type": "void", "arguments": [ - ["godot_dictionary *", "r_dest"] + ["godot_string *", "r_dest"] ] }, { - "name": "godot_dictionary_new_copy", + "name": "godot_string_new_copy", "return_type": "void", "arguments": [ - ["godot_dictionary *", "r_dest"], - ["const godot_dictionary *", "p_src"] + ["godot_string *", "r_dest"], + ["const godot_string *", "p_src"] ] }, { - "name": "godot_dictionary_destroy", + "name": "godot_string_new_with_wide_string", "return_type": "void", "arguments": [ - ["godot_dictionary *", "p_self"] + ["godot_string *", "r_dest"], + ["const wchar_t *", "p_contents"], + ["const int", "p_size"] ] }, { - "name": "godot_dictionary_size", - "return_type": "godot_int", + "name": "godot_string_operator_index", + "return_type": "const wchar_t *", "arguments": [ - ["const godot_dictionary *", "p_self"] + ["godot_string *", "p_self"], + ["const godot_int", "p_idx"] ] }, { - "name": "godot_dictionary_empty", - "return_type": "godot_bool", + "name": "godot_string_operator_index_const", + "return_type": "wchar_t", "arguments": [ - ["const godot_dictionary *", "p_self"] + ["const godot_string *", "p_self"], + ["const godot_int", "p_idx"] ] }, { - "name": "godot_dictionary_clear", - "return_type": "void", + "name": "godot_string_wide_str", + "return_type": "const wchar_t *", "arguments": [ - ["godot_dictionary *", "p_self"] + ["const godot_string *", "p_self"] ] }, { - "name": "godot_dictionary_has", + "name": "godot_string_operator_equal", "return_type": "godot_bool", "arguments": [ - ["const godot_dictionary *", "p_self"], - ["const godot_variant *", "p_key"] + ["const godot_string *", "p_self"], + ["const godot_string *", "p_b"] ] }, { - "name": "godot_dictionary_has_all", + "name": "godot_string_operator_less", "return_type": "godot_bool", "arguments": [ - ["const godot_dictionary *", "p_self"], - ["const godot_array *", "p_keys"] + ["const godot_string *", "p_self"], + ["const godot_string *", "p_b"] ] }, { - "name": "godot_dictionary_erase", - "return_type": "void", + "name": "godot_string_operator_plus", + "return_type": "godot_string", "arguments": [ - ["godot_dictionary *", "p_self"], - ["const godot_variant *", "p_key"] + ["const godot_string *", "p_self"], + ["const godot_string *", "p_b"] ] }, { - "name": "godot_dictionary_hash", + "name": "godot_string_count", "return_type": "godot_int", "arguments": [ - ["const godot_dictionary *", "p_self"] + ["const godot_string *", "p_self"], + ["godot_string", "p_what"], + ["godot_int", "p_from"], + ["godot_int", "p_to"] ] }, { - "name": "godot_dictionary_keys", - "return_type": "godot_array", + "name": "godot_string_countn", + "return_type": "godot_int", "arguments": [ - ["const godot_dictionary *", "p_self"] + ["const godot_string *", "p_self"], + ["godot_string", "p_what"], + ["godot_int", "p_from"], + ["godot_int", "p_to"] ] }, { - "name": "godot_dictionary_values", - "return_type": "godot_array", + "name": "godot_string_dedent", + "return_type": "godot_string", "arguments": [ - ["const godot_dictionary *", "p_self"] + ["const godot_string *", "p_self"] ] }, { - "name": "godot_dictionary_get", - "return_type": "godot_variant", + "name": "godot_string_length", + "return_type": "godot_int", "arguments": [ - ["const godot_dictionary *", "p_self"], - ["const godot_variant *", "p_key"] + ["const godot_string *", "p_self"] ] }, { - "name": "godot_dictionary_set", - "return_type": "void", + "name": "godot_string_casecmp_to", + "return_type": "signed char", "arguments": [ - ["godot_dictionary *", "p_self"], - ["const godot_variant *", "p_key"], - ["const godot_variant *", "p_value"] + ["const godot_string *", "p_self"], + ["const godot_string *", "p_str"] ] }, { - "name": "godot_dictionary_operator_index", - "return_type": "godot_variant *", + "name": "godot_string_nocasecmp_to", + "return_type": "signed char", "arguments": [ - ["godot_dictionary *", "p_self"], - ["const godot_variant *", "p_key"] + ["const godot_string *", "p_self"], + ["const godot_string *", "p_str"] ] }, { - "name": "godot_dictionary_operator_index_const", - "return_type": "const godot_variant *", + "name": "godot_string_naturalnocasecmp_to", + "return_type": "signed char", "arguments": [ - ["const godot_dictionary *", "p_self"], - ["const godot_variant *", "p_key"] + ["const godot_string *", "p_self"], + ["const godot_string *", "p_str"] ] }, { - "name": "godot_dictionary_next", - "return_type": "godot_variant *", + "name": "godot_string_begins_with", + "return_type": "godot_bool", "arguments": [ - ["const godot_dictionary *", "p_self"], - ["const godot_variant *", "p_key"] + ["const godot_string *", "p_self"], + ["const godot_string *", "p_string"] ] }, { - "name": "godot_dictionary_operator_equal", + "name": "godot_string_begins_with_char_array", "return_type": "godot_bool", "arguments": [ - ["const godot_dictionary *", "p_self"], - ["const godot_dictionary *", "p_b"] + ["const godot_string *", "p_self"], + ["const char *", "p_char_array"] ] }, { - "name": "godot_dictionary_to_json", + "name": "godot_string_bigrams", + "return_type": "godot_array", + "arguments": [ + ["const godot_string *", "p_self"] + ] + }, + { + "name": "godot_string_chr", "return_type": "godot_string", "arguments": [ - ["const godot_dictionary *", "p_self"] + ["wchar_t", "p_character"] ] }, { - "name": "godot_node_path_new", - "return_type": "void", + "name": "godot_string_ends_with", + "return_type": "godot_bool", "arguments": [ - ["godot_node_path *", "r_dest"], - ["const godot_string *", "p_from"] + ["const godot_string *", "p_self"], + ["const godot_string *", "p_string"] ] }, { - "name": "godot_node_path_new_copy", - "return_type": "void", + "name": "godot_string_find", + "return_type": "godot_int", "arguments": [ - ["godot_node_path *", "r_dest"], - ["const godot_node_path *", "p_src"] + ["const godot_string *", "p_self"], + ["godot_string", "p_what"] ] }, { - "name": "godot_node_path_destroy", - "return_type": "void", + "name": "godot_string_find_from", + "return_type": "godot_int", "arguments": [ - ["godot_node_path *", "p_self"] + ["const godot_string *", "p_self"], + ["godot_string", "p_what"], + ["godot_int", "p_from"] ] }, { - "name": "godot_node_path_as_string", - "return_type": "godot_string", + "name": "godot_string_findmk", + "return_type": "godot_int", "arguments": [ - ["const godot_node_path *", "p_self"] + ["const godot_string *", "p_self"], + ["const godot_array *", "p_keys"] ] }, { - "name": "godot_node_path_is_absolute", - "return_type": "godot_bool", + "name": "godot_string_findmk_from", + "return_type": "godot_int", "arguments": [ - ["const godot_node_path *", "p_self"] + ["const godot_string *", "p_self"], + ["const godot_array *", "p_keys"], + ["godot_int", "p_from"] ] }, { - "name": "godot_node_path_get_name_count", + "name": "godot_string_findmk_from_in_place", "return_type": "godot_int", "arguments": [ - ["const godot_node_path *", "p_self"] + ["const godot_string *", "p_self"], + ["const godot_array *", "p_keys"], + ["godot_int", "p_from"], + ["godot_int *", "r_key"] ] }, { - "name": "godot_node_path_get_name", + "name": "godot_string_findn", + "return_type": "godot_int", + "arguments": [ + ["const godot_string *", "p_self"], + ["godot_string", "p_what"] + ] + }, + { + "name": "godot_string_findn_from", + "return_type": "godot_int", + "arguments": [ + ["const godot_string *", "p_self"], + ["godot_string", "p_what"], + ["godot_int", "p_from"] + ] + }, + { + "name": "godot_string_find_last", + "return_type": "godot_int", + "arguments": [ + ["const godot_string *", "p_self"], + ["godot_string", "p_what"] + ] + }, + { + "name": "godot_string_format", "return_type": "godot_string", "arguments": [ - ["const godot_node_path *", "p_self"], - ["const godot_int", "p_idx"] + ["const godot_string *", "p_self"], + ["const godot_variant *", "p_values"] ] }, { - "name": "godot_node_path_get_subname_count", + "name": "godot_string_format_with_custom_placeholder", + "return_type": "godot_string", + "arguments": [ + ["const godot_string *", "p_self"], + ["const godot_variant *", "p_values"], + ["const char *", "p_placeholder"] + ] + }, + { + "name": "godot_string_hex_encode_buffer", + "return_type": "godot_string", + "arguments": [ + ["const uint8_t *", "p_buffer"], + ["godot_int", "p_len"] + ] + }, + { + "name": "godot_string_hex_to_int", "return_type": "godot_int", "arguments": [ - ["const godot_node_path *", "p_self"] + ["const godot_string *", "p_self"] ] }, { - "name": "godot_node_path_get_subname", + "name": "godot_string_hex_to_int_without_prefix", + "return_type": "godot_int", + "arguments": [ + ["const godot_string *", "p_self"] + ] + }, + { + "name": "godot_string_insert", "return_type": "godot_string", "arguments": [ - ["const godot_node_path *", "p_self"], - ["const godot_int", "p_idx"] + ["const godot_string *", "p_self"], + ["godot_int", "p_at_pos"], + ["godot_string", "p_string"] ] }, { - "name": "godot_node_path_get_concatenated_subnames", + "name": "godot_string_is_numeric", + "return_type": "godot_bool", + "arguments": [ + ["const godot_string *", "p_self"] + ] + }, + { + "name": "godot_string_is_subsequence_of", + "return_type": "godot_bool", + "arguments": [ + ["const godot_string *", "p_self"], + ["const godot_string *", "p_string"] + ] + }, + { + "name": "godot_string_is_subsequence_ofi", + "return_type": "godot_bool", + "arguments": [ + ["const godot_string *", "p_self"], + ["const godot_string *", "p_string"] + ] + }, + { + "name": "godot_string_lpad", "return_type": "godot_string", "arguments": [ - ["const godot_node_path *", "p_self"] + ["const godot_string *", "p_self"], + ["godot_int", "p_min_length"] ] }, { - "name": "godot_node_path_is_empty", + "name": "godot_string_lpad_with_custom_character", + "return_type": "godot_string", + "arguments": [ + ["const godot_string *", "p_self"], + ["godot_int", "p_min_length"], + ["const godot_string *", "p_character"] + ] + }, + { + "name": "godot_string_match", "return_type": "godot_bool", "arguments": [ - ["const godot_node_path *", "p_self"] + ["const godot_string *", "p_self"], + ["const godot_string *", "p_wildcard"] ] }, { - "name": "godot_node_path_operator_equal", + "name": "godot_string_matchn", "return_type": "godot_bool", "arguments": [ - ["const godot_node_path *", "p_self"], - ["const godot_node_path *", "p_b"] + ["const godot_string *", "p_self"], + ["const godot_string *", "p_wildcard"] ] }, { - "name": "godot_plane_new_with_reals", - "return_type": "void", + "name": "godot_string_md5", + "return_type": "godot_string", "arguments": [ - ["godot_plane *", "r_dest"], - ["const godot_real", "p_a"], - ["const godot_real", "p_b"], - ["const godot_real", "p_c"], - ["const godot_real", "p_d"] + ["const uint8_t *", "p_md5"] ] }, { - "name": "godot_plane_new_with_vectors", - "return_type": "void", + "name": "godot_string_num", + "return_type": "godot_string", "arguments": [ - ["godot_plane *", "r_dest"], - ["const godot_vector3 *", "p_v1"], - ["const godot_vector3 *", "p_v2"], - ["const godot_vector3 *", "p_v3"] + ["double", "p_num"] ] }, { - "name": "godot_plane_new_with_normal", - "return_type": "void", + "name": "godot_string_num_int64", + "return_type": "godot_string", "arguments": [ - ["godot_plane *", "r_dest"], - ["const godot_vector3 *", "p_normal"], - ["const godot_real", "p_d"] + ["int64_t", "p_num"], + ["godot_int", "p_base"] ] }, { - "name": "godot_plane_as_string", + "name": "godot_string_num_int64_capitalized", "return_type": "godot_string", "arguments": [ - ["const godot_plane *", "p_self"] + ["int64_t", "p_num"], + ["godot_int", "p_base"], + ["godot_bool", "p_capitalize_hex"] ] }, { - "name": "godot_plane_normalized", - "return_type": "godot_plane", + "name": "godot_string_num_real", + "return_type": "godot_string", "arguments": [ - ["const godot_plane *", "p_self"] + ["double", "p_num"] ] }, { - "name": "godot_plane_center", - "return_type": "godot_vector3", + "name": "godot_string_num_scientific", + "return_type": "godot_string", "arguments": [ - ["const godot_plane *", "p_self"] + ["double", "p_num"] ] }, { - "name": "godot_plane_get_any_point", - "return_type": "godot_vector3", + "name": "godot_string_num_with_decimals", + "return_type": "godot_string", "arguments": [ - ["const godot_plane *", "p_self"] + ["double", "p_num"], + ["godot_int", "p_decimals"] ] }, { - "name": "godot_plane_is_point_over", - "return_type": "godot_bool", + "name": "godot_string_pad_decimals", + "return_type": "godot_string", "arguments": [ - ["const godot_plane *", "p_self"], - ["const godot_vector3 *", "p_point"] + ["const godot_string *", "p_self"], + ["godot_int", "p_digits"] ] }, { - "name": "godot_plane_distance_to", - "return_type": "godot_real", + "name": "godot_string_pad_zeros", + "return_type": "godot_string", "arguments": [ - ["const godot_plane *", "p_self"], - ["const godot_vector3 *", "p_point"] + ["const godot_string *", "p_self"], + ["godot_int", "p_digits"] ] }, { - "name": "godot_plane_has_point", - "return_type": "godot_bool", + "name": "godot_string_replace_first", + "return_type": "godot_string", "arguments": [ - ["const godot_plane *", "p_self"], - ["const godot_vector3 *", "p_point"], - ["const godot_real", "p_epsilon"] + ["const godot_string *", "p_self"], + ["godot_string", "p_key"], + ["godot_string", "p_with"] ] }, { - "name": "godot_plane_project", - "return_type": "godot_vector3", + "name": "godot_string_replace", + "return_type": "godot_string", "arguments": [ - ["const godot_plane *", "p_self"], - ["const godot_vector3 *", "p_point"] + ["const godot_string *", "p_self"], + ["godot_string", "p_key"], + ["godot_string", "p_with"] ] }, { - "name": "godot_plane_intersect_3", - "return_type": "godot_bool", + "name": "godot_string_replacen", + "return_type": "godot_string", "arguments": [ - ["const godot_plane *", "p_self"], - ["godot_vector3 *", "r_dest"], - ["const godot_plane *", "p_b"], - ["const godot_plane *", "p_c"] + ["const godot_string *", "p_self"], + ["godot_string", "p_key"], + ["godot_string", "p_with"] ] }, { - "name": "godot_plane_intersects_ray", - "return_type": "godot_bool", + "name": "godot_string_rfind", + "return_type": "godot_int", "arguments": [ - ["const godot_plane *", "p_self"], - ["godot_vector3 *", "r_dest"], - ["const godot_vector3 *", "p_from"], - ["const godot_vector3 *", "p_dir"] + ["const godot_string *", "p_self"], + ["godot_string", "p_what"] ] }, { - "name": "godot_plane_intersects_segment", - "return_type": "godot_bool", + "name": "godot_string_rfindn", + "return_type": "godot_int", "arguments": [ - ["const godot_plane *", "p_self"], - ["godot_vector3 *", "r_dest"], - ["const godot_vector3 *", "p_begin"], - ["const godot_vector3 *", "p_end"] + ["const godot_string *", "p_self"], + ["godot_string", "p_what"] ] }, { - "name": "godot_plane_operator_neg", - "return_type": "godot_plane", + "name": "godot_string_rfind_from", + "return_type": "godot_int", "arguments": [ - ["const godot_plane *", "p_self"] + ["const godot_string *", "p_self"], + ["godot_string", "p_what"], + ["godot_int", "p_from"] ] }, { - "name": "godot_plane_operator_equal", - "return_type": "godot_bool", + "name": "godot_string_rfindn_from", + "return_type": "godot_int", "arguments": [ - ["const godot_plane *", "p_self"], - ["const godot_plane *", "p_b"] + ["const godot_string *", "p_self"], + ["godot_string", "p_what"], + ["godot_int", "p_from"] ] }, { - "name": "godot_plane_set_normal", - "return_type": "void", + "name": "godot_string_rpad", + "return_type": "godot_string", "arguments": [ - ["godot_plane *", "p_self"], - ["const godot_vector3 *", "p_normal"] + ["const godot_string *", "p_self"], + ["godot_int", "p_min_length"] ] }, { - "name": "godot_plane_get_normal", - "return_type": "godot_vector3", + "name": "godot_string_rpad_with_custom_character", + "return_type": "godot_string", "arguments": [ - ["const godot_plane *", "p_self"] + ["const godot_string *", "p_self"], + ["godot_int", "p_min_length"], + ["const godot_string *", "p_character"] ] }, { - "name": "godot_plane_get_d", + "name": "godot_string_similarity", "return_type": "godot_real", "arguments": [ - ["const godot_plane *", "p_self"] + ["const godot_string *", "p_self"], + ["const godot_string *", "p_string"] ] }, { - "name": "godot_plane_set_d", - "return_type": "void", + "name": "godot_string_sprintf", + "return_type": "godot_string", "arguments": [ - ["godot_plane *", "p_self"], - ["const godot_real", "p_d"] + ["const godot_string *", "p_self"], + ["const godot_array *", "p_values"], + ["godot_bool *", "p_error"] ] }, { - "name": "godot_rect2_new_with_position_and_size", - "return_type": "void", + "name": "godot_string_substr", + "return_type": "godot_string", "arguments": [ - ["godot_rect2 *", "r_dest"], - ["const godot_vector2 *", "p_pos"], - ["const godot_vector2 *", "p_size"] + ["const godot_string *", "p_self"], + ["godot_int", "p_from"], + ["godot_int", "p_chars"] ] }, { - "name": "godot_rect2_new", - "return_type": "void", + "name": "godot_string_to_double", + "return_type": "double", "arguments": [ - ["godot_rect2 *", "r_dest"], - ["const godot_real", "p_x"], - ["const godot_real", "p_y"], - ["const godot_real", "p_width"], - ["const godot_real", "p_height"] + ["const godot_string *", "p_self"] ] }, { - "name": "godot_rect2_as_string", + "name": "godot_string_to_float", + "return_type": "godot_real", + "arguments": [ + ["const godot_string *", "p_self"] + ] + }, + { + "name": "godot_string_to_int", + "return_type": "godot_int", + "arguments": [ + ["const godot_string *", "p_self"] + ] + }, + { + "name": "godot_string_camelcase_to_underscore", "return_type": "godot_string", "arguments": [ - ["const godot_rect2 *", "p_self"] + ["const godot_string *", "p_self"] ] }, { - "name": "godot_rect2_get_area", - "return_type": "godot_real", + "name": "godot_string_camelcase_to_underscore_lowercased", + "return_type": "godot_string", "arguments": [ - ["const godot_rect2 *", "p_self"] + ["const godot_string *", "p_self"] ] }, { - "name": "godot_rect2_intersects", - "return_type": "godot_bool", + "name": "godot_string_capitalize", + "return_type": "godot_string", "arguments": [ - ["const godot_rect2 *", "p_self"], - ["const godot_rect2 *", "p_b"] + ["const godot_string *", "p_self"] ] }, { - "name": "godot_rect2_encloses", - "return_type": "godot_bool", + "name": "godot_string_char_to_double", + "return_type": "double", "arguments": [ - ["const godot_rect2 *", "p_self"], - ["const godot_rect2 *", "p_b"] + ["const char *", "p_what"] ] }, { - "name": "godot_rect2_has_no_area", - "return_type": "godot_bool", + "name": "godot_string_char_to_int", + "return_type": "godot_int", "arguments": [ - ["const godot_rect2 *", "p_self"] + ["const char *", "p_what"] ] }, { - "name": "godot_rect2_clip", - "return_type": "godot_rect2", + "name": "godot_string_wchar_to_int", + "return_type": "int64_t", "arguments": [ - ["const godot_rect2 *", "p_self"], - ["const godot_rect2 *", "p_b"] + ["const wchar_t *", "p_str"] ] }, { - "name": "godot_rect2_merge", - "return_type": "godot_rect2", + "name": "godot_string_char_to_int_with_len", + "return_type": "godot_int", "arguments": [ - ["const godot_rect2 *", "p_self"], - ["const godot_rect2 *", "p_b"] + ["const char *", "p_what"], + ["godot_int", "p_len"] ] }, { - "name": "godot_rect2_has_point", - "return_type": "godot_bool", + "name": "godot_string_char_to_int64_with_len", + "return_type": "int64_t", "arguments": [ - ["const godot_rect2 *", "p_self"], - ["const godot_vector2 *", "p_point"] + ["const wchar_t *", "p_str"], + ["int", "p_len"] ] }, { - "name": "godot_rect2_grow", - "return_type": "godot_rect2", + "name": "godot_string_hex_to_int64", + "return_type": "int64_t", "arguments": [ - ["const godot_rect2 *", "p_self"], - ["const godot_real", "p_by"] + ["const godot_string *", "p_self"] ] }, { - "name": "godot_rect2_expand", - "return_type": "godot_rect2", + "name": "godot_string_hex_to_int64_with_prefix", + "return_type": "int64_t", "arguments": [ - ["const godot_rect2 *", "p_self"], - ["const godot_vector2 *", "p_to"] + ["const godot_string *", "p_self"] ] }, { - "name": "godot_rect2_operator_equal", - "return_type": "godot_bool", + "name": "godot_string_to_int64", + "return_type": "int64_t", "arguments": [ - ["const godot_rect2 *", "p_self"], - ["const godot_rect2 *", "p_b"] + ["const godot_string *", "p_self"] ] }, { - "name": "godot_rect2_get_position", - "return_type": "godot_vector2", + "name": "godot_string_unicode_char_to_double", + "return_type": "double", "arguments": [ - ["const godot_rect2 *", "p_self"] + ["const wchar_t *", "p_str"], + ["const wchar_t **", "r_end"] ] }, { - "name": "godot_rect2_get_size", - "return_type": "godot_vector2", + "name": "godot_string_get_slice_count", + "return_type": "godot_int", "arguments": [ - ["const godot_rect2 *", "p_self"] + ["const godot_string *", "p_self"], + ["godot_string", "p_splitter"] ] }, { - "name": "godot_rect2_set_position", - "return_type": "void", + "name": "godot_string_get_slice", + "return_type": "godot_string", "arguments": [ - ["godot_rect2 *", "p_self"], - ["const godot_vector2 *", "p_pos"] + ["const godot_string *", "p_self"], + ["godot_string", "p_splitter"], + ["godot_int", "p_slice"] ] }, { - "name": "godot_rect2_set_size", - "return_type": "void", + "name": "godot_string_get_slicec", + "return_type": "godot_string", "arguments": [ - ["godot_rect2 *", "p_self"], - ["const godot_vector2 *", "p_size"] + ["const godot_string *", "p_self"], + ["wchar_t", "p_splitter"], + ["godot_int", "p_slice"] ] }, { - "name": "godot_aabb_new", - "return_type": "void", + "name": "godot_string_split", + "return_type": "godot_array", "arguments": [ - ["godot_aabb *", "r_dest"], - ["const godot_vector3 *", "p_pos"], - ["const godot_vector3 *", "p_size"] + ["const godot_string *", "p_self"], + ["const godot_string *", "p_splitter"] ] }, { - "name": "godot_aabb_get_position", - "return_type": "godot_vector3", + "name": "godot_string_split_allow_empty", + "return_type": "godot_array", "arguments": [ - ["const godot_aabb *", "p_self"] + ["const godot_string *", "p_self"], + ["const godot_string *", "p_splitter"] ] }, { - "name": "godot_aabb_set_position", - "return_type": "void", + "name": "godot_string_split_floats", + "return_type": "godot_array", "arguments": [ - ["const godot_aabb *", "p_self"], - ["const godot_vector3 *", "p_v"] + ["const godot_string *", "p_self"], + ["const godot_string *", "p_splitter"] ] }, { - "name": "godot_aabb_get_size", - "return_type": "godot_vector3", + "name": "godot_string_split_floats_allows_empty", + "return_type": "godot_array", "arguments": [ - ["const godot_aabb *", "p_self"] + ["const godot_string *", "p_self"], + ["const godot_string *", "p_splitter"] ] }, { - "name": "godot_aabb_set_size", - "return_type": "void", + "name": "godot_string_split_floats_mk", + "return_type": "godot_array", "arguments": [ - ["const godot_aabb *", "p_self"], - ["const godot_vector3 *", "p_v"] + ["const godot_string *", "p_self"], + ["const godot_array *", "p_splitters"] ] }, { - "name": "godot_aabb_as_string", + "name": "godot_string_split_floats_mk_allows_empty", + "return_type": "godot_array", + "arguments": [ + ["const godot_string *", "p_self"], + ["const godot_array *", "p_splitters"] + ] + }, + { + "name": "godot_string_split_ints", + "return_type": "godot_array", + "arguments": [ + ["const godot_string *", "p_self"], + ["const godot_string *", "p_splitter"] + ] + }, + { + "name": "godot_string_split_ints_allows_empty", + "return_type": "godot_array", + "arguments": [ + ["const godot_string *", "p_self"], + ["const godot_string *", "p_splitter"] + ] + }, + { + "name": "godot_string_split_ints_mk", + "return_type": "godot_array", + "arguments": [ + ["const godot_string *", "p_self"], + ["const godot_array *", "p_splitters"] + ] + }, + { + "name": "godot_string_split_ints_mk_allows_empty", + "return_type": "godot_array", + "arguments": [ + ["const godot_string *", "p_self"], + ["const godot_array *", "p_splitters"] + ] + }, + { + "name": "godot_string_split_spaces", + "return_type": "godot_array", + "arguments": [ + ["const godot_string *", "p_self"] + ] + }, + { + "name": "godot_string_rstrip", "return_type": "godot_string", "arguments": [ - ["const godot_aabb *", "p_self"] + ["const godot_string *", "p_self"], + ["const godot_string *", "p_chars"] ] }, { - "name": "godot_aabb_get_area", - "return_type": "godot_real", + "name": "godot_string_rsplit", + "return_type": "godot_packed_string_array", "arguments": [ - ["const godot_aabb *", "p_self"] + ["const godot_string *", "p_self"], + ["const godot_string *", "p_divisor"], + ["const godot_bool", "p_allow_empty"], + ["const godot_int", "p_maxsplit"] ] }, { - "name": "godot_aabb_has_no_area", - "return_type": "godot_bool", + "name": "godot_string_trim_prefix", + "return_type": "godot_string", "arguments": [ - ["const godot_aabb *", "p_self"] + ["const godot_string *", "p_self"], + ["const godot_string *", "p_prefix"] ] }, { - "name": "godot_aabb_has_no_surface", + "name": "godot_string_trim_suffix", + "return_type": "godot_string", + "arguments": [ + ["const godot_string *", "p_self"], + ["const godot_string *", "p_suffix"] + ] + }, + { + "name": "godot_string_char_lowercase", + "return_type": "wchar_t", + "arguments": [ + ["wchar_t", "p_char"] + ] + }, + { + "name": "godot_string_char_uppercase", + "return_type": "wchar_t", + "arguments": [ + ["wchar_t", "p_char"] + ] + }, + { + "name": "godot_string_to_lower", + "return_type": "godot_string", + "arguments": [ + ["const godot_string *", "p_self"] + ] + }, + { + "name": "godot_string_to_upper", + "return_type": "godot_string", + "arguments": [ + ["const godot_string *", "p_self"] + ] + }, + { + "name": "godot_string_get_basename", + "return_type": "godot_string", + "arguments": [ + ["const godot_string *", "p_self"] + ] + }, + { + "name": "godot_string_get_extension", + "return_type": "godot_string", + "arguments": [ + ["const godot_string *", "p_self"] + ] + }, + { + "name": "godot_string_left", + "return_type": "godot_string", + "arguments": [ + ["const godot_string *", "p_self"], + ["godot_int", "p_pos"] + ] + }, + { + "name": "godot_string_ord_at", + "return_type": "wchar_t", + "arguments": [ + ["const godot_string *", "p_self"], + ["godot_int", "p_idx"] + ] + }, + { + "name": "godot_string_plus_file", + "return_type": "godot_string", + "arguments": [ + ["const godot_string *", "p_self"], + ["const godot_string *", "p_file"] + ] + }, + { + "name": "godot_string_right", + "return_type": "godot_string", + "arguments": [ + ["const godot_string *", "p_self"], + ["godot_int", "p_pos"] + ] + }, + { + "name": "godot_string_strip_edges", + "return_type": "godot_string", + "arguments": [ + ["const godot_string *", "p_self"], + ["godot_bool", "p_left"], + ["godot_bool", "p_right"] + ] + }, + { + "name": "godot_string_strip_escapes", + "return_type": "godot_string", + "arguments": [ + ["const godot_string *", "p_self"] + ] + }, + { + "name": "godot_string_erase", + "return_type": "void", + "arguments": [ + ["godot_string *", "p_self"], + ["godot_int", "p_pos"], + ["godot_int", "p_chars"] + ] + }, + { + "name": "godot_string_ascii", + "return_type": "godot_char_string", + "arguments": [ + ["const godot_string *", "p_self"] + ] + }, + { + "name": "godot_string_ascii_extended", + "return_type": "godot_char_string", + "arguments": [ + ["const godot_string *", "p_self"] + ] + }, + { + "name": "godot_string_utf8", + "return_type": "godot_char_string", + "arguments": [ + ["const godot_string *", "p_self"] + ] + }, + { + "name": "godot_string_parse_utf8", "return_type": "godot_bool", "arguments": [ - ["const godot_aabb *", "p_self"] + ["godot_string *", "p_self"], + ["const char *", "p_utf8"] ] }, { - "name": "godot_aabb_intersects", + "name": "godot_string_parse_utf8_with_len", "return_type": "godot_bool", "arguments": [ - ["const godot_aabb *", "p_self"], - ["const godot_aabb *", "p_with"] + ["godot_string *", "p_self"], + ["const char *", "p_utf8"], + ["godot_int", "p_len"] ] }, { - "name": "godot_aabb_encloses", + "name": "godot_string_chars_to_utf8", + "return_type": "godot_string", + "arguments": [ + ["const char *", "p_utf8"] + ] + }, + { + "name": "godot_string_chars_to_utf8_with_len", + "return_type": "godot_string", + "arguments": [ + ["const char *", "p_utf8"], + ["godot_int", "p_len"] + ] + }, + { + "name": "godot_string_hash", + "return_type": "uint32_t", + "arguments": [ + ["const godot_string *", "p_self"] + ] + }, + { + "name": "godot_string_hash64", + "return_type": "uint64_t", + "arguments": [ + ["const godot_string *", "p_self"] + ] + }, + { + "name": "godot_string_hash_chars", + "return_type": "uint32_t", + "arguments": [ + ["const char *", "p_cstr"] + ] + }, + { + "name": "godot_string_hash_chars_with_len", + "return_type": "uint32_t", + "arguments": [ + ["const char *", "p_cstr"], + ["godot_int", "p_len"] + ] + }, + { + "name": "godot_string_hash_utf8_chars", + "return_type": "uint32_t", + "arguments": [ + ["const wchar_t *", "p_str"] + ] + }, + { + "name": "godot_string_hash_utf8_chars_with_len", + "return_type": "uint32_t", + "arguments": [ + ["const wchar_t *", "p_str"], + ["godot_int", "p_len"] + ] + }, + { + "name": "godot_string_md5_buffer", + "return_type": "godot_packed_byte_array", + "arguments": [ + ["const godot_string *", "p_self"] + ] + }, + { + "name": "godot_string_md5_text", + "return_type": "godot_string", + "arguments": [ + ["const godot_string *", "p_self"] + ] + }, + { + "name": "godot_string_sha256_buffer", + "return_type": "godot_packed_byte_array", + "arguments": [ + ["const godot_string *", "p_self"] + ] + }, + { + "name": "godot_string_sha256_text", + "return_type": "godot_string", + "arguments": [ + ["const godot_string *", "p_self"] + ] + }, + { + "name": "godot_string_empty", "return_type": "godot_bool", "arguments": [ - ["const godot_aabb *", "p_self"], - ["const godot_aabb *", "p_with"] + ["const godot_string *", "p_self"] ] }, { - "name": "godot_aabb_merge", - "return_type": "godot_aabb", + "name": "godot_string_get_base_dir", + "return_type": "godot_string", "arguments": [ - ["const godot_aabb *", "p_self"], - ["const godot_aabb *", "p_with"] + ["const godot_string *", "p_self"] ] }, { - "name": "godot_aabb_intersection", - "return_type": "godot_aabb", + "name": "godot_string_get_file", + "return_type": "godot_string", "arguments": [ - ["const godot_aabb *", "p_self"], - ["const godot_aabb *", "p_with"] + ["const godot_string *", "p_self"] ] }, { - "name": "godot_aabb_intersects_plane", + "name": "godot_string_humanize_size", + "return_type": "godot_string", + "arguments": [ + ["size_t", "p_size"] + ] + }, + { + "name": "godot_string_is_abs_path", "return_type": "godot_bool", "arguments": [ - ["const godot_aabb *", "p_self"], - ["const godot_plane *", "p_plane"] + ["const godot_string *", "p_self"] ] }, { - "name": "godot_aabb_intersects_segment", + "name": "godot_string_is_rel_path", "return_type": "godot_bool", "arguments": [ - ["const godot_aabb *", "p_self"], - ["const godot_vector3 *", "p_from"], - ["const godot_vector3 *", "p_to"] + ["const godot_string *", "p_self"] ] }, { - "name": "godot_aabb_has_point", + "name": "godot_string_is_resource_file", "return_type": "godot_bool", "arguments": [ - ["const godot_aabb *", "p_self"], - ["const godot_vector3 *", "p_point"] + ["const godot_string *", "p_self"] ] }, { - "name": "godot_aabb_get_support", - "return_type": "godot_vector3", + "name": "godot_string_path_to", + "return_type": "godot_string", "arguments": [ - ["const godot_aabb *", "p_self"], - ["const godot_vector3 *", "p_dir"] + ["const godot_string *", "p_self"], + ["const godot_string *", "p_path"] ] }, { - "name": "godot_aabb_get_longest_axis", - "return_type": "godot_vector3", + "name": "godot_string_path_to_file", + "return_type": "godot_string", "arguments": [ - ["const godot_aabb *", "p_self"] + ["const godot_string *", "p_self"], + ["const godot_string *", "p_path"] ] }, { - "name": "godot_aabb_get_longest_axis_index", - "return_type": "godot_int", + "name": "godot_string_simplify_path", + "return_type": "godot_string", "arguments": [ - ["const godot_aabb *", "p_self"] + ["const godot_string *", "p_self"] ] }, { - "name": "godot_aabb_get_longest_axis_size", - "return_type": "godot_real", + "name": "godot_string_c_escape", + "return_type": "godot_string", "arguments": [ - ["const godot_aabb *", "p_self"] + ["const godot_string *", "p_self"] ] }, { - "name": "godot_aabb_get_shortest_axis", - "return_type": "godot_vector3", + "name": "godot_string_c_escape_multiline", + "return_type": "godot_string", "arguments": [ - ["const godot_aabb *", "p_self"] + ["const godot_string *", "p_self"] ] }, { - "name": "godot_aabb_get_shortest_axis_index", - "return_type": "godot_int", + "name": "godot_string_c_unescape", + "return_type": "godot_string", "arguments": [ - ["const godot_aabb *", "p_self"] + ["const godot_string *", "p_self"] ] }, { - "name": "godot_aabb_get_shortest_axis_size", - "return_type": "godot_real", + "name": "godot_string_http_escape", + "return_type": "godot_string", "arguments": [ - ["const godot_aabb *", "p_self"] + ["const godot_string *", "p_self"] ] }, { - "name": "godot_aabb_expand", - "return_type": "godot_aabb", + "name": "godot_string_http_unescape", + "return_type": "godot_string", "arguments": [ - ["const godot_aabb *", "p_self"], - ["const godot_vector3 *", "p_to_point"] + ["const godot_string *", "p_self"] ] }, { - "name": "godot_aabb_grow", - "return_type": "godot_aabb", + "name": "godot_string_json_escape", + "return_type": "godot_string", "arguments": [ - ["const godot_aabb *", "p_self"], - ["const godot_real", "p_by"] + ["const godot_string *", "p_self"] ] }, { - "name": "godot_aabb_get_endpoint", - "return_type": "godot_vector3", + "name": "godot_string_word_wrap", + "return_type": "godot_string", "arguments": [ - ["const godot_aabb *", "p_self"], - ["const godot_int", "p_idx"] + ["const godot_string *", "p_self"], + ["godot_int", "p_chars_per_line"] ] }, { - "name": "godot_aabb_operator_equal", + "name": "godot_string_xml_escape", + "return_type": "godot_string", + "arguments": [ + ["const godot_string *", "p_self"] + ] + }, + { + "name": "godot_string_xml_escape_with_quotes", + "return_type": "godot_string", + "arguments": [ + ["const godot_string *", "p_self"] + ] + }, + { + "name": "godot_string_xml_unescape", + "return_type": "godot_string", + "arguments": [ + ["const godot_string *", "p_self"] + ] + }, + { + "name": "godot_string_percent_decode", + "return_type": "godot_string", + "arguments": [ + ["const godot_string *", "p_self"] + ] + }, + { + "name": "godot_string_percent_encode", + "return_type": "godot_string", + "arguments": [ + ["const godot_string *", "p_self"] + ] + }, + { + "name": "godot_string_is_valid_float", "return_type": "godot_bool", "arguments": [ - ["const godot_aabb *", "p_self"], - ["const godot_aabb *", "p_b"] + ["const godot_string *", "p_self"] ] }, { - "name": "godot_rid_new", + "name": "godot_string_is_valid_hex_number", + "return_type": "godot_bool", + "arguments": [ + ["const godot_string *", "p_self"], + ["godot_bool", "p_with_prefix"] + ] + }, + { + "name": "godot_string_is_valid_html_color", + "return_type": "godot_bool", + "arguments": [ + ["const godot_string *", "p_self"] + ] + }, + { + "name": "godot_string_is_valid_identifier", + "return_type": "godot_bool", + "arguments": [ + ["const godot_string *", "p_self"] + ] + }, + { + "name": "godot_string_is_valid_integer", + "return_type": "godot_bool", + "arguments": [ + ["const godot_string *", "p_self"] + ] + }, + { + "name": "godot_string_is_valid_ip_address", + "return_type": "godot_bool", + "arguments": [ + ["const godot_string *", "p_self"] + ] + }, + { + "name": "godot_string_destroy", "return_type": "void", "arguments": [ - ["godot_rid *", "r_dest"] + ["godot_string *", "p_self"] ] }, { - "name": "godot_rid_get_id", - "return_type": "godot_int", + "name": "godot_string_name_new", + "return_type": "void", "arguments": [ - ["const godot_rid *", "p_self"] + ["godot_string_name *", "r_dest"], + ["const godot_string *", "p_name"] ] }, { - "name": "godot_rid_new_with_resource", + "name": "godot_string_name_new_data", "return_type": "void", "arguments": [ - ["godot_rid *", "r_dest"], - ["const godot_object *", "p_from"] + ["godot_string_name *", "r_dest"], + ["const char *", "p_name"] ] }, { - "name": "godot_rid_operator_equal", + "name": "godot_string_name_get_name", + "return_type": "godot_string", + "arguments": [ + ["const godot_string_name *", "p_self"] + ] + }, + { + "name": "godot_string_name_get_hash", + "return_type": "uint32_t", + "arguments": [ + ["const godot_string_name *", "p_self"] + ] + }, + { + "name": "godot_string_name_get_data_unique_pointer", + "return_type": "const void *", + "arguments": [ + ["const godot_string_name *", "p_self"] + ] + }, + { + "name": "godot_string_name_operator_equal", "return_type": "godot_bool", "arguments": [ - ["const godot_rid *", "p_self"], - ["const godot_rid *", "p_b"] + ["const godot_string_name *", "p_self"], + ["const godot_string_name *", "p_other"] ] }, { - "name": "godot_rid_operator_less", + "name": "godot_string_name_operator_less", "return_type": "godot_bool", "arguments": [ - ["const godot_rid *", "p_self"], - ["const godot_rid *", "p_b"] + ["const godot_string_name *", "p_self"], + ["const godot_string_name *", "p_other"] + ] + }, + { + "name": "godot_string_name_destroy", + "return_type": "void", + "arguments": [ + ["godot_string_name *", "p_self"] ] }, { @@ -3525,6 +4867,14 @@ ] }, { + "name": "godot_transform_new_with_quat", + "return_type": "void", + "arguments": [ + ["godot_transform *", "r_dest"], + ["const godot_quat *", "p_quat"] + ] + }, + { "name": "godot_transform_new", "return_type": "void", "arguments": [ @@ -3931,6 +5281,14 @@ ] }, { + "name": "godot_variant_new_string_name", + "return_type": "void", + "arguments": [ + ["godot_variant *", "r_dest"], + ["const godot_string_name *", "p_s"] + ] + }, + { "name": "godot_variant_new_vector2", "return_type": "void", "arguments": [ @@ -3939,6 +5297,14 @@ ] }, { + "name": "godot_variant_new_vector2i", + "return_type": "void", + "arguments": [ + ["godot_variant *", "r_dest"], + ["const godot_vector2i *", "p_v2"] + ] + }, + { "name": "godot_variant_new_rect2", "return_type": "void", "arguments": [ @@ -3947,6 +5313,14 @@ ] }, { + "name": "godot_variant_new_rect2i", + "return_type": "void", + "arguments": [ + ["godot_variant *", "r_dest"], + ["const godot_rect2i *", "p_rect2"] + ] + }, + { "name": "godot_variant_new_vector3", "return_type": "void", "arguments": [ @@ -3955,6 +5329,14 @@ ] }, { + "name": "godot_variant_new_vector3i", + "return_type": "void", + "arguments": [ + ["godot_variant *", "r_dest"], + ["const godot_vector3i *", "p_v3"] + ] + }, + { "name": "godot_variant_new_transform2d", "return_type": "void", "arguments": [ @@ -4035,6 +5417,22 @@ ] }, { + "name": "godot_variant_new_callable", + "return_type": "void", + "arguments": [ + ["godot_variant *", "r_dest"], + ["const godot_callable *", "p_cb"] + ] + }, + { + "name": "godot_variant_new_signal", + "return_type": "void", + "arguments": [ + ["godot_variant *", "r_dest"], + ["const godot_signal *", "p_signal"] + ] + }, + { "name": "godot_variant_new_dictionary", "return_type": "void", "arguments": [ @@ -4059,19 +5457,35 @@ ] }, { - "name": "godot_variant_new_packed_int_array", + "name": "godot_variant_new_packed_int32_array", "return_type": "void", "arguments": [ ["godot_variant *", "r_dest"], - ["const godot_packed_int_array *", "p_pia"] + ["const godot_packed_int32_array *", "p_pia"] ] }, { - "name": "godot_variant_new_packed_real_array", + "name": "godot_variant_new_packed_int64_array", "return_type": "void", "arguments": [ ["godot_variant *", "r_dest"], - ["const godot_packed_real_array *", "p_pra"] + ["const godot_packed_int64_array *", "p_pia"] + ] + }, + { + "name": "godot_variant_new_packed_float32_array", + "return_type": "void", + "arguments": [ + ["godot_variant *", "r_dest"], + ["const godot_packed_float32_array *", "p_pra"] + ] + }, + { + "name": "godot_variant_new_packed_float64_array", + "return_type": "void", + "arguments": [ + ["godot_variant *", "r_dest"], + ["const godot_packed_float64_array *", "p_pra"] ] }, { @@ -4142,6 +5556,13 @@ ] }, { + "name": "godot_variant_as_string_name", + "return_type": "godot_string_name", + "arguments": [ + ["const godot_variant *", "p_self"] + ] + }, + { "name": "godot_variant_as_vector2", "return_type": "godot_vector2", "arguments": [ @@ -4149,6 +5570,13 @@ ] }, { + "name": "godot_variant_as_vector2i", + "return_type": "godot_vector2i", + "arguments": [ + ["const godot_variant *", "p_self"] + ] + }, + { "name": "godot_variant_as_rect2", "return_type": "godot_rect2", "arguments": [ @@ -4156,6 +5584,13 @@ ] }, { + "name": "godot_variant_as_rect2i", + "return_type": "godot_rect2i", + "arguments": [ + ["const godot_variant *", "p_self"] + ] + }, + { "name": "godot_variant_as_vector3", "return_type": "godot_vector3", "arguments": [ @@ -4163,6 +5598,13 @@ ] }, { + "name": "godot_variant_as_vector3i", + "return_type": "godot_vector3i", + "arguments": [ + ["const godot_variant *", "p_self"] + ] + }, + { "name": "godot_variant_as_transform2d", "return_type": "godot_transform2d", "arguments": [ @@ -4233,6 +5675,20 @@ ] }, { + "name": "godot_variant_as_callable", + "return_type": "godot_callable", + "arguments": [ + ["const godot_variant *", "p_self"] + ] + }, + { + "name": "godot_variant_as_signal", + "return_type": "godot_signal", + "arguments": [ + ["const godot_variant *", "p_self"] + ] + }, + { "name": "godot_variant_as_dictionary", "return_type": "godot_dictionary", "arguments": [ @@ -4254,15 +5710,29 @@ ] }, { - "name": "godot_variant_as_packed_int_array", - "return_type": "godot_packed_int_array", + "name": "godot_variant_as_packed_int32_array", + "return_type": "godot_packed_int32_array", "arguments": [ ["const godot_variant *", "p_self"] ] }, { - "name": "godot_variant_as_packed_real_array", - "return_type": "godot_packed_real_array", + "name": "godot_variant_as_packed_int64_array", + "return_type": "godot_packed_int64_array", + "arguments": [ + ["const godot_variant *", "p_self"] + ] + }, + { + "name": "godot_variant_as_packed_float32_array", + "return_type": "godot_packed_float32_array", + "arguments": [ + ["const godot_variant *", "p_self"] + ] + }, + { + "name": "godot_variant_as_packed_float64_array", + "return_type": "godot_packed_float64_array", "arguments": [ ["const godot_variant *", "p_self"] ] @@ -4315,15 +5785,14 @@ ] }, { - "name": "godot_variant_operator_equal", - "return_type": "godot_bool", + "name": "godot_variant_hash", + "return_type": "uint32_t", "arguments": [ - ["const godot_variant *", "p_self"], - ["const godot_variant *", "p_other"] + ["const godot_variant *", "p_self"] ] }, { - "name": "godot_variant_operator_less", + "name": "godot_variant_operator_equal", "return_type": "godot_bool", "arguments": [ ["const godot_variant *", "p_self"], @@ -4331,7 +5800,7 @@ ] }, { - "name": "godot_variant_hash_compare", + "name": "godot_variant_operator_less", "return_type": "godot_bool", "arguments": [ ["const godot_variant *", "p_self"], @@ -4339,1236 +5808,1005 @@ ] }, { - "name": "godot_variant_booleanize", - "return_type": "godot_bool", - "arguments": [ - ["const godot_variant *", "p_self"] - ] - }, - { - "name": "godot_variant_destroy", - "return_type": "void", - "arguments": [ - ["godot_variant *", "p_self"] - ] - }, - { - "name": "godot_char_string_length", - "return_type": "godot_int", - "arguments": [ - ["const godot_char_string *", "p_cs"] - ] - }, - { - "name": "godot_char_string_get_data", - "return_type": "const char *", + "name": "godot_variant_get_operator_name", + "return_type": "godot_string", "arguments": [ - ["const godot_char_string *", "p_cs"] + ["godot_variant_operator", "p_op"] ] }, { - "name": "godot_char_string_destroy", + "name": "godot_variant_evaluate", "return_type": "void", "arguments": [ - ["godot_char_string *", "p_cs"] + ["godot_variant_operator", "p_op"], + ["const godot_variant *", "p_a"], + ["const godot_variant *", "p_b"], + ["godot_variant *", "r_ret"], + ["godot_bool *", "r_valid"] ] }, { - "name": "godot_string_new", - "return_type": "void", + "name": "godot_variant_hash_compare", + "return_type": "godot_bool", "arguments": [ - ["godot_string *", "r_dest"] + ["const godot_variant *", "p_self"], + ["const godot_variant *", "p_other"] ] }, { - "name": "godot_string_new_copy", - "return_type": "void", + "name": "godot_variant_booleanize", + "return_type": "godot_bool", "arguments": [ - ["godot_string *", "r_dest"], - ["const godot_string *", "p_src"] + ["const godot_variant *", "p_self"] ] }, { - "name": "godot_string_new_with_wide_string", + "name": "godot_variant_destroy", "return_type": "void", "arguments": [ - ["godot_string *", "r_dest"], - ["const wchar_t *", "p_contents"], - ["const int", "p_size"] + ["godot_variant *", "p_self"] ] }, { - "name": "godot_string_operator_index", - "return_type": "const wchar_t *", + "name": "godot_vector2_as_vector2i", + "return_type": "godot_vector2i", "arguments": [ - ["godot_string *", "p_self"], - ["const godot_int", "p_idx"] + ["const godot_vector2 *", "p_self"] ] }, { - "name": "godot_string_operator_index_const", - "return_type": "wchar_t", + "name": "godot_vector2_sign", + "return_type": "godot_vector2", "arguments": [ - ["const godot_string *", "p_self"], - ["const godot_int", "p_idx"] + ["const godot_vector2 *", "p_self"] ] }, { - "name": "godot_string_wide_str", - "return_type": "const wchar_t *", + "name": "godot_vector2_move_toward", + "return_type": "godot_vector2", "arguments": [ - ["const godot_string *", "p_self"] + ["const godot_vector2 *", "p_self"], + ["const godot_vector2 *", "p_to"], + ["const godot_real", "p_delta"] ] }, { - "name": "godot_string_operator_equal", - "return_type": "godot_bool", + "name": "godot_vector2_direction_to", + "return_type": "godot_vector2", "arguments": [ - ["const godot_string *", "p_self"], - ["const godot_string *", "p_b"] + ["const godot_vector2 *", "p_self"], + ["const godot_vector2 *", "p_to"] ] }, { - "name": "godot_string_operator_less", - "return_type": "godot_bool", + "name": "godot_vector2_new", + "return_type": "void", "arguments": [ - ["const godot_string *", "p_self"], - ["const godot_string *", "p_b"] + ["godot_vector2 *", "r_dest"], + ["const godot_real", "p_x"], + ["const godot_real", "p_y"] ] }, { - "name": "godot_string_operator_plus", + "name": "godot_vector2_as_string", "return_type": "godot_string", "arguments": [ - ["const godot_string *", "p_self"], - ["const godot_string *", "p_b"] + ["const godot_vector2 *", "p_self"] ] }, { - "name": "godot_string_length", - "return_type": "godot_int", + "name": "godot_vector2_normalized", + "return_type": "godot_vector2", "arguments": [ - ["const godot_string *", "p_self"] + ["const godot_vector2 *", "p_self"] ] }, { - "name": "godot_string_casecmp_to", - "return_type": "signed char", + "name": "godot_vector2_length", + "return_type": "godot_real", "arguments": [ - ["const godot_string *", "p_self"], - ["const godot_string *", "p_str"] + ["const godot_vector2 *", "p_self"] ] }, { - "name": "godot_string_nocasecmp_to", - "return_type": "signed char", + "name": "godot_vector2_angle", + "return_type": "godot_real", "arguments": [ - ["const godot_string *", "p_self"], - ["const godot_string *", "p_str"] + ["const godot_vector2 *", "p_self"] ] }, { - "name": "godot_string_naturalnocasecmp_to", - "return_type": "signed char", + "name": "godot_vector2_length_squared", + "return_type": "godot_real", "arguments": [ - ["const godot_string *", "p_self"], - ["const godot_string *", "p_str"] + ["const godot_vector2 *", "p_self"] ] }, { - "name": "godot_string_begins_with", + "name": "godot_vector2_is_normalized", "return_type": "godot_bool", "arguments": [ - ["const godot_string *", "p_self"], - ["const godot_string *", "p_string"] + ["const godot_vector2 *", "p_self"] ] }, { - "name": "godot_string_begins_with_char_array", - "return_type": "godot_bool", + "name": "godot_vector2_distance_to", + "return_type": "godot_real", "arguments": [ - ["const godot_string *", "p_self"], - ["const char *", "p_char_array"] + ["const godot_vector2 *", "p_self"], + ["const godot_vector2 *", "p_to"] ] }, { - "name": "godot_string_bigrams", - "return_type": "godot_array", + "name": "godot_vector2_distance_squared_to", + "return_type": "godot_real", "arguments": [ - ["const godot_string *", "p_self"] + ["const godot_vector2 *", "p_self"], + ["const godot_vector2 *", "p_to"] ] }, { - "name": "godot_string_chr", - "return_type": "godot_string", + "name": "godot_vector2_angle_to", + "return_type": "godot_real", "arguments": [ - ["wchar_t", "p_character"] + ["const godot_vector2 *", "p_self"], + ["const godot_vector2 *", "p_to"] ] }, { - "name": "godot_string_ends_with", - "return_type": "godot_bool", + "name": "godot_vector2_angle_to_point", + "return_type": "godot_real", "arguments": [ - ["const godot_string *", "p_self"], - ["const godot_string *", "p_string"] + ["const godot_vector2 *", "p_self"], + ["const godot_vector2 *", "p_to"] ] }, { - "name": "godot_string_find", - "return_type": "godot_int", + "name": "godot_vector2_lerp", + "return_type": "godot_vector2", "arguments": [ - ["const godot_string *", "p_self"], - ["godot_string", "p_what"] + ["const godot_vector2 *", "p_self"], + ["const godot_vector2 *", "p_b"], + ["const godot_real", "p_t"] ] }, { - "name": "godot_string_find_from", - "return_type": "godot_int", + "name": "godot_vector2_cubic_interpolate", + "return_type": "godot_vector2", "arguments": [ - ["const godot_string *", "p_self"], - ["godot_string", "p_what"], - ["godot_int", "p_from"] + ["const godot_vector2 *", "p_self"], + ["const godot_vector2 *", "p_b"], + ["const godot_vector2 *", "p_pre_a"], + ["const godot_vector2 *", "p_post_b"], + ["const godot_real", "p_t"] ] }, { - "name": "godot_string_findmk", - "return_type": "godot_int", + "name": "godot_vector2_rotated", + "return_type": "godot_vector2", "arguments": [ - ["const godot_string *", "p_self"], - ["const godot_array *", "p_keys"] + ["const godot_vector2 *", "p_self"], + ["const godot_real", "p_phi"] ] }, { - "name": "godot_string_findmk_from", - "return_type": "godot_int", + "name": "godot_vector2_tangent", + "return_type": "godot_vector2", "arguments": [ - ["const godot_string *", "p_self"], - ["const godot_array *", "p_keys"], - ["godot_int", "p_from"] + ["const godot_vector2 *", "p_self"] ] }, { - "name": "godot_string_findmk_from_in_place", - "return_type": "godot_int", + "name": "godot_vector2_floor", + "return_type": "godot_vector2", "arguments": [ - ["const godot_string *", "p_self"], - ["const godot_array *", "p_keys"], - ["godot_int", "p_from"], - ["godot_int *", "r_key"] + ["const godot_vector2 *", "p_self"] ] }, { - "name": "godot_string_findn", - "return_type": "godot_int", + "name": "godot_vector2_snapped", + "return_type": "godot_vector2", "arguments": [ - ["const godot_string *", "p_self"], - ["godot_string", "p_what"] + ["const godot_vector2 *", "p_self"], + ["const godot_vector2 *", "p_by"] ] }, { - "name": "godot_string_findn_from", - "return_type": "godot_int", + "name": "godot_vector2_aspect", + "return_type": "godot_real", "arguments": [ - ["const godot_string *", "p_self"], - ["godot_string", "p_what"], - ["godot_int", "p_from"] + ["const godot_vector2 *", "p_self"] ] }, { - "name": "godot_string_find_last", - "return_type": "godot_int", + "name": "godot_vector2_dot", + "return_type": "godot_real", "arguments": [ - ["const godot_string *", "p_self"], - ["godot_string", "p_what"] + ["const godot_vector2 *", "p_self"], + ["const godot_vector2 *", "p_with"] ] }, { - "name": "godot_string_format", - "return_type": "godot_string", + "name": "godot_vector2_slide", + "return_type": "godot_vector2", "arguments": [ - ["const godot_string *", "p_self"], - ["const godot_variant *", "p_values"] + ["const godot_vector2 *", "p_self"], + ["const godot_vector2 *", "p_n"] ] }, { - "name": "godot_string_format_with_custom_placeholder", - "return_type": "godot_string", + "name": "godot_vector2_bounce", + "return_type": "godot_vector2", "arguments": [ - ["const godot_string *", "p_self"], - ["const godot_variant *", "p_values"], - ["const char *", "p_placeholder"] + ["const godot_vector2 *", "p_self"], + ["const godot_vector2 *", "p_n"] ] }, { - "name": "godot_string_hex_encode_buffer", - "return_type": "godot_string", + "name": "godot_vector2_reflect", + "return_type": "godot_vector2", "arguments": [ - ["const uint8_t *", "p_buffer"], - ["godot_int", "p_len"] + ["const godot_vector2 *", "p_self"], + ["const godot_vector2 *", "p_n"] ] }, { - "name": "godot_string_hex_to_int", - "return_type": "godot_int", + "name": "godot_vector2_abs", + "return_type": "godot_vector2", "arguments": [ - ["const godot_string *", "p_self"] + ["const godot_vector2 *", "p_self"] ] }, { - "name": "godot_string_hex_to_int_without_prefix", - "return_type": "godot_int", + "name": "godot_vector2_clamped", + "return_type": "godot_vector2", "arguments": [ - ["const godot_string *", "p_self"] + ["const godot_vector2 *", "p_self"], + ["const godot_real", "p_length"] ] }, { - "name": "godot_string_insert", - "return_type": "godot_string", + "name": "godot_vector2_operator_add", + "return_type": "godot_vector2", "arguments": [ - ["const godot_string *", "p_self"], - ["godot_int", "p_at_pos"], - ["godot_string", "p_string"] + ["const godot_vector2 *", "p_self"], + ["const godot_vector2 *", "p_b"] ] }, { - "name": "godot_string_is_numeric", - "return_type": "godot_bool", + "name": "godot_vector2_operator_subtract", + "return_type": "godot_vector2", "arguments": [ - ["const godot_string *", "p_self"] + ["const godot_vector2 *", "p_self"], + ["const godot_vector2 *", "p_b"] ] }, { - "name": "godot_string_is_subsequence_of", - "return_type": "godot_bool", + "name": "godot_vector2_operator_multiply_vector", + "return_type": "godot_vector2", "arguments": [ - ["const godot_string *", "p_self"], - ["const godot_string *", "p_string"] + ["const godot_vector2 *", "p_self"], + ["const godot_vector2 *", "p_b"] ] }, { - "name": "godot_string_is_subsequence_ofi", - "return_type": "godot_bool", + "name": "godot_vector2_operator_multiply_scalar", + "return_type": "godot_vector2", "arguments": [ - ["const godot_string *", "p_self"], - ["const godot_string *", "p_string"] + ["const godot_vector2 *", "p_self"], + ["const godot_real", "p_b"] ] }, { - "name": "godot_string_lpad", - "return_type": "godot_string", + "name": "godot_vector2_operator_divide_vector", + "return_type": "godot_vector2", "arguments": [ - ["const godot_string *", "p_self"], - ["godot_int", "p_min_length"] + ["const godot_vector2 *", "p_self"], + ["const godot_vector2 *", "p_b"] ] }, { - "name": "godot_string_lpad_with_custom_character", - "return_type": "godot_string", + "name": "godot_vector2_operator_divide_scalar", + "return_type": "godot_vector2", "arguments": [ - ["const godot_string *", "p_self"], - ["godot_int", "p_min_length"], - ["const godot_string *", "p_character"] + ["const godot_vector2 *", "p_self"], + ["const godot_real", "p_b"] ] }, { - "name": "godot_string_match", + "name": "godot_vector2_operator_equal", "return_type": "godot_bool", "arguments": [ - ["const godot_string *", "p_self"], - ["const godot_string *", "p_wildcard"] + ["const godot_vector2 *", "p_self"], + ["const godot_vector2 *", "p_b"] ] }, { - "name": "godot_string_matchn", + "name": "godot_vector2_operator_less", "return_type": "godot_bool", "arguments": [ - ["const godot_string *", "p_self"], - ["const godot_string *", "p_wildcard"] - ] - }, - { - "name": "godot_string_md5", - "return_type": "godot_string", - "arguments": [ - ["const uint8_t *", "p_md5"] - ] - }, - { - "name": "godot_string_num", - "return_type": "godot_string", - "arguments": [ - ["double", "p_num"] - ] - }, - { - "name": "godot_string_num_int64", - "return_type": "godot_string", - "arguments": [ - ["int64_t", "p_num"], - ["godot_int", "p_base"] - ] - }, - { - "name": "godot_string_num_int64_capitalized", - "return_type": "godot_string", - "arguments": [ - ["int64_t", "p_num"], - ["godot_int", "p_base"], - ["godot_bool", "p_capitalize_hex"] - ] - }, - { - "name": "godot_string_num_real", - "return_type": "godot_string", - "arguments": [ - ["double", "p_num"] - ] - }, - { - "name": "godot_string_num_scientific", - "return_type": "godot_string", - "arguments": [ - ["double", "p_num"] - ] - }, - { - "name": "godot_string_num_with_decimals", - "return_type": "godot_string", - "arguments": [ - ["double", "p_num"], - ["godot_int", "p_decimals"] - ] - }, - { - "name": "godot_string_pad_decimals", - "return_type": "godot_string", - "arguments": [ - ["const godot_string *", "p_self"], - ["godot_int", "p_digits"] - ] - }, - { - "name": "godot_string_pad_zeros", - "return_type": "godot_string", - "arguments": [ - ["const godot_string *", "p_self"], - ["godot_int", "p_digits"] - ] - }, - { - "name": "godot_string_replace_first", - "return_type": "godot_string", - "arguments": [ - ["const godot_string *", "p_self"], - ["godot_string", "p_key"], - ["godot_string", "p_with"] - ] - }, - { - "name": "godot_string_replace", - "return_type": "godot_string", - "arguments": [ - ["const godot_string *", "p_self"], - ["godot_string", "p_key"], - ["godot_string", "p_with"] - ] - }, - { - "name": "godot_string_replacen", - "return_type": "godot_string", - "arguments": [ - ["const godot_string *", "p_self"], - ["godot_string", "p_key"], - ["godot_string", "p_with"] - ] - }, - { - "name": "godot_string_rfind", - "return_type": "godot_int", - "arguments": [ - ["const godot_string *", "p_self"], - ["godot_string", "p_what"] - ] - }, - { - "name": "godot_string_rfindn", - "return_type": "godot_int", - "arguments": [ - ["const godot_string *", "p_self"], - ["godot_string", "p_what"] + ["const godot_vector2 *", "p_self"], + ["const godot_vector2 *", "p_b"] ] }, { - "name": "godot_string_rfind_from", - "return_type": "godot_int", + "name": "godot_vector2_operator_neg", + "return_type": "godot_vector2", "arguments": [ - ["const godot_string *", "p_self"], - ["godot_string", "p_what"], - ["godot_int", "p_from"] + ["const godot_vector2 *", "p_self"] ] }, { - "name": "godot_string_rfindn_from", - "return_type": "godot_int", + "name": "godot_vector2_set_x", + "return_type": "void", "arguments": [ - ["const godot_string *", "p_self"], - ["godot_string", "p_what"], - ["godot_int", "p_from"] + ["godot_vector2 *", "p_self"], + ["const godot_real", "p_x"] ] }, { - "name": "godot_string_rpad", - "return_type": "godot_string", + "name": "godot_vector2_set_y", + "return_type": "void", "arguments": [ - ["const godot_string *", "p_self"], - ["godot_int", "p_min_length"] + ["godot_vector2 *", "p_self"], + ["const godot_real", "p_y"] ] }, { - "name": "godot_string_rpad_with_custom_character", - "return_type": "godot_string", + "name": "godot_vector2_get_x", + "return_type": "godot_real", "arguments": [ - ["const godot_string *", "p_self"], - ["godot_int", "p_min_length"], - ["const godot_string *", "p_character"] + ["const godot_vector2 *", "p_self"] ] }, { - "name": "godot_string_similarity", + "name": "godot_vector2_get_y", "return_type": "godot_real", "arguments": [ - ["const godot_string *", "p_self"], - ["const godot_string *", "p_string"] + ["const godot_vector2 *", "p_self"] ] }, { - "name": "godot_string_sprintf", - "return_type": "godot_string", + "name": "godot_vector2i_new", + "return_type": "void", "arguments": [ - ["const godot_string *", "p_self"], - ["const godot_array *", "p_values"], - ["godot_bool *", "p_error"] + ["godot_vector2i *", "r_dest"], + ["const godot_int", "p_x"], + ["const godot_int", "p_y"] ] }, { - "name": "godot_string_substr", + "name": "godot_vector2i_as_string", "return_type": "godot_string", "arguments": [ - ["const godot_string *", "p_self"], - ["godot_int", "p_from"], - ["godot_int", "p_chars"] + ["const godot_vector2i *", "p_self"] ] }, { - "name": "godot_string_to_double", - "return_type": "double", + "name": "godot_vector2i_as_vector2", + "return_type": "godot_vector2", "arguments": [ - ["const godot_string *", "p_self"] + ["const godot_vector2i *", "p_self"] ] }, { - "name": "godot_string_to_float", + "name": "godot_vector2i_aspect", "return_type": "godot_real", "arguments": [ - ["const godot_string *", "p_self"] + ["const godot_vector2i *", "p_self"] ] }, { - "name": "godot_string_to_int", - "return_type": "godot_int", + "name": "godot_vector2i_abs", + "return_type": "godot_vector2i", "arguments": [ - ["const godot_string *", "p_self"] + ["const godot_vector2i *", "p_self"] ] }, { - "name": "godot_string_camelcase_to_underscore", - "return_type": "godot_string", + "name": "godot_vector2i_sign", + "return_type": "godot_vector2i", "arguments": [ - ["const godot_string *", "p_self"] + ["const godot_vector2i *", "p_self"] ] }, { - "name": "godot_string_camelcase_to_underscore_lowercased", - "return_type": "godot_string", + "name": "godot_vector2i_operator_add", + "return_type": "godot_vector2i", "arguments": [ - ["const godot_string *", "p_self"] + ["const godot_vector2i *", "p_self"], + ["const godot_vector2i *", "p_b"] ] }, { - "name": "godot_string_capitalize", - "return_type": "godot_string", + "name": "godot_vector2i_operator_subtract", + "return_type": "godot_vector2i", "arguments": [ - ["const godot_string *", "p_self"] + ["const godot_vector2i *", "p_self"], + ["const godot_vector2i *", "p_b"] ] }, { - "name": "godot_string_char_to_double", - "return_type": "double", + "name": "godot_vector2i_operator_multiply_vector", + "return_type": "godot_vector2i", "arguments": [ - ["const char *", "p_what"] + ["const godot_vector2i *", "p_self"], + ["const godot_vector2i *", "p_b"] ] }, { - "name": "godot_string_char_to_int", - "return_type": "godot_int", + "name": "godot_vector2i_operator_multiply_scalar", + "return_type": "godot_vector2i", "arguments": [ - ["const char *", "p_what"] + ["const godot_vector2i *", "p_self"], + ["const godot_int", "p_b"] ] }, { - "name": "godot_string_wchar_to_int", - "return_type": "int64_t", + "name": "godot_vector2i_operator_divide_vector", + "return_type": "godot_vector2i", "arguments": [ - ["const wchar_t *", "p_str"] + ["const godot_vector2i *", "p_self"], + ["const godot_vector2i *", "p_b"] ] }, { - "name": "godot_string_char_to_int_with_len", - "return_type": "godot_int", + "name": "godot_vector2i_operator_divide_scalar", + "return_type": "godot_vector2i", "arguments": [ - ["const char *", "p_what"], - ["godot_int", "p_len"] + ["const godot_vector2i *", "p_self"], + ["const godot_int", "p_b"] ] }, { - "name": "godot_string_char_to_int64_with_len", - "return_type": "int64_t", + "name": "godot_vector2i_operator_equal", + "return_type": "godot_bool", "arguments": [ - ["const wchar_t *", "p_str"], - ["int", "p_len"] + ["const godot_vector2i *", "p_self"], + ["const godot_vector2i *", "p_b"] ] }, { - "name": "godot_string_hex_to_int64", - "return_type": "int64_t", + "name": "godot_vector2i_operator_less", + "return_type": "godot_bool", "arguments": [ - ["const godot_string *", "p_self"] + ["const godot_vector2i *", "p_self"], + ["const godot_vector2i *", "p_b"] ] }, { - "name": "godot_string_hex_to_int64_with_prefix", - "return_type": "int64_t", + "name": "godot_vector2i_operator_neg", + "return_type": "godot_vector2i", "arguments": [ - ["const godot_string *", "p_self"] + ["const godot_vector2i *", "p_self"] ] }, { - "name": "godot_string_to_int64", - "return_type": "int64_t", + "name": "godot_vector2i_set_x", + "return_type": "void", "arguments": [ - ["const godot_string *", "p_self"] + ["godot_vector2i *", "p_self"], + ["const godot_int", "p_x"] ] }, { - "name": "godot_string_unicode_char_to_double", - "return_type": "double", + "name": "godot_vector2i_set_y", + "return_type": "void", "arguments": [ - ["const wchar_t *", "p_str"], - ["const wchar_t **", "r_end"] + ["godot_vector2i *", "p_self"], + ["const godot_int", "p_y"] ] }, { - "name": "godot_string_get_slice_count", + "name": "godot_vector2i_get_x", "return_type": "godot_int", "arguments": [ - ["const godot_string *", "p_self"], - ["godot_string", "p_splitter"] - ] - }, - { - "name": "godot_string_get_slice", - "return_type": "godot_string", - "arguments": [ - ["const godot_string *", "p_self"], - ["godot_string", "p_splitter"], - ["godot_int", "p_slice"] + ["const godot_vector2i *", "p_self"] ] }, { - "name": "godot_string_get_slicec", - "return_type": "godot_string", - "arguments": [ - ["const godot_string *", "p_self"], - ["wchar_t", "p_splitter"], - ["godot_int", "p_slice"] - ] - }, - { - "name": "godot_string_split", - "return_type": "godot_array", - "arguments": [ - ["const godot_string *", "p_self"], - ["const godot_string *", "p_splitter"] - ] - }, - { - "name": "godot_string_split_allow_empty", - "return_type": "godot_array", - "arguments": [ - ["const godot_string *", "p_self"], - ["const godot_string *", "p_splitter"] - ] - }, - { - "name": "godot_string_split_floats", - "return_type": "godot_array", - "arguments": [ - ["const godot_string *", "p_self"], - ["const godot_string *", "p_splitter"] - ] - }, - { - "name": "godot_string_split_floats_allows_empty", - "return_type": "godot_array", - "arguments": [ - ["const godot_string *", "p_self"], - ["const godot_string *", "p_splitter"] - ] - }, - { - "name": "godot_string_split_floats_mk", - "return_type": "godot_array", - "arguments": [ - ["const godot_string *", "p_self"], - ["const godot_array *", "p_splitters"] - ] - }, - { - "name": "godot_string_split_floats_mk_allows_empty", - "return_type": "godot_array", - "arguments": [ - ["const godot_string *", "p_self"], - ["const godot_array *", "p_splitters"] - ] - }, - { - "name": "godot_string_split_ints", - "return_type": "godot_array", - "arguments": [ - ["const godot_string *", "p_self"], - ["const godot_string *", "p_splitter"] - ] - }, - { - "name": "godot_string_split_ints_allows_empty", - "return_type": "godot_array", - "arguments": [ - ["const godot_string *", "p_self"], - ["const godot_string *", "p_splitter"] - ] - }, - { - "name": "godot_string_split_ints_mk", - "return_type": "godot_array", + "name": "godot_vector2i_get_y", + "return_type": "godot_int", "arguments": [ - ["const godot_string *", "p_self"], - ["const godot_array *", "p_splitters"] + ["const godot_vector2i *", "p_self"] ] }, { - "name": "godot_string_split_ints_mk_allows_empty", - "return_type": "godot_array", + "name": "godot_vector3_as_vector3i", + "return_type": "godot_vector3i", "arguments": [ - ["const godot_string *", "p_self"], - ["const godot_array *", "p_splitters"] - ] - }, - { - "name": "godot_string_split_spaces", - "return_type": "godot_array", - "arguments": [ - ["const godot_string *", "p_self"] + ["const godot_vector3 *", "p_self"] ] }, { - "name": "godot_string_char_lowercase", - "return_type": "wchar_t", + "name": "godot_vector3_sign", + "return_type": "godot_vector3", "arguments": [ - ["wchar_t", "p_char"] + ["const godot_vector3 *", "p_self"] ] }, { - "name": "godot_string_char_uppercase", - "return_type": "wchar_t", + "name": "godot_vector3_move_toward", + "return_type": "godot_vector3", "arguments": [ - ["wchar_t", "p_char"] + ["const godot_vector3 *", "p_self"], + ["const godot_vector3 *", "p_to"], + ["const godot_real", "p_delta"] ] }, { - "name": "godot_string_to_lower", - "return_type": "godot_string", + "name": "godot_vector3_direction_to", + "return_type": "godot_vector3", "arguments": [ - ["const godot_string *", "p_self"] + ["const godot_vector3 *", "p_self"], + ["const godot_vector3 *", "p_to"] ] }, { - "name": "godot_string_to_upper", - "return_type": "godot_string", + "name": "godot_vector3_new", + "return_type": "void", "arguments": [ - ["const godot_string *", "p_self"] + ["godot_vector3 *", "r_dest"], + ["const godot_real", "p_x"], + ["const godot_real", "p_y"], + ["const godot_real", "p_z"] ] }, { - "name": "godot_string_get_basename", + "name": "godot_vector3_as_string", "return_type": "godot_string", "arguments": [ - ["const godot_string *", "p_self"] + ["const godot_vector3 *", "p_self"] ] }, { - "name": "godot_string_get_extension", - "return_type": "godot_string", + "name": "godot_vector3_min_axis", + "return_type": "godot_int", "arguments": [ - ["const godot_string *", "p_self"] + ["const godot_vector3 *", "p_self"] ] }, { - "name": "godot_string_left", - "return_type": "godot_string", + "name": "godot_vector3_max_axis", + "return_type": "godot_int", "arguments": [ - ["const godot_string *", "p_self"], - ["godot_int", "p_pos"] + ["const godot_vector3 *", "p_self"] ] }, { - "name": "godot_string_ord_at", - "return_type": "wchar_t", + "name": "godot_vector3_length", + "return_type": "godot_real", "arguments": [ - ["const godot_string *", "p_self"], - ["godot_int", "p_idx"] + ["const godot_vector3 *", "p_self"] ] }, { - "name": "godot_string_plus_file", - "return_type": "godot_string", + "name": "godot_vector3_length_squared", + "return_type": "godot_real", "arguments": [ - ["const godot_string *", "p_self"], - ["const godot_string *", "p_file"] + ["const godot_vector3 *", "p_self"] ] }, { - "name": "godot_string_right", - "return_type": "godot_string", + "name": "godot_vector3_is_normalized", + "return_type": "godot_bool", "arguments": [ - ["const godot_string *", "p_self"], - ["godot_int", "p_pos"] + ["const godot_vector3 *", "p_self"] ] }, { - "name": "godot_string_strip_edges", - "return_type": "godot_string", + "name": "godot_vector3_normalized", + "return_type": "godot_vector3", "arguments": [ - ["const godot_string *", "p_self"], - ["godot_bool", "p_left"], - ["godot_bool", "p_right"] + ["const godot_vector3 *", "p_self"] ] }, { - "name": "godot_string_strip_escapes", - "return_type": "godot_string", + "name": "godot_vector3_inverse", + "return_type": "godot_vector3", "arguments": [ - ["const godot_string *", "p_self"] + ["const godot_vector3 *", "p_self"] ] }, { - "name": "godot_string_erase", - "return_type": "void", + "name": "godot_vector3_snapped", + "return_type": "godot_vector3", "arguments": [ - ["godot_string *", "p_self"], - ["godot_int", "p_pos"], - ["godot_int", "p_chars"] + ["const godot_vector3 *", "p_self"], + ["const godot_vector3 *", "p_by"] ] }, { - "name": "godot_string_ascii", - "return_type": "godot_char_string", + "name": "godot_vector3_rotated", + "return_type": "godot_vector3", "arguments": [ - ["const godot_string *", "p_self"] + ["const godot_vector3 *", "p_self"], + ["const godot_vector3 *", "p_axis"], + ["const godot_real", "p_phi"] ] }, { - "name": "godot_string_ascii_extended", - "return_type": "godot_char_string", + "name": "godot_vector3_lerp", + "return_type": "godot_vector3", "arguments": [ - ["const godot_string *", "p_self"] + ["const godot_vector3 *", "p_self"], + ["const godot_vector3 *", "p_b"], + ["const godot_real", "p_t"] ] }, { - "name": "godot_string_utf8", - "return_type": "godot_char_string", + "name": "godot_vector3_cubic_interpolate", + "return_type": "godot_vector3", "arguments": [ - ["const godot_string *", "p_self"] + ["const godot_vector3 *", "p_self"], + ["const godot_vector3 *", "p_b"], + ["const godot_vector3 *", "p_pre_a"], + ["const godot_vector3 *", "p_post_b"], + ["const godot_real", "p_t"] ] }, { - "name": "godot_string_parse_utf8", - "return_type": "godot_bool", + "name": "godot_vector3_dot", + "return_type": "godot_real", "arguments": [ - ["godot_string *", "p_self"], - ["const char *", "p_utf8"] + ["const godot_vector3 *", "p_self"], + ["const godot_vector3 *", "p_b"] ] }, { - "name": "godot_string_parse_utf8_with_len", - "return_type": "godot_bool", + "name": "godot_vector3_cross", + "return_type": "godot_vector3", "arguments": [ - ["godot_string *", "p_self"], - ["const char *", "p_utf8"], - ["godot_int", "p_len"] + ["const godot_vector3 *", "p_self"], + ["const godot_vector3 *", "p_b"] ] }, { - "name": "godot_string_chars_to_utf8", - "return_type": "godot_string", + "name": "godot_vector3_outer", + "return_type": "godot_basis", "arguments": [ - ["const char *", "p_utf8"] + ["const godot_vector3 *", "p_self"], + ["const godot_vector3 *", "p_b"] ] }, { - "name": "godot_string_chars_to_utf8_with_len", - "return_type": "godot_string", + "name": "godot_vector3_to_diagonal_matrix", + "return_type": "godot_basis", "arguments": [ - ["const char *", "p_utf8"], - ["godot_int", "p_len"] + ["const godot_vector3 *", "p_self"] ] }, { - "name": "godot_string_hash", - "return_type": "uint32_t", + "name": "godot_vector3_abs", + "return_type": "godot_vector3", "arguments": [ - ["const godot_string *", "p_self"] + ["const godot_vector3 *", "p_self"] ] }, { - "name": "godot_string_hash64", - "return_type": "uint64_t", + "name": "godot_vector3_floor", + "return_type": "godot_vector3", "arguments": [ - ["const godot_string *", "p_self"] + ["const godot_vector3 *", "p_self"] ] }, { - "name": "godot_string_hash_chars", - "return_type": "uint32_t", + "name": "godot_vector3_ceil", + "return_type": "godot_vector3", "arguments": [ - ["const char *", "p_cstr"] + ["const godot_vector3 *", "p_self"] ] }, { - "name": "godot_string_hash_chars_with_len", - "return_type": "uint32_t", + "name": "godot_vector3_distance_to", + "return_type": "godot_real", "arguments": [ - ["const char *", "p_cstr"], - ["godot_int", "p_len"] + ["const godot_vector3 *", "p_self"], + ["const godot_vector3 *", "p_b"] ] }, { - "name": "godot_string_hash_utf8_chars", - "return_type": "uint32_t", + "name": "godot_vector3_distance_squared_to", + "return_type": "godot_real", "arguments": [ - ["const wchar_t *", "p_str"] + ["const godot_vector3 *", "p_self"], + ["const godot_vector3 *", "p_b"] ] }, { - "name": "godot_string_hash_utf8_chars_with_len", - "return_type": "uint32_t", + "name": "godot_vector3_angle_to", + "return_type": "godot_real", "arguments": [ - ["const wchar_t *", "p_str"], - ["godot_int", "p_len"] + ["const godot_vector3 *", "p_self"], + ["const godot_vector3 *", "p_to"] ] }, { - "name": "godot_string_md5_buffer", - "return_type": "godot_packed_byte_array", + "name": "godot_vector3_slide", + "return_type": "godot_vector3", "arguments": [ - ["const godot_string *", "p_self"] + ["const godot_vector3 *", "p_self"], + ["const godot_vector3 *", "p_n"] ] }, { - "name": "godot_string_md5_text", - "return_type": "godot_string", + "name": "godot_vector3_bounce", + "return_type": "godot_vector3", "arguments": [ - ["const godot_string *", "p_self"] + ["const godot_vector3 *", "p_self"], + ["const godot_vector3 *", "p_n"] ] }, { - "name": "godot_string_sha256_buffer", - "return_type": "godot_packed_byte_array", + "name": "godot_vector3_reflect", + "return_type": "godot_vector3", "arguments": [ - ["const godot_string *", "p_self"] + ["const godot_vector3 *", "p_self"], + ["const godot_vector3 *", "p_n"] ] }, { - "name": "godot_string_sha256_text", - "return_type": "godot_string", + "name": "godot_vector3_operator_add", + "return_type": "godot_vector3", "arguments": [ - ["const godot_string *", "p_self"] + ["const godot_vector3 *", "p_self"], + ["const godot_vector3 *", "p_b"] ] }, { - "name": "godot_string_empty", - "return_type": "godot_bool", + "name": "godot_vector3_operator_subtract", + "return_type": "godot_vector3", "arguments": [ - ["const godot_string *", "p_self"] + ["const godot_vector3 *", "p_self"], + ["const godot_vector3 *", "p_b"] ] }, { - "name": "godot_string_get_base_dir", - "return_type": "godot_string", + "name": "godot_vector3_operator_multiply_vector", + "return_type": "godot_vector3", "arguments": [ - ["const godot_string *", "p_self"] + ["const godot_vector3 *", "p_self"], + ["const godot_vector3 *", "p_b"] ] }, { - "name": "godot_string_get_file", - "return_type": "godot_string", + "name": "godot_vector3_operator_multiply_scalar", + "return_type": "godot_vector3", "arguments": [ - ["const godot_string *", "p_self"] + ["const godot_vector3 *", "p_self"], + ["const godot_real", "p_b"] ] }, { - "name": "godot_string_humanize_size", - "return_type": "godot_string", + "name": "godot_vector3_operator_divide_vector", + "return_type": "godot_vector3", "arguments": [ - ["size_t", "p_size"] + ["const godot_vector3 *", "p_self"], + ["const godot_vector3 *", "p_b"] ] }, { - "name": "godot_string_is_abs_path", - "return_type": "godot_bool", + "name": "godot_vector3_operator_divide_scalar", + "return_type": "godot_vector3", "arguments": [ - ["const godot_string *", "p_self"] + ["const godot_vector3 *", "p_self"], + ["const godot_real", "p_b"] ] }, { - "name": "godot_string_is_rel_path", + "name": "godot_vector3_operator_equal", "return_type": "godot_bool", "arguments": [ - ["const godot_string *", "p_self"] + ["const godot_vector3 *", "p_self"], + ["const godot_vector3 *", "p_b"] ] }, { - "name": "godot_string_is_resource_file", + "name": "godot_vector3_operator_less", "return_type": "godot_bool", "arguments": [ - ["const godot_string *", "p_self"] - ] - }, - { - "name": "godot_string_path_to", - "return_type": "godot_string", - "arguments": [ - ["const godot_string *", "p_self"], - ["const godot_string *", "p_path"] - ] - }, - { - "name": "godot_string_path_to_file", - "return_type": "godot_string", - "arguments": [ - ["const godot_string *", "p_self"], - ["const godot_string *", "p_path"] - ] - }, - { - "name": "godot_string_simplify_path", - "return_type": "godot_string", - "arguments": [ - ["const godot_string *", "p_self"] + ["const godot_vector3 *", "p_self"], + ["const godot_vector3 *", "p_b"] ] }, { - "name": "godot_string_c_escape", - "return_type": "godot_string", + "name": "godot_vector3_operator_neg", + "return_type": "godot_vector3", "arguments": [ - ["const godot_string *", "p_self"] + ["const godot_vector3 *", "p_self"] ] }, { - "name": "godot_string_c_escape_multiline", - "return_type": "godot_string", + "name": "godot_vector3_set_axis", + "return_type": "void", "arguments": [ - ["const godot_string *", "p_self"] + ["godot_vector3 *", "p_self"], + ["const godot_vector3_axis", "p_axis"], + ["const godot_real", "p_val"] ] }, { - "name": "godot_string_c_unescape", - "return_type": "godot_string", + "name": "godot_vector3_get_axis", + "return_type": "godot_real", "arguments": [ - ["const godot_string *", "p_self"] + ["const godot_vector3 *", "p_self"], + ["const godot_vector3_axis", "p_axis"] ] }, { - "name": "godot_string_http_escape", - "return_type": "godot_string", + "name": "godot_vector3i_new", + "return_type": "void", "arguments": [ - ["const godot_string *", "p_self"] + ["godot_vector3i *", "r_dest"], + ["const godot_int", "p_x"], + ["const godot_int", "p_y"], + ["const godot_int", "p_z"] ] }, { - "name": "godot_string_http_unescape", + "name": "godot_vector3i_as_string", "return_type": "godot_string", "arguments": [ - ["const godot_string *", "p_self"] + ["const godot_vector3i *", "p_self"] ] }, { - "name": "godot_string_json_escape", - "return_type": "godot_string", + "name": "godot_vector3i_as_vector3", + "return_type": "godot_vector3", "arguments": [ - ["const godot_string *", "p_self"] + ["const godot_vector3i *", "p_self"] ] }, { - "name": "godot_string_word_wrap", - "return_type": "godot_string", + "name": "godot_vector3i_min_axis", + "return_type": "godot_int", "arguments": [ - ["const godot_string *", "p_self"], - ["godot_int", "p_chars_per_line"] + ["const godot_vector3i *", "p_self"] ] }, { - "name": "godot_string_xml_escape", - "return_type": "godot_string", + "name": "godot_vector3i_max_axis", + "return_type": "godot_int", "arguments": [ - ["const godot_string *", "p_self"] + ["const godot_vector3i *", "p_self"] ] }, { - "name": "godot_string_xml_escape_with_quotes", - "return_type": "godot_string", + "name": "godot_vector3i_abs", + "return_type": "godot_vector3i", "arguments": [ - ["const godot_string *", "p_self"] + ["const godot_vector3i *", "p_self"] ] }, { - "name": "godot_string_xml_unescape", - "return_type": "godot_string", + "name": "godot_vector3i_sign", + "return_type": "godot_vector3i", "arguments": [ - ["const godot_string *", "p_self"] + ["const godot_vector3i *", "p_self"] ] }, { - "name": "godot_string_percent_decode", - "return_type": "godot_string", + "name": "godot_vector3i_operator_add", + "return_type": "godot_vector3i", "arguments": [ - ["const godot_string *", "p_self"] + ["const godot_vector3i *", "p_self"], + ["const godot_vector3i *", "p_b"] ] }, { - "name": "godot_string_percent_encode", - "return_type": "godot_string", + "name": "godot_vector3i_operator_subtract", + "return_type": "godot_vector3i", "arguments": [ - ["const godot_string *", "p_self"] + ["const godot_vector3i *", "p_self"], + ["const godot_vector3i *", "p_b"] ] }, { - "name": "godot_string_is_valid_float", - "return_type": "godot_bool", + "name": "godot_vector3i_operator_multiply_vector", + "return_type": "godot_vector3i", "arguments": [ - ["const godot_string *", "p_self"] + ["const godot_vector3i *", "p_self"], + ["const godot_vector3i *", "p_b"] ] }, { - "name": "godot_string_is_valid_hex_number", - "return_type": "godot_bool", + "name": "godot_vector3i_operator_multiply_scalar", + "return_type": "godot_vector3i", "arguments": [ - ["const godot_string *", "p_self"], - ["godot_bool", "p_with_prefix"] + ["const godot_vector3i *", "p_self"], + ["const godot_int", "p_b"] ] }, { - "name": "godot_string_is_valid_html_color", - "return_type": "godot_bool", + "name": "godot_vector3i_operator_divide_vector", + "return_type": "godot_vector3i", "arguments": [ - ["const godot_string *", "p_self"] + ["const godot_vector3i *", "p_self"], + ["const godot_vector3i *", "p_b"] ] }, { - "name": "godot_string_is_valid_identifier", - "return_type": "godot_bool", + "name": "godot_vector3i_operator_divide_scalar", + "return_type": "godot_vector3i", "arguments": [ - ["const godot_string *", "p_self"] + ["const godot_vector3i *", "p_self"], + ["const godot_int", "p_b"] ] }, { - "name": "godot_string_is_valid_integer", + "name": "godot_vector3i_operator_equal", "return_type": "godot_bool", "arguments": [ - ["const godot_string *", "p_self"] + ["const godot_vector3i *", "p_self"], + ["const godot_vector3i *", "p_b"] ] }, { - "name": "godot_string_is_valid_ip_address", + "name": "godot_vector3i_operator_less", "return_type": "godot_bool", "arguments": [ - ["const godot_string *", "p_self"] + ["const godot_vector3i *", "p_self"], + ["const godot_vector3i *", "p_b"] ] }, { - "name": "godot_string_destroy", - "return_type": "void", + "name": "godot_vector3i_operator_neg", + "return_type": "godot_vector3i", "arguments": [ - ["godot_string *", "p_self"] + ["const godot_vector3i *", "p_self"] ] }, { - "name": "godot_string_name_new", + "name": "godot_vector3i_set_axis", "return_type": "void", "arguments": [ - ["godot_string_name *", "r_dest"], - ["const godot_string *", "p_name"] - ] - }, - { - "name": "godot_string_name_new_data", - "return_type": "void", - "arguments": [ - ["godot_string_name *", "r_dest"], - ["const char *", "p_name"] + ["godot_vector3i *", "p_self"], + ["const godot_vector3_axis", "p_axis"], + ["const godot_int", "p_val"] ] }, { - "name": "godot_string_name_get_name", - "return_type": "godot_string", + "name": "godot_vector3i_get_axis", + "return_type": "godot_int", "arguments": [ - ["const godot_string_name *", "p_self"] + ["const godot_vector3i *", "p_self"], + ["const godot_vector3_axis", "p_axis"] ] }, { - "name": "godot_string_name_get_hash", - "return_type": "uint32_t", + "name": "godot_global_get_singleton", + "return_type": "godot_object *", "arguments": [ - ["const godot_string_name *", "p_self"] + ["char *", "p_name"] ] }, { - "name": "godot_string_name_get_data_unique_pointer", - "return_type": "const void *", + "name": "godot_get_class_tag", + "return_type": "void *", "arguments": [ - ["const godot_string_name *", "p_self"] + ["const godot_string_name *", "p_class"] ] }, { - "name": "godot_string_name_operator_equal", - "return_type": "godot_bool", + "name": "godot_object_cast_to", + "return_type": "godot_object *", "arguments": [ - ["const godot_string_name *", "p_self"], - ["const godot_string_name *", "p_other"] + ["const godot_object *", "p_object"], + ["void *", "p_class_tag"] ] }, { - "name": "godot_string_name_operator_less", - "return_type": "godot_bool", + "name": "godot_object_get_instance_id", + "return_type": "uint64_t", "arguments": [ - ["const godot_string_name *", "p_self"], - ["const godot_string_name *", "p_other"] + ["const godot_object *", "p_object"] ] }, { - "name": "godot_string_name_destroy", - "return_type": "void", + "name": "godot_instance_from_id", + "return_type": "godot_object *", "arguments": [ - ["godot_string_name *", "p_self"] + ["uint64_t", "p_instance_id"] ] }, { @@ -5579,13 +6817,6 @@ ] }, { - "name": "godot_global_get_singleton", - "return_type": "godot_object *", - "arguments": [ - ["char *", "p_name"] - ] - }, - { "name": "godot_method_bind_get_method", "return_type": "godot_method_bind *", "arguments": [ @@ -5691,132 +6922,10 @@ "name": "nativescript", "type": "NATIVESCRIPT", "version": { - "major": 1, + "major": 4, "minor": 0 }, - "next": { - "type": "NATIVESCRIPT", - "version": { - "major": 1, - "minor": 1 - }, - "next": null, - "api": [ - { - "name": "godot_nativescript_set_method_argument_information", - "return_type": "void", - "arguments": [ - ["void *", "p_gdnative_handle"], - ["const char *", "p_name"], - ["const char *", "p_function_name"], - ["int", "p_num_args"], - ["const godot_method_arg *", "p_args"] - ] - }, - { - "name": "godot_nativescript_set_class_documentation", - "return_type": "void", - "arguments": [ - ["void *", "p_gdnative_handle"], - ["const char *", "p_name"], - ["godot_string", "p_documentation"] - ] - }, - { - "name": "godot_nativescript_set_method_documentation", - "return_type": "void", - "arguments": [ - ["void *", "p_gdnative_handle"], - ["const char *", "p_name"], - ["const char *", "p_function_name"], - ["godot_string", "p_documentation"] - ] - }, - { - "name": "godot_nativescript_set_property_documentation", - "return_type": "void", - "arguments": [ - ["void *", "p_gdnative_handle"], - ["const char *", "p_name"], - ["const char *", "p_path"], - ["godot_string", "p_documentation"] - ] - }, - { - "name": "godot_nativescript_set_signal_documentation", - "return_type": "void", - "arguments": [ - ["void *", "p_gdnative_handle"], - ["const char *", "p_name"], - ["const char *", "p_signal_name"], - ["godot_string", "p_documentation"] - ] - }, - { - "name": "godot_nativescript_set_global_type_tag", - "return_type": "void", - "arguments": [ - ["int", "p_idx"], - ["const char *", "p_name"], - ["const void *", "p_type_tag"] - ] - }, - { - "name": "godot_nativescript_get_global_type_tag", - "return_type": "const void *", - "arguments": [ - ["int", "p_idx"], - ["const char *", "p_name"] - ] - }, - { - "name": "godot_nativescript_set_type_tag", - "return_type": "void", - "arguments": [ - ["void *", "p_gdnative_handle"], - ["const char *", "p_name"], - ["const void *", "p_type_tag"] - ] - }, - { - "name": "godot_nativescript_get_type_tag", - "return_type": "const void *", - "arguments": [ - ["const godot_object *", "p_object"] - ] - }, - { - "name": "godot_nativescript_register_instance_binding_data_functions", - "return_type": "int", - "arguments": [ - ["godot_instance_binding_functions", "p_binding_functions"] - ] - }, - { - "name": "godot_nativescript_unregister_instance_binding_data_functions", - "return_type": "void", - "arguments": [ - ["int", "p_idx"] - ] - }, - { - "name": "godot_nativescript_get_instance_binding_data", - "return_type": "void *", - "arguments": [ - ["int", "p_idx"], - ["godot_object *", "p_object"] - ] - }, - { - "name": "godot_nativescript_profiling_add_data", - "return_type": "void", - "arguments": [ - ["const char *", "p_signature"], - ["uint64_t", "p_line"] - ] - } - ] - }, + "next": null, "api": [ { "name": "godot_nativescript_register_class", @@ -5825,8 +6934,8 @@ ["void *", "p_gdnative_handle"], ["const char *", "p_name"], ["const char *", "p_base"], - ["godot_instance_create_func", "p_create_func"], - ["godot_instance_destroy_func", "p_destroy_func"] + ["godot_nativescript_instance_create_func", "p_create_func"], + ["godot_nativescript_instance_destroy_func", "p_destroy_func"] ] }, { @@ -5836,8 +6945,8 @@ ["void *", "p_gdnative_handle"], ["const char *", "p_name"], ["const char *", "p_base"], - ["godot_instance_create_func", "p_create_func"], - ["godot_instance_destroy_func", "p_destroy_func"] + ["godot_nativescript_instance_create_func", "p_create_func"], + ["godot_nativescript_instance_destroy_func", "p_destroy_func"] ] }, { @@ -5847,8 +6956,19 @@ ["void *", "p_gdnative_handle"], ["const char *", "p_name"], ["const char *", "p_function_name"], - ["godot_method_attributes", "p_attr"], - ["godot_instance_method", "p_method"] + ["godot_nativescript_method_attributes", "p_attr"], + ["godot_nativescript_instance_method", "p_method"] + ] + }, + { + "name": "godot_nativescript_set_method_argument_information", + "return_type": "void", + "arguments": [ + ["void *", "p_gdnative_handle"], + ["const char *", "p_name"], + ["const char *", "p_function_name"], + ["int", "p_num_args"], + ["const godot_nativescript_method_argument *", "p_args"] ] }, { @@ -5858,9 +6978,9 @@ ["void *", "p_gdnative_handle"], ["const char *", "p_name"], ["const char *", "p_path"], - ["godot_property_attributes *", "p_attr"], - ["godot_property_set_func", "p_set_func"], - ["godot_property_get_func", "p_get_func"] + ["godot_nativescript_property_attributes *", "p_attr"], + ["godot_nativescript_property_set_func", "p_set_func"], + ["godot_nativescript_property_get_func", "p_get_func"] ] }, { @@ -5869,7 +6989,7 @@ "arguments": [ ["void *", "p_gdnative_handle"], ["const char *", "p_name"], - ["const godot_signal *", "p_signal"] + ["const godot_nativescript_signal *", "p_signal"] ] }, { @@ -5878,6 +6998,108 @@ "arguments": [ ["godot_object *", "p_instance"] ] + }, + { + "name": "godot_nativescript_set_class_documentation", + "return_type": "void", + "arguments": [ + ["void *", "p_gdnative_handle"], + ["const char *", "p_name"], + ["godot_string", "p_documentation"] + ] + }, + { + "name": "godot_nativescript_set_method_documentation", + "return_type": "void", + "arguments": [ + ["void *", "p_gdnative_handle"], + ["const char *", "p_name"], + ["const char *", "p_function_name"], + ["godot_string", "p_documentation"] + ] + }, + { + "name": "godot_nativescript_set_property_documentation", + "return_type": "void", + "arguments": [ + ["void *", "p_gdnative_handle"], + ["const char *", "p_name"], + ["const char *", "p_path"], + ["godot_string", "p_documentation"] + ] + }, + { + "name": "godot_nativescript_set_signal_documentation", + "return_type": "void", + "arguments": [ + ["void *", "p_gdnative_handle"], + ["const char *", "p_name"], + ["const char *", "p_signal_name"], + ["godot_string", "p_documentation"] + ] + }, + { + "name": "godot_nativescript_set_global_type_tag", + "return_type": "void", + "arguments": [ + ["int", "p_idx"], + ["const char *", "p_name"], + ["const void *", "p_type_tag"] + ] + }, + { + "name": "godot_nativescript_get_global_type_tag", + "return_type": "const void *", + "arguments": [ + ["int", "p_idx"], + ["const char *", "p_name"] + ] + }, + { + "name": "godot_nativescript_set_type_tag", + "return_type": "void", + "arguments": [ + ["void *", "p_gdnative_handle"], + ["const char *", "p_name"], + ["const void *", "p_type_tag"] + ] + }, + { + "name": "godot_nativescript_get_type_tag", + "return_type": "const void *", + "arguments": [ + ["const godot_object *", "p_object"] + ] + }, + { + "name": "godot_nativescript_register_instance_binding_data_functions", + "return_type": "int", + "arguments": [ + ["godot_nativescript_instance_binding_functions", "p_binding_functions"] + ] + }, + { + "name": "godot_nativescript_unregister_instance_binding_data_functions", + "return_type": "void", + "arguments": [ + ["int", "p_idx"] + ] + }, + { + "name": "godot_nativescript_get_instance_binding_data", + "return_type": "void *", + "arguments": [ + ["int", "p_idx"], + ["godot_object *", "p_object"] + ] + }, + { + "name": "godot_nativescript_profiling_add_data", + "return_type": "void", + "arguments": [ + ["const char *", "p_signature"], + ["uint64_t", "p_line"] + ] } ] }, @@ -6071,42 +7293,10 @@ "name": "net", "type": "NET", "version": { - "major": 3, - "minor": 1 - }, - "next": { - "type": "NET", - "version": { - "major": 3, - "minor": 2 - }, - "next": null, - "api": [ - { - "name": "godot_net_set_webrtc_library", - "return_type": "godot_error", - "arguments": [ - ["const godot_net_webrtc_library *", "p_library"] - ] - }, - { - "name": "godot_net_bind_webrtc_peer_connection", - "return_type": "void", - "arguments": [ - ["godot_object *", "p_obj"], - ["const godot_net_webrtc_peer_connection *", "p_interface"] - ] - }, - { - "name": "godot_net_bind_webrtc_data_channel", - "return_type": "void", - "arguments": [ - ["godot_object *", "p_obj"], - ["const godot_net_webrtc_data_channel *", "p_interface"] - ] - } - ] + "major": 4, + "minor": 0 }, + "next": null, "api": [ { "name": "godot_net_bind_stream_peer", @@ -6131,6 +7321,29 @@ ["godot_object *", "p_obj"], ["const godot_net_multiplayer_peer *", "p_interface"] ] + }, + { + "name": "godot_net_set_webrtc_library", + "return_type": "godot_error", + "arguments": [ + ["const godot_net_webrtc_library *", "p_library"] + ] + }, + { + "name": "godot_net_bind_webrtc_peer_connection", + "return_type": "void", + "arguments": [ + ["godot_object *", "p_obj"], + ["const godot_net_webrtc_peer_connection *", "p_interface"] + ] + }, + { + "name": "godot_net_bind_webrtc_data_channel", + "return_type": "void", + "arguments": [ + ["godot_object *", "p_obj"], + ["const godot_net_webrtc_data_channel *", "p_interface"] + ] } ] } diff --git a/modules/gdnative/gdnative_builders.py b/modules/gdnative/gdnative_builders.py index 620935795f..a6f8afb85b 100644 --- a/modules/gdnative/gdnative_builders.py +++ b/modules/gdnative/gdnative_builders.py @@ -228,7 +228,16 @@ def _build_gdnative_api_struct_source(api): "extern const godot_gdnative_core_api_struct api_struct = {", "\tGDNATIVE_" + api["core"]["type"] + ",", "\t{" + str(api["core"]["version"]["major"]) + ", " + str(api["core"]["version"]["minor"]) + "},", - "\t(const godot_gdnative_api_struct *)&api_1_1,", + "\t" + + ( + "nullptr, " + if not api["core"]["next"] + else ( + "(const godot_gdnative_api_struct *)& api_{0}_{1},".format( + api["core"]["next"]["version"]["major"], api["core"]["next"]["version"]["minor"] + ) + ) + ), "\t" + str(len(api["extensions"])) + ",", "\tgdnative_extensions_pointers,", ] diff --git a/modules/gdnative/gdnative_library_editor_plugin.cpp b/modules/gdnative/gdnative_library_editor_plugin.cpp index 2a9836329e..5896da4640 100644 --- a/modules/gdnative/gdnative_library_editor_plugin.cpp +++ b/modules/gdnative/gdnative_library_editor_plugin.cpp @@ -283,7 +283,7 @@ GDNativeLibraryEditor::GDNativeLibraryEditor() { platforms["Haiku"] = platform_haiku; NativePlatformConfig platform_uwp; - platform_uwp.name = "Windows Universal"; + platform_uwp.name = "UWP"; platform_uwp.entries.push_back("arm"); platform_uwp.entries.push_back("32"); platform_uwp.entries.push_back("64"); diff --git a/modules/gdnative/include/gdnative/array.h b/modules/gdnative/include/gdnative/array.h index e3114e9348..4db685873f 100644 --- a/modules/gdnative/include/gdnative/array.h +++ b/modules/gdnative/include/gdnative/array.h @@ -51,7 +51,7 @@ typedef struct { } #endif -#include <gdnative/pool_arrays.h> +#include <gdnative/packed_arrays.h> #include <gdnative/variant.h> #include <gdnative/gdnative.h> @@ -66,8 +66,10 @@ void GDAPI godot_array_new_packed_color_array(godot_array *r_dest, const godot_p void GDAPI godot_array_new_packed_vector3_array(godot_array *r_dest, const godot_packed_vector3_array *p_pv3a); void GDAPI godot_array_new_packed_vector2_array(godot_array *r_dest, const godot_packed_vector2_array *p_pv2a); void GDAPI godot_array_new_packed_string_array(godot_array *r_dest, const godot_packed_string_array *p_psa); -void GDAPI godot_array_new_packed_real_array(godot_array *r_dest, const godot_packed_real_array *p_pra); -void GDAPI godot_array_new_packed_int_array(godot_array *r_dest, const godot_packed_int_array *p_pia); +void GDAPI godot_array_new_packed_float32_array(godot_array *r_dest, const godot_packed_float32_array *p_pra); +void GDAPI godot_array_new_packed_float64_array(godot_array *r_dest, const godot_packed_float64_array *p_pra); +void GDAPI godot_array_new_packed_int32_array(godot_array *r_dest, const godot_packed_int32_array *p_pia); +void GDAPI godot_array_new_packed_int64_array(godot_array *r_dest, const godot_packed_int64_array *p_pia); void GDAPI godot_array_new_packed_byte_array(godot_array *r_dest, const godot_packed_byte_array *p_pba); void GDAPI godot_array_set(godot_array *p_self, const godot_int p_idx, const godot_variant *p_value); diff --git a/modules/gdnative/include/gdnative/callable.h b/modules/gdnative/include/gdnative/callable.h new file mode 100644 index 0000000000..dbb5d02590 --- /dev/null +++ b/modules/gdnative/include/gdnative/callable.h @@ -0,0 +1,126 @@ +/*************************************************************************/ +/* callable.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* https://godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/*************************************************************************/ + +#ifndef GODOT_CALLABLE_H +#define GODOT_CALLABLE_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include <stdint.h> + +#define GODOT_CALLABLE_SIZE (16) + +#ifndef GODOT_CORE_API_GODOT_CALLABLE_TYPE_DEFINED +#define GODOT_CORE_API_GODOT_CALLABLE_TYPE_DEFINED +typedef struct { + uint8_t _dont_touch_that[GODOT_CALLABLE_SIZE]; +} godot_callable; +#endif + +#define GODOT_SIGNAL_SIZE (16) + +#ifndef GODOT_CORE_API_GODOT_SIGNAL_TYPE_DEFINED +#define GODOT_CORE_API_GODOT_SIGNAL_TYPE_DEFINED +typedef struct { + uint8_t _dont_touch_that[GODOT_SIGNAL_SIZE]; +} godot_signal; +#endif + +#ifdef __cplusplus +} +#endif + +#include <gdnative/gdnative.h> +#include <gdnative/string_name.h> + +#ifdef __cplusplus +extern "C" { +#endif + +// Callable + +void GDAPI godot_callable_new_with_object(godot_callable *r_dest, const godot_object *p_object, const godot_string_name *p_method); +void GDAPI godot_callable_new_with_object_id(godot_callable *r_dest, uint64_t p_objectid, const godot_string_name *p_method); +void GDAPI godot_callable_new_copy(godot_callable *r_dest, const godot_callable *p_src); + +void GDAPI godot_callable_destroy(godot_callable *p_self); + +godot_int GDAPI godot_callable_call(const godot_callable *p_self, const godot_variant **p_arguments, godot_int p_argcount, godot_variant *r_return_value); +void GDAPI godot_callable_call_deferred(const godot_callable *p_self, const godot_variant **p_arguments, godot_int p_argcount); + +godot_bool GDAPI godot_callable_is_null(const godot_callable *p_self); +godot_bool GDAPI godot_callable_is_custom(const godot_callable *p_self); +godot_bool GDAPI godot_callable_is_standard(const godot_callable *p_self); + +godot_object GDAPI *godot_callable_get_object(const godot_callable *p_self); +uint64_t GDAPI godot_callable_get_object_id(const godot_callable *p_self); +godot_string_name GDAPI godot_callable_get_method(const godot_callable *p_self); + +uint32_t GDAPI godot_callable_hash(const godot_callable *p_self); + +godot_string GDAPI godot_callable_as_string(const godot_callable *p_self); + +godot_bool GDAPI godot_callable_operator_equal(const godot_callable *p_self, const godot_callable *p_other); +godot_bool GDAPI godot_callable_operator_less(const godot_callable *p_self, const godot_callable *p_other); + +// Signal + +void GDAPI godot_signal_new_with_object(godot_signal *r_dest, const godot_object *p_object, const godot_string_name *p_name); +void GDAPI godot_signal_new_with_object_id(godot_signal *r_dest, uint64_t p_objectid, const godot_string_name *p_name); +void GDAPI godot_signal_new_copy(godot_signal *r_dest, const godot_signal *p_src); + +void GDAPI godot_signal_destroy(godot_signal *p_self); + +godot_int GDAPI godot_signal_emit(const godot_signal *p_self, const godot_variant **p_arguments, godot_int p_argcount); + +godot_int GDAPI godot_signal_connect(godot_signal *p_self, const godot_callable *p_callable, const godot_array *p_binds, uint32_t p_flags); +void GDAPI godot_signal_disconnect(godot_signal *p_self, const godot_callable *p_callable); + +godot_bool GDAPI godot_signal_is_null(const godot_signal *p_self); +godot_bool GDAPI godot_signal_is_connected(const godot_signal *p_self, const godot_callable *p_callable); + +godot_array GDAPI godot_signal_get_connections(const godot_signal *p_self); + +godot_object GDAPI *godot_signal_get_object(const godot_signal *p_self); +uint64_t GDAPI godot_signal_get_object_id(const godot_signal *p_self); +godot_string_name GDAPI godot_signal_get_name(const godot_signal *p_self); + +godot_string GDAPI godot_signal_as_string(const godot_signal *p_self); + +godot_bool GDAPI godot_signal_operator_equal(const godot_signal *p_self, const godot_signal *p_other); +godot_bool GDAPI godot_signal_operator_less(const godot_signal *p_self, const godot_signal *p_other); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/modules/gdnative/include/gdnative/gdnative.h b/modules/gdnative/include/gdnative/gdnative.h index 6fdca30122..6a0a375da8 100644 --- a/modules/gdnative/include/gdnative/gdnative.h +++ b/modules/gdnative/include/gdnative/gdnative.h @@ -144,15 +144,15 @@ typedef void godot_object; #include <gdnative/string_name.h> -////// Vector2 +////// Vector2 & Vector2i #include <gdnative/vector2.h> -////// Rect2 +////// Rect2 & Rect2i #include <gdnative/rect2.h> -////// Vector3 +////// Vector3 & Vector3i #include <gdnative/vector3.h> @@ -192,6 +192,10 @@ typedef void godot_object; #include <gdnative/rid.h> +/////// Callable & Signal + +#include <gdnative/callable.h> + /////// Dictionary #include <gdnative/dictionary.h> @@ -200,8 +204,8 @@ typedef void godot_object; #include <gdnative/array.h> -// single API file for Pool*Array -#include <gdnative/pool_arrays.h> +// single API file for Packed*Array +#include <gdnative/packed_arrays.h> void GDAPI godot_object_destroy(godot_object *p_o); @@ -289,7 +293,9 @@ void GDAPI *godot_get_class_tag(const godot_string_name *p_class); godot_object GDAPI *godot_object_cast_to(const godot_object *p_object, void *p_class_tag); // equivalent of GDScript's instance_from_id -godot_object GDAPI *godot_instance_from_id(godot_int p_instance_id); +godot_object GDAPI *godot_instance_from_id(uint64_t p_instance_id); + +uint64_t GDAPI godot_object_get_instance_id(const godot_object *p_object); #ifdef __cplusplus } diff --git a/modules/gdnative/include/gdnative/pool_arrays.h b/modules/gdnative/include/gdnative/packed_arrays.h index 652bd6ae1c..87d467a5b8 100644 --- a/modules/gdnative/include/gdnative/pool_arrays.h +++ b/modules/gdnative/include/gdnative/packed_arrays.h @@ -1,5 +1,5 @@ /*************************************************************************/ -/* pool_arrays.h */ +/* packed_arrays.h */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ @@ -28,8 +28,8 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -#ifndef GODOT_POOL_ARRAYS_H -#define GODOT_POOL_ARRAYS_H +#ifndef GODOT_PACKED_ARRAYS_H +#define GODOT_PACKED_ARRAYS_H #ifdef __cplusplus extern "C" { @@ -50,24 +50,46 @@ typedef struct { /////// PackedInt32Array -#define GODOT_PACKED_INT_ARRAY_SIZE (2 * sizeof(void *)) +#define GODOT_PACKED_INT32_ARRAY_SIZE (2 * sizeof(void *)) -#ifndef GODOT_CORE_API_GODOT_PACKED_INT_ARRAY_TYPE_DEFINED -#define GODOT_CORE_API_GODOT_PACKED_INT_ARRAY_TYPE_DEFINED +#ifndef GODOT_CORE_API_GODOT_PACKED_INT32_ARRAY_TYPE_DEFINED +#define GODOT_CORE_API_GODOT_PACKED_INT32_ARRAY_TYPE_DEFINED typedef struct { - uint8_t _dont_touch_that[GODOT_PACKED_INT_ARRAY_SIZE]; -} godot_packed_int_array; + uint8_t _dont_touch_that[GODOT_PACKED_INT32_ARRAY_SIZE]; +} godot_packed_int32_array; +#endif + +/////// PackedInt64Array + +#define GODOT_PACKED_INT64_ARRAY_SIZE (2 * sizeof(void *)) + +#ifndef GODOT_CORE_API_GODOT_PACKED_INT64_ARRAY_TYPE_DEFINED +#define GODOT_CORE_API_GODOT_PACKED_INT64_ARRAY_TYPE_DEFINED +typedef struct { + uint8_t _dont_touch_that[GODOT_PACKED_INT64_ARRAY_SIZE]; +} godot_packed_int64_array; #endif /////// PackedFloat32Array -#define GODOT_PACKED_REAL_ARRAY_SIZE (2 * sizeof(void *)) +#define GODOT_PACKED_FLOAT32_ARRAY_SIZE (2 * sizeof(void *)) + +#ifndef GODOT_CORE_API_GODOT_PACKED_FLOAT32_ARRAY_TYPE_DEFINED +#define GODOT_CORE_API_GODOT_PACKED_FLOAT32_ARRAY_TYPE_DEFINED +typedef struct { + uint8_t _dont_touch_that[GODOT_PACKED_FLOAT32_ARRAY_SIZE]; +} godot_packed_float32_array; +#endif + +/////// PackedFloat64Array -#ifndef GODOT_CORE_API_GODOT_PACKED_REAL_ARRAY_TYPE_DEFINED -#define GODOT_CORE_API_GODOT_PACKED_REAL_ARRAY_TYPE_DEFINED +#define GODOT_PACKED_FLOAT64_ARRAY_SIZE (2 * sizeof(void *)) + +#ifndef GODOT_CORE_API_GODOT_PACKED_FLOAT64_ARRAY_TYPE_DEFINED +#define GODOT_CORE_API_GODOT_PACKED_FLOAT64_ARRAY_TYPE_DEFINED typedef struct { - uint8_t _dont_touch_that[GODOT_PACKED_REAL_ARRAY_SIZE]; -} godot_packed_real_array; + uint8_t _dont_touch_that[GODOT_PACKED_FLOAT64_ARRAY_SIZE]; +} godot_packed_float64_array; #endif /////// PackedStringArray @@ -136,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); @@ -159,63 +184,133 @@ godot_bool GDAPI godot_packed_byte_array_empty(const godot_packed_byte_array *p_ void GDAPI godot_packed_byte_array_destroy(godot_packed_byte_array *p_self); -// int +// int32 + +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); + +godot_error GDAPI godot_packed_int32_array_insert(godot_packed_int32_array *p_self, const godot_int p_idx, const int32_t p_data); + +void GDAPI godot_packed_int32_array_invert(godot_packed_int32_array *p_self); + +void GDAPI godot_packed_int32_array_push_back(godot_packed_int32_array *p_self, const int32_t p_data); + +void GDAPI godot_packed_int32_array_remove(godot_packed_int32_array *p_self, const godot_int p_idx); + +void GDAPI godot_packed_int32_array_resize(godot_packed_int32_array *p_self, const godot_int p_size); + +void GDAPI godot_packed_int32_array_set(godot_packed_int32_array *p_self, const godot_int p_idx, const int32_t p_data); +int32_t GDAPI godot_packed_int32_array_get(const godot_packed_int32_array *p_self, const godot_int p_idx); + +godot_int GDAPI godot_packed_int32_array_size(const godot_packed_int32_array *p_self); + +godot_bool GDAPI godot_packed_int32_array_empty(const godot_packed_int32_array *p_self); -void GDAPI godot_packed_int_array_new(godot_packed_int_array *r_dest); -void GDAPI godot_packed_int_array_new_copy(godot_packed_int_array *r_dest, const godot_packed_int_array *p_src); -void GDAPI godot_packed_int_array_new_with_array(godot_packed_int_array *r_dest, const godot_array *p_a); +void GDAPI godot_packed_int32_array_destroy(godot_packed_int32_array *p_self); -void GDAPI godot_packed_int_array_append(godot_packed_int_array *p_self, const godot_int p_data); +// int64 -void GDAPI godot_packed_int_array_append_array(godot_packed_int_array *p_self, const godot_packed_int_array *p_array); +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); -godot_error GDAPI godot_packed_int_array_insert(godot_packed_int_array *p_self, const godot_int p_idx, const godot_int p_data); +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_int_array_invert(godot_packed_int_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_int_array_push_back(godot_packed_int_array *p_self, const godot_int p_data); +void GDAPI godot_packed_int64_array_append_array(godot_packed_int64_array *p_self, const godot_packed_int64_array *p_array); -void GDAPI godot_packed_int_array_remove(godot_packed_int_array *p_self, const godot_int p_idx); +godot_error GDAPI godot_packed_int64_array_insert(godot_packed_int64_array *p_self, const godot_int p_idx, const int64_t p_data); -void GDAPI godot_packed_int_array_resize(godot_packed_int_array *p_self, const godot_int p_size); +void GDAPI godot_packed_int64_array_invert(godot_packed_int64_array *p_self); -void GDAPI godot_packed_int_array_set(godot_packed_int_array *p_self, const godot_int p_idx, const godot_int p_data); -godot_int GDAPI godot_packed_int_array_get(const godot_packed_int_array *p_self, const godot_int p_idx); +void GDAPI godot_packed_int64_array_push_back(godot_packed_int64_array *p_self, const int64_t p_data); -godot_int GDAPI godot_packed_int_array_size(const godot_packed_int_array *p_self); +void GDAPI godot_packed_int64_array_remove(godot_packed_int64_array *p_self, const godot_int p_idx); -godot_bool GDAPI godot_packed_int_array_empty(const godot_packed_int_array *p_self); +void GDAPI godot_packed_int64_array_resize(godot_packed_int64_array *p_self, const godot_int p_size); -void GDAPI godot_packed_int_array_destroy(godot_packed_int_array *p_self); +void GDAPI godot_packed_int64_array_set(godot_packed_int64_array *p_self, const godot_int p_idx, const int64_t p_data); +int64_t GDAPI godot_packed_int64_array_get(const godot_packed_int64_array *p_self, const godot_int p_idx); -// real +godot_int GDAPI godot_packed_int64_array_size(const godot_packed_int64_array *p_self); -void GDAPI godot_packed_real_array_new(godot_packed_real_array *r_dest); -void GDAPI godot_packed_real_array_new_copy(godot_packed_real_array *r_dest, const godot_packed_real_array *p_src); -void GDAPI godot_packed_real_array_new_with_array(godot_packed_real_array *r_dest, const godot_array *p_a); +godot_bool GDAPI godot_packed_int64_array_empty(const godot_packed_int64_array *p_self); -void GDAPI godot_packed_real_array_append(godot_packed_real_array *p_self, const godot_real p_data); +void GDAPI godot_packed_int64_array_destroy(godot_packed_int64_array *p_self); -void GDAPI godot_packed_real_array_append_array(godot_packed_real_array *p_self, const godot_packed_real_array *p_array); +// float32 -godot_error GDAPI godot_packed_real_array_insert(godot_packed_real_array *p_self, const godot_int p_idx, const godot_real p_data); +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); -void GDAPI godot_packed_real_array_invert(godot_packed_real_array *p_self); +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_real_array_push_back(godot_packed_real_array *p_self, const godot_real p_data); +void GDAPI godot_packed_float32_array_append(godot_packed_float32_array *p_self, const float p_data); -void GDAPI godot_packed_real_array_remove(godot_packed_real_array *p_self, const godot_int p_idx); +void GDAPI godot_packed_float32_array_append_array(godot_packed_float32_array *p_self, const godot_packed_float32_array *p_array); -void GDAPI godot_packed_real_array_resize(godot_packed_real_array *p_self, const godot_int p_size); +godot_error GDAPI godot_packed_float32_array_insert(godot_packed_float32_array *p_self, const godot_int p_idx, const float p_data); -void GDAPI godot_packed_real_array_set(godot_packed_real_array *p_self, const godot_int p_idx, const godot_real p_data); -godot_real GDAPI godot_packed_real_array_get(const godot_packed_real_array *p_self, const godot_int p_idx); +void GDAPI godot_packed_float32_array_invert(godot_packed_float32_array *p_self); -godot_int GDAPI godot_packed_real_array_size(const godot_packed_real_array *p_self); +void GDAPI godot_packed_float32_array_push_back(godot_packed_float32_array *p_self, const float p_data); -godot_bool GDAPI godot_packed_real_array_empty(const godot_packed_real_array *p_self); +void GDAPI godot_packed_float32_array_remove(godot_packed_float32_array *p_self, const godot_int p_idx); -void GDAPI godot_packed_real_array_destroy(godot_packed_real_array *p_self); +void GDAPI godot_packed_float32_array_resize(godot_packed_float32_array *p_self, const godot_int p_size); + +void GDAPI godot_packed_float32_array_set(godot_packed_float32_array *p_self, const godot_int p_idx, const float p_data); +float GDAPI godot_packed_float32_array_get(const godot_packed_float32_array *p_self, const godot_int p_idx); + +godot_int GDAPI godot_packed_float32_array_size(const godot_packed_float32_array *p_self); + +godot_bool GDAPI godot_packed_float32_array_empty(const godot_packed_float32_array *p_self); + +void GDAPI godot_packed_float32_array_destroy(godot_packed_float32_array *p_self); + +// float64 + +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); + +godot_error GDAPI godot_packed_float64_array_insert(godot_packed_float64_array *p_self, const godot_int p_idx, const double p_data); + +void GDAPI godot_packed_float64_array_invert(godot_packed_float64_array *p_self); + +void GDAPI godot_packed_float64_array_push_back(godot_packed_float64_array *p_self, const double p_data); + +void GDAPI godot_packed_float64_array_remove(godot_packed_float64_array *p_self, const godot_int p_idx); + +void GDAPI godot_packed_float64_array_resize(godot_packed_float64_array *p_self, const godot_int p_size); + +void GDAPI godot_packed_float64_array_set(godot_packed_float64_array *p_self, const godot_int p_idx, const double p_data); +double GDAPI godot_packed_float64_array_get(const godot_packed_float64_array *p_self, const godot_int p_idx); + +godot_int GDAPI godot_packed_float64_array_size(const godot_packed_float64_array *p_self); + +godot_bool GDAPI godot_packed_float64_array_empty(const godot_packed_float64_array *p_self); + +void GDAPI godot_packed_float64_array_destroy(godot_packed_float64_array *p_self); // string @@ -223,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); @@ -252,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); @@ -281,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); @@ -310,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/gdnative/include/gdnative/rect2.h b/modules/gdnative/include/gdnative/rect2.h index 0ecf072471..f317afc9da 100644 --- a/modules/gdnative/include/gdnative/rect2.h +++ b/modules/gdnative/include/gdnative/rect2.h @@ -44,6 +44,13 @@ typedef struct godot_rect2 { } godot_rect2; #endif +#ifndef GODOT_CORE_API_GODOT_RECT2I_TYPE_DEFINED +#define GODOT_CORE_API_GODOT_RECT2I_TYPE_DEFINED +typedef struct godot_rect2i { + uint8_t _dont_touch_that[16]; +} godot_rect2i; +#endif + // reduce extern "C" nesting for VS2013 #ifdef __cplusplus } @@ -56,11 +63,15 @@ typedef struct godot_rect2 { extern "C" { #endif +// Rect2 + void GDAPI godot_rect2_new_with_position_and_size(godot_rect2 *r_dest, const godot_vector2 *p_pos, const godot_vector2 *p_size); void GDAPI godot_rect2_new(godot_rect2 *r_dest, const godot_real p_x, const godot_real p_y, const godot_real p_width, const godot_real p_height); godot_string GDAPI godot_rect2_as_string(const godot_rect2 *p_self); +godot_rect2i GDAPI godot_rect2_as_rect2i(const godot_rect2 *p_self); + godot_real GDAPI godot_rect2_get_area(const godot_rect2 *p_self); godot_bool GDAPI godot_rect2_intersects(const godot_rect2 *p_self, const godot_rect2 *p_b); @@ -95,6 +106,49 @@ void GDAPI godot_rect2_set_position(godot_rect2 *p_self, const godot_vector2 *p_ void GDAPI godot_rect2_set_size(godot_rect2 *p_self, const godot_vector2 *p_size); +// Rect2I + +void GDAPI godot_rect2i_new_with_position_and_size(godot_rect2i *r_dest, const godot_vector2i *p_pos, const godot_vector2i *p_size); +void GDAPI godot_rect2i_new(godot_rect2i *r_dest, const godot_int p_x, const godot_int p_y, const godot_int p_width, const godot_int p_height); + +godot_string GDAPI godot_rect2i_as_string(const godot_rect2i *p_self); + +godot_rect2 GDAPI godot_rect2i_as_rect2(const godot_rect2i *p_self); + +godot_int GDAPI godot_rect2i_get_area(const godot_rect2i *p_self); + +godot_bool GDAPI godot_rect2i_intersects(const godot_rect2i *p_self, const godot_rect2i *p_b); + +godot_bool GDAPI godot_rect2i_encloses(const godot_rect2i *p_self, const godot_rect2i *p_b); + +godot_bool GDAPI godot_rect2i_has_no_area(const godot_rect2i *p_self); + +godot_rect2i GDAPI godot_rect2i_clip(const godot_rect2i *p_self, const godot_rect2i *p_b); + +godot_rect2i GDAPI godot_rect2i_merge(const godot_rect2i *p_self, const godot_rect2i *p_b); + +godot_bool GDAPI godot_rect2i_has_point(const godot_rect2i *p_self, const godot_vector2i *p_point); + +godot_rect2i GDAPI godot_rect2i_grow(const godot_rect2i *p_self, const godot_int p_by); + +godot_rect2i GDAPI godot_rect2i_grow_individual(const godot_rect2i *p_self, const godot_int p_left, const godot_int p_top, const godot_int p_right, const godot_int p_bottom); + +godot_rect2i GDAPI godot_rect2i_grow_margin(const godot_rect2i *p_self, const godot_int p_margin, const godot_int p_by); + +godot_rect2i GDAPI godot_rect2i_abs(const godot_rect2i *p_self); + +godot_rect2i GDAPI godot_rect2i_expand(const godot_rect2i *p_self, const godot_vector2i *p_to); + +godot_bool GDAPI godot_rect2i_operator_equal(const godot_rect2i *p_self, const godot_rect2i *p_b); + +godot_vector2i GDAPI godot_rect2i_get_position(const godot_rect2i *p_self); + +godot_vector2i GDAPI godot_rect2i_get_size(const godot_rect2i *p_self); + +void GDAPI godot_rect2i_set_position(godot_rect2i *p_self, const godot_vector2i *p_pos); + +void GDAPI godot_rect2i_set_size(godot_rect2i *p_self, const godot_vector2i *p_size); + #ifdef __cplusplus } #endif diff --git a/modules/gdnative/include/gdnative/variant.h b/modules/gdnative/include/gdnative/variant.h index 682c3e3ba8..0a611b76e9 100644 --- a/modules/gdnative/include/gdnative/variant.h +++ b/modules/gdnative/include/gdnative/variant.h @@ -71,16 +71,21 @@ typedef enum godot_variant_type { // misc types GODOT_VARIANT_TYPE_COLOR, + GODOT_VARIANT_TYPE_STRING_NAME, GODOT_VARIANT_TYPE_NODE_PATH, GODOT_VARIANT_TYPE_RID, GODOT_VARIANT_TYPE_OBJECT, + GODOT_VARIANT_TYPE_CALLABLE, + GODOT_VARIANT_TYPE_SIGNAL, GODOT_VARIANT_TYPE_DICTIONARY, GODOT_VARIANT_TYPE_ARRAY, // arrays GODOT_VARIANT_TYPE_PACKED_BYTE_ARRAY, - GODOT_VARIANT_TYPE_PACKED_INT_ARRAY, - GODOT_VARIANT_TYPE_PACKED_REAL_ARRAY, + GODOT_VARIANT_TYPE_PACKED_INT32_ARRAY, + GODOT_VARIANT_TYPE_PACKED_INT64_ARRAY, + GODOT_VARIANT_TYPE_PACKED_FLOAT32_ARRAY, + GODOT_VARIANT_TYPE_PACKED_FLOAT64_ARRAY, GODOT_VARIANT_TYPE_PACKED_STRING_ARRAY, GODOT_VARIANT_TYPE_PACKED_VECTOR2_ARRAY, GODOT_VARIANT_TYPE_PACKED_VECTOR3_ARRAY, @@ -149,15 +154,17 @@ typedef enum godot_variant_operator { #include <gdnative/aabb.h> #include <gdnative/array.h> #include <gdnative/basis.h> +#include <gdnative/callable.h> #include <gdnative/color.h> #include <gdnative/dictionary.h> #include <gdnative/node_path.h> +#include <gdnative/packed_arrays.h> #include <gdnative/plane.h> -#include <gdnative/pool_arrays.h> #include <gdnative/quat.h> #include <gdnative/rect2.h> #include <gdnative/rid.h> #include <gdnative/string.h> +#include <gdnative/string_name.h> #include <gdnative/transform.h> #include <gdnative/transform2d.h> #include <gdnative/variant.h> @@ -181,9 +188,13 @@ void GDAPI godot_variant_new_uint(godot_variant *r_dest, const uint64_t p_i); void GDAPI godot_variant_new_int(godot_variant *r_dest, const int64_t p_i); void GDAPI godot_variant_new_real(godot_variant *r_dest, const double p_r); void GDAPI godot_variant_new_string(godot_variant *r_dest, const godot_string *p_s); +void GDAPI godot_variant_new_string_name(godot_variant *r_dest, const godot_string_name *p_s); void GDAPI godot_variant_new_vector2(godot_variant *r_dest, const godot_vector2 *p_v2); +void GDAPI godot_variant_new_vector2i(godot_variant *r_dest, const godot_vector2i *p_v2); void GDAPI godot_variant_new_rect2(godot_variant *r_dest, const godot_rect2 *p_rect2); +void GDAPI godot_variant_new_rect2i(godot_variant *r_dest, const godot_rect2i *p_rect2); void GDAPI godot_variant_new_vector3(godot_variant *r_dest, const godot_vector3 *p_v3); +void GDAPI godot_variant_new_vector3i(godot_variant *r_dest, const godot_vector3i *p_v3); void GDAPI godot_variant_new_transform2d(godot_variant *r_dest, const godot_transform2d *p_t2d); void GDAPI godot_variant_new_plane(godot_variant *r_dest, const godot_plane *p_plane); void GDAPI godot_variant_new_quat(godot_variant *r_dest, const godot_quat *p_quat); @@ -193,12 +204,16 @@ void GDAPI godot_variant_new_transform(godot_variant *r_dest, const godot_transf void GDAPI godot_variant_new_color(godot_variant *r_dest, const godot_color *p_color); void GDAPI godot_variant_new_node_path(godot_variant *r_dest, const godot_node_path *p_np); void GDAPI godot_variant_new_rid(godot_variant *r_dest, const godot_rid *p_rid); +void GDAPI godot_variant_new_callable(godot_variant *r_dest, const godot_callable *p_callable); +void GDAPI godot_variant_new_signal(godot_variant *r_dest, const godot_signal *p_signal); void GDAPI godot_variant_new_object(godot_variant *r_dest, const godot_object *p_obj); void GDAPI godot_variant_new_dictionary(godot_variant *r_dest, const godot_dictionary *p_dict); void GDAPI godot_variant_new_array(godot_variant *r_dest, const godot_array *p_arr); void GDAPI godot_variant_new_packed_byte_array(godot_variant *r_dest, const godot_packed_byte_array *p_pba); -void GDAPI godot_variant_new_packed_int_array(godot_variant *r_dest, const godot_packed_int_array *p_pia); -void GDAPI godot_variant_new_packed_real_array(godot_variant *r_dest, const godot_packed_real_array *p_pra); +void GDAPI godot_variant_new_packed_int32_array(godot_variant *r_dest, const godot_packed_int32_array *p_pia); +void GDAPI godot_variant_new_packed_int64_array(godot_variant *r_dest, const godot_packed_int64_array *p_pia); +void GDAPI godot_variant_new_packed_float32_array(godot_variant *r_dest, const godot_packed_float32_array *p_pra); +void GDAPI godot_variant_new_packed_float64_array(godot_variant *r_dest, const godot_packed_float64_array *p_pra); void GDAPI godot_variant_new_packed_string_array(godot_variant *r_dest, const godot_packed_string_array *p_psa); void GDAPI godot_variant_new_packed_vector2_array(godot_variant *r_dest, const godot_packed_vector2_array *p_pv2a); void GDAPI godot_variant_new_packed_vector3_array(godot_variant *r_dest, const godot_packed_vector3_array *p_pv3a); @@ -209,9 +224,13 @@ uint64_t GDAPI godot_variant_as_uint(const godot_variant *p_self); int64_t GDAPI godot_variant_as_int(const godot_variant *p_self); double GDAPI godot_variant_as_real(const godot_variant *p_self); godot_string GDAPI godot_variant_as_string(const godot_variant *p_self); +godot_string_name GDAPI godot_variant_as_string_name(const godot_variant *p_self); godot_vector2 GDAPI godot_variant_as_vector2(const godot_variant *p_self); +godot_vector2i GDAPI godot_variant_as_vector2i(const godot_variant *p_self); godot_rect2 GDAPI godot_variant_as_rect2(const godot_variant *p_self); +godot_rect2i GDAPI godot_variant_as_rect2i(const godot_variant *p_self); godot_vector3 GDAPI godot_variant_as_vector3(const godot_variant *p_self); +godot_vector3i GDAPI godot_variant_as_vector3i(const godot_variant *p_self); godot_transform2d GDAPI godot_variant_as_transform2d(const godot_variant *p_self); godot_plane GDAPI godot_variant_as_plane(const godot_variant *p_self); godot_quat GDAPI godot_variant_as_quat(const godot_variant *p_self); @@ -221,12 +240,16 @@ godot_transform GDAPI godot_variant_as_transform(const godot_variant *p_self); godot_color GDAPI godot_variant_as_color(const godot_variant *p_self); godot_node_path GDAPI godot_variant_as_node_path(const godot_variant *p_self); godot_rid GDAPI godot_variant_as_rid(const godot_variant *p_self); +godot_callable GDAPI godot_variant_as_callable(const godot_variant *p_self); +godot_signal GDAPI godot_variant_as_signal(const godot_variant *p_self); godot_object GDAPI *godot_variant_as_object(const godot_variant *p_self); godot_dictionary GDAPI godot_variant_as_dictionary(const godot_variant *p_self); godot_array GDAPI godot_variant_as_array(const godot_variant *p_self); godot_packed_byte_array GDAPI godot_variant_as_packed_byte_array(const godot_variant *p_self); -godot_packed_int_array GDAPI godot_variant_as_packed_int_array(const godot_variant *p_self); -godot_packed_real_array GDAPI godot_variant_as_packed_real_array(const godot_variant *p_self); +godot_packed_int32_array GDAPI godot_variant_as_packed_int32_array(const godot_variant *p_self); +godot_packed_int64_array GDAPI godot_variant_as_packed_int64_array(const godot_variant *p_self); +godot_packed_float32_array GDAPI godot_variant_as_packed_float32_array(const godot_variant *p_self); +godot_packed_float64_array GDAPI godot_variant_as_packed_float64_array(const godot_variant *p_self); godot_packed_string_array GDAPI godot_variant_as_packed_string_array(const godot_variant *p_self); godot_packed_vector2_array GDAPI godot_variant_as_packed_vector2_array(const godot_variant *p_self); godot_packed_vector3_array GDAPI godot_variant_as_packed_vector3_array(const godot_variant *p_self); @@ -239,6 +262,7 @@ godot_bool GDAPI godot_variant_has_method(const godot_variant *p_self, const god godot_bool GDAPI godot_variant_operator_equal(const godot_variant *p_self, const godot_variant *p_other); godot_bool GDAPI godot_variant_operator_less(const godot_variant *p_self, const godot_variant *p_other); +uint32_t GDAPI godot_variant_hash(const godot_variant *p_self); godot_bool GDAPI godot_variant_hash_compare(const godot_variant *p_self, const godot_variant *p_other); godot_bool GDAPI godot_variant_booleanize(const godot_variant *p_self); diff --git a/modules/gdnative/include/gdnative/vector2.h b/modules/gdnative/include/gdnative/vector2.h index c11e23a586..35b02c5a75 100644 --- a/modules/gdnative/include/gdnative/vector2.h +++ b/modules/gdnative/include/gdnative/vector2.h @@ -46,6 +46,15 @@ typedef struct { } godot_vector2; #endif +#define GODOT_VECTOR2I_SIZE 8 + +#ifndef GODOT_CORE_API_GODOT_VECTOR2I_TYPE_DEFINED +#define GODOT_CORE_API_GODOT_VECTOR2I_TYPE_DEFINED +typedef struct { + uint8_t _dont_touch_that[GODOT_VECTOR2I_SIZE]; +} godot_vector2i; +#endif + // reduce extern "C" nesting for VS2013 #ifdef __cplusplus } @@ -57,10 +66,14 @@ typedef struct { extern "C" { #endif +// Vector2 + void GDAPI godot_vector2_new(godot_vector2 *r_dest, const godot_real p_x, const godot_real p_y); godot_string GDAPI godot_vector2_as_string(const godot_vector2 *p_self); +godot_vector2i GDAPI godot_vector2_as_vector2i(const godot_vector2 *p_self); + godot_vector2 GDAPI godot_vector2_normalized(const godot_vector2 *p_self); godot_real GDAPI godot_vector2_length(const godot_vector2 *p_self); @@ -93,6 +106,8 @@ godot_vector2 GDAPI godot_vector2_tangent(const godot_vector2 *p_self); godot_vector2 GDAPI godot_vector2_floor(const godot_vector2 *p_self); +godot_vector2 GDAPI godot_vector2_sign(const godot_vector2 *p_self); + godot_vector2 GDAPI godot_vector2_snapped(const godot_vector2 *p_self, const godot_vector2 *p_by); godot_real GDAPI godot_vector2_aspect(const godot_vector2 *p_self); @@ -135,6 +150,46 @@ godot_real GDAPI godot_vector2_get_x(const godot_vector2 *p_self); godot_real GDAPI godot_vector2_get_y(const godot_vector2 *p_self); +// Vector2i + +void GDAPI godot_vector2i_new(godot_vector2i *r_dest, const godot_int p_x, const godot_int p_y); + +godot_string GDAPI godot_vector2i_as_string(const godot_vector2i *p_self); + +godot_vector2 GDAPI godot_vector2i_as_vector2(const godot_vector2i *p_self); + +godot_real GDAPI godot_vector2i_aspect(const godot_vector2i *p_self); + +godot_vector2i GDAPI godot_vector2i_abs(const godot_vector2i *p_self); + +godot_vector2i GDAPI godot_vector2i_sign(const godot_vector2i *p_self); + +godot_vector2i GDAPI godot_vector2i_operator_add(const godot_vector2i *p_self, const godot_vector2i *p_b); + +godot_vector2i GDAPI godot_vector2i_operator_subtract(const godot_vector2i *p_self, const godot_vector2i *p_b); + +godot_vector2i GDAPI godot_vector2i_operator_multiply_vector(const godot_vector2i *p_self, const godot_vector2i *p_b); + +godot_vector2i GDAPI godot_vector2i_operator_multiply_scalar(const godot_vector2i *p_self, const godot_int p_b); + +godot_vector2i GDAPI godot_vector2i_operator_divide_vector(const godot_vector2i *p_self, const godot_vector2i *p_b); + +godot_vector2i GDAPI godot_vector2i_operator_divide_scalar(const godot_vector2i *p_self, const godot_int p_b); + +godot_bool GDAPI godot_vector2i_operator_equal(const godot_vector2i *p_self, const godot_vector2i *p_b); + +godot_bool GDAPI godot_vector2i_operator_less(const godot_vector2i *p_self, const godot_vector2i *p_b); + +godot_vector2i GDAPI godot_vector2i_operator_neg(const godot_vector2i *p_self); + +void GDAPI godot_vector2i_set_x(godot_vector2i *p_self, const godot_int p_x); + +void GDAPI godot_vector2i_set_y(godot_vector2i *p_self, const godot_int p_y); + +godot_int GDAPI godot_vector2i_get_x(const godot_vector2i *p_self); + +godot_int GDAPI godot_vector2i_get_y(const godot_vector2i *p_self); + #ifdef __cplusplus } #endif diff --git a/modules/gdnative/include/gdnative/vector3.h b/modules/gdnative/include/gdnative/vector3.h index 8ebf15b724..5127b8789b 100644 --- a/modules/gdnative/include/gdnative/vector3.h +++ b/modules/gdnative/include/gdnative/vector3.h @@ -46,6 +46,15 @@ typedef struct { } godot_vector3; #endif +#define GODOT_VECTOR3I_SIZE 12 + +#ifndef GODOT_CORE_API_GODOT_VECTOR3I_TYPE_DEFINED +#define GODOT_CORE_API_GODOT_VECTOR3I_TYPE_DEFINED +typedef struct { + uint8_t _dont_touch_that[GODOT_VECTOR3I_SIZE]; +} godot_vector3i; +#endif + // reduce extern "C" nesting for VS2013 #ifdef __cplusplus } @@ -64,10 +73,14 @@ typedef enum { GODOT_VECTOR3_AXIS_Z, } godot_vector3_axis; +// Vector3 + void GDAPI godot_vector3_new(godot_vector3 *r_dest, const godot_real p_x, const godot_real p_y, const godot_real p_z); godot_string GDAPI godot_vector3_as_string(const godot_vector3 *p_self); +godot_vector3i GDAPI godot_vector3_as_vector3i(const godot_vector3 *p_self); + godot_int GDAPI godot_vector3_min_axis(const godot_vector3 *p_self); godot_int GDAPI godot_vector3_max_axis(const godot_vector3 *p_self); @@ -102,6 +115,8 @@ godot_basis GDAPI godot_vector3_to_diagonal_matrix(const godot_vector3 *p_self); godot_vector3 GDAPI godot_vector3_abs(const godot_vector3 *p_self); +godot_vector3 GDAPI godot_vector3_sign(const godot_vector3 *p_self); + godot_vector3 GDAPI godot_vector3_floor(const godot_vector3 *p_self); godot_vector3 GDAPI godot_vector3_ceil(const godot_vector3 *p_self); @@ -142,6 +157,44 @@ void GDAPI godot_vector3_set_axis(godot_vector3 *p_self, const godot_vector3_axi godot_real GDAPI godot_vector3_get_axis(const godot_vector3 *p_self, const godot_vector3_axis p_axis); +// Vector3i + +void GDAPI godot_vector3i_new(godot_vector3i *r_dest, const godot_int p_x, const godot_int p_y, const godot_int p_z); + +godot_string GDAPI godot_vector3i_as_string(const godot_vector3i *p_self); + +godot_vector3 GDAPI godot_vector3i_as_vector3(const godot_vector3i *p_self); + +godot_int GDAPI godot_vector3i_min_axis(const godot_vector3i *p_self); + +godot_int GDAPI godot_vector3i_max_axis(const godot_vector3i *p_self); + +godot_vector3i GDAPI godot_vector3i_abs(const godot_vector3i *p_self); + +godot_vector3i GDAPI godot_vector3i_sign(const godot_vector3i *p_self); + +godot_vector3i GDAPI godot_vector3i_operator_add(const godot_vector3i *p_self, const godot_vector3i *p_b); + +godot_vector3i GDAPI godot_vector3i_operator_subtract(const godot_vector3i *p_self, const godot_vector3i *p_b); + +godot_vector3i GDAPI godot_vector3i_operator_multiply_vector(const godot_vector3i *p_self, const godot_vector3i *p_b); + +godot_vector3i GDAPI godot_vector3i_operator_multiply_scalar(const godot_vector3i *p_self, const godot_int p_b); + +godot_vector3i GDAPI godot_vector3i_operator_divide_vector(const godot_vector3i *p_self, const godot_vector3i *p_b); + +godot_vector3i GDAPI godot_vector3i_operator_divide_scalar(const godot_vector3i *p_self, const godot_int p_b); + +godot_bool GDAPI godot_vector3i_operator_equal(const godot_vector3i *p_self, const godot_vector3i *p_b); + +godot_bool GDAPI godot_vector3i_operator_less(const godot_vector3i *p_self, const godot_vector3i *p_b); + +godot_vector3i GDAPI godot_vector3i_operator_neg(const godot_vector3i *p_self); + +void GDAPI godot_vector3i_set_axis(godot_vector3i *p_self, const godot_vector3_axis p_axis, const godot_int p_val); + +godot_int GDAPI godot_vector3i_get_axis(const godot_vector3i *p_self, const godot_vector3_axis p_axis); + #ifdef __cplusplus } #endif diff --git a/modules/gdnative/include/nativescript/godot_nativescript.h b/modules/gdnative/include/nativescript/godot_nativescript.h index 0fb5180103..825033c99c 100644 --- a/modules/gdnative/include/nativescript/godot_nativescript.h +++ b/modules/gdnative/include/nativescript/godot_nativescript.h @@ -45,7 +45,7 @@ typedef enum { GODOT_METHOD_RPC_MODE_REMOTESYNC, GODOT_METHOD_RPC_MODE_MASTERSYNC, GODOT_METHOD_RPC_MODE_PUPPETSYNC, -} godot_method_rpc_mode; +} godot_nativescript_method_rpc_mode; typedef enum { GODOT_PROPERTY_HINT_NONE, ///< no hint provided. @@ -82,7 +82,7 @@ typedef enum { GODOT_PROPERTY_HINT_PROPERTY_OF_INSTANCE, ///< a property of an instance GODOT_PROPERTY_HINT_PROPERTY_OF_SCRIPT, ///< a property of a script & base GODOT_PROPERTY_HINT_MAX, -} godot_property_hint; +} godot_nativescript_property_hint; typedef enum { @@ -106,106 +106,95 @@ typedef enum { GODOT_PROPERTY_USAGE_DEFAULT = GODOT_PROPERTY_USAGE_STORAGE | GODOT_PROPERTY_USAGE_EDITOR | GODOT_PROPERTY_USAGE_NETWORK, GODOT_PROPERTY_USAGE_DEFAULT_INTL = GODOT_PROPERTY_USAGE_STORAGE | GODOT_PROPERTY_USAGE_EDITOR | GODOT_PROPERTY_USAGE_NETWORK | GODOT_PROPERTY_USAGE_INTERNATIONALIZED, GODOT_PROPERTY_USAGE_NOEDITOR = GODOT_PROPERTY_USAGE_STORAGE | GODOT_PROPERTY_USAGE_NETWORK, -} godot_property_usage_flags; +} godot_nativescript_property_usage_flags; typedef struct { - godot_method_rpc_mode rset_type; + godot_nativescript_method_rpc_mode rset_type; godot_int type; - godot_property_hint hint; + godot_nativescript_property_hint hint; godot_string hint_string; - godot_property_usage_flags usage; + godot_nativescript_property_usage_flags usage; godot_variant default_value; -} godot_property_attributes; +} godot_nativescript_property_attributes; typedef struct { // instance pointer, method_data - return user data GDCALLINGCONV void *(*create_func)(godot_object *, void *); void *method_data; GDCALLINGCONV void (*free_func)(void *); -} godot_instance_create_func; +} godot_nativescript_instance_create_func; typedef struct { // instance pointer, method data, user data GDCALLINGCONV void (*destroy_func)(godot_object *, void *, void *); void *method_data; GDCALLINGCONV void (*free_func)(void *); -} godot_instance_destroy_func; +} godot_nativescript_instance_destroy_func; -void GDAPI godot_nativescript_register_class(void *p_gdnative_handle, const char *p_name, const char *p_base, godot_instance_create_func p_create_func, godot_instance_destroy_func p_destroy_func); +void GDAPI godot_nativescript_register_class(void *p_gdnative_handle, const char *p_name, const char *p_base, godot_nativescript_instance_create_func p_create_func, godot_nativescript_instance_destroy_func p_destroy_func); -void GDAPI godot_nativescript_register_tool_class(void *p_gdnative_handle, const char *p_name, const char *p_base, godot_instance_create_func p_create_func, godot_instance_destroy_func p_destroy_func); +void GDAPI godot_nativescript_register_tool_class(void *p_gdnative_handle, const char *p_name, const char *p_base, godot_nativescript_instance_create_func p_create_func, godot_nativescript_instance_destroy_func p_destroy_func); typedef struct { - godot_method_rpc_mode rpc_type; -} godot_method_attributes; + godot_nativescript_method_rpc_mode rpc_type; +} godot_nativescript_method_attributes; + +typedef struct { + godot_string name; + + godot_variant_type type; + godot_nativescript_property_hint hint; + godot_string hint_string; +} godot_nativescript_method_argument; typedef struct { // instance pointer, method data, user data, num args, args - return result as varaint GDCALLINGCONV godot_variant (*method)(godot_object *, void *, void *, int, godot_variant **); void *method_data; GDCALLINGCONV void (*free_func)(void *); -} godot_instance_method; +} godot_nativescript_instance_method; -void GDAPI godot_nativescript_register_method(void *p_gdnative_handle, const char *p_name, const char *p_function_name, godot_method_attributes p_attr, godot_instance_method p_method); +void GDAPI godot_nativescript_register_method(void *p_gdnative_handle, const char *p_name, const char *p_function_name, godot_nativescript_method_attributes p_attr, godot_nativescript_instance_method p_method); +void GDAPI godot_nativescript_set_method_argument_information(void *p_gdnative_handle, const char *p_name, const char *p_function_name, int p_num_args, const godot_nativescript_method_argument *p_args); typedef struct { // instance pointer, method data, user data, value GDCALLINGCONV void (*set_func)(godot_object *, void *, void *, godot_variant *); void *method_data; GDCALLINGCONV void (*free_func)(void *); -} godot_property_set_func; +} godot_nativescript_property_set_func; typedef struct { // instance pointer, method data, user data, value GDCALLINGCONV godot_variant (*get_func)(godot_object *, void *, void *); void *method_data; GDCALLINGCONV void (*free_func)(void *); -} godot_property_get_func; +} godot_nativescript_property_get_func; -void GDAPI godot_nativescript_register_property(void *p_gdnative_handle, const char *p_name, const char *p_path, godot_property_attributes *p_attr, godot_property_set_func p_set_func, godot_property_get_func p_get_func); +void GDAPI godot_nativescript_register_property(void *p_gdnative_handle, const char *p_name, const char *p_path, godot_nativescript_property_attributes *p_attr, godot_nativescript_property_set_func p_set_func, godot_nativescript_property_get_func p_get_func); typedef struct { godot_string name; godot_int type; - godot_property_hint hint; + godot_nativescript_property_hint hint; godot_string hint_string; - godot_property_usage_flags usage; + godot_nativescript_property_usage_flags usage; godot_variant default_value; -} godot_signal_argument; +} godot_nativescript_signal_argument; typedef struct { godot_string name; int num_args; - godot_signal_argument *args; + godot_nativescript_signal_argument *args; int num_default_args; godot_variant *default_args; -} godot_signal; +} godot_nativescript_signal; -void GDAPI godot_nativescript_register_signal(void *p_gdnative_handle, const char *p_name, const godot_signal *p_signal); +void GDAPI godot_nativescript_register_signal(void *p_gdnative_handle, const char *p_name, const godot_nativescript_signal *p_signal); void GDAPI *godot_nativescript_get_userdata(godot_object *p_instance); -/* - * - * - * NativeScript 1.1 - * - * - */ - -// method registering with argument names - -typedef struct { - godot_string name; - - godot_variant_type type; - godot_property_hint hint; - godot_string hint_string; -} godot_method_arg; - -void GDAPI godot_nativescript_set_method_argument_information(void *p_gdnative_handle, const char *p_name, const char *p_function_name, int p_num_args, const godot_method_arg *p_args); - // documentation void GDAPI godot_nativescript_set_class_documentation(void *p_gdnative_handle, const char *p_name, godot_string p_documentation); @@ -230,9 +219,9 @@ typedef struct { GDCALLINGCONV bool (*refcount_decremented_instance_binding)(void *, godot_object *); void *data; GDCALLINGCONV void (*free_func)(void *); -} godot_instance_binding_functions; +} godot_nativescript_instance_binding_functions; -int GDAPI godot_nativescript_register_instance_binding_data_functions(godot_instance_binding_functions p_binding_functions); +int GDAPI godot_nativescript_register_instance_binding_data_functions(godot_nativescript_instance_binding_functions p_binding_functions); void GDAPI godot_nativescript_unregister_instance_binding_data_functions(int p_idx); void GDAPI *godot_nativescript_get_instance_binding_data(int p_idx, godot_object *p_object); diff --git a/modules/gdnative/nativescript/godot_nativescript.cpp b/modules/gdnative/nativescript/godot_nativescript.cpp index 1bdac0dcb2..e47548f3e9 100644 --- a/modules/gdnative/nativescript/godot_nativescript.cpp +++ b/modules/gdnative/nativescript/godot_nativescript.cpp @@ -51,7 +51,7 @@ extern "C" void _native_script_hook() { // Script API -void GDAPI godot_nativescript_register_class(void *p_gdnative_handle, const char *p_name, const char *p_base, godot_instance_create_func p_create_func, godot_instance_destroy_func p_destroy_func) { +void GDAPI godot_nativescript_register_class(void *p_gdnative_handle, const char *p_name, const char *p_base, godot_nativescript_instance_create_func p_create_func, godot_nativescript_instance_destroy_func p_destroy_func) { String *s = (String *)p_gdnative_handle; Map<StringName, NativeScriptDesc> *classes = &NSL->library_classes[*s]; @@ -83,7 +83,7 @@ void GDAPI godot_nativescript_register_class(void *p_gdnative_handle, const char classes->insert(p_name, desc); } -void GDAPI godot_nativescript_register_tool_class(void *p_gdnative_handle, const char *p_name, const char *p_base, godot_instance_create_func p_create_func, godot_instance_destroy_func p_destroy_func) { +void GDAPI godot_nativescript_register_tool_class(void *p_gdnative_handle, const char *p_name, const char *p_base, godot_nativescript_instance_create_func p_create_func, godot_nativescript_instance_destroy_func p_destroy_func) { String *s = (String *)p_gdnative_handle; Map<StringName, NativeScriptDesc> *classes = &NSL->library_classes[*s]; @@ -116,7 +116,7 @@ void GDAPI godot_nativescript_register_tool_class(void *p_gdnative_handle, const classes->insert(p_name, desc); } -void GDAPI godot_nativescript_register_method(void *p_gdnative_handle, const char *p_name, const char *p_function_name, godot_method_attributes p_attr, godot_instance_method p_method) { +void GDAPI godot_nativescript_register_method(void *p_gdnative_handle, const char *p_name, const char *p_function_name, godot_nativescript_method_attributes p_attr, godot_nativescript_instance_method p_method) { String *s = (String *)p_gdnative_handle; Map<StringName, NativeScriptDesc>::Element *E = NSL->library_classes[*s].find(p_name); @@ -135,7 +135,7 @@ void GDAPI godot_nativescript_register_method(void *p_gdnative_handle, const cha E->get().methods.insert(p_function_name, method); } -void GDAPI godot_nativescript_register_property(void *p_gdnative_handle, const char *p_name, const char *p_path, godot_property_attributes *p_attr, godot_property_set_func p_set_func, godot_property_get_func p_get_func) { +void GDAPI godot_nativescript_register_property(void *p_gdnative_handle, const char *p_name, const char *p_path, godot_nativescript_property_attributes *p_attr, godot_nativescript_property_set_func p_set_func, godot_nativescript_property_get_func p_get_func) { String *s = (String *)p_gdnative_handle; Map<StringName, NativeScriptDesc>::Element *E = NSL->library_classes[*s].find(p_name); @@ -159,7 +159,7 @@ void GDAPI godot_nativescript_register_property(void *p_gdnative_handle, const c E->get().properties.insert(p_path, property); } -void GDAPI godot_nativescript_register_signal(void *p_gdnative_handle, const char *p_name, const godot_signal *p_signal) { +void GDAPI godot_nativescript_register_signal(void *p_gdnative_handle, const char *p_name, const godot_nativescript_signal *p_signal) { String *s = (String *)p_gdnative_handle; Map<StringName, NativeScriptDesc>::Element *E = NSL->library_classes[*s].find(p_name); @@ -171,7 +171,7 @@ void GDAPI godot_nativescript_register_signal(void *p_gdnative_handle, const cha for (int i = 0; i < p_signal->num_args; i++) { PropertyInfo info; - godot_signal_argument arg = p_signal->args[i]; + godot_nativescript_signal_argument arg = p_signal->args[i]; info.hint = (PropertyHint)arg.hint; info.hint_string = *(String *)&arg.hint_string; @@ -184,7 +184,7 @@ void GDAPI godot_nativescript_register_signal(void *p_gdnative_handle, const cha for (int i = 0; i < p_signal->num_default_args; i++) { Variant *v; - godot_signal_argument attrib = p_signal->args[i]; + godot_nativescript_signal_argument attrib = p_signal->args[i]; v = (Variant *)&attrib.default_value; @@ -221,7 +221,7 @@ void GDAPI *godot_nativescript_get_userdata(godot_object *p_instance) { * */ -void GDAPI godot_nativescript_set_method_argument_information(void *p_gdnative_handle, const char *p_name, const char *p_function_name, int p_num_args, const godot_method_arg *p_args) { +void GDAPI godot_nativescript_set_method_argument_information(void *p_gdnative_handle, const char *p_name, const char *p_function_name, int p_num_args, const godot_nativescript_method_argument *p_args) { String *s = (String *)p_gdnative_handle; Map<StringName, NativeScriptDesc>::Element *E = NSL->library_classes[*s].find(p_name); @@ -235,7 +235,7 @@ void GDAPI godot_nativescript_set_method_argument_information(void *p_gdnative_h List<PropertyInfo> args; for (int i = 0; i < p_num_args; i++) { - godot_method_arg arg = p_args[i]; + godot_nativescript_method_argument arg = p_args[i]; String name = *(String *)&arg.name; String hint_string = *(String *)&arg.hint_string; @@ -329,7 +329,7 @@ const void GDAPI *godot_nativescript_get_type_tag(const godot_object *p_object) return nullptr; } -int GDAPI godot_nativescript_register_instance_binding_data_functions(godot_instance_binding_functions p_binding_functions) { +int GDAPI godot_nativescript_register_instance_binding_data_functions(godot_nativescript_instance_binding_functions p_binding_functions) { return NativeScriptLanguage::get_singleton()->register_binding_functions(p_binding_functions); } diff --git a/modules/gdnative/nativescript/nativescript.cpp b/modules/gdnative/nativescript/nativescript.cpp index f3dfd0b68e..06b9534fce 100644 --- a/modules/gdnative/nativescript/nativescript.cpp +++ b/modules/gdnative/nativescript/nativescript.cpp @@ -1498,7 +1498,7 @@ void NativeScriptLanguage::profiling_add_data(StringName p_signature, uint64_t p #endif } -int NativeScriptLanguage::register_binding_functions(godot_instance_binding_functions p_binding_functions) { +int NativeScriptLanguage::register_binding_functions(godot_nativescript_instance_binding_functions p_binding_functions) { // find index int idx = -1; diff --git a/modules/gdnative/nativescript/nativescript.h b/modules/gdnative/nativescript/nativescript.h index 1aca142889..fabf4bb87e 100644 --- a/modules/gdnative/nativescript/nativescript.h +++ b/modules/gdnative/nativescript/nativescript.h @@ -48,7 +48,7 @@ struct NativeScriptDesc { struct Method { - godot_instance_method method; + godot_nativescript_instance_method method; MethodInfo info; int rpc_mode; uint16_t rpc_method_id; @@ -56,8 +56,8 @@ struct NativeScriptDesc { }; struct Property { - godot_property_set_func setter; - godot_property_get_func getter; + godot_nativescript_property_set_func setter; + godot_nativescript_property_get_func getter; PropertyInfo info; Variant default_value; int rset_mode; @@ -78,8 +78,8 @@ struct NativeScriptDesc { StringName base; StringName base_native_type; NativeScriptDesc *base_data; - godot_instance_create_func create_func; - godot_instance_destroy_func destroy_func; + godot_nativescript_instance_create_func create_func; + godot_nativescript_instance_destroy_func destroy_func; String documentation; @@ -88,8 +88,8 @@ struct NativeScriptDesc { bool is_tool; inline NativeScriptDesc() { - zeromem(&create_func, sizeof(godot_instance_create_func)); - zeromem(&destroy_func, sizeof(godot_instance_destroy_func)); + zeromem(&create_func, sizeof(godot_nativescript_instance_create_func)); + zeromem(&destroy_func, sizeof(godot_nativescript_instance_destroy_func)); } }; @@ -267,7 +267,7 @@ private: void call_libraries_cb(const StringName &name); - Vector<Pair<bool, godot_instance_binding_functions>> binding_functions; + Vector<Pair<bool, godot_nativescript_instance_binding_functions>> binding_functions; Set<Vector<void *> *> binding_instances; Map<int, HashMap<StringName, const void *>> global_type_tags; @@ -360,7 +360,7 @@ public: virtual int profiling_get_accumulated_data(ProfilingInfo *p_info_arr, int p_info_max); virtual int profiling_get_frame_data(ProfilingInfo *p_info_arr, int p_info_max); - int register_binding_functions(godot_instance_binding_functions p_binding_functions); + int register_binding_functions(godot_nativescript_instance_binding_functions p_binding_functions); void unregister_binding_functions(int p_idx); void *get_instance_binding_data(int p_idx, Object *p_object); diff --git a/modules/gdnative/videodecoder/video_stream_gdnative.cpp b/modules/gdnative/videodecoder/video_stream_gdnative.cpp index 9d9c5b6473..fe7c10cad9 100644 --- a/modules/gdnative/videodecoder/video_stream_gdnative.cpp +++ b/modules/gdnative/videodecoder/video_stream_gdnative.cpp @@ -214,6 +214,11 @@ void VideoStreamPlaybackGDNative::cleanup() { if (pcm) { memfree(pcm); } + if (file) { + file->close(); + memdelete(file); + file = nullptr; + } pcm = nullptr; time = 0; num_channels = -1; diff --git a/modules/gdnavigation/nav_map.cpp b/modules/gdnavigation/nav_map.cpp index c7df6dc1fb..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; @@ -299,7 +299,6 @@ Vector<Vector3> NavMap::get_path(Vector3 p_origin, Vector3 p_destination, bool p left = p->poly->points[prev].pos; right = p->poly->points[prev_n].pos; - //if (CLOCK_TANGENT(apex_point,left,(left+right)*0.5).dot(up) < 0){ if (p->poly->clockwise) { SWAP(left, right); } @@ -414,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_editor_plugin.cpp b/modules/gdnavigation/navigation_mesh_editor_plugin.cpp index 5fe1060aae..648f4f7cdd 100644 --- a/modules/gdnavigation/navigation_mesh_editor_plugin.cpp +++ b/modules/gdnavigation/navigation_mesh_editor_plugin.cpp @@ -95,13 +95,15 @@ void NavigationMeshEditor::_bind_methods() { NavigationMeshEditor::NavigationMeshEditor() { bake_hbox = memnew(HBoxContainer); - button_bake = memnew(ToolButton); + button_bake = memnew(Button); + button_bake->set_flat(true); bake_hbox->add_child(button_bake); button_bake->set_toggle_mode(true); button_bake->set_text(TTR("Bake NavMesh")); button_bake->connect("pressed", callable_mp(this, &NavigationMeshEditor::_bake_pressed)); - button_reset = memnew(ToolButton); + button_reset = memnew(Button); + button_reset->set_flat(true); bake_hbox->add_child(button_reset); // No button text, we only use a revert icon which is set when entering the tree. button_reset->set_tooltip(TTR("Clear the navigation mesh.")); diff --git a/modules/gdnavigation/navigation_mesh_editor_plugin.h b/modules/gdnavigation/navigation_mesh_editor_plugin.h index da3a981f8c..728f958eaa 100644 --- a/modules/gdnavigation/navigation_mesh_editor_plugin.h +++ b/modules/gdnavigation/navigation_mesh_editor_plugin.h @@ -46,8 +46,8 @@ class NavigationMeshEditor : public Control { AcceptDialog *err_dialog; HBoxContainer *bake_hbox; - ToolButton *button_bake; - ToolButton *button_reset; + Button *button_bake; + Button *button_reset; Label *bake_info; NavigationRegion3D *node; 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/doc_classes/@GDScript.xml b/modules/gdscript/doc_classes/@GDScript.xml index be159b6407..f04cb4b4c3 100644 --- a/modules/gdscript/doc_classes/@GDScript.xml +++ b/modules/gdscript/doc_classes/@GDScript.xml @@ -619,11 +619,11 @@ <argument index="0" name="path" type="String"> </argument> <description> - Loads a resource from the filesystem located at [code]path[/code]. - [b]Note:[/b] Resource paths can be obtained by right-clicking on a resource in the FileSystem dock and choosing [b]Copy Path[/b]. + Loads a resource from the filesystem located at [code]path[/code]. The resource is loaded on the method call (unless it's referenced already elsewhere, e.g. in another script or in the scene), which might cause slight delay, especially when loading scenes. To avoid unnecessary delays when loading something multiple times, either store the resource in a variable or use [method preload]. + [b]Note:[/b] Resource paths can be obtained by right-clicking on a resource in the FileSystem dock and choosing "Copy Path" or by dragging the file from the FileSystem dock into the script. [codeblock] - # Load a scene called main located in the root of the project directory. - var main = load("res://main.tscn") + # Load a scene called main located in the root of the project directory and cache it in a variable. + var main = load("res://main.tscn") # main will contain a PackedScene resource. [/codeblock] [b]Important:[/b] The path must be absolute, a local path will just return [code]null[/code]. </description> @@ -797,11 +797,11 @@ <argument index="0" name="path" type="String"> </argument> <description> - Returns a resource from the filesystem that is loaded during script parsing. - [b]Note:[/b] Resource paths can be obtained by right clicking on a resource in the Assets Panel and choosing "Copy Path". + Returns a [Resource] from the filesystem located at [code]path[/code]. The resource is loaded during script parsing, i.e. is loaded with the script and [method preload] effectively acts as a reference to that resource. Note that the method requires a constant path. If you want to load a resource from a dynamic/variable path, use [method load]. + [b]Note:[/b] Resource paths can be obtained by right clicking on a resource in the Assets Panel and choosing "Copy Path" or by dragging the file from the FileSystem dock into the script. [codeblock] - # Load a scene called main located in the root of the project directory. - var main = preload("res://main.tscn") + # Instance a scene. + var diamond = preload("res://diamond.tscn").instance() [/codeblock] </description> </method> diff --git a/modules/gdscript/gdscript_compiler.cpp b/modules/gdscript/gdscript_compiler.cpp index bc095ae1f9..5bc9003c29 100644 --- a/modules/gdscript/gdscript_compiler.cpp +++ b/modules/gdscript/gdscript_compiler.cpp @@ -1422,6 +1422,10 @@ Error GDScriptCompiler::_parse_block(CodeGen &codegen, const GDScriptParser::Blo codegen.opcodes.push_back(0); codegen.opcodes.write[else_addr] = codegen.opcodes.size(); + codegen.opcodes.push_back(GDScriptFunction::OPCODE_LINE); + codegen.opcodes.push_back(cf->body_else->line); + codegen.current_line = cf->body_else->line; + Error err2 = _parse_block(codegen, cf->body_else, p_stack_level, p_break_addr, p_continue_addr); if (err2) { return err2; diff --git a/modules/gdscript/gdscript_editor.cpp b/modules/gdscript/gdscript_editor.cpp index 7433c4a5bc..3a5db3687b 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) { @@ -3089,6 +3093,14 @@ static Error _lookup_symbol_from_base(const GDScriptParser::DataType &p_base, co return OK; } } + + for (int i = 0; i < base_type.class_type->subclasses.size(); i++) { + if (base_type.class_type->subclasses[i]->name == p_symbol) { + r_result.type = ScriptLanguage::LookupResult::RESULT_SCRIPT_LOCATION; + r_result.location = base_type.class_type->subclasses[i]->line; + return OK; + } + } } base_type = base_type.class_type->base_type; } diff --git a/modules/gdscript/gdscript_function.cpp b/modules/gdscript/gdscript_function.cpp index 92e07ab874..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 { @@ -1818,8 +1823,6 @@ Variant GDScriptFunctionState::resume(const Variant &p_arg) { state.result = Variant(); if (completed) { - _clear_stack(); - if (first_state.is_valid()) { first_state->emit_signal("completed", ret); } else { diff --git a/modules/gdscript/gdscript_parser.cpp b/modules/gdscript/gdscript_parser.cpp index fbb5f91139..ca452bf008 100644 --- a/modules/gdscript/gdscript_parser.cpp +++ b/modules/gdscript/gdscript_parser.cpp @@ -2821,6 +2821,8 @@ void GDScriptParser::_parse_block(BlockNode *p_block, bool p_static) { #ifdef DEBUG_ENABLED + pending_newline = -1; // reset for the new block + NewLineNode *nl = alloc_node<NewLineNode>(); nl->line = tokenizer->get_token_line(); @@ -3167,7 +3169,6 @@ void GDScriptParser::_parse_block(BlockNode *p_block, bool p_static) { if (error_set) { return; } - p_block->has_return = cf_while->body->has_return; p_block->statements.push_back(cf_while); } break; case GDScriptTokenizer::TK_CF_FOR: { @@ -3179,6 +3180,22 @@ void GDScriptParser::_parse_block(BlockNode *p_block, bool p_static) { IdentifierNode *id = alloc_node<IdentifierNode>(); id->name = tokenizer->get_token_identifier(); +#ifdef DEBUG_ENABLED + for (int j = 0; j < current_class->variables.size(); j++) { + if (current_class->variables[j].identifier == id->name) { + _add_warning(GDScriptWarning::SHADOWED_VARIABLE, id->line, id->name, itos(current_class->variables[j].line)); + } + } +#endif // DEBUG_ENABLED + + 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(); @@ -3308,7 +3325,6 @@ void GDScriptParser::_parse_block(BlockNode *p_block, bool p_static) { if (error_set) { return; } - p_block->has_return = cf_for->body->has_return; p_block->statements.push_back(cf_for); } break; case GDScriptTokenizer::TK_CF_CONTINUE: { @@ -4123,6 +4139,14 @@ void GDScriptParser::_parse_class(ClassNode *p_class) { sig.name = tokenizer->get_token_identifier(); sig.emissions = 0; sig.line = tokenizer->get_token_line(); + + for (int i = 0; i < current_class->_signals.size(); i++) { + if (current_class->_signals[i].name == sig.name) { + _set_error("The signal \"" + sig.name + "\" already exists in this class (at line: " + itos(current_class->_signals[i].line) + ")."); + return; + } + } + tokenizer->advance(); if (tokenizer->get_token() == GDScriptTokenizer::TK_PARENTHESIS_OPEN) { @@ -7330,8 +7354,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(); @@ -7948,6 +7972,47 @@ void GDScriptParser::_check_class_level_types(ClassNode *p_class) { } } + // Signals + DataType base = p_class->base_type; + + while (base.kind == DataType::CLASS) { + ClassNode *base_class = base.class_type; + for (int i = 0; i < p_class->_signals.size(); i++) { + for (int j = 0; j < base_class->_signals.size(); j++) { + if (p_class->_signals[i].name == base_class->_signals[j].name) { + _set_error("The signal \"" + p_class->_signals[i].name + "\" already exists in a parent class.", p_class->_signals[i].line); + return; + } + } + } + base = base_class->base_type; + } + + StringName native; + if (base.kind == DataType::GDSCRIPT || base.kind == DataType::SCRIPT) { + Ref<Script> scr = base.script_type; + if (scr.is_valid() && scr->is_valid()) { + native = scr->get_instance_base_type(); + for (int i = 0; i < p_class->_signals.size(); i++) { + if (scr->has_script_signal(p_class->_signals[i].name)) { + _set_error("The signal \"" + p_class->_signals[i].name + "\" already exists in a parent class.", p_class->_signals[i].line); + return; + } + } + } + } else if (base.kind == DataType::NATIVE) { + native = base.native_type; + } + + if (native != StringName()) { + for (int i = 0; i < p_class->_signals.size(); i++) { + if (ClassDB::has_signal(native, p_class->_signals[i].name)) { + _set_error("The signal \"" + p_class->_signals[i].name + "\" already exists in a parent class.", p_class->_signals[i].line); + return; + } + } + } + // Inner classes for (int i = 0; i < p_class->subclasses.size(); i++) { current_class = p_class->subclasses[i]; diff --git a/modules/gdscript/language_server/gdscript_extend_parser.cpp b/modules/gdscript/language_server/gdscript_extend_parser.cpp index f87e8687e5..330530be80 100644 --- a/modules/gdscript/language_server/gdscript_extend_parser.cpp +++ b/modules/gdscript/language_server/gdscript_extend_parser.cpp @@ -29,6 +29,7 @@ /*************************************************************************/ #include "gdscript_extend_parser.h" + #include "../gdscript.h" #include "core/io/json.h" #include "gdscript_language_protocol.h" diff --git a/modules/gdscript/language_server/gdscript_language_protocol.cpp b/modules/gdscript/language_server/gdscript_language_protocol.cpp index 35bf4287b8..2a67d2ff4f 100644 --- a/modules/gdscript/language_server/gdscript_language_protocol.cpp +++ b/modules/gdscript/language_server/gdscript_language_protocol.cpp @@ -29,6 +29,7 @@ /*************************************************************************/ #include "gdscript_language_protocol.h" + #include "core/io/json.h" #include "core/os/copymem.h" #include "core/project_settings.h" @@ -161,7 +162,7 @@ void GDScriptLanguageProtocol::_bind_methods() { ClassDB::bind_method(D_METHOD("initialized", "params"), &GDScriptLanguageProtocol::initialized); ClassDB::bind_method(D_METHOD("on_client_connected"), &GDScriptLanguageProtocol::on_client_connected); ClassDB::bind_method(D_METHOD("on_client_disconnected"), &GDScriptLanguageProtocol::on_client_disconnected); - ClassDB::bind_method(D_METHOD("notify_client", "p_method", "p_params"), &GDScriptLanguageProtocol::notify_client, DEFVAL(Variant()), DEFVAL(-1)); + ClassDB::bind_method(D_METHOD("notify_client", "method", "params"), &GDScriptLanguageProtocol::notify_client, DEFVAL(Variant()), DEFVAL(-1)); ClassDB::bind_method(D_METHOD("is_smart_resolve_enabled"), &GDScriptLanguageProtocol::is_smart_resolve_enabled); ClassDB::bind_method(D_METHOD("get_text_document"), &GDScriptLanguageProtocol::get_text_document); ClassDB::bind_method(D_METHOD("get_workspace"), &GDScriptLanguageProtocol::get_workspace); @@ -187,8 +188,10 @@ Dictionary GDScriptLanguageProtocol::initialize(const Dictionary &p_params) { Dictionary params; params["path"] = workspace->root; - Dictionary request = make_notification("gdscrip_client/changeWorkspace", params); + Dictionary request = make_notification("gdscript_client/changeWorkspace", params); + ERR_FAIL_COND_V_MSG(!clients.has(latest_client_id), ret.to_json(), + vformat("GDScriptLanguageProtocol: Can't initialize invalid peer '%d'.", latest_client_id)); Ref<LSPeer> peer = clients.get(latest_client_id); if (peer != nullptr) { String msg = JSON::print(request); @@ -268,8 +271,11 @@ void GDScriptLanguageProtocol::stop() { void GDScriptLanguageProtocol::notify_client(const String &p_method, const Variant &p_params, int p_client_id) { if (p_client_id == -1) { + ERR_FAIL_COND_MSG(latest_client_id == -1, + "GDScript LSP: Can't notify client as none was connected."); p_client_id = latest_client_id; } + ERR_FAIL_COND(!clients.has(p_client_id)); Ref<LSPeer> peer = clients.get(p_client_id); ERR_FAIL_COND(peer == nullptr); @@ -290,13 +296,10 @@ bool GDScriptLanguageProtocol::is_goto_native_symbols_enabled() const { GDScriptLanguageProtocol::GDScriptLanguageProtocol() { server.instance(); singleton = this; - _initialized = false; workspace.instance(); text_document.instance(); set_scope("textDocument", text_document.ptr()); set_scope("completionItem", text_document.ptr()); set_scope("workspace", workspace.ptr()); workspace->root = ProjectSettings::get_singleton()->get_resource_path(); - latest_client_id = 0; - next_client_id = 0; } diff --git a/modules/gdscript/language_server/gdscript_language_protocol.h b/modules/gdscript/language_server/gdscript_language_protocol.h index d929fd255d..cf5242e8c5 100644 --- a/modules/gdscript/language_server/gdscript_language_protocol.h +++ b/modules/gdscript/language_server/gdscript_language_protocol.h @@ -70,8 +70,8 @@ private: HashMap<int, Ref<LSPeer>> clients; Ref<TCP_Server> server; - int latest_client_id; - int next_client_id; + int latest_client_id = 0; + int next_client_id = 0; Ref<GDScriptTextDocument> text_document; Ref<GDScriptWorkspace> workspace; @@ -82,7 +82,7 @@ private: String process_message(const String &p_text); String format_output(const String &p_text); - bool _initialized; + bool _initialized = false; protected: static void _bind_methods(); diff --git a/modules/gdscript/language_server/gdscript_language_server.cpp b/modules/gdscript/language_server/gdscript_language_server.cpp index d53914814f..3387d262f8 100644 --- a/modules/gdscript/language_server/gdscript_language_server.cpp +++ b/modules/gdscript/language_server/gdscript_language_server.cpp @@ -29,6 +29,7 @@ /*************************************************************************/ #include "gdscript_language_server.h" + #include "core/os/file_access.h" #include "core/os/os.h" #include "editor/editor_log.h" diff --git a/modules/gdscript/language_server/gdscript_text_document.cpp b/modules/gdscript/language_server/gdscript_text_document.cpp index 778cb4d254..c6fe3169dc 100644 --- a/modules/gdscript/language_server/gdscript_text_document.cpp +++ b/modules/gdscript/language_server/gdscript_text_document.cpp @@ -29,6 +29,7 @@ /*************************************************************************/ #include "gdscript_text_document.h" + #include "../gdscript.h" #include "core/os/os.h" #include "editor/editor_settings.h" diff --git a/modules/gdscript/language_server/gdscript_workspace.cpp b/modules/gdscript/language_server/gdscript_workspace.cpp index 9285d88157..a203b9bfdb 100644 --- a/modules/gdscript/language_server/gdscript_workspace.cpp +++ b/modules/gdscript/language_server/gdscript_workspace.cpp @@ -29,6 +29,7 @@ /*************************************************************************/ #include "gdscript_workspace.h" + #include "../gdscript.h" #include "../gdscript_parser.h" #include "core/project_settings.h" @@ -41,12 +42,12 @@ void GDScriptWorkspace::_bind_methods() { ClassDB::bind_method(D_METHOD("symbol"), &GDScriptWorkspace::symbol); - ClassDB::bind_method(D_METHOD("parse_script", "p_path", "p_content"), &GDScriptWorkspace::parse_script); - ClassDB::bind_method(D_METHOD("parse_local_script", "p_path"), &GDScriptWorkspace::parse_local_script); - ClassDB::bind_method(D_METHOD("get_file_path", "p_uri"), &GDScriptWorkspace::get_file_path); - ClassDB::bind_method(D_METHOD("get_file_uri", "p_path"), &GDScriptWorkspace::get_file_uri); - ClassDB::bind_method(D_METHOD("publish_diagnostics", "p_path"), &GDScriptWorkspace::publish_diagnostics); - ClassDB::bind_method(D_METHOD("generate_script_api", "p_path"), &GDScriptWorkspace::generate_script_api); + ClassDB::bind_method(D_METHOD("parse_script", "path", "content"), &GDScriptWorkspace::parse_script); + ClassDB::bind_method(D_METHOD("parse_local_script", "path"), &GDScriptWorkspace::parse_local_script); + ClassDB::bind_method(D_METHOD("get_file_path", "uri"), &GDScriptWorkspace::get_file_path); + ClassDB::bind_method(D_METHOD("get_file_uri", "path"), &GDScriptWorkspace::get_file_uri); + ClassDB::bind_method(D_METHOD("publish_diagnostics", "path"), &GDScriptWorkspace::publish_diagnostics); + ClassDB::bind_method(D_METHOD("generate_script_api", "path"), &GDScriptWorkspace::generate_script_api); } void GDScriptWorkspace::remove_cache_parser(const String &p_path) { diff --git a/modules/gridmap/grid_map_editor_plugin.cpp b/modules/gridmap/grid_map_editor_plugin.cpp index 2bae43510a..1b7ce98721 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" @@ -1242,14 +1241,16 @@ GridMapEditor::GridMapEditor(EditorNode *p_editor) { search_box->connect("text_changed", callable_mp(this, &GridMapEditor::_text_changed)); search_box->connect("gui_input", callable_mp(this, &GridMapEditor::_sbox_input)); - mode_thumbnail = memnew(ToolButton); + mode_thumbnail = memnew(Button); + mode_thumbnail->set_flat(true); mode_thumbnail->set_toggle_mode(true); mode_thumbnail->set_pressed(true); mode_thumbnail->set_icon(p_editor->get_gui_base()->get_theme_icon("FileThumbnail", "EditorIcons")); hb->add_child(mode_thumbnail); mode_thumbnail->connect("pressed", callable_mp(this, &GridMapEditor::_set_display_mode), varray(DISPLAY_THUMBNAIL)); - mode_list = memnew(ToolButton); + mode_list = memnew(Button); + mode_list->set_flat(true); mode_list->set_toggle_mode(true); mode_list->set_pressed(false); mode_list->set_icon(p_editor->get_gui_base()->get_theme_icon("FileList", "EditorIcons")); diff --git a/modules/gridmap/grid_map_editor_plugin.h b/modules/gridmap/grid_map_editor_plugin.h index 19eea18965..0ae9b27833 100644 --- a/modules/gridmap/grid_map_editor_plugin.h +++ b/modules/gridmap/grid_map_editor_plugin.h @@ -74,8 +74,8 @@ class GridMapEditor : public VBoxContainer { MenuButton *options; SpinBox *floor; double accumulated_floor_delta; - ToolButton *mode_thumbnail; - ToolButton *mode_list; + Button *mode_thumbnail; + Button *mode_list; LineEdit *search_box; HSlider *size_slider; HBoxContainer *spatial_editor_hb; 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/lightmapper_rd/lm_blendseams.glsl b/modules/lightmapper_rd/lm_blendseams.glsl index 8a9ea91311..e47e5fcc51 100644 --- a/modules/lightmapper_rd/lm_blendseams.glsl +++ b/modules/lightmapper_rd/lm_blendseams.glsl @@ -1,10 +1,9 @@ -/* clang-format off */ -[versions] +#[versions] -lines = "#define MODE_LINES" -triangles = "#define MODE_TRIANGLES" +lines = "#define MODE_LINES"; +triangles = "#define MODE_TRIANGLES"; -[vertex] +#[vertex] #version 450 @@ -12,22 +11,20 @@ VERSION_DEFINES #include "lm_common_inc.glsl" - /* clang-format on */ - - layout(push_constant, binding = 0, std430) uniform Params { - uint base_index; - uint slice; - vec2 uv_offset; - bool debug; - float blend; - uint pad[2]; - } params; +layout(push_constant, binding = 0, std430) uniform Params { + uint base_index; + uint slice; + vec2 uv_offset; + bool debug; + float blend; + uint pad[2]; +} +params; layout(location = 0) out vec3 uv_interp; void main() { #ifdef MODE_TRIANGLES - uint triangle_idx = params.base_index + gl_VertexIndex / 3; uint triangle_subidx = gl_VertexIndex % 3; @@ -42,7 +39,6 @@ void main() { uv_interp = vec3(uv, float(params.slice)); gl_Position = vec4((uv + params.uv_offset) * 2.0 - 1.0, 0.0001, 1.0); - #endif #ifdef MODE_LINES @@ -71,12 +67,10 @@ void main() { uv_interp = vec3(src_uv, float(params.slice)); gl_Position = vec4(dst_uv * 2.0 - 1.0, 0.0001, 1.0); - ; #endif } -/* clang-format off */ -[fragment] +#[fragment] #version 450 @@ -84,16 +78,15 @@ VERSION_DEFINES #include "lm_common_inc.glsl" - /* clang-format on */ - - layout(push_constant, binding = 0, std430) uniform Params { - uint base_index; - uint slice; - vec2 uv_offset; - bool debug; - float blend; - uint pad[2]; - } params; +layout(push_constant, binding = 0, std430) uniform Params { + uint base_index; + uint slice; + vec2 uv_offset; + bool debug; + float blend; + uint pad[2]; +} +params; layout(location = 0) in vec3 uv_interp; diff --git a/modules/lightmapper_rd/lm_common_inc.glsl b/modules/lightmapper_rd/lm_common_inc.glsl index 15946d5327..0ff455936e 100644 --- a/modules/lightmapper_rd/lm_common_inc.glsl +++ b/modules/lightmapper_rd/lm_common_inc.glsl @@ -11,7 +11,6 @@ struct Vertex { layout(set = 0, binding = 1, std430) restrict readonly buffer Vertices { Vertex data[]; } - vertices; struct Triangle { @@ -22,7 +21,6 @@ struct Triangle { layout(set = 0, binding = 2, std430) restrict readonly buffer Triangles { Triangle data[]; } - triangles; struct Box { @@ -35,13 +33,11 @@ struct Box { layout(set = 0, binding = 3, std430) restrict readonly buffer Boxes { Box data[]; } - boxes; layout(set = 0, binding = 4, std430) restrict readonly buffer GridIndices { uint data[]; } - grid_indices; #define LIGHT_TYPE_DIRECTIONAL 0 @@ -70,7 +66,6 @@ struct Light { layout(set = 0, binding = 5, std430) restrict readonly buffer Lights { Light data[]; } - lights; struct Seam { @@ -81,13 +76,11 @@ struct Seam { layout(set = 0, binding = 6, std430) restrict readonly buffer Seams { Seam data[]; } - seams; layout(set = 0, binding = 7, std430) restrict readonly buffer Probes { vec4 data[]; } - probe_positions; layout(set = 0, binding = 8) uniform utexture3D grid; diff --git a/modules/lightmapper_rd/lm_compute.glsl b/modules/lightmapper_rd/lm_compute.glsl index a442016969..56976bd623 100644 --- a/modules/lightmapper_rd/lm_compute.glsl +++ b/modules/lightmapper_rd/lm_compute.glsl @@ -1,13 +1,12 @@ -/* clang-format off */ -[versions] +#[versions] -primary = "#define MODE_DIRECT_LIGHT" -secondary = "#define MODE_BOUNCE_LIGHT" -dilate = "#define MODE_DILATE" -unocclude = "#define MODE_UNOCCLUDE" -light_probes = "#define MODE_LIGHT_PROBES" +primary = "#define MODE_DIRECT_LIGHT"; +secondary = "#define MODE_BOUNCE_LIGHT"; +dilate = "#define MODE_DILATE"; +unocclude = "#define MODE_UNOCCLUDE"; +light_probes = "#define MODE_LIGHT_PROBES"; -[compute] +#[compute] #version 450 @@ -29,14 +28,11 @@ layout(local_size_x = 8, local_size_y = 8, local_size_z = 1) in; #include "lm_common_inc.glsl" -/* clang-format on */ - #ifdef MODE_LIGHT_PROBES layout(set = 1, binding = 0, std430) restrict buffer LightProbeData { vec4 data[]; } - light_probes; layout(set = 1, binding = 1) uniform texture2DArray source_light; @@ -94,7 +90,6 @@ layout(push_constant, binding = 0, std430) uniform Params { mat3x4 env_transform; } - params; //check it, but also return distance and barycentric coords (for uv lookup) @@ -123,7 +118,6 @@ bool trace_ray(vec3 p_from, vec3 p_to out float r_distance, out vec3 r_normal #endif ) { - /* world coords */ vec3 rel = p_to - p_from; @@ -149,7 +143,6 @@ bool trace_ray(vec3 p_from, vec3 p_to while (all(greaterThanEqual(icell, ivec3(0))) && all(lessThan(icell, ivec3(params.grid_size))) && iters < 1000) { uvec2 cell_data = texelFetch(usampler3D(grid, linear_sampler), icell, 0).xy; if (cell_data.x > 0) { //triangles here - bool hit = false; #if defined(MODE_UNOCCLUDE) bool hit_backface = false; @@ -211,7 +204,6 @@ bool trace_ray(vec3 p_from, vec3 p_to r_triangle = tidx; r_barycentric = barycentric; } - #endif } } diff --git a/modules/lightmapper_rd/lm_raster.glsl b/modules/lightmapper_rd/lm_raster.glsl index 36b706bcd5..6c2904192b 100644 --- a/modules/lightmapper_rd/lm_raster.glsl +++ b/modules/lightmapper_rd/lm_raster.glsl @@ -1,5 +1,4 @@ -/* clang-format off */ -[vertex] +#[vertex] #version 450 @@ -7,9 +6,7 @@ VERSION_DEFINES #include "lm_common_inc.glsl" - /* clang-format on */ - - layout(location = 0) out vec3 vertex_interp; +layout(location = 0) out vec3 vertex_interp; layout(location = 1) out vec3 normal_interp; layout(location = 2) out vec2 uv_interp; layout(location = 3) out vec3 barycentric; @@ -26,11 +23,8 @@ layout(push_constant, binding = 0, std430) uniform Params { ivec3 grid_size; uint pad2; } - params; -/* clang-format on */ - void main() { uint triangle_idx = params.base_triangle + gl_VertexIndex / 3; uint triangle_subidx = gl_VertexIndex % 3; @@ -56,12 +50,9 @@ void main() { face_normal = -normalize(cross((vertices.data[vertex_indices.x].position - vertices.data[vertex_indices.y].position), (vertices.data[vertex_indices.x].position - vertices.data[vertex_indices.z].position))); gl_Position = vec4((uv_interp + params.uv_offset) * 2.0 - 1.0, 0.0001, 1.0); - ; } -/* clang-format off */ - -[fragment] +#[fragment] #version 450 @@ -69,7 +60,6 @@ VERSION_DEFINES #include "lm_common_inc.glsl" - layout(push_constant, binding = 0, std430) uniform Params { vec2 atlas_size; vec2 uv_offset; @@ -79,9 +69,8 @@ layout(push_constant, binding = 0, std430) uniform Params { float bias; ivec3 grid_size; uint pad2; -} params; - -/* clang-format on */ +} +params; layout(location = 0) in vec3 vertex_interp; layout(location = 1) in vec3 normal_interp; @@ -100,7 +89,6 @@ void main() { { // smooth out vertex position by interpolating its projection in the 3 normal planes (normal plane is created by vertex pos and normal) // because we don't want to interpolate inwards, normals found pointing inwards are pushed out. - vec3 pos_a = vertices.data[vertex_indices.x].position; vec3 pos_b = vertices.data[vertex_indices.y].position; vec3 pos_c = vertices.data[vertex_indices.z].position; diff --git a/modules/mbedtls/crypto_mbedtls.cpp b/modules/mbedtls/crypto_mbedtls.cpp index 1f9d8c2aa3..501bfff075 100644 --- a/modules/mbedtls/crypto_mbedtls.cpp +++ b/modules/mbedtls/crypto_mbedtls.cpp @@ -50,7 +50,7 @@ CryptoKey *CryptoKeyMbedTLS::create() { return memnew(CryptoKeyMbedTLS); } -Error CryptoKeyMbedTLS::load(String p_path) { +Error CryptoKeyMbedTLS::load(String p_path, bool p_public_only) { ERR_FAIL_COND_V_MSG(locks, ERR_ALREADY_IN_USE, "Key is in use"); PackedByteArray out; @@ -59,42 +59,81 @@ Error CryptoKeyMbedTLS::load(String p_path) { int flen = f->get_len(); out.resize(flen + 1); - { - uint8_t *w = out.ptrw(); - f->get_buffer(w, flen); - w[flen] = 0; //end f string - } + f->get_buffer(out.ptrw(), flen); + out.write[flen] = 0; // string terminator memdelete(f); - int ret = mbedtls_pk_parse_key(&pkey, out.ptr(), out.size(), nullptr, 0); + int ret = 0; + if (p_public_only) { + ret = mbedtls_pk_parse_public_key(&pkey, out.ptr(), out.size()); + } else { + ret = mbedtls_pk_parse_key(&pkey, out.ptr(), out.size(), nullptr, 0); + } // We MUST zeroize the memory for safety! mbedtls_platform_zeroize(out.ptrw(), out.size()); - ERR_FAIL_COND_V_MSG(ret, FAILED, "Error parsing private key '" + itos(ret) + "'."); + ERR_FAIL_COND_V_MSG(ret, FAILED, "Error parsing key '" + itos(ret) + "'."); + public_only = p_public_only; return OK; } -Error CryptoKeyMbedTLS::save(String p_path) { +Error CryptoKeyMbedTLS::save(String p_path, bool p_public_only) { FileAccess *f = FileAccess::open(p_path, FileAccess::WRITE); ERR_FAIL_COND_V_MSG(!f, ERR_INVALID_PARAMETER, "Cannot save CryptoKeyMbedTLS file '" + p_path + "'."); unsigned char w[16000]; memset(w, 0, sizeof(w)); - int ret = mbedtls_pk_write_key_pem(&pkey, w, sizeof(w)); + int ret = 0; + if (p_public_only) { + ret = mbedtls_pk_write_pubkey_pem(&pkey, w, sizeof(w)); + } else { + ret = mbedtls_pk_write_key_pem(&pkey, w, sizeof(w)); + } if (ret != 0) { memdelete(f); - memset(w, 0, sizeof(w)); // Zeroize anything we might have written. + mbedtls_platform_zeroize(w, sizeof(w)); // Zeroize anything we might have written. ERR_FAIL_V_MSG(FAILED, "Error writing key '" + itos(ret) + "'."); } size_t len = strlen((char *)w); f->store_buffer(w, len); memdelete(f); - memset(w, 0, sizeof(w)); // Zeroize temporary buffer. + mbedtls_platform_zeroize(w, sizeof(w)); // Zeroize temporary buffer. return OK; } +Error CryptoKeyMbedTLS::load_from_string(String p_string_key, bool p_public_only) { + int ret = 0; + if (p_public_only) { + ret = mbedtls_pk_parse_public_key(&pkey, (unsigned char *)p_string_key.utf8().get_data(), p_string_key.utf8().size()); + } else { + ret = mbedtls_pk_parse_key(&pkey, (unsigned char *)p_string_key.utf8().get_data(), p_string_key.utf8().size(), nullptr, 0); + } + ERR_FAIL_COND_V_MSG(ret, FAILED, "Error parsing key '" + itos(ret) + "'."); + + public_only = p_public_only; + return OK; +} + +String CryptoKeyMbedTLS::save_to_string(bool p_public_only) { + unsigned char w[16000]; + memset(w, 0, sizeof(w)); + + int ret = 0; + if (p_public_only) { + ret = mbedtls_pk_write_pubkey_pem(&pkey, w, sizeof(w)); + } else { + ret = mbedtls_pk_write_key_pem(&pkey, w, sizeof(w)); + } + if (ret != 0) { + mbedtls_platform_zeroize(w, sizeof(w)); + ERR_FAIL_V_MSG("", "Error saving key '" + itos(ret) + "'."); + } + String s = String::utf8((char *)w); + return s; +} + X509Certificate *X509CertificateMbedTLS::create() { return memnew(X509CertificateMbedTLS); } @@ -108,11 +147,8 @@ Error X509CertificateMbedTLS::load(String p_path) { int flen = f->get_len(); out.resize(flen + 1); - { - uint8_t *w = out.ptrw(); - f->get_buffer(w, flen); - w[flen] = 0; //end f string - } + f->get_buffer(out.ptrw(), flen); + out.write[flen] = 0; // string terminator memdelete(f); int ret = mbedtls_x509_crt_parse(&cert, out.ptr(), out.size()); @@ -211,9 +247,8 @@ void CryptoMbedTLS::load_default_certificates(String p_path) { // Use builtin certs only if user did not override it in project settings. PackedByteArray out; out.resize(_certs_uncompressed_size + 1); - uint8_t *w = out.ptrw(); - Compression::decompress(w, _certs_uncompressed_size, _certs_compressed, _certs_compressed_size, Compression::MODE_DEFLATE); - w[_certs_uncompressed_size] = 0; // Make sure it ends with string terminator + Compression::decompress(out.ptrw(), _certs_uncompressed_size, _certs_compressed, _certs_compressed_size, Compression::MODE_DEFLATE); + out.write[_certs_uncompressed_size] = 0; // Make sure it ends with string terminator #ifdef DEBUG_ENABLED print_verbose("Loaded builtin certs"); #endif @@ -228,6 +263,7 @@ Ref<CryptoKey> CryptoMbedTLS::generate_rsa(int p_bytes) { int ret = mbedtls_pk_setup(&(out->pkey), mbedtls_pk_info_from_type(MBEDTLS_PK_RSA)); ERR_FAIL_COND_V(ret != 0, nullptr); ret = mbedtls_rsa_gen_key(mbedtls_pk_rsa(out->pkey), mbedtls_ctr_drbg_random, &ctr_drbg, p_bytes, 65537); + out->public_only = false; ERR_FAIL_COND_V(ret != 0, nullptr); return out; } @@ -281,3 +317,75 @@ PackedByteArray CryptoMbedTLS::generate_random_bytes(int p_bytes) { mbedtls_ctr_drbg_random(&ctr_drbg, out.ptrw(), p_bytes); return out; } + +mbedtls_md_type_t CryptoMbedTLS::_md_type_from_hashtype(HashingContext::HashType p_hash_type, int &r_size) { + switch (p_hash_type) { + case HashingContext::HASH_MD5: + r_size = 16; + return MBEDTLS_MD_MD5; + case HashingContext::HASH_SHA1: + r_size = 20; + return MBEDTLS_MD_SHA1; + case HashingContext::HASH_SHA256: + r_size = 32; + return MBEDTLS_MD_SHA256; + default: + r_size = 0; + ERR_FAIL_V_MSG(MBEDTLS_MD_NONE, "Invalid hash type."); + } +} + +Vector<uint8_t> CryptoMbedTLS::sign(HashingContext::HashType p_hash_type, Vector<uint8_t> p_hash, Ref<CryptoKey> p_key) { + int size; + mbedtls_md_type_t type = _md_type_from_hashtype(p_hash_type, size); + ERR_FAIL_COND_V_MSG(type == MBEDTLS_MD_NONE, Vector<uint8_t>(), "Invalid hash type."); + ERR_FAIL_COND_V_MSG(p_hash.size() != size, Vector<uint8_t>(), "Invalid hash provided. Size must be " + itos(size)); + Ref<CryptoKeyMbedTLS> key = static_cast<Ref<CryptoKeyMbedTLS>>(p_key); + ERR_FAIL_COND_V_MSG(!key.is_valid(), Vector<uint8_t>(), "Invalid key provided."); + ERR_FAIL_COND_V_MSG(key->is_public_only(), Vector<uint8_t>(), "Invalid key provided. Cannot sign with public_only keys."); + size_t sig_size = 0; + unsigned char buf[MBEDTLS_MPI_MAX_SIZE]; + Vector<uint8_t> out; + int ret = mbedtls_pk_sign(&(key->pkey), type, p_hash.ptr(), size, buf, &sig_size, mbedtls_ctr_drbg_random, &ctr_drbg); + ERR_FAIL_COND_V_MSG(ret, out, "Error while signing: " + itos(ret)); + out.resize(sig_size); + copymem(out.ptrw(), buf, sig_size); + return out; +} + +bool CryptoMbedTLS::verify(HashingContext::HashType p_hash_type, Vector<uint8_t> p_hash, Vector<uint8_t> p_signature, Ref<CryptoKey> p_key) { + int size; + mbedtls_md_type_t type = _md_type_from_hashtype(p_hash_type, size); + ERR_FAIL_COND_V_MSG(type == MBEDTLS_MD_NONE, false, "Invalid hash type."); + ERR_FAIL_COND_V_MSG(p_hash.size() != size, false, "Invalid hash provided. Size must be " + itos(size)); + Ref<CryptoKeyMbedTLS> key = static_cast<Ref<CryptoKeyMbedTLS>>(p_key); + ERR_FAIL_COND_V_MSG(!key.is_valid(), false, "Invalid key provided."); + return mbedtls_pk_verify(&(key->pkey), type, p_hash.ptr(), size, p_signature.ptr(), p_signature.size()) == 0; +} + +Vector<uint8_t> CryptoMbedTLS::encrypt(Ref<CryptoKey> p_key, Vector<uint8_t> p_plaintext) { + Ref<CryptoKeyMbedTLS> key = static_cast<Ref<CryptoKeyMbedTLS>>(p_key); + ERR_FAIL_COND_V_MSG(!key.is_valid(), Vector<uint8_t>(), "Invalid key provided."); + uint8_t buf[1024]; + size_t size; + Vector<uint8_t> out; + int ret = mbedtls_pk_encrypt(&(key->pkey), p_plaintext.ptr(), p_plaintext.size(), buf, &size, sizeof(buf), mbedtls_ctr_drbg_random, &ctr_drbg); + ERR_FAIL_COND_V_MSG(ret, out, "Error while encrypting: " + itos(ret)); + out.resize(size); + copymem(out.ptrw(), buf, size); + return out; +} + +Vector<uint8_t> CryptoMbedTLS::decrypt(Ref<CryptoKey> p_key, Vector<uint8_t> p_ciphertext) { + Ref<CryptoKeyMbedTLS> key = static_cast<Ref<CryptoKeyMbedTLS>>(p_key); + ERR_FAIL_COND_V_MSG(!key.is_valid(), Vector<uint8_t>(), "Invalid key provided."); + ERR_FAIL_COND_V_MSG(key->is_public_only(), Vector<uint8_t>(), "Invalid key provided. Cannot decrypt using a public_only key."); + uint8_t buf[2048]; + size_t size; + Vector<uint8_t> out; + int ret = mbedtls_pk_decrypt(&(key->pkey), p_ciphertext.ptr(), p_ciphertext.size(), buf, &size, sizeof(buf), mbedtls_ctr_drbg_random, &ctr_drbg); + ERR_FAIL_COND_V_MSG(ret, out, "Error while decrypting: " + itos(ret)); + out.resize(size); + copymem(out.ptrw(), buf, size); + return out; +} diff --git a/modules/mbedtls/crypto_mbedtls.h b/modules/mbedtls/crypto_mbedtls.h index 48855d082a..2a446f9d48 100644 --- a/modules/mbedtls/crypto_mbedtls.h +++ b/modules/mbedtls/crypto_mbedtls.h @@ -43,15 +43,19 @@ class SSLContextMbedTLS; class CryptoKeyMbedTLS : public CryptoKey { private: mbedtls_pk_context pkey; - int locks; + int locks = 0; + bool public_only = true; public: static CryptoKey *create(); static void make_default() { CryptoKey::_create = create; } static void finalize() { CryptoKey::_create = nullptr; } - virtual Error load(String p_path); - virtual Error save(String p_path); + virtual Error load(String p_path, bool p_public_only); + virtual Error save(String p_path, bool p_public_only); + virtual String save_to_string(bool p_public_only); + virtual Error load_from_string(String p_string_key, bool p_public_only); + virtual bool is_public_only() const { return public_only; }; CryptoKeyMbedTLS() { mbedtls_pk_init(&pkey); @@ -102,6 +106,7 @@ private: mbedtls_entropy_context entropy; mbedtls_ctr_drbg_context ctr_drbg; static X509CertificateMbedTLS *default_certs; + mbedtls_md_type_t _md_type_from_hashtype(HashingContext::HashType p_hash_type, int &r_size); public: static Crypto *create(); @@ -113,6 +118,10 @@ public: virtual PackedByteArray generate_random_bytes(int p_bytes); virtual Ref<CryptoKey> generate_rsa(int p_bytes); virtual Ref<X509Certificate> generate_self_signed_certificate(Ref<CryptoKey> p_key, String p_issuer_name, String p_not_before, String p_not_after); + virtual Vector<uint8_t> sign(HashingContext::HashType p_hash_type, Vector<uint8_t> p_hash, Ref<CryptoKey> p_key); + virtual bool verify(HashingContext::HashType p_hash_type, Vector<uint8_t> p_hash, Vector<uint8_t> p_signature, Ref<CryptoKey> p_key); + virtual Vector<uint8_t> encrypt(Ref<CryptoKey> p_key, Vector<uint8_t> p_plaintext); + virtual Vector<uint8_t> decrypt(Ref<CryptoKey> p_key, Vector<uint8_t> p_ciphertext); CryptoMbedTLS(); ~CryptoMbedTLS(); diff --git a/modules/mobile_vr/mobile_vr_interface.cpp b/modules/mobile_vr/mobile_vr_interface.cpp index eebb3af709..a2fb443ef0 100644 --- a/modules/mobile_vr/mobile_vr_interface.cpp +++ b/modules/mobile_vr/mobile_vr_interface.cpp @@ -448,12 +448,6 @@ void MobileVRInterface::process() { }; }; -void MobileVRInterface::notification(int p_what){ - _THREAD_SAFE_METHOD_ - - // nothing to do here, I guess we could pauze our sensors... -} - MobileVRInterface::MobileVRInterface() { initialized = false; diff --git a/modules/mobile_vr/mobile_vr_interface.h b/modules/mobile_vr/mobile_vr_interface.h index 3a9ed1314a..e986a4a3de 100644 --- a/modules/mobile_vr/mobile_vr_interface.h +++ b/modules/mobile_vr/mobile_vr_interface.h @@ -142,7 +142,7 @@ public: virtual void commit_for_eye(XRInterface::Eyes p_eye, RID p_render_target, const Rect2 &p_screen_rect); virtual void process(); - virtual void notification(int p_what); + virtual void notification(int p_what) {} MobileVRInterface(); ~MobileVRInterface(); diff --git a/modules/mono/SCsub b/modules/mono/SCsub index c723b210cb..e8f3174a0a 100644 --- a/modules/mono/SCsub +++ b/modules/mono/SCsub @@ -29,7 +29,7 @@ if env_mono["tools"] or env_mono["target"] != "release": mono_configure.configure(env, env_mono) -if env_mono["tools"] and env_mono["mono_glue"]: +if env_mono["tools"] and env_mono["mono_glue"] and env_mono["build_cil"]: # Build Godot API solution import build_scripts.api_solution_build as api_solution_build diff --git a/modules/mono/build_scripts/godot_tools_build.py b/modules/mono/build_scripts/godot_tools_build.py index 7391e8790d..3bbbf29d3b 100644 --- a/modules/mono/build_scripts/godot_tools_build.py +++ b/modules/mono/build_scripts/godot_tools_build.py @@ -15,7 +15,9 @@ def build_godot_tools(source, target, env): from .solution_builder import build_solution - build_solution(env, solution_path, build_config) + extra_msbuild_args = ["/p:GodotPlatform=" + env["platform"]] + + build_solution(env, solution_path, build_config, extra_msbuild_args) # No need to copy targets. The GodotTools csproj takes care of copying them. diff --git a/modules/mono/build_scripts/mono_configure.py b/modules/mono/build_scripts/mono_configure.py index 23f01b3cca..80e3b59325 100644 --- a/modules/mono/build_scripts/mono_configure.py +++ b/modules/mono/build_scripts/mono_configure.py @@ -191,17 +191,16 @@ def configure(env, env_mono): env.Append(LIBS=["psapi"]) env.Append(LIBS=["version"]) else: - mono_lib_name = find_name_in_dir_files( - mono_lib_path, mono_lib_names, prefixes=["", "lib"], extensions=lib_suffixes - ) + mono_lib_file = find_file_in_dir(mono_lib_path, mono_lib_names, extensions=lib_suffixes) - if not mono_lib_name: + if not mono_lib_file: raise RuntimeError("Could not find mono library in: " + mono_lib_path) if env.msvc: - env.Append(LINKFLAGS=mono_lib_name + ".lib") + env.Append(LINKFLAGS=mono_lib_file) else: - env.Append(LIBS=[mono_lib_name]) + mono_lib_file_path = os.path.join(mono_lib_path, mono_lib_file) + env.Append(LINKFLAGS=mono_lib_file_path) mono_bin_path = os.path.join(mono_root, "bin") diff --git a/modules/mono/build_scripts/solution_builder.py b/modules/mono/build_scripts/solution_builder.py index 371819fd72..03f4e57f02 100644 --- a/modules/mono/build_scripts/solution_builder.py +++ b/modules/mono/build_scripts/solution_builder.py @@ -142,9 +142,7 @@ def build_solution(env, solution_path, build_config, extra_msbuild_args=[]): # Build solution - targets = ["Restore", "Build"] - - msbuild_args += [solution_path, "/t:%s" % ",".join(targets), "/p:Configuration=" + build_config] + msbuild_args += [solution_path, "/restore", "/t:Build", "/p:Configuration=" + build_config] msbuild_args += extra_msbuild_args run_command(msbuild_path, msbuild_args, env_override=msbuild_env, name="msbuild") diff --git a/modules/mono/config.py b/modules/mono/config.py index d41f3755b5..cd659057ef 100644 --- a/modules/mono/config.py +++ b/modules/mono/config.py @@ -30,6 +30,7 @@ def configure(env): ) envvars.Add(BoolVariable("mono_static", "Statically link mono", default_mono_static)) envvars.Add(BoolVariable("mono_glue", "Build with the mono glue sources", True)) + envvars.Add(BoolVariable("build_cil", "Build C# solutions", True)) envvars.Add( BoolVariable( "copy_mono_root", "Make a copy of the mono installation directory to bundle with the editor", False @@ -56,7 +57,6 @@ def configure(env): def get_doc_classes(): return [ - "@C#", "CSharpScript", "GodotSharp", ] diff --git a/modules/mono/csharp_script.cpp b/modules/mono/csharp_script.cpp index a5aae5175b..ae25bd3544 100644 --- a/modules/mono/csharp_script.cpp +++ b/modules/mono/csharp_script.cpp @@ -2419,15 +2419,22 @@ bool CSharpScript::_update_exports() { StringName member_name = field->get_name(); member_info[member_name] = prop_info; + + if (exported) { #ifdef TOOLS_ENABLED - if (is_editor && exported) { - exported_members_cache.push_front(prop_info); + if (is_editor) { + exported_members_cache.push_front(prop_info); - if (tmp_object) { - exported_members_defval_cache[member_name] = GDMonoMarshal::mono_object_to_variant(field->get_value(tmp_object)); + if (tmp_object) { + exported_members_defval_cache[member_name] = GDMonoMarshal::mono_object_to_variant(field->get_value(tmp_object)); + } } - } #endif + +#if defined(TOOLS_ENABLED) || defined(DEBUG_ENABLED) + exported_members_names.insert(member_name); +#endif + } } } @@ -2440,21 +2447,28 @@ bool CSharpScript::_update_exports() { StringName member_name = property->get_name(); member_info[member_name] = prop_info; + + if (exported) { #ifdef TOOLS_ENABLED - if (is_editor && exported) { - exported_members_cache.push_front(prop_info); - if (tmp_object) { - MonoException *exc = nullptr; - MonoObject *ret = property->get_value(tmp_object, &exc); - if (exc) { - exported_members_defval_cache[member_name] = Variant(); - GDMonoUtils::debug_print_unhandled_exception(exc); - } else { - exported_members_defval_cache[member_name] = GDMonoMarshal::mono_object_to_variant(ret); + if (is_editor) { + exported_members_cache.push_front(prop_info); + if (tmp_object) { + MonoException *exc = nullptr; + MonoObject *ret = property->get_value(tmp_object, &exc); + if (exc) { + exported_members_defval_cache[member_name] = Variant(); + GDMonoUtils::debug_print_unhandled_exception(exc); + } else { + exported_members_defval_cache[member_name] = GDMonoMarshal::mono_object_to_variant(ret); + } } } - } #endif + +#if defined(TOOLS_ENABLED) || defined(DEBUG_ENABLED) + exported_members_names.insert(member_name); +#endif + } } } @@ -2674,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; @@ -3240,9 +3256,7 @@ Error CSharpScript::reload(bool p_keep_state) { ERR_FAIL_NULL_V(namespace_, ERR_BUG); ERR_FAIL_NULL_V(class_name, ERR_BUG); GDMonoClass *klass = project_assembly->get_class(namespace_->operator String(), class_name->operator String()); - if (klass) { - bool obj_type = CACHED_CLASS(GodotObject)->is_assignable_from(klass); - ERR_FAIL_COND_V(!obj_type, ERR_BUG); + if (klass && CACHED_CLASS(GodotObject)->is_assignable_from(klass)) { script_class = klass; } } else { @@ -3593,6 +3607,16 @@ CSharpScript::~CSharpScript() { #endif } +void CSharpScript::get_members(Set<StringName> *p_members) { +#if defined(TOOLS_ENABLED) || defined(DEBUG_ENABLED) + if (p_members) { + for (Set<StringName>::Element *E = exported_members_names.front(); E; E = E->next()) { + p_members->insert(E->get()); + } + } +#endif +} + /*************** RESOURCE ***************/ RES ResourceFormatLoaderCSharpScript::load(const String &p_path, const String &p_original_path, Error *r_error, bool p_use_sub_threads, float *r_progress, bool p_no_cache) { diff --git a/modules/mono/csharp_script.h b/modules/mono/csharp_script.h index 52b0783a6e..0bf08ceafd 100644 --- a/modules/mono/csharp_script.h +++ b/modules/mono/csharp_script.h @@ -138,6 +138,10 @@ private: virtual void _placeholder_erased(PlaceHolderScriptInstance *p_placeholder); #endif +#if defined(TOOLS_ENABLED) || defined(DEBUG_ENABLED) + Set<StringName> exported_members_names; +#endif + Map<StringName, PropertyInfo> member_info; void _clear(); @@ -191,6 +195,8 @@ public: virtual void get_script_property_list(List<PropertyInfo> *p_list) const; virtual void update_exports(); + void get_members(Set<StringName> *p_members) override; + virtual bool is_tool() const { return tool; } virtual bool is_valid() const { return valid; } diff --git a/modules/mono/doc_classes/@C#.xml b/modules/mono/doc_classes/@C#.xml deleted file mode 100644 index 83a7fbf02c..0000000000 --- a/modules/mono/doc_classes/@C#.xml +++ /dev/null @@ -1,13 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" ?> -<class name="@C#" version="4.0"> - <brief_description> - </brief_description> - <description> - </description> - <tutorials> - </tutorials> - <methods> - </methods> - <constants> - </constants> -</class> diff --git a/modules/mono/doc_classes/CSharpScript.xml b/modules/mono/doc_classes/CSharpScript.xml index 1eb3404f9e..e1e9d1381f 100644 --- a/modules/mono/doc_classes/CSharpScript.xml +++ b/modules/mono/doc_classes/CSharpScript.xml @@ -1,16 +1,21 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="CSharpScript" inherits="Script" version="4.0"> <brief_description> + A script implemented in the C# programming language (Mono-enabled builds only). </brief_description> <description> + This class represents a C# script. It is the C# equivalent of the [GDScript] class and is only available in Mono-enabled Godot builds. + See also [GodotSharp]. </description> <tutorials> + <link>https://docs.godotengine.org/en/latest/getting_started/scripting/c_sharp/index.html</link> </tutorials> <methods> <method name="new" qualifiers="vararg"> <return type="Variant"> </return> <description> + Returns a new instance of the script. </description> </method> </methods> diff --git a/modules/mono/doc_classes/GodotSharp.xml b/modules/mono/doc_classes/GodotSharp.xml index 19a08d2036..417f8ac704 100644 --- a/modules/mono/doc_classes/GodotSharp.xml +++ b/modules/mono/doc_classes/GodotSharp.xml @@ -1,8 +1,11 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="GodotSharp" inherits="Object" version="4.0"> <brief_description> + Bridge between Godot and the Mono runtime (Mono-enabled builds only). </brief_description> <description> + This class is a bridge between Godot and the Mono runtime. It exposes several low-level operations and is only available in Mono-enabled Godot builds. + See also [CSharpScript]. </description> <tutorials> </tutorials> @@ -11,26 +14,30 @@ <return type="void"> </return> <description> - Attaches the current thread to the mono runtime. + Attaches the current thread to the Mono runtime. </description> </method> <method name="detach_thread"> <return type="void"> </return> <description> - Detaches the current thread from the mono runtime. + Detaches the current thread from the Mono runtime. </description> </method> <method name="get_domain_id"> <return type="int"> </return> <description> + Returns the current MonoDomain ID. + [b]Note:[/b] The Mono runtime must be initialized for this method to work (use [method is_runtime_initialized] to check). If the Mono runtime isn't initialized at the time this method is called, the engine will crash. </description> </method> <method name="get_scripts_domain_id"> <return type="int"> </return> <description> + Returns the scripts MonoDomain's ID. This will be the same MonoDomain ID as [method get_domain_id], unless the scripts domain isn't loaded. + [b]Note:[/b] The Mono runtime must be initialized for this method to work (use [method is_runtime_initialized] to check). If the Mono runtime isn't initialized at the time this method is called, the engine will crash. </description> </method> <method name="is_domain_finalizing_for_unload"> @@ -39,26 +46,28 @@ <argument index="0" name="domain_id" type="int"> </argument> <description> - Returns whether the domain is being finalized. + Returns [code]true[/code] if the domain is being finalized, [code]false[/code] otherwise. </description> </method> <method name="is_runtime_initialized"> <return type="bool"> </return> <description> + Returns [code]true[/code] if the Mono runtime is initialized, [code]false[/code] otherwise. </description> </method> <method name="is_runtime_shutting_down"> <return type="bool"> </return> <description> + Returns [code]true[/code] if the Mono runtime is shutting down, [code]false[/code] otherwise. </description> </method> <method name="is_scripts_domain_loaded"> <return type="bool"> </return> <description> - Returns whether the scripts domain is loaded. + Returns [code]true[/code] if the scripts domain is loaded, [code]false[/code] otherwise. </description> </method> </methods> diff --git a/modules/mono/editor/GodotTools/GodotTools.Core/StringExtensions.cs b/modules/mono/editor/GodotTools/GodotTools.Core/StringExtensions.cs index 7ab5c5fc59..012b69032e 100644 --- a/modules/mono/editor/GodotTools/GodotTools.Core/StringExtensions.cs +++ b/modules/mono/editor/GodotTools/GodotTools.Core/StringExtensions.cs @@ -25,8 +25,9 @@ namespace GodotTools.Core bool rooted = path.IsAbsolutePath(); path = path.Replace('\\', '/'); + path = path[path.Length - 1] == '/' ? path.Substring(0, path.Length - 1) : path; - string[] parts = path.Split(new[] { '/' }, StringSplitOptions.RemoveEmptyEntries); + string[] parts = path.Split(new[] {'/'}, StringSplitOptions.RemoveEmptyEntries); path = string.Join(Path.DirectorySeparatorChar.ToString(), parts).Trim(); diff --git a/modules/mono/editor/GodotTools/GodotTools.IdeMessaging/Client.cs b/modules/mono/editor/GodotTools/GodotTools.IdeMessaging/Client.cs index d069651dd3..572c541412 100644 --- a/modules/mono/editor/GodotTools/GodotTools.IdeMessaging/Client.cs +++ b/modules/mono/editor/GodotTools/GodotTools.IdeMessaging/Client.cs @@ -19,9 +19,12 @@ namespace GodotTools.IdeMessaging private readonly string identity; private string MetaFilePath { get; } + private DateTime? metaFileModifiedTime; private GodotIdeMetadata godotIdeMetadata; private readonly FileSystemWatcher fsWatcher; + public string GodotEditorExecutablePath => godotIdeMetadata.EditorExecutablePath; + private readonly IMessageHandler messageHandler; private Peer peer; @@ -123,7 +126,7 @@ namespace GodotTools.IdeMessaging MetaFilePath = Path.Combine(projectMetadataDir, GodotIdeMetadata.DefaultFileName); // FileSystemWatcher requires an existing directory - if (!File.Exists(projectMetadataDir)) + if (!Directory.Exists(projectMetadataDir)) Directory.CreateDirectory(projectMetadataDir); fsWatcher = new FileSystemWatcher(projectMetadataDir, GodotIdeMetadata.DefaultFileName); @@ -142,6 +145,13 @@ namespace GodotTools.IdeMessaging if (!File.Exists(MetaFilePath)) return; + var lastWriteTime = File.GetLastWriteTime(MetaFilePath); + + if (lastWriteTime == metaFileModifiedTime) + return; + + metaFileModifiedTime = lastWriteTime; + var metadata = ReadMetadataFile(); if (metadata != null && metadata != godotIdeMetadata) @@ -173,6 +183,13 @@ namespace GodotTools.IdeMessaging if (IsConnected || !File.Exists(MetaFilePath)) return; + var lastWriteTime = File.GetLastWriteTime(MetaFilePath); + + if (lastWriteTime == metaFileModifiedTime) + return; + + metaFileModifiedTime = lastWriteTime; + var metadata = ReadMetadataFile(); if (metadata != null) @@ -185,7 +202,8 @@ namespace GodotTools.IdeMessaging private GodotIdeMetadata? ReadMetadataFile() { - using (var reader = File.OpenText(MetaFilePath)) + using (var fileStream = new FileStream(MetaFilePath, FileMode.Open, FileAccess.Read, FileShare.ReadWrite)) + using (var reader = new StreamReader(fileStream)) { string portStr = reader.ReadLine(); @@ -272,6 +290,7 @@ namespace GodotTools.IdeMessaging // ReSharper disable once UnusedMember.Global public async void Start() { + fsWatcher.Created += OnMetaFileChanged; fsWatcher.Changed += OnMetaFileChanged; fsWatcher.Deleted += OnMetaFileDeleted; fsWatcher.EnableRaisingEvents = true; diff --git a/modules/mono/editor/GodotTools/GodotTools.IdeMessaging/GodotTools.IdeMessaging.csproj b/modules/mono/editor/GodotTools/GodotTools.IdeMessaging/GodotTools.IdeMessaging.csproj index 67815959a6..dad6b9ae7a 100644 --- a/modules/mono/editor/GodotTools/GodotTools.IdeMessaging/GodotTools.IdeMessaging.csproj +++ b/modules/mono/editor/GodotTools/GodotTools.IdeMessaging/GodotTools.IdeMessaging.csproj @@ -4,7 +4,7 @@ <TargetFramework>netstandard2.0</TargetFramework> <LangVersion>7.2</LangVersion> <PackageId>GodotTools.IdeMessaging</PackageId> - <Version>1.1.0</Version> + <Version>1.1.1</Version> <AssemblyVersion>$(Version)</AssemblyVersion> <Authors>Godot Engine contributors</Authors> <Company /> diff --git a/modules/mono/editor/GodotTools/GodotTools.IdeMessaging/Peer.cs b/modules/mono/editor/GodotTools/GodotTools.IdeMessaging/Peer.cs index a4e86d6177..10d7e1898e 100644 --- a/modules/mono/editor/GodotTools/GodotTools.IdeMessaging/Peer.cs +++ b/modules/mono/editor/GodotTools/GodotTools.IdeMessaging/Peer.cs @@ -105,49 +105,45 @@ namespace GodotTools.IdeMessaging try { - try + if (msg.Kind == MessageKind.Request) { - if (msg.Kind == MessageKind.Request) - { - var responseContent = await messageHandler.HandleRequest(this, msg.Id, msg.Content, Logger); - await WriteMessage(new Message(MessageKind.Response, msg.Id, responseContent)); - } - else if (msg.Kind == MessageKind.Response) - { - ResponseAwaiter responseAwaiter; + var responseContent = await messageHandler.HandleRequest(this, msg.Id, msg.Content, Logger); + await WriteMessage(new Message(MessageKind.Response, msg.Id, responseContent)); + } + else if (msg.Kind == MessageKind.Response) + { + ResponseAwaiter responseAwaiter; - using (await requestsSem.UseAsync()) + using (await requestsSem.UseAsync()) + { + if (!requestAwaiterQueues.TryGetValue(msg.Id, out var queue) || queue.Count <= 0) { - if (!requestAwaiterQueues.TryGetValue(msg.Id, out var queue) || queue.Count <= 0) - { - Logger.LogError($"Received unexpected response: {msg.Id}"); - return; - } - - responseAwaiter = queue.Dequeue(); + Logger.LogError($"Received unexpected response: {msg.Id}"); + return; } - responseAwaiter.SetResult(msg.Content); - } - else - { - throw new IndexOutOfRangeException($"Invalid message kind {msg.Kind}"); + responseAwaiter = queue.Dequeue(); } + + responseAwaiter.SetResult(msg.Content); } - catch (Exception e) + else { - Logger.LogError($"Message handler for '{msg}' failed with exception", e); + throw new IndexOutOfRangeException($"Invalid message kind {msg.Kind}"); } } catch (Exception e) { - Logger.LogError($"Exception thrown from message handler. Message: {msg}", e); + Logger.LogError($"Message handler for '{msg}' failed with exception", e); } } } catch (Exception e) { - Logger.LogError("Unhandled exception in the peer loop", e); + if (!IsDisposed || !(e is SocketException || e.InnerException is SocketException)) + { + Logger.LogError("Unhandled exception in the peer loop", e); + } } } diff --git a/modules/mono/editor/GodotTools/GodotTools.IdeMessaging/Requests/Requests.cs b/modules/mono/editor/GodotTools/GodotTools.IdeMessaging/Requests/Requests.cs index 1dd4f852e5..e93db9377b 100644 --- a/modules/mono/editor/GodotTools/GodotTools.IdeMessaging/Requests/Requests.cs +++ b/modules/mono/editor/GodotTools/GodotTools.IdeMessaging/Requests/Requests.cs @@ -67,6 +67,19 @@ namespace GodotTools.IdeMessaging.Requests { } + public sealed class StopPlayRequest : Request + { + public new const string Id = "StopPlay"; + + public StopPlayRequest() : base(Id) + { + } + } + + public sealed class StopPlayResponse : Response + { + } + public sealed class DebugPlayRequest : Request { public string DebuggerHost { get; set; } diff --git a/modules/mono/editor/GodotTools/GodotTools.OpenVisualStudio/GodotTools.OpenVisualStudio.csproj b/modules/mono/editor/GodotTools/GodotTools.OpenVisualStudio/GodotTools.OpenVisualStudio.csproj new file mode 100644 index 0000000000..5b3ed0b1b7 --- /dev/null +++ b/modules/mono/editor/GodotTools/GodotTools.OpenVisualStudio/GodotTools.OpenVisualStudio.csproj @@ -0,0 +1,12 @@ +<Project Sdk="Microsoft.NET.Sdk"> + <PropertyGroup> + <ProjectGuid>{EAFFF236-FA96-4A4D-BD23-0E51EF988277}</ProjectGuid> + <OutputType>Exe</OutputType> + <TargetFramework>net472</TargetFramework> + <LangVersion>7.2</LangVersion> + </PropertyGroup> + <ItemGroup> + <PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.0" PrivateAssets="All" /> + <PackageReference Include="EnvDTE" Version="8.0.2" /> + </ItemGroup> +</Project> diff --git a/modules/mono/editor/GodotTools/GodotTools.OpenVisualStudio/Program.cs b/modules/mono/editor/GodotTools/GodotTools.OpenVisualStudio/Program.cs new file mode 100644 index 0000000000..affb2a47e7 --- /dev/null +++ b/modules/mono/editor/GodotTools/GodotTools.OpenVisualStudio/Program.cs @@ -0,0 +1,270 @@ +using System; +using System.IO; +using System.Runtime.InteropServices; +using System.Runtime.InteropServices.ComTypes; +using System.Text.RegularExpressions; +using EnvDTE; + +namespace GodotTools.OpenVisualStudio +{ + internal static class Program + { + [DllImport("ole32.dll")] + private static extern int GetRunningObjectTable(int reserved, out IRunningObjectTable pprot); + + [DllImport("ole32.dll")] + private static extern void CreateBindCtx(int reserved, out IBindCtx ppbc); + + [DllImport("user32.dll")] + private static extern bool SetForegroundWindow(IntPtr hWnd); + + private static void ShowHelp() + { + Console.WriteLine("Opens the file(s) in a Visual Studio instance that is editing the specified solution."); + Console.WriteLine("If an existing instance for the solution is not found, a new one is created."); + Console.WriteLine(); + Console.WriteLine("Usage:"); + Console.WriteLine(@" GodotTools.OpenVisualStudio.exe solution [file[;line[;col]]...]"); + Console.WriteLine(); + Console.WriteLine("Lines and columns begin at one. Zero or lower will result in an error."); + Console.WriteLine("If a line is specified but a column is not, the line is selected in the text editor."); + } + + // STAThread needed, otherwise CoRegisterMessageFilter may return CO_E_NOT_SUPPORTED. + [STAThread] + private static int Main(string[] args) + { + if (args.Length == 0 || args[0] == "--help" || args[0] == "-h") + { + ShowHelp(); + return 0; + } + + string solutionFile = NormalizePath(args[0]); + + var dte = FindInstanceEditingSolution(solutionFile); + + if (dte == null) + { + // Open a new instance + + var visualStudioDteType = Type.GetTypeFromProgID("VisualStudio.DTE.16.0", throwOnError: true); + dte = (DTE)Activator.CreateInstance(visualStudioDteType); + + dte.UserControl = true; + + try + { + dte.Solution.Open(solutionFile); + } + catch (ArgumentException) + { + Console.Error.WriteLine("Solution.Open: Invalid path or file not found"); + return 1; + } + + dte.MainWindow.Visible = true; + } + + MessageFilter.Register(); + + try + { + // Open files + + for (int i = 1; i < args.Length; i++) + { + // Both the line number and the column begin at one + + string[] fileArgumentParts = args[i].Split(';'); + + string filePath = NormalizePath(fileArgumentParts[0]); + + try + { + dte.ItemOperations.OpenFile(filePath); + } + catch (ArgumentException) + { + Console.Error.WriteLine("ItemOperations.OpenFile: Invalid path or file not found"); + return 1; + } + + if (fileArgumentParts.Length > 1) + { + if (int.TryParse(fileArgumentParts[1], out int line)) + { + var textSelection = (TextSelection)dte.ActiveDocument.Selection; + + if (fileArgumentParts.Length > 2) + { + if (int.TryParse(fileArgumentParts[2], out int column)) + { + textSelection.MoveToLineAndOffset(line, column); + } + else + { + Console.Error.WriteLine("The column part of the argument must be a valid integer"); + return 1; + } + } + else + { + textSelection.GotoLine(line, Select: true); + } + } + else + { + Console.Error.WriteLine("The line part of the argument must be a valid integer"); + return 1; + } + } + } + } + finally + { + var mainWindow = dte.MainWindow; + mainWindow.Activate(); + SetForegroundWindow(new IntPtr(mainWindow.HWnd)); + + MessageFilter.Revoke(); + } + + return 0; + } + + private static DTE FindInstanceEditingSolution(string solutionPath) + { + if (GetRunningObjectTable(0, out IRunningObjectTable pprot) != 0) + return null; + + try + { + pprot.EnumRunning(out IEnumMoniker ppenumMoniker); + ppenumMoniker.Reset(); + + var moniker = new IMoniker[1]; + + while (ppenumMoniker.Next(1, moniker, IntPtr.Zero) == 0) + { + string ppszDisplayName; + + CreateBindCtx(0, out IBindCtx ppbc); + + try + { + moniker[0].GetDisplayName(ppbc, null, out ppszDisplayName); + } + finally + { + Marshal.ReleaseComObject(ppbc); + } + + if (ppszDisplayName == null) + continue; + + // The digits after the colon are the process ID + if (!Regex.IsMatch(ppszDisplayName, "!VisualStudio.DTE.16.0:[0-9]")) + continue; + + if (pprot.GetObject(moniker[0], out object ppunkObject) == 0) + { + if (ppunkObject is DTE dte && dte.Solution.FullName.Length > 0) + { + if (NormalizePath(dte.Solution.FullName) == solutionPath) + return dte; + } + } + } + } + finally + { + Marshal.ReleaseComObject(pprot); + } + + return null; + } + + static string NormalizePath(string path) + { + return new Uri(Path.GetFullPath(path)).LocalPath + .TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar) + .ToUpperInvariant(); + } + + #region MessageFilter. See: http: //msdn.microsoft.com/en-us/library/ms228772.aspx + + private class MessageFilter : IOleMessageFilter + { + // Class containing the IOleMessageFilter + // thread error-handling functions + + private static IOleMessageFilter _oldFilter; + + // Start the filter + public static void Register() + { + IOleMessageFilter newFilter = new MessageFilter(); + int ret = CoRegisterMessageFilter(newFilter, out _oldFilter); + if (ret != 0) + Console.Error.WriteLine($"CoRegisterMessageFilter failed with error code: {ret}"); + } + + // Done with the filter, close it + public static void Revoke() + { + int ret = CoRegisterMessageFilter(_oldFilter, out _); + if (ret != 0) + Console.Error.WriteLine($"CoRegisterMessageFilter failed with error code: {ret}"); + } + + // + // IOleMessageFilter functions + // Handle incoming thread requests + int IOleMessageFilter.HandleInComingCall(int dwCallType, IntPtr hTaskCaller, int dwTickCount, IntPtr lpInterfaceInfo) + { + // Return the flag SERVERCALL_ISHANDLED + return 0; + } + + // Thread call was rejected, so try again. + int IOleMessageFilter.RetryRejectedCall(IntPtr hTaskCallee, int dwTickCount, int dwRejectType) + { + if (dwRejectType == 2) + // flag = SERVERCALL_RETRYLATER + { + // Retry the thread call immediately if return >= 0 & < 100 + return 99; + } + + // Too busy; cancel call + return -1; + } + + int IOleMessageFilter.MessagePending(IntPtr hTaskCallee, int dwTickCount, int dwPendingType) + { + // Return the flag PENDINGMSG_WAITDEFPROCESS + return 2; + } + + // Implement the IOleMessageFilter interface + [DllImport("ole32.dll")] + private static extern int CoRegisterMessageFilter(IOleMessageFilter newFilter, out IOleMessageFilter oldFilter); + } + + [ComImport(), Guid("00000016-0000-0000-C000-000000000046"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] + private interface IOleMessageFilter + { + [PreserveSig] + int HandleInComingCall(int dwCallType, IntPtr hTaskCaller, int dwTickCount, IntPtr lpInterfaceInfo); + + [PreserveSig] + int RetryRejectedCall(IntPtr hTaskCallee, int dwTickCount, int dwRejectType); + + [PreserveSig] + int MessagePending(IntPtr hTaskCallee, int dwTickCount, int dwPendingType); + } + + #endregion + } +} diff --git a/modules/mono/editor/GodotTools/GodotTools.ProjectEditor/ProjectGenerator.cs b/modules/mono/editor/GodotTools/GodotTools.ProjectEditor/ProjectGenerator.cs index fb2beb6995..679d5bb444 100644 --- a/modules/mono/editor/GodotTools/GodotTools.ProjectEditor/ProjectGenerator.cs +++ b/modules/mono/editor/GodotTools/GodotTools.ProjectEditor/ProjectGenerator.cs @@ -12,6 +12,11 @@ namespace GodotTools.ProjectEditor private const string CoreApiProjectName = "GodotSharp"; private const string EditorApiProjectName = "GodotSharpEditor"; + public const string CSharpProjectTypeGuid = "{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}"; + public const string GodotProjectTypeGuid = "{8F3E2DF0-C35C-4265-82FC-BEA011F4A7ED}"; + + public static readonly string GodotDefaultProjectTypeGuids = $"{GodotProjectTypeGuid};{CSharpProjectTypeGuid}"; + public static string GenGameProject(string dir, string name, IEnumerable<string> compileItems) { string path = Path.Combine(dir, name + ".csproj"); @@ -19,6 +24,7 @@ namespace GodotTools.ProjectEditor ProjectPropertyGroupElement mainGroup; var root = CreateLibraryProject(name, "Debug", out mainGroup); + mainGroup.SetProperty("ProjectTypeGuids", GodotDefaultProjectTypeGuids); mainGroup.SetProperty("OutputPath", Path.Combine(".mono", "temp", "bin", "$(Configuration)")); mainGroup.SetProperty("BaseIntermediateOutputPath", Path.Combine(".mono", "temp", "obj")); mainGroup.SetProperty("IntermediateOutputPath", Path.Combine("$(BaseIntermediateOutputPath)", "$(Configuration)")); diff --git a/modules/mono/editor/GodotTools/GodotTools.ProjectEditor/ProjectUtils.cs b/modules/mono/editor/GodotTools/GodotTools.ProjectEditor/ProjectUtils.cs index 069a1edaa3..8774b4ee31 100644 --- a/modules/mono/editor/GodotTools/GodotTools.ProjectEditor/ProjectUtils.cs +++ b/modules/mono/editor/GodotTools/GodotTools.ProjectEditor/ProjectUtils.cs @@ -165,6 +165,21 @@ namespace GodotTools.ProjectEditor return result.ToArray(); } + public static void EnsureHasProjectTypeGuids(MSBuildProject project) + { + var root = project.Root; + + bool found = root.PropertyGroups.Any(pg => + string.IsNullOrEmpty(pg.Condition) && pg.Properties.Any(p => p.Name == "ProjectTypeGuids")); + + if (found) + return; + + root.AddProperty("ProjectTypeGuids", ProjectGenerator.GodotDefaultProjectTypeGuids); + + project.HasUnsavedChanges = true; + } + /// Simple function to make sure the Api assembly references are configured correctly public static void FixApiHintPath(MSBuildProject project) { diff --git a/modules/mono/editor/GodotTools/GodotTools.sln b/modules/mono/editor/GodotTools/GodotTools.sln index f6147eb5bb..ba5379e562 100644 --- a/modules/mono/editor/GodotTools/GodotTools.sln +++ b/modules/mono/editor/GodotTools/GodotTools.sln @@ -11,6 +11,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GodotTools.BuildLogger", "G EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GodotTools.IdeMessaging", "GodotTools.IdeMessaging\GodotTools.IdeMessaging.csproj", "{92600954-25F0-4291-8E11-1FEE9FC4BE20}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GodotTools.OpenVisualStudio", "GodotTools.OpenVisualStudio\GodotTools.OpenVisualStudio.csproj", "{EAFFF236-FA96-4A4D-BD23-0E51EF988277}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -37,5 +39,9 @@ Global {92600954-25F0-4291-8E11-1FEE9FC4BE20}.Debug|Any CPU.Build.0 = Debug|Any CPU {92600954-25F0-4291-8E11-1FEE9FC4BE20}.Release|Any CPU.ActiveCfg = Release|Any CPU {92600954-25F0-4291-8E11-1FEE9FC4BE20}.Release|Any CPU.Build.0 = Release|Any CPU + {EAFFF236-FA96-4A4D-BD23-0E51EF988277}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {EAFFF236-FA96-4A4D-BD23-0E51EF988277}.Debug|Any CPU.Build.0 = Debug|Any CPU + {EAFFF236-FA96-4A4D-BD23-0E51EF988277}.Release|Any CPU.ActiveCfg = Release|Any CPU + {EAFFF236-FA96-4A4D-BD23-0E51EF988277}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection EndGlobal diff --git a/modules/mono/editor/GodotTools/GodotTools/BottomPanel.cs b/modules/mono/editor/GodotTools/GodotTools/BottomPanel.cs index 3cf495f025..3de3d8d318 100644 --- a/modules/mono/editor/GodotTools/GodotTools/BottomPanel.cs +++ b/modules/mono/editor/GodotTools/GodotTools/BottomPanel.cs @@ -20,8 +20,8 @@ namespace GodotTools private ItemList buildTabsList; private TabContainer buildTabs; - private ToolButton warningsBtn; - private ToolButton errorsBtn; + private Button warningsBtn; + private Button errorsBtn; private Button viewLogBtn; private void _UpdateBuildTabsList() @@ -285,7 +285,7 @@ namespace GodotTools toolBarHBox.AddSpacer(begin: false); - warningsBtn = new ToolButton + warningsBtn = new Button { Text = "Warnings".TTR(), ToggleMode = true, @@ -296,7 +296,7 @@ namespace GodotTools warningsBtn.Toggled += _WarningsToggled; toolBarHBox.AddChild(warningsBtn); - errorsBtn = new ToolButton + errorsBtn = new Button { Text = "Errors".TTR(), ToggleMode = true, diff --git a/modules/mono/editor/GodotTools/GodotTools/Build/BuildSystem.cs b/modules/mono/editor/GodotTools/GodotTools/Build/BuildSystem.cs index e55558c100..34e42489eb 100644 --- a/modules/mono/editor/GodotTools/GodotTools/Build/BuildSystem.cs +++ b/modules/mono/editor/GodotTools/GodotTools/Build/BuildSystem.cs @@ -47,19 +47,14 @@ namespace GodotTools.Build private static bool PrintBuildOutput => (bool)EditorSettings.GetSetting("mono/builds/print_build_output"); - private static Process LaunchBuild(string solution, IEnumerable<string> targets, string config, string loggerOutputDir, IEnumerable<string> customProperties = null) + private static Process LaunchBuild(BuildInfo buildInfo) { (string msbuildPath, BuildTool buildTool) = MsBuildFinder.FindMsBuild(); if (msbuildPath == null) throw new FileNotFoundException("Cannot find the MSBuild executable."); - var customPropertiesList = new List<string>(); - - if (customProperties != null) - customPropertiesList.AddRange(customProperties); - - string compilerArgs = BuildArguments(buildTool, solution, targets, config, loggerOutputDir, customPropertiesList); + string compilerArgs = BuildArguments(buildTool, buildInfo); var startInfo = new ProcessStartInfo(msbuildPath, compilerArgs); @@ -100,19 +95,7 @@ namespace GodotTools.Build public static int Build(BuildInfo buildInfo) { - return Build(buildInfo.Solution, buildInfo.Targets, buildInfo.Configuration, - buildInfo.LogsDirPath, buildInfo.CustomProperties); - } - - public static Task<int> BuildAsync(BuildInfo buildInfo) - { - return BuildAsync(buildInfo.Solution, buildInfo.Targets, buildInfo.Configuration, - buildInfo.LogsDirPath, buildInfo.CustomProperties); - } - - public static int Build(string solution, string[] targets, string config, string loggerOutputDir, IEnumerable<string> customProperties = null) - { - using (var process = LaunchBuild(solution, targets, config, loggerOutputDir, customProperties)) + using (var process = LaunchBuild(buildInfo)) { process.WaitForExit(); @@ -120,9 +103,9 @@ namespace GodotTools.Build } } - public static async Task<int> BuildAsync(string solution, IEnumerable<string> targets, string config, string loggerOutputDir, IEnumerable<string> customProperties = null) + public static async Task<int> BuildAsync(BuildInfo buildInfo) { - using (var process = LaunchBuild(solution, targets, config, loggerOutputDir, customProperties)) + using (var process = LaunchBuild(buildInfo)) { await process.WaitForExitAsync(); @@ -130,17 +113,18 @@ namespace GodotTools.Build } } - private static string BuildArguments(BuildTool buildTool, string solution, IEnumerable<string> targets, string config, string loggerOutputDir, IEnumerable<string> customProperties) + private static string BuildArguments(BuildTool buildTool, BuildInfo buildInfo) { string arguments = string.Empty; if (buildTool == BuildTool.DotnetCli) arguments += "msbuild "; // `dotnet msbuild` command - arguments += $@"""{solution}"" /v:normal /t:{string.Join(",", targets)} ""/p:{"Configuration=" + config}"" " + - $@"""/l:{typeof(GodotBuildLogger).FullName},{GodotBuildLogger.AssemblyPath};{loggerOutputDir}"""; + arguments += $@"""{buildInfo.Solution}"" /t:{string.Join(",", buildInfo.Targets)} " + + $@"""/p:{"Configuration=" + buildInfo.Configuration}"" /v:normal " + + $@"""/l:{typeof(GodotBuildLogger).FullName},{GodotBuildLogger.AssemblyPath};{buildInfo.LogsDirPath}"""; - foreach (string customProperty in customProperties) + foreach (string customProperty in buildInfo.CustomProperties) { arguments += " /p:" + customProperty; } diff --git a/modules/mono/editor/GodotTools/GodotTools/Build/BuildTool.cs b/modules/mono/editor/GodotTools/GodotTools/Build/BuildTool.cs index a1a69334e3..837c8adddb 100644 --- a/modules/mono/editor/GodotTools/GodotTools/Build/BuildTool.cs +++ b/modules/mono/editor/GodotTools/GodotTools/Build/BuildTool.cs @@ -1,6 +1,6 @@ namespace GodotTools.Build { - public enum BuildTool + public enum BuildTool : long { MsBuildMono, MsBuildVs, diff --git a/modules/mono/editor/GodotTools/GodotTools/BuildInfo.cs b/modules/mono/editor/GodotTools/GodotTools/BuildInfo.cs index cca0983c01..ab090c46e7 100644 --- a/modules/mono/editor/GodotTools/GodotTools/BuildInfo.cs +++ b/modules/mono/editor/GodotTools/GodotTools/BuildInfo.cs @@ -12,6 +12,7 @@ namespace GodotTools public string Solution { get; } public string[] Targets { get; } public string Configuration { get; } + public bool Restore { get; } public Array<string> CustomProperties { get; } = new Array<string>(); // TODO Use List once we have proper serialization public string LogsDirPath => Path.Combine(GodotSharpDirs.BuildLogsDirs, $"{Solution.MD5Text()}_{Configuration}"); @@ -39,11 +40,12 @@ namespace GodotTools { } - public BuildInfo(string solution, string[] targets, string configuration) + public BuildInfo(string solution, string[] targets, string configuration, bool restore) { Solution = solution; Targets = targets; Configuration = configuration; + Restore = restore; } } } diff --git a/modules/mono/editor/GodotTools/GodotTools/BuildManager.cs b/modules/mono/editor/GodotTools/GodotTools/BuildManager.cs index 598787ba03..0974d23176 100644 --- a/modules/mono/editor/GodotTools/GodotTools/BuildManager.cs +++ b/modules/mono/editor/GodotTools/GodotTools/BuildManager.cs @@ -175,7 +175,7 @@ namespace GodotTools { pr.Step("Building project solution", 0); - var buildInfo = new BuildInfo(GodotSharpDirs.ProjectSlnPath, targets: new[] {"Restore", "Build"}, config); + var buildInfo = new BuildInfo(GodotSharpDirs.ProjectSlnPath, targets: new[] {"Build"}, config, restore: true); bool escapeNeedsDoubleBackslash = buildTool == BuildTool.MsBuildMono || buildTool == BuildTool.DotnetCli; diff --git a/modules/mono/editor/GodotTools/GodotTools/BuildTab.cs b/modules/mono/editor/GodotTools/GodotTools/BuildTab.cs index 0106e1f1ac..8596cd24af 100644 --- a/modules/mono/editor/GodotTools/GodotTools/BuildTab.cs +++ b/modules/mono/editor/GodotTools/GodotTools/BuildTab.cs @@ -113,7 +113,7 @@ namespace GodotTools throw new IndexOutOfRangeException("Item list index out of range"); // Get correct issue idx from issue list - int issueIndex = (int)issuesList.GetItemMetadata(idx); + int issueIndex = (int)(long)issuesList.GetItemMetadata(idx); if (issueIndex < 0 || issueIndex >= issues.Count) throw new IndexOutOfRangeException("Issue index out of range"); diff --git a/modules/mono/editor/GodotTools/GodotTools/ExternalEditorId.cs b/modules/mono/editor/GodotTools/GodotTools/ExternalEditorId.cs index bb218c2f19..90d6eb960e 100644 --- a/modules/mono/editor/GodotTools/GodotTools/ExternalEditorId.cs +++ b/modules/mono/editor/GodotTools/GodotTools/ExternalEditorId.cs @@ -1,6 +1,6 @@ namespace GodotTools { - public enum ExternalEditorId + public enum ExternalEditorId : long { None, VisualStudio, // TODO (Windows-only) diff --git a/modules/mono/editor/GodotTools/GodotTools/GodotSharpEditor.cs b/modules/mono/editor/GodotTools/GodotTools/GodotSharpEditor.cs index eb7696685f..f330f9ed2c 100644 --- a/modules/mono/editor/GodotTools/GodotTools/GodotSharpEditor.cs +++ b/modules/mono/editor/GodotTools/GodotTools/GodotSharpEditor.cs @@ -6,6 +6,7 @@ using System; using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; using System.IO; +using System.Linq; using GodotTools.Ides; using GodotTools.Ides.Rider; using GodotTools.Internals; @@ -29,7 +30,7 @@ namespace GodotTools private AcceptDialog aboutDialog; private CheckBox aboutDialogCheckBox; - private ToolButton bottomPanelBtn; + private Button bottomPanelBtn; public GodotIdeManager GodotIdeManager { get; private set; } @@ -238,7 +239,31 @@ namespace GodotTools // Not an error. Tells the caller to fallback to the global external editor settings or the built-in editor. return Error.Unavailable; case ExternalEditorId.VisualStudio: - throw new NotSupportedException(); + { + string scriptPath = ProjectSettings.GlobalizePath(script.ResourcePath); + + var args = new List<string> + { + GodotSharpDirs.ProjectSlnPath, + line >= 0 ? $"{scriptPath};{line + 1};{col + 1}" : scriptPath + }; + + string command = Path.Combine(GodotSharpDirs.DataEditorToolsDir, "GodotTools.OpenVisualStudio.exe"); + + try + { + if (Godot.OS.IsStdoutVerbose()) + Console.WriteLine($"Running: \"{command}\" {string.Join(" ", args.Select(a => $"\"{a}\""))}"); + + OS.RunProcess(command, args); + } + catch (Exception e) + { + GD.PushError($"Error when trying to run code editor: VisualStudio. Exception message: '{e.Message}'"); + } + + break; + } case ExternalEditorId.VisualStudioForMac: goto case ExternalEditorId.MonoDevelop; case ExternalEditorId.Rider: @@ -421,7 +446,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" + @@ -458,6 +483,9 @@ namespace GodotTools // Apply the other fixes only after configurations have been migrated + // Make sure the existing project has the ProjectTypeGuids property (for VisualStudio) + ProjectUtils.EnsureHasProjectTypeGuids(msbuildProject); + // Make sure the existing project has Api assembly references configured correctly ProjectUtils.FixApiHintPath(msbuildProject); @@ -485,7 +513,7 @@ namespace GodotTools menuPopup.IdPressed += _MenuOptionPressed; - var buildButton = new ToolButton + var buildButton = new Button { Text = "Build", HintTooltip = "Build solution", @@ -501,7 +529,8 @@ namespace GodotTools if (OS.IsWindows) { - settingsHintStr += $",MonoDevelop:{(int)ExternalEditorId.MonoDevelop}" + + settingsHintStr += $",Visual Studio:{(int)ExternalEditorId.VisualStudio}" + + $",MonoDevelop:{(int)ExternalEditorId.MonoDevelop}" + $",Visual Studio Code:{(int)ExternalEditorId.VsCode}" + $",JetBrains Rider:{(int)ExternalEditorId.Rider}"; } diff --git a/modules/mono/editor/GodotTools/GodotTools/GodotTools.csproj b/modules/mono/editor/GodotTools/GodotTools/GodotTools.csproj index ba527ca3b5..3f14629b11 100644 --- a/modules/mono/editor/GodotTools/GodotTools/GodotTools.csproj +++ b/modules/mono/editor/GodotTools/GodotTools/GodotTools.csproj @@ -33,5 +33,7 @@ <ProjectReference Include="..\GodotTools.IdeMessaging\GodotTools.IdeMessaging.csproj" /> <ProjectReference Include="..\GodotTools.ProjectEditor\GodotTools.ProjectEditor.csproj" /> <ProjectReference Include="..\GodotTools.Core\GodotTools.Core.csproj" /> + <!-- Include it if this is an SCons build targeting Windows, or if it's not an SCons build but we're on Windows --> + <ProjectReference Include="..\GodotTools.OpenVisualStudio\GodotTools.OpenVisualStudio.csproj" Condition=" '$(GodotPlatform)' == 'windows' Or ( '$(GodotPlatform)' == '' And '$(OS)' == 'Windows_NT' ) " /> </ItemGroup> </Project> diff --git a/modules/mono/editor/GodotTools/GodotTools/Ides/MessagingServer.cs b/modules/mono/editor/GodotTools/GodotTools/Ides/MessagingServer.cs index 32f264d100..17f3339560 100644 --- a/modules/mono/editor/GodotTools/GodotTools/Ides/MessagingServer.cs +++ b/modules/mono/editor/GodotTools/GodotTools/Ides/MessagingServer.cs @@ -12,6 +12,7 @@ using GodotTools.IdeMessaging; using GodotTools.IdeMessaging.Requests; using GodotTools.IdeMessaging.Utils; using GodotTools.Internals; +using GodotTools.Utils; using Newtonsoft.Json; using Directory = System.IO.Directory; using File = System.IO.File; @@ -307,6 +308,11 @@ namespace GodotTools.Ides var request = JsonConvert.DeserializeObject<DebugPlayRequest>(content.Body); return await HandleDebugPlay(request); }, + [StopPlayRequest.Id] = async (peer, content) => + { + var request = JsonConvert.DeserializeObject<StopPlayRequest>(content.Body); + return await HandleStopPlay(request); + }, [ReloadScriptsRequest.Id] = async (peer, content) => { _ = JsonConvert.DeserializeObject<ReloadScriptsRequest>(content.Body); @@ -343,6 +349,12 @@ namespace GodotTools.Ides return Task.FromResult<Response>(new DebugPlayResponse()); } + private static Task<Response> HandleStopPlay(StopPlayRequest request) + { + DispatchToMainThread(Internal.EditorRunStop); + return Task.FromResult<Response>(new StopPlayResponse()); + } + private static Task<Response> HandleReloadScripts() { DispatchToMainThread(Internal.ScriptEditorDebugger_ReloadScripts); @@ -351,8 +363,13 @@ namespace GodotTools.Ides private static async Task<Response> HandleCodeCompletionRequest(CodeCompletionRequest request) { + // This is needed if the "resource path" part of the path is case insensitive. + // However, it doesn't fix resource loading if the rest of the path is also case insensitive. + string scriptFileLocalized = FsPathUtils.LocalizePathWithCaseChecked(request.ScriptFile); + var response = new CodeCompletionResponse {Kind = request.Kind, ScriptFile = request.ScriptFile}; - response.Suggestions = await Task.Run(() => Internal.CodeCompletionRequest(response.Kind, response.ScriptFile)); + response.Suggestions = await Task.Run(() => + Internal.CodeCompletionRequest(response.Kind, scriptFileLocalized ?? request.ScriptFile)); return response; } } diff --git a/modules/mono/editor/GodotTools/GodotTools/Internals/ScriptClassParser.cs b/modules/mono/editor/GodotTools/GodotTools/Internals/ScriptClassParser.cs index 7fb087467f..569f27649f 100644 --- a/modules/mono/editor/GodotTools/GodotTools/Internals/ScriptClassParser.cs +++ b/modules/mono/editor/GodotTools/GodotTools/Internals/ScriptClassParser.cs @@ -13,9 +13,9 @@ namespace GodotTools.Internals public string Name { get; } public string Namespace { get; } public bool Nested { get; } - public int BaseCount { get; } + public long BaseCount { get; } - public ClassDecl(string name, string @namespace, bool nested, int baseCount) + public ClassDecl(string name, string @namespace, bool nested, long baseCount) { Name = name; Namespace = @namespace; @@ -45,7 +45,7 @@ namespace GodotTools.Internals (string)classDeclDict["name"], (string)classDeclDict["namespace"], (bool)classDeclDict["nested"], - (int)classDeclDict["base_count"] + (long)classDeclDict["base_count"] )); } diff --git a/modules/mono/editor/GodotTools/GodotTools/Utils/FsPathUtils.cs b/modules/mono/editor/GodotTools/GodotTools/Utils/FsPathUtils.cs new file mode 100644 index 0000000000..c6724ccaf7 --- /dev/null +++ b/modules/mono/editor/GodotTools/GodotTools/Utils/FsPathUtils.cs @@ -0,0 +1,48 @@ +using System; +using System.IO; +using Godot; +using GodotTools.Core; +using JetBrains.Annotations; + +namespace GodotTools.Utils +{ + public static class FsPathUtils + { + private static readonly string ResourcePath = ProjectSettings.GlobalizePath("res://"); + + private static bool PathStartsWithAlreadyNorm(this string childPath, string parentPath) + { + // This won't work for Linux/macOS case insensitive file systems, but it's enough for our current problems + bool caseSensitive = !OS.IsWindows; + + string parentPathNorm = parentPath.NormalizePath() + Path.DirectorySeparatorChar; + string childPathNorm = childPath.NormalizePath() + Path.DirectorySeparatorChar; + + return childPathNorm.StartsWith(parentPathNorm, + caseSensitive ? StringComparison.Ordinal : StringComparison.OrdinalIgnoreCase); + } + + public static bool PathStartsWith(this string childPath, string parentPath) + { + string childPathNorm = childPath.NormalizePath() + Path.DirectorySeparatorChar; + string parentPathNorm = parentPath.NormalizePath() + Path.DirectorySeparatorChar; + + return childPathNorm.PathStartsWithAlreadyNorm(parentPathNorm); + } + + [CanBeNull] + public static string LocalizePathWithCaseChecked(string path) + { + string pathNorm = path.NormalizePath() + Path.DirectorySeparatorChar; + string resourcePathNorm = ResourcePath.NormalizePath() + Path.DirectorySeparatorChar; + + if (!pathNorm.PathStartsWithAlreadyNorm(resourcePathNorm)) + return null; + + string result = "res://" + pathNorm.Substring(resourcePathNorm.Length); + + // Remove the last separator we added + return result.Substring(0, result.Length - 1); + } + } +} diff --git a/modules/mono/editor/bindings_generator.cpp b/modules/mono/editor/bindings_generator.cpp index 0218773105..730ffcb945 100644 --- a/modules/mono/editor/bindings_generator.cpp +++ b/modules/mono/editor/bindings_generator.cpp @@ -123,8 +123,9 @@ static String snake_to_pascal_case(const String &p_identifier, bool p_input_is_u if (part.length()) { part[0] = _find_upper(part[0]); if (p_input_is_upper) { - for (int j = 1; j < part.length(); j++) + for (int j = 1; j < part.length(); j++) { part[j] = _find_lower(part[j]); + } } ret += part; } else { @@ -157,8 +158,9 @@ static String snake_to_camel_case(const String &p_identifier, bool p_input_is_up part[0] = _find_upper(part[0]); } if (p_input_is_upper) { - for (int j = i != 0 ? 1 : 0; j < part.length(); j++) + for (int j = i != 0 ? 1 : 0; j < part.length(); j++) { part[j] = _find_lower(part[j]); + } } ret += part; } else { @@ -182,8 +184,9 @@ static String snake_to_camel_case(const String &p_identifier, bool p_input_is_up String BindingsGenerator::bbcode_to_xml(const String &p_bbcode, const TypeInterface *p_itype) { // Based on the version in EditorHelp - if (p_bbcode.empty()) + if (p_bbcode.empty()) { return String(); + } DocData *doc = EditorHelp::get_doc_data(); @@ -200,8 +203,9 @@ String BindingsGenerator::bbcode_to_xml(const String &p_bbcode, const TypeInterf while (pos < bbcode.length()) { int brk_pos = bbcode.find("[", pos); - if (brk_pos < 0) + if (brk_pos < 0) { brk_pos = bbcode.length(); + } if (brk_pos > pos) { String text = bbcode.substr(pos, brk_pos - pos); @@ -210,19 +214,22 @@ String BindingsGenerator::bbcode_to_xml(const String &p_bbcode, const TypeInterf } else { Vector<String> lines = text.split("\n"); for (int i = 0; i < lines.size(); i++) { - if (i != 0) + if (i != 0) { xml_output.append("<para>"); + } xml_output.append(lines[i].xml_escape()); - if (i != lines.size() - 1) + if (i != lines.size() - 1) { xml_output.append("</para>\n"); + } } } } - if (brk_pos == bbcode.length()) + if (brk_pos == bbcode.length()) { break; // nothing else to add + } int brk_end = bbcode.find("]", brk_pos + 1); @@ -233,13 +240,15 @@ String BindingsGenerator::bbcode_to_xml(const String &p_bbcode, const TypeInterf } else { Vector<String> lines = text.split("\n"); for (int i = 0; i < lines.size(); i++) { - if (i != 0) + if (i != 0) { xml_output.append("<para>"); + } xml_output.append(lines[i].xml_escape()); - if (i != lines.size() - 1) + if (i != lines.size() - 1) { xml_output.append("</para>\n"); + } } } @@ -412,8 +421,9 @@ String BindingsGenerator::bbcode_to_xml(const String &p_bbcode, const TypeInterf for (const List<EnumInterface>::Element *E = global_enums.front(); E; E = E->next()) { target_ienum = &E->get(); target_iconst = find_constant_by_name(target_name, target_ienum->constants); - if (target_iconst) + if (target_iconst) { break; + } } if (target_iconst) { @@ -450,8 +460,9 @@ String BindingsGenerator::bbcode_to_xml(const String &p_bbcode, const TypeInterf for (const List<EnumInterface>::Element *E = target_itype->enums.front(); E; E = E->next()) { target_ienum = &E->get(); target_iconst = find_constant_by_name(target_name, target_ienum->constants); - if (target_iconst) + if (target_iconst) { break; + } } if (target_iconst) { @@ -583,8 +594,9 @@ String BindingsGenerator::bbcode_to_xml(const String &p_bbcode, const TypeInterf tag_stack.push_front(tag); } else if (tag == "url") { int end = bbcode.find("[", brk_end); - if (end == -1) + if (end == -1) { end = bbcode.length(); + } String url = bbcode.substr(brk_end + 1, end - brk_end - 1); xml_output.append("<a href=\""); xml_output.append(url); @@ -603,8 +615,9 @@ String BindingsGenerator::bbcode_to_xml(const String &p_bbcode, const TypeInterf tag_stack.push_front("url"); } else if (tag == "img") { int end = bbcode.find("[", brk_end); - if (end == -1) + if (end == -1) { end = bbcode.length(); + } String image = bbcode.substr(brk_end + 1, end - brk_end - 1); // Not supported. Just append the bbcode. @@ -640,8 +653,9 @@ int BindingsGenerator::_determine_enum_prefix(const EnumInterface &p_ienum) { Vector<String> front_parts = front_iconstant.name.split("_", /* p_allow_empty: */ true); int candidate_len = front_parts.size() - 1; - if (candidate_len == 0) + if (candidate_len == 0) { return 0; + } for (const List<ConstantInterface>::Element *E = p_ienum.constants.front()->next(); E; E = E->next()) { const ConstantInterface &iconstant = E->get(); @@ -653,14 +667,16 @@ int BindingsGenerator::_determine_enum_prefix(const EnumInterface &p_ienum) { if (front_parts[i] != parts[i]) { // HARDCODED: Some Flag enums have the prefix 'FLAG_' for everything except 'FLAGS_DEFAULT' (same for 'METHOD_FLAG_' and'METHOD_FLAGS_DEFAULT'). bool hardcoded_exc = (i == candidate_len - 1 && ((front_parts[i] == "FLAGS" && parts[i] == "FLAG") || (front_parts[i] == "FLAG" && parts[i] == "FLAGS"))); - if (!hardcoded_exc) + if (!hardcoded_exc) { break; + } } } candidate_len = i; - if (candidate_len == 0) + if (candidate_len == 0) { return 0; + } } return candidate_len; @@ -677,22 +693,25 @@ void BindingsGenerator::_apply_prefix_to_enum_constants(BindingsGenerator::EnumI Vector<String> parts = constant_name.split("_", /* p_allow_empty: */ true); - if (parts.size() <= curr_prefix_length) + if (parts.size() <= curr_prefix_length) { continue; + } if (parts[curr_prefix_length][0] >= '0' && parts[curr_prefix_length][0] <= '9') { // The name of enum constants may begin with a numeric digit when strip from the enum prefix, // so we make the prefix for this constant one word shorter in those cases. for (curr_prefix_length = curr_prefix_length - 1; curr_prefix_length > 0; curr_prefix_length--) { - if (parts[curr_prefix_length][0] < '0' || parts[curr_prefix_length][0] > '9') + if (parts[curr_prefix_length][0] < '0' || parts[curr_prefix_length][0] > '9') { break; + } } } constant_name = ""; for (int i = curr_prefix_length; i < parts.size(); i++) { - if (i > curr_prefix_length) + if (i > curr_prefix_length) { constant_name += "_"; + } constant_name += parts[i]; } @@ -705,8 +724,9 @@ void BindingsGenerator::_generate_method_icalls(const TypeInterface &p_itype) { for (const List<MethodInterface>::Element *E = p_itype.methods.front(); E; E = E->next()) { const MethodInterface &imethod = E->get(); - if (imethod.is_virtual) + if (imethod.is_virtual) { continue; + } const TypeInterface *return_type = _get_type_or_placeholder(imethod.return_type); @@ -755,8 +775,9 @@ void BindingsGenerator::_generate_method_icalls(const TypeInterface &p_itype) { List<InternalCall>::Element *match = method_icalls.find(im_icall); if (match) { - if (p_itype.api_type != ClassDB::API_EDITOR) + if (p_itype.api_type != ClassDB::API_EDITOR) { match->get().editor_only = false; + } method_icalls_map.insert(&E->get(), &match->get()); } else { List<InternalCall>::Element *added = method_icalls.push_back(im_icall); @@ -801,8 +822,9 @@ void BindingsGenerator::_generate_global_constants(StringBuilder &p_output) { p_output.append(";"); } - if (!global_constants.empty()) + if (!global_constants.empty()) { p_output.append("\n"); + } p_output.append(INDENT1 CLOSE_BLOCK); // end of GD class @@ -864,8 +886,9 @@ void BindingsGenerator::_generate_global_constants(StringBuilder &p_output) { p_output.append(INDENT1 CLOSE_BLOCK); - if (enum_in_static_class) + if (enum_in_static_class) { p_output.append(INDENT1 CLOSE_BLOCK); + } } p_output.append(CLOSE_BLOCK); // end of namespace @@ -899,8 +922,9 @@ Error BindingsGenerator::generate_cs_core_project(const String &p_proj_dir) { _generate_global_constants(constants_source); String output_file = path::join(base_gen_dir, BINDINGS_GLOBAL_SCOPE_CLASS "_constants.cs"); Error save_err = _save_file(output_file, constants_source); - if (save_err != OK) + if (save_err != OK) { return save_err; + } compile_items.push_back(output_file); } @@ -908,17 +932,20 @@ Error BindingsGenerator::generate_cs_core_project(const String &p_proj_dir) { for (OrderedHashMap<StringName, TypeInterface>::Element E = obj_types.front(); E; E = E.next()) { const TypeInterface &itype = E.get(); - if (itype.api_type == ClassDB::API_EDITOR) + if (itype.api_type == ClassDB::API_EDITOR) { continue; + } String output_file = path::join(godot_objects_gen_dir, itype.proxy_name + ".cs"); Error err = _generate_cs_type(itype, output_file); - if (err == ERR_SKIP) + if (err == ERR_SKIP) { continue; + } - if (err != OK) + if (err != OK) { return err; + } compile_items.push_back(output_file); } @@ -949,10 +976,12 @@ Error BindingsGenerator::generate_cs_core_project(const String &p_proj_dir) { cs_icalls_content.append(m_icall.im_sig + ");\n"); \ } - for (const List<InternalCall>::Element *E = core_custom_icalls.front(); E; E = E->next()) + for (const List<InternalCall>::Element *E = core_custom_icalls.front(); E; E = E->next()) { ADD_INTERNAL_CALL(E->get()); - for (const List<InternalCall>::Element *E = method_icalls.front(); E; E = E->next()) + } + for (const List<InternalCall>::Element *E = method_icalls.front(); E; E = E->next()) { ADD_INTERNAL_CALL(E->get()); + } #undef ADD_INTERNAL_CALL @@ -961,8 +990,9 @@ Error BindingsGenerator::generate_cs_core_project(const String &p_proj_dir) { String internal_methods_file = path::join(base_gen_dir, BINDINGS_CLASS_NATIVECALLS ".cs"); Error err = _save_file(internal_methods_file, cs_icalls_content); - if (err != OK) + if (err != OK) { return err; + } compile_items.push_back(internal_methods_file); @@ -981,8 +1011,9 @@ Error BindingsGenerator::generate_cs_core_project(const String &p_proj_dir) { String includes_props_file = path::join(base_gen_dir, "GeneratedIncludes.props"); err = _save_file(includes_props_file, includes_props_content); - if (err != OK) + if (err != OK) { return err; + } return OK; } @@ -1010,17 +1041,20 @@ Error BindingsGenerator::generate_cs_editor_project(const String &p_proj_dir) { for (OrderedHashMap<StringName, TypeInterface>::Element E = obj_types.front(); E; E = E.next()) { const TypeInterface &itype = E.get(); - if (itype.api_type != ClassDB::API_EDITOR) + if (itype.api_type != ClassDB::API_EDITOR) { continue; + } String output_file = path::join(godot_objects_gen_dir, itype.proxy_name + ".cs"); Error err = _generate_cs_type(itype, output_file); - if (err == ERR_SKIP) + if (err == ERR_SKIP) { continue; + } - if (err != OK) + if (err != OK) { return err; + } compile_items.push_back(output_file); } @@ -1050,10 +1084,12 @@ Error BindingsGenerator::generate_cs_editor_project(const String &p_proj_dir) { cs_icalls_content.append(m_icall.im_sig + ");\n"); \ } - for (const List<InternalCall>::Element *E = editor_custom_icalls.front(); E; E = E->next()) + for (const List<InternalCall>::Element *E = editor_custom_icalls.front(); E; E = E->next()) { ADD_INTERNAL_CALL(E->get()); - for (const List<InternalCall>::Element *E = method_icalls.front(); E; E = E->next()) + } + for (const List<InternalCall>::Element *E = method_icalls.front(); E; E = E->next()) { ADD_INTERNAL_CALL(E->get()); + } #undef ADD_INTERNAL_CALL @@ -1062,8 +1098,9 @@ Error BindingsGenerator::generate_cs_editor_project(const String &p_proj_dir) { String internal_methods_file = path::join(base_gen_dir, BINDINGS_CLASS_NATIVECALLS_EDITOR ".cs"); Error err = _save_file(internal_methods_file, cs_icalls_content); - if (err != OK) + if (err != OK) { return err; + } compile_items.push_back(internal_methods_file); @@ -1082,8 +1119,9 @@ Error BindingsGenerator::generate_cs_editor_project(const String &p_proj_dir) { String includes_props_file = path::join(base_gen_dir, "GeneratedIncludes.props"); err = _save_file(includes_props_file, includes_props_content); - if (err != OK) + if (err != OK) { return err; + } return OK; } @@ -1210,92 +1248,89 @@ Error BindingsGenerator::_generate_cs_type(const TypeInterface &itype, const Str output.append(INDENT1 "{"); - if (class_doc) { - // Add constants - - for (const List<ConstantInterface>::Element *E = itype.constants.front(); E; E = E->next()) { - const ConstantInterface &iconstant = E->get(); + // Add constants - if (iconstant.const_doc && iconstant.const_doc->description.size()) { - String xml_summary = bbcode_to_xml(fix_doc_description(iconstant.const_doc->description), &itype); - Vector<String> summary_lines = xml_summary.length() ? xml_summary.split("\n") : Vector<String>(); + for (const List<ConstantInterface>::Element *E = itype.constants.front(); E; E = E->next()) { + const ConstantInterface &iconstant = E->get(); - if (summary_lines.size()) { - output.append(MEMBER_BEGIN "/// <summary>\n"); + if (iconstant.const_doc && iconstant.const_doc->description.size()) { + String xml_summary = bbcode_to_xml(fix_doc_description(iconstant.const_doc->description), &itype); + Vector<String> summary_lines = xml_summary.length() ? xml_summary.split("\n") : Vector<String>(); - for (int i = 0; i < summary_lines.size(); i++) { - output.append(INDENT2 "/// "); - output.append(summary_lines[i]); - output.append("\n"); - } + if (summary_lines.size()) { + output.append(MEMBER_BEGIN "/// <summary>\n"); - output.append(INDENT2 "/// </summary>"); + for (int i = 0; i < summary_lines.size(); i++) { + output.append(INDENT2 "/// "); + output.append(summary_lines[i]); + output.append("\n"); } - } - output.append(MEMBER_BEGIN "public const int "); - output.append(iconstant.proxy_name); - output.append(" = "); - output.append(itos(iconstant.value)); - output.append(";"); + output.append(INDENT2 "/// </summary>"); + } } - if (itype.constants.size()) - output.append("\n"); + output.append(MEMBER_BEGIN "public const int "); + output.append(iconstant.proxy_name); + output.append(" = "); + output.append(itos(iconstant.value)); + output.append(";"); + } - // Add enums + if (itype.constants.size()) { + output.append("\n"); + } - for (const List<EnumInterface>::Element *E = itype.enums.front(); E; E = E->next()) { - const EnumInterface &ienum = E->get(); + // Add enums - ERR_FAIL_COND_V(ienum.constants.empty(), ERR_BUG); + for (const List<EnumInterface>::Element *E = itype.enums.front(); E; E = E->next()) { + const EnumInterface &ienum = E->get(); - output.append(MEMBER_BEGIN "public enum "); - output.append(ienum.cname.operator String()); - output.append(MEMBER_BEGIN OPEN_BLOCK); + ERR_FAIL_COND_V(ienum.constants.empty(), ERR_BUG); - for (const List<ConstantInterface>::Element *F = ienum.constants.front(); F; F = F->next()) { - const ConstantInterface &iconstant = F->get(); + output.append(MEMBER_BEGIN "public enum "); + output.append(ienum.cname.operator String()); + output.append(MEMBER_BEGIN OPEN_BLOCK); - if (iconstant.const_doc && iconstant.const_doc->description.size()) { - String xml_summary = bbcode_to_xml(fix_doc_description(iconstant.const_doc->description), &itype); - Vector<String> summary_lines = xml_summary.length() ? xml_summary.split("\n") : Vector<String>(); + for (const List<ConstantInterface>::Element *F = ienum.constants.front(); F; F = F->next()) { + const ConstantInterface &iconstant = F->get(); - if (summary_lines.size()) { - output.append(INDENT3 "/// <summary>\n"); + if (iconstant.const_doc && iconstant.const_doc->description.size()) { + String xml_summary = bbcode_to_xml(fix_doc_description(iconstant.const_doc->description), &itype); + Vector<String> summary_lines = xml_summary.length() ? xml_summary.split("\n") : Vector<String>(); - for (int i = 0; i < summary_lines.size(); i++) { - output.append(INDENT3 "/// "); - output.append(summary_lines[i]); - output.append("\n"); - } + if (summary_lines.size()) { + output.append(INDENT3 "/// <summary>\n"); - output.append(INDENT3 "/// </summary>\n"); + for (int i = 0; i < summary_lines.size(); i++) { + output.append(INDENT3 "/// "); + output.append(summary_lines[i]); + output.append("\n"); } - } - output.append(INDENT3); - output.append(iconstant.proxy_name); - output.append(" = "); - output.append(itos(iconstant.value)); - output.append(F != ienum.constants.back() ? ",\n" : "\n"); + output.append(INDENT3 "/// </summary>\n"); + } } - output.append(INDENT2 CLOSE_BLOCK); + output.append(INDENT3); + output.append(iconstant.proxy_name); + output.append(" = "); + output.append(itos(iconstant.value)); + output.append(F != ienum.constants.back() ? ",\n" : "\n"); } - // Add properties - - for (const List<PropertyInterface>::Element *E = itype.properties.front(); E; E = E->next()) { - const PropertyInterface &iprop = E->get(); - Error prop_err = _generate_cs_property(itype, iprop, output); - ERR_FAIL_COND_V_MSG(prop_err != OK, prop_err, - "Failed to generate property '" + iprop.cname.operator String() + - "' for class '" + itype.name + "'."); - } + output.append(INDENT2 CLOSE_BLOCK); } - // TODO: BINDINGS_NATIVE_NAME_FIELD should be StringName, once we support it in C# + // Add properties + + for (const List<PropertyInterface>::Element *E = itype.properties.front(); E; E = E->next()) { + const PropertyInterface &iprop = E->get(); + Error prop_err = _generate_cs_property(itype, iprop, output); + ERR_FAIL_COND_V_MSG(prop_err != OK, prop_err, + "Failed to generate property '" + iprop.cname.operator String() + + "' for class '" + itype.name + "'."); + } if (itype.is_singleton) { // Add the type name and the singleton pointer as static fields @@ -1368,15 +1403,17 @@ Error BindingsGenerator::_generate_cs_type(const TypeInterface &itype, const Str if (itype.is_singleton) { InternalCall singleton_icall = InternalCall(itype.api_type, ICALL_PREFIX + itype.name + SINGLETON_ICALL_SUFFIX, "IntPtr"); - if (!find_icall_by_name(singleton_icall.name, custom_icalls)) + if (!find_icall_by_name(singleton_icall.name, custom_icalls)) { custom_icalls.push_back(singleton_icall); + } } if (is_derived_type && itype.is_instantiable) { InternalCall ctor_icall = InternalCall(itype.api_type, ctor_method, "IntPtr", itype.proxy_name + " obj"); - if (!find_icall_by_name(ctor_icall.name, custom_icalls)) + if (!find_icall_by_name(ctor_icall.name, custom_icalls)) { custom_icalls.push_back(ctor_icall); + } } output.append(INDENT1 CLOSE_BLOCK /* class */ @@ -1442,6 +1479,9 @@ Error BindingsGenerator::_generate_cs_property(const BindingsGenerator::TypeInte const TypeInterface *prop_itype = _get_type_or_null(proptype_name); ERR_FAIL_NULL_V(prop_itype, ERR_BUG); // Property type not found + ERR_FAIL_COND_V_MSG(prop_itype->is_singleton, ERR_BUG, + "Property type is a singleton: '" + p_itype.name + "." + String(p_iprop.cname) + "'."); + if (p_iprop.prop_doc && p_iprop.prop_doc->description.size()) { String xml_summary = bbcode_to_xml(fix_doc_description(p_iprop.prop_doc->description), &p_itype); Vector<String> summary_lines = xml_summary.length() ? xml_summary.split("\n") : Vector<String>(); @@ -1461,8 +1501,9 @@ Error BindingsGenerator::_generate_cs_property(const BindingsGenerator::TypeInte p_output.append(MEMBER_BEGIN "public "); - if (p_itype.is_singleton) + if (p_itype.is_singleton) { p_output.append("static "); + } p_output.append(prop_itype->cs_type); p_output.append(" "); @@ -1534,6 +1575,9 @@ Error BindingsGenerator::_generate_cs_property(const BindingsGenerator::TypeInte Error BindingsGenerator::_generate_cs_method(const BindingsGenerator::TypeInterface &p_itype, const BindingsGenerator::MethodInterface &p_imethod, int &p_method_bind_count, StringBuilder &p_output) { const TypeInterface *return_type = _get_type_or_placeholder(p_imethod.return_type); + ERR_FAIL_COND_V_MSG(return_type->is_singleton, ERR_BUG, + "Method return type is a singleton: '" + p_itype.name + "." + p_imethod.name + "'."); + String method_bind_field = "__method_bind_" + itos(p_method_bind_count); String arguments_sig; @@ -1549,29 +1593,41 @@ Error BindingsGenerator::_generate_cs_method(const BindingsGenerator::TypeInterf const ArgumentInterface &iarg = F->get(); const TypeInterface *arg_type = _get_type_or_placeholder(iarg.type); + ERR_FAIL_COND_V_MSG(arg_type->is_singleton, ERR_BUG, + "Argument type is a singleton: '" + iarg.name + "' of method '" + p_itype.name + "." + p_imethod.name + "'."); + + if (iarg.default_argument.size()) { + CRASH_COND_MSG(!_arg_default_value_is_assignable_to_type(iarg.def_param_value, *arg_type), + "Invalid default value for parameter '" + iarg.name + "' of method '" + p_itype.name + "." + p_imethod.name + "'."); + } + // Add the current arguments to the signature // If the argument has a default value which is not a constant, we will make it Nullable { - if (F != p_imethod.arguments.front()) + if (F != p_imethod.arguments.front()) { arguments_sig += ", "; + } - if (iarg.def_param_mode == ArgumentInterface::NULLABLE_VAL) + if (iarg.def_param_mode == ArgumentInterface::NULLABLE_VAL) { arguments_sig += "Nullable<"; + } arguments_sig += arg_type->cs_type; - if (iarg.def_param_mode == ArgumentInterface::NULLABLE_VAL) + if (iarg.def_param_mode == ArgumentInterface::NULLABLE_VAL) { arguments_sig += "> "; - else + } else { arguments_sig += " "; + } arguments_sig += iarg.name; if (iarg.default_argument.size()) { - if (iarg.def_param_mode != ArgumentInterface::CONSTANT) + if (iarg.def_param_mode != ArgumentInterface::CONSTANT) { arguments_sig += " = null"; - else + } else { arguments_sig += " = " + sformat(iarg.default_argument, arg_type->cs_type); + } } } @@ -1589,17 +1645,19 @@ Error BindingsGenerator::_generate_cs_method(const BindingsGenerator::TypeInterf cs_in_statements += " = "; cs_in_statements += iarg.name; - if (iarg.def_param_mode == ArgumentInterface::NULLABLE_VAL) + if (iarg.def_param_mode == ArgumentInterface::NULLABLE_VAL) { cs_in_statements += ".HasValue ? "; - else + } else { cs_in_statements += " != null ? "; + } cs_in_statements += iarg.name; - if (iarg.def_param_mode == ArgumentInterface::NULLABLE_VAL) + if (iarg.def_param_mode == ArgumentInterface::NULLABLE_VAL) { cs_in_statements += ".Value : "; - else + } else { cs_in_statements += " : "; + } String def_arg = sformat(iarg.default_argument, arg_type->cs_type); @@ -1659,8 +1717,9 @@ Error BindingsGenerator::_generate_cs_method(const BindingsGenerator::TypeInterf } if (p_imethod.is_deprecated) { - if (p_imethod.deprecation_message.empty()) + if (p_imethod.deprecation_message.empty()) { WARN_PRINT("An empty deprecation message is discouraged. Method: '" + p_imethod.proxy_name + "'."); + } p_output.append(MEMBER_BEGIN "[Obsolete(\""); p_output.append(p_imethod.deprecation_message); @@ -1720,8 +1779,9 @@ Error BindingsGenerator::_generate_cs_method(const BindingsGenerator::TypeInterf im_call += "."; im_call += im_icall->name; - if (p_imethod.arguments.size()) + if (p_imethod.arguments.size()) { p_output.append(cs_in_statements); + } if (return_type->cname == name_cache.type_void) { p_output.append(im_call + "(" + icall_params + ");\n"); @@ -1748,10 +1808,14 @@ Error BindingsGenerator::_generate_cs_signal(const BindingsGenerator::TypeInterf const ArgumentInterface &iarg = F->get(); const TypeInterface *arg_type = _get_type_or_placeholder(iarg.type); + ERR_FAIL_COND_V_MSG(arg_type->is_singleton, ERR_BUG, + "Argument type is a singleton: '" + iarg.name + "' of signal" + p_itype.name + "." + p_isignal.name + "'."); + // Add the current arguments to the signature - if (F != p_isignal.arguments.front()) + if (F != p_isignal.arguments.front()) { arguments_sig += ", "; + } arguments_sig += arg_type->cs_type; arguments_sig += " "; @@ -1778,8 +1842,9 @@ Error BindingsGenerator::_generate_cs_signal(const BindingsGenerator::TypeInterf } if (p_isignal.is_deprecated) { - if (p_isignal.deprecation_message.empty()) + if (p_isignal.deprecation_message.empty()) { WARN_PRINT("An empty deprecation message is discouraged. Signal: '" + p_isignal.proxy_name + "'."); + } p_output.append(MEMBER_BEGIN "[Obsolete(\""); p_output.append(p_isignal.deprecation_message); @@ -1810,8 +1875,9 @@ Error BindingsGenerator::_generate_cs_signal(const BindingsGenerator::TypeInterf // Generate event p_output.append(MEMBER_BEGIN "[Signal]" MEMBER_BEGIN "public "); - if (p_itype.is_singleton) + if (p_itype.is_singleton) { p_output.append("static "); + } p_output.append("event "); p_output.append(delegate_name); @@ -1819,18 +1885,20 @@ Error BindingsGenerator::_generate_cs_signal(const BindingsGenerator::TypeInterf p_output.append(p_isignal.proxy_name); p_output.append("\n" OPEN_BLOCK_L2); - if (p_itype.is_singleton) + if (p_itype.is_singleton) { p_output.append("add => Singleton.Connect(__signal_name_"); - else + } else { p_output.append("add => Connect(__signal_name_"); + } p_output.append(p_isignal.name); p_output.append(", new Callable(value));\n"); - if (p_itype.is_singleton) + if (p_itype.is_singleton) { p_output.append(INDENT3 "remove => Singleton.Disconnect(__signal_name_"); - else + } else { p_output.append(INDENT3 "remove => Disconnect(__signal_name_"); + } p_output.append(p_isignal.name); p_output.append(", new Callable(value));\n"); @@ -1864,7 +1932,6 @@ Error BindingsGenerator::generate_glue(const String &p_output_dir) { CRASH_COND(itype.cname != name_cache.type_Object); CRASH_COND(!itype.is_instantiable); CRASH_COND(itype.api_type != ClassDB::API_CORE); - CRASH_COND(itype.is_reference); CRASH_COND(itype.is_singleton); } @@ -1885,8 +1952,9 @@ Error BindingsGenerator::generate_glue(const String &p_output_dir) { String singleton_icall_name = ICALL_PREFIX + itype.name + SINGLETON_ICALL_SUFFIX; InternalCall singleton_icall = InternalCall(itype.api_type, singleton_icall_name, "IntPtr"); - if (!find_icall_by_name(singleton_icall.name, custom_icalls)) + if (!find_icall_by_name(singleton_icall.name, custom_icalls)) { custom_icalls.push_back(singleton_icall); + } output.append("Object* "); output.append(singleton_icall_name); @@ -1898,8 +1966,9 @@ Error BindingsGenerator::generate_glue(const String &p_output_dir) { if (is_derived_type && itype.is_instantiable) { InternalCall ctor_icall = InternalCall(itype.api_type, ctor_method, "IntPtr", itype.proxy_name + " obj"); - if (!find_icall_by_name(ctor_icall.name, custom_icalls)) + if (!find_icall_by_name(ctor_icall.name, custom_icalls)) { custom_icalls.push_back(ctor_icall); + } output.append("Object* "); output.append(ctor_method); @@ -1998,8 +2067,9 @@ Error BindingsGenerator::generate_glue(const String &p_output_dir) { output.append("\n#endif // MONO_GLUE_ENABLED\n"); Error save_err = _save_file(path::join(p_output_dir, "mono_glue.gen.cpp"), output); - if (save_err != OK) + if (save_err != OK) { return save_err; + } OS::get_singleton()->print("Mono glue generated successfully\n"); @@ -2022,8 +2092,9 @@ Error BindingsGenerator::_save_file(const String &p_path, const StringBuilder &p } Error BindingsGenerator::_generate_glue_method(const BindingsGenerator::TypeInterface &p_itype, const BindingsGenerator::MethodInterface &p_imethod, StringBuilder &p_output) { - if (p_imethod.is_virtual) + if (p_imethod.is_virtual) { return OK; // Ignore + } bool ret_void = p_imethod.return_type.cname == name_cache.type_void; @@ -2051,10 +2122,12 @@ Error BindingsGenerator::_generate_glue_method(const BindingsGenerator::TypeInte c_in_statements += sformat(", &%s_in);\n", c_param_name); } } else { - if (i > 0) + if (i > 0) { c_args_var_content += ", "; - if (arg_type->c_in.size()) + } + if (arg_type->c_in.size()) { c_in_statements += sformat(arg_type->c_in, arg_type->c_type, c_param_name); + } c_args_var_content += sformat(arg_type->c_arg_in, c_param_name); } @@ -2084,8 +2157,9 @@ Error BindingsGenerator::_generate_glue_method(const BindingsGenerator::TypeInte if (!generated_icall_funcs.find(im_icall)) { generated_icall_funcs.push_back(im_icall); - if (im_icall->editor_only) + if (im_icall->editor_only) { p_output.append("#ifdef TOOLS_ENABLED\n"); + } // Generate icall function @@ -2203,8 +2277,9 @@ Error BindingsGenerator::_generate_glue_method(const BindingsGenerator::TypeInte p_output.append(CLOSE_BLOCK "\n"); - if (im_icall->editor_only) + if (im_icall->editor_only) { p_output.append("#endif // TOOLS_ENABLED\n"); + } } return OK; @@ -2213,19 +2288,22 @@ Error BindingsGenerator::_generate_glue_method(const BindingsGenerator::TypeInte const BindingsGenerator::TypeInterface *BindingsGenerator::_get_type_or_null(const TypeReference &p_typeref) { const Map<StringName, TypeInterface>::Element *builtin_type_match = builtin_types.find(p_typeref.cname); - if (builtin_type_match) + if (builtin_type_match) { return &builtin_type_match->get(); + } const OrderedHashMap<StringName, TypeInterface>::Element obj_type_match = obj_types.find(p_typeref.cname); - if (obj_type_match) + if (obj_type_match) { return &obj_type_match.get(); + } if (p_typeref.is_enum) { const Map<StringName, TypeInterface>::Element *enum_match = enum_types.find(p_typeref.cname); - if (enum_match) + if (enum_match) { return &enum_match->get(); + } // Enum not found. Most likely because none of its constants were bound, so it's empty. That's fine. Use int instead. const Map<StringName, TypeInterface>::Element *int_match = builtin_types.find(name_cache.type_int); @@ -2239,15 +2317,17 @@ const BindingsGenerator::TypeInterface *BindingsGenerator::_get_type_or_null(con const BindingsGenerator::TypeInterface *BindingsGenerator::_get_type_or_placeholder(const TypeReference &p_typeref) { const TypeInterface *found = _get_type_or_null(p_typeref); - if (found) + if (found) { return found; + } ERR_PRINT(String() + "Type not found. Creating placeholder: '" + p_typeref.cname.operator String() + "'."); const Map<StringName, TypeInterface>::Element *match = placeholder_types.find(p_typeref.cname); - if (match) + if (match) { return &match->get(); + } TypeInterface placeholder; TypeInterface::create_placeholder_type(placeholder, p_typeref.cname); @@ -2305,6 +2385,84 @@ StringName BindingsGenerator::_get_float_type_name_from_meta(GodotTypeInfo::Meta } } +bool BindingsGenerator::_arg_default_value_is_assignable_to_type(const Variant &p_val, const TypeInterface &p_arg_type) { + if (p_arg_type.name == name_cache.type_Variant) { + // Variant can take anything + return true; + } + + switch (p_val.get_type()) { + case Variant::NIL: + return p_arg_type.is_object_type || + name_cache.is_nullable_type(p_arg_type.name); + case Variant::BOOL: + return p_arg_type.name == name_cache.type_bool; + case Variant::INT: + return p_arg_type.name == name_cache.type_sbyte || + p_arg_type.name == name_cache.type_short || + p_arg_type.name == name_cache.type_int || + p_arg_type.name == name_cache.type_byte || + p_arg_type.name == name_cache.type_ushort || + p_arg_type.name == name_cache.type_uint || + p_arg_type.name == name_cache.type_long || + p_arg_type.name == name_cache.type_ulong || + p_arg_type.name == name_cache.type_float || + p_arg_type.name == name_cache.type_double || + p_arg_type.is_enum; + case Variant::FLOAT: + return p_arg_type.name == name_cache.type_float || + p_arg_type.name == name_cache.type_double; + case Variant::STRING: + case Variant::STRING_NAME: + return p_arg_type.name == name_cache.type_String || + p_arg_type.name == name_cache.type_StringName || + p_arg_type.name == name_cache.type_NodePath; + case Variant::NODE_PATH: + return p_arg_type.name == name_cache.type_NodePath; + case Variant::TRANSFORM: + case Variant::TRANSFORM2D: + case Variant::BASIS: + case Variant::QUAT: + case Variant::PLANE: + case Variant::AABB: + case Variant::COLOR: + case Variant::VECTOR2: + case Variant::RECT2: + case Variant::VECTOR3: + case Variant::_RID: + case Variant::ARRAY: + case Variant::DICTIONARY: + case Variant::PACKED_BYTE_ARRAY: + case Variant::PACKED_INT32_ARRAY: + case Variant::PACKED_INT64_ARRAY: + case Variant::PACKED_FLOAT32_ARRAY: + case Variant::PACKED_FLOAT64_ARRAY: + case Variant::PACKED_STRING_ARRAY: + case Variant::PACKED_VECTOR2_ARRAY: + case Variant::PACKED_VECTOR3_ARRAY: + case Variant::PACKED_COLOR_ARRAY: + case Variant::CALLABLE: + case Variant::SIGNAL: + return p_arg_type.name == Variant::get_type_name(p_val.get_type()); + case Variant::OBJECT: + return p_arg_type.is_object_type; + case Variant::VECTOR2I: + return p_arg_type.name == name_cache.type_Vector2 || + p_arg_type.name == Variant::get_type_name(p_val.get_type()); + case Variant::RECT2I: + return p_arg_type.name == name_cache.type_Rect2 || + p_arg_type.name == Variant::get_type_name(p_val.get_type()); + case Variant::VECTOR3I: + return p_arg_type.name == name_cache.type_Vector3 || + p_arg_type.name == Variant::get_type_name(p_val.get_type()); + default: + CRASH_NOW_MSG("Unexpected Variant type: " + itos(p_val.get_type())); + break; + } + + return false; +} + bool BindingsGenerator::_populate_object_type_interfaces() { obj_types.clear(); @@ -2367,8 +2525,9 @@ bool BindingsGenerator::_populate_object_type_interfaces() { for (const List<PropertyInfo>::Element *E = property_list.front(); E; E = E->next()) { const PropertyInfo &property = E->get(); - if (property.usage & PROPERTY_USAGE_GROUP || property.usage & PROPERTY_USAGE_SUBGROUP || property.usage & PROPERTY_USAGE_CATEGORY) + if (property.usage & PROPERTY_USAGE_GROUP || property.usage & PROPERTY_USAGE_SUBGROUP || property.usage & PROPERTY_USAGE_CATEGORY) { continue; + } if (property.name.find("/") >= 0) { // Ignore properties with '/' (slash) in the name. These are only meant for use in the inspector. @@ -2380,10 +2539,12 @@ bool BindingsGenerator::_populate_object_type_interfaces() { iprop.setter = ClassDB::get_property_setter(type_cname, iprop.cname); iprop.getter = ClassDB::get_property_getter(type_cname, iprop.cname); - if (iprop.setter != StringName()) + if (iprop.setter != StringName()) { accessor_methods[iprop.setter] = iprop.cname; - if (iprop.getter != StringName()) + } + if (iprop.getter != StringName()) { accessor_methods[iprop.getter] = iprop.cname; + } bool valid = false; iprop.index = ClassDB::get_property_index(type_cname, iprop.cname, &valid); @@ -2427,20 +2588,23 @@ bool BindingsGenerator::_populate_object_type_interfaces() { int argc = method_info.arguments.size(); - if (method_info.name.empty()) + if (method_info.name.empty()) { continue; + } String cname = method_info.name; - if (blacklisted_methods.find(itype.cname) && blacklisted_methods[itype.cname].find(cname)) + if (blacklisted_methods.find(itype.cname) && blacklisted_methods[itype.cname].find(cname)) { continue; + } MethodInterface imethod; imethod.name = method_info.name; imethod.cname = cname; - if (method_info.flags & METHOD_FLAG_VIRTUAL) + if (method_info.flags & METHOD_FLAG_VIRTUAL) { imethod.is_virtual = true; + } PropertyInfo return_info = method_info.return_val; @@ -2462,9 +2626,8 @@ bool BindingsGenerator::_populate_object_type_interfaces() { // We assume the return type is void. imethod.return_type.cname = name_cache.type_void; - // Actually, more methods like this may be added in the future, - // which could actually will return something different. - // Let's put this to notify us if that ever happens. + // Actually, more methods like this may be added in the future, which could return + // something different. Let's put this check to notify us if that ever happens. if (itype.cname != name_cache.type_Object || imethod.name != "free") { WARN_PRINT("Notification: New unexpected virtual non-overridable method found." " We only expected Object.free, but found '" + @@ -2475,13 +2638,12 @@ bool BindingsGenerator::_populate_object_type_interfaces() { imethod.return_type.is_enum = true; } else if (return_info.class_name != StringName()) { imethod.return_type.cname = return_info.class_name; - if (!imethod.is_virtual && ClassDB::is_parent_class(return_info.class_name, name_cache.type_Reference) && return_info.hint != PROPERTY_HINT_RESOURCE_TYPE) { - /* clang-format off */ - ERR_PRINT("Return type is reference but hint is not '" _STR(PROPERTY_HINT_RESOURCE_TYPE) "'." - " Are you returning a reference type by pointer? Method: '" + itype.name + "." + imethod.name + "'."); - /* clang-format on */ - ERR_FAIL_V(false); - } + + bool bad_reference_hint = !imethod.is_virtual && return_info.hint != PROPERTY_HINT_RESOURCE_TYPE && + ClassDB::is_parent_class(return_info.class_name, name_cache.type_Reference); + ERR_FAIL_COND_V_MSG(bad_reference_hint, false, + String() + "Return type is reference but hint is not '" _STR(PROPERTY_HINT_RESOURCE_TYPE) "'." + + " Are you returning a reference type by pointer? Method: '" + itype.name + "." + imethod.name + "'."); } else if (return_info.hint == PROPERTY_HINT_RESOURCE_TYPE) { imethod.return_type.cname = return_info.hint_string; } else if (return_info.type == Variant::NIL && return_info.usage & PROPERTY_USAGE_NIL_IS_VARIANT) { @@ -2572,6 +2734,10 @@ bool BindingsGenerator::_populate_object_type_interfaces() { } } + ERR_FAIL_COND_V_MSG(itype.find_property_by_name(imethod.cname), false, + "Method name conflicts with property: '" + itype.name + "." + imethod.name + "'."); + + // Classes starting with an underscore are ignored unless they're used as a property setter or getter if (!imethod.is_virtual && imethod.name[0] == '_') { for (const List<PropertyInterface>::Element *F = itype.properties.front(); F; F = F->next()) { const PropertyInterface &iprop = F->get(); @@ -2751,7 +2917,8 @@ bool BindingsGenerator::_populate_object_type_interfaces() { } bool BindingsGenerator::_arg_default_value_from_variant(const Variant &p_val, ArgumentInterface &r_iarg) { - r_iarg.default_argument = p_val; + r_iarg.def_param_value = p_val; + r_iarg.default_argument = p_val.operator String(); switch (p_val.get_type()) { case Variant::NIL: @@ -2784,8 +2951,9 @@ bool BindingsGenerator::_arg_default_value_from_variant(const Variant &p_val, Ar } break; case Variant::TRANSFORM: - if (p_val.operator Transform() == Transform()) + if (p_val.operator Transform() == Transform()) { r_iarg.default_argument.clear(); + } r_iarg.default_argument = "new %s(" + r_iarg.default_argument + ")"; r_iarg.def_param_mode = ArgumentInterface::NULLABLE_VAL; break; @@ -2851,8 +3019,9 @@ bool BindingsGenerator::_arg_default_value_from_variant(const Variant &p_val, Ar break; } - if (r_iarg.def_param_mode == ArgumentInterface::CONSTANT && r_iarg.type.cname == name_cache.type_Variant && r_iarg.default_argument != "null") + if (r_iarg.def_param_mode == ArgumentInterface::CONSTANT && r_iarg.type.cname == name_cache.type_Variant && r_iarg.default_argument != "null") { r_iarg.def_param_mode = ArgumentInterface::NULLABLE_REF; + } return true; } @@ -3357,8 +3526,9 @@ void BindingsGenerator::_initialize() { core_custom_icalls.clear(); editor_custom_icalls.clear(); - for (OrderedHashMap<StringName, TypeInterface>::Element E = obj_types.front(); E; E = E.next()) + for (OrderedHashMap<StringName, TypeInterface>::Element E = obj_types.front(); E; E = E.next()) { _generate_method_icalls(E.get()); + } initialized = true; } @@ -3426,21 +3596,25 @@ void BindingsGenerator::handle_cmdline_args(const List<String> &p_cmdline_args) } if (glue_dir_path.length()) { - if (bindings_generator.generate_glue(glue_dir_path) != OK) + if (bindings_generator.generate_glue(glue_dir_path) != OK) { ERR_PRINT(generate_all_glue_option + ": Failed to generate the C++ glue."); + } - if (bindings_generator.generate_cs_api(glue_dir_path.plus_file(API_SOLUTION_NAME)) != OK) + if (bindings_generator.generate_cs_api(glue_dir_path.plus_file(API_SOLUTION_NAME)) != OK) { ERR_PRINT(generate_all_glue_option + ": Failed to generate the C# API."); + } } if (cs_dir_path.length()) { - if (bindings_generator.generate_cs_api(cs_dir_path) != OK) + if (bindings_generator.generate_cs_api(cs_dir_path) != OK) { ERR_PRINT(generate_cs_glue_option + ": Failed to generate the C# API."); + } } if (cpp_dir_path.length()) { - if (bindings_generator.generate_glue(cpp_dir_path) != OK) + if (bindings_generator.generate_glue(cpp_dir_path) != OK) { ERR_PRINT(generate_cpp_glue_option + ": Failed to generate the C++ glue."); + } } // Exit once done diff --git a/modules/mono/editor/bindings_generator.h b/modules/mono/editor/bindings_generator.h index aad109e03c..90c1c9f3ee 100644 --- a/modules/mono/editor/bindings_generator.h +++ b/modules/mono/editor/bindings_generator.h @@ -102,6 +102,8 @@ class BindingsGenerator { TypeReference type; String name; + + Variant def_param_value; DefaultParamMode def_param_mode = CONSTANT; /** @@ -355,8 +357,9 @@ class BindingsGenerator { const MethodInterface *find_method_by_name(const StringName &p_cname) const { for (const List<MethodInterface>::Element *E = methods.front(); E; E = E->next()) { - if (E->get().cname == p_cname) + if (E->get().cname == p_cname) { return &E->get(); + } } return nullptr; @@ -364,8 +367,9 @@ class BindingsGenerator { const PropertyInterface *find_property_by_name(const StringName &p_cname) const { for (const List<PropertyInterface>::Element *E = properties.front(); E; E = E->next()) { - if (E->get().cname == p_cname) + if (E->get().cname == p_cname) { return &E->get(); + } } return nullptr; @@ -373,8 +377,9 @@ class BindingsGenerator { const PropertyInterface *find_property_by_proxy_name(const String &p_proxy_name) const { for (const List<PropertyInterface>::Element *E = properties.front(); E; E = E->next()) { - if (E->get().proxy_name == p_proxy_name) + if (E->get().proxy_name == p_proxy_name) { return &E->get(); + } } return nullptr; @@ -382,8 +387,9 @@ class BindingsGenerator { const MethodInterface *find_method_by_proxy_name(const String &p_proxy_name) const { for (const List<MethodInterface>::Element *E = methods.front(); E; E = E->next()) { - if (E->get().proxy_name == p_proxy_name) + if (E->get().proxy_name == p_proxy_name) { return &E->get(); + } } return nullptr; @@ -523,58 +529,70 @@ class BindingsGenerator { void _initialize_blacklisted_methods(); struct NameCache { - StringName type_void; - StringName type_Array; - StringName type_Dictionary; - StringName type_Variant; - StringName type_VarArg; - StringName type_Object; - StringName type_Reference; - StringName type_RID; - StringName type_String; - StringName type_StringName; - StringName type_NodePath; - StringName type_at_GlobalScope; - StringName enum_Error; - - StringName type_sbyte; - StringName type_short; - StringName type_int; - StringName type_long; - StringName type_byte; - StringName type_ushort; - StringName type_uint; - StringName type_ulong; - StringName type_float; - StringName type_double; - - NameCache() { - type_void = StaticCString::create("void"); - type_Array = StaticCString::create("Array"); - type_Dictionary = StaticCString::create("Dictionary"); - type_Variant = StaticCString::create("Variant"); - type_VarArg = StaticCString::create("VarArg"); - type_Object = StaticCString::create("Object"); - type_Reference = StaticCString::create("Reference"); - type_RID = StaticCString::create("RID"); - type_String = StaticCString::create("String"); - type_StringName = StaticCString::create("StringName"); - type_NodePath = StaticCString::create("NodePath"); - type_at_GlobalScope = StaticCString::create("@GlobalScope"); - enum_Error = StaticCString::create("Error"); - - type_sbyte = StaticCString::create("sbyte"); - type_short = StaticCString::create("short"); - type_int = StaticCString::create("int"); - type_long = StaticCString::create("long"); - type_byte = StaticCString::create("byte"); - type_ushort = StaticCString::create("ushort"); - type_uint = StaticCString::create("uint"); - type_ulong = StaticCString::create("ulong"); - type_float = StaticCString::create("float"); - type_double = StaticCString::create("double"); + StringName type_void = StaticCString::create("void"); + StringName type_Variant = StaticCString::create("Variant"); + StringName type_VarArg = StaticCString::create("VarArg"); + StringName type_Object = StaticCString::create("Object"); + StringName type_Reference = StaticCString::create("Reference"); + StringName type_RID = StaticCString::create("RID"); + StringName type_String = StaticCString::create("String"); + StringName type_StringName = StaticCString::create("StringName"); + StringName type_NodePath = StaticCString::create("NodePath"); + StringName type_at_GlobalScope = StaticCString::create("@GlobalScope"); + StringName enum_Error = StaticCString::create("Error"); + + StringName type_sbyte = StaticCString::create("sbyte"); + StringName type_short = StaticCString::create("short"); + StringName type_int = StaticCString::create("int"); + StringName type_byte = StaticCString::create("byte"); + StringName type_ushort = StaticCString::create("ushort"); + StringName type_uint = StaticCString::create("uint"); + StringName type_long = StaticCString::create("long"); + StringName type_ulong = StaticCString::create("ulong"); + + StringName type_bool = StaticCString::create("bool"); + StringName type_float = StaticCString::create("float"); + StringName type_double = StaticCString::create("double"); + + StringName type_Vector2 = StaticCString::create("Vector2"); + StringName type_Rect2 = StaticCString::create("Rect2"); + StringName type_Vector3 = StaticCString::create("Vector3"); + + // Object not included as it must be checked for all derived classes + static constexpr int nullable_types_count = 17; + StringName nullable_types[nullable_types_count] = { + type_String, + type_StringName, + type_NodePath, + + StaticCString::create(_STR(Array)), + StaticCString::create(_STR(Dictionary)), + StaticCString::create(_STR(Callable)), + StaticCString::create(_STR(Signal)), + + StaticCString::create(_STR(PackedByteArray)), + StaticCString::create(_STR(PackedInt32Array)), + StaticCString::create(_STR(PackedInt64rray)), + StaticCString::create(_STR(PackedFloat32Array)), + StaticCString::create(_STR(PackedFloat64Array)), + StaticCString::create(_STR(PackedStringArray)), + StaticCString::create(_STR(PackedVector2Array)), + StaticCString::create(_STR(PackedVector3Array)), + StaticCString::create(_STR(PackedColorArray)), + }; + + bool is_nullable_type(const StringName &p_type) const { + for (int i = 0; i < nullable_types_count; i++) { + if (p_type == nullable_types[i]) { + return true; + } + } + + return false; } + NameCache() {} + private: NameCache(const NameCache &); NameCache &operator=(const NameCache &); @@ -585,8 +603,9 @@ class BindingsGenerator { const List<InternalCall>::Element *find_icall_by_name(const String &p_name, const List<InternalCall> &p_list) { const List<InternalCall>::Element *it = p_list.front(); while (it) { - if (it->get().name == p_name) + if (it->get().name == p_name) { return it; + } it = it->next(); } return nullptr; @@ -594,20 +613,22 @@ class BindingsGenerator { const ConstantInterface *find_constant_by_name(const String &p_name, const List<ConstantInterface> &p_constants) const { for (const List<ConstantInterface>::Element *E = p_constants.front(); E; E = E->next()) { - if (E->get().name == p_name) + if (E->get().name == p_name) { return &E->get(); + } } return nullptr; } inline String get_unique_sig(const TypeInterface &p_type) { - if (p_type.is_reference) + if (p_type.is_reference) { return "Ref"; - else if (p_type.is_object_type) + } else if (p_type.is_object_type) { return "Obj"; - else if (p_type.is_enum) + } else if (p_type.is_enum) { return "int"; + } return p_type.name; } @@ -626,6 +647,7 @@ class BindingsGenerator { StringName _get_float_type_name_from_meta(GodotTypeInfo::Metadata p_meta); bool _arg_default_value_from_variant(const Variant &p_val, ArgumentInterface &r_iarg); + bool _arg_default_value_is_assignable_to_type(const Variant &p_val, const TypeInterface &p_arg_type); bool _populate_object_type_interfaces(); void _populate_builtin_type_interfaces(); diff --git a/modules/mono/glue/GodotSharp/GodotSharp/Core/Extensions/SceneTreeExtensions.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Extensions/SceneTreeExtensions.cs new file mode 100644 index 0000000000..20b11a48dd --- /dev/null +++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/Extensions/SceneTreeExtensions.cs @@ -0,0 +1,17 @@ +using System; +using System.Runtime.CompilerServices; +using Godot.Collections; + +namespace Godot +{ + public partial class SceneTree + { + public Array<T> GetNodesInGroup<T>(StringName group) where T : class + { + return new Array<T>(godot_icall_SceneTree_get_nodes_in_group_Generic(Object.GetPtr(this), StringName.GetPtr(group), typeof(T))); + } + + [MethodImpl(MethodImplOptions.InternalCall)] + internal extern static IntPtr godot_icall_SceneTree_get_nodes_in_group_Generic(IntPtr obj, IntPtr group, Type elemType); + } +} diff --git a/modules/mono/glue/GodotSharp/GodotSharp/GodotSharp.csproj b/modules/mono/glue/GodotSharp/GodotSharp/GodotSharp.csproj index b5ac124c9a..06ec2483c8 100644 --- a/modules/mono/glue/GodotSharp/GodotSharp/GodotSharp.csproj +++ b/modules/mono/glue/GodotSharp/GodotSharp/GodotSharp.csproj @@ -53,6 +53,7 @@ <Compile Include="Core\Extensions\NodeExtensions.cs" /> <Compile Include="Core\Extensions\ObjectExtensions.cs" /> <Compile Include="Core\Extensions\ResourceLoaderExtensions.cs" /> + <Compile Include="Core\Extensions\SceneTreeExtensions.cs" /> <Compile Include="Core\GD.cs" /> <Compile Include="Core\GodotSynchronizationContext.cs" /> <Compile Include="Core\GodotTaskScheduler.cs" /> diff --git a/modules/mono/glue/glue_header.h b/modules/mono/glue/glue_header.h index ee99a300b9..f6999d01fb 100644 --- a/modules/mono/glue/glue_header.h +++ b/modules/mono/glue/glue_header.h @@ -35,6 +35,7 @@ #include "gd_glue.h" #include "nodepath_glue.h" #include "rid_glue.h" +#include "scene_tree_glue.h" #include "string_glue.h" #include "string_name_glue.h" @@ -50,6 +51,7 @@ void godot_register_glue_header_icalls() { godot_register_object_icalls(); godot_register_rid_icalls(); godot_register_string_icalls(); + godot_register_scene_tree_icalls(); } // Used by the generated glue diff --git a/modules/mono/glue/scene_tree_glue.cpp b/modules/mono/glue/scene_tree_glue.cpp new file mode 100644 index 0000000000..bea9544b08 --- /dev/null +++ b/modules/mono/glue/scene_tree_glue.cpp @@ -0,0 +1,82 @@ +/*************************************************************************/ +/* scene_tree_glue.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* https://godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/*************************************************************************/ + +#include "scene_tree_glue.h" + +#ifdef MONO_GLUE_ENABLED + +#include "core/class_db.h" +#include "modules/mono/csharp_script.h" +#include "modules/mono/mono_gd/gd_mono_utils.h" +#include "scene/main/node.h" + +Array *godot_icall_SceneTree_get_nodes_in_group_Generic(SceneTree *ptr, StringName *group, MonoReflectionType *refltype) { + List<Node *> nodes; + Array ret; + + // Retrieve all the nodes in the group + ptr->get_nodes_in_group(*group, &nodes); + + // No need to bother if the group is empty + if (!nodes.empty()) { + MonoType *elem_type = mono_reflection_type_get_type(refltype); + MonoClass *mono_class = mono_class_from_mono_type(elem_type); + GDMonoClass *klass = GDMono::get_singleton()->get_class(mono_class); + + if (klass == GDMonoUtils::get_class_native_base(klass)) { + // If we're trying to get native objects, just check the inheritance list + StringName native_class_name = GDMonoUtils::get_native_godot_class_name(klass); + for (int i = 0; i < nodes.size(); ++i) { + if (ClassDB::is_parent_class(nodes[i]->get_class(), native_class_name)) + ret.push_back(nodes[i]); + } + } else { + // If we're trying to get csharpscript instances, get the mono object and compare the classes + for (int i = 0; i < nodes.size(); ++i) { + CSharpInstance *si = CAST_CSHARP_INSTANCE(nodes[i]->get_script_instance()); + + if (si != nullptr) { + MonoObject *obj = si->get_mono_object(); + if (obj != nullptr && mono_object_get_class(obj) == mono_class) { + ret.push_back(nodes[i]); + } + } + } + } + } + + return memnew(Array(ret)); +} + +void godot_register_scene_tree_icalls() { + mono_add_internal_call("Godot.SceneTree::godot_icall_SceneTree_get_nodes_in_group_Generic", (void *)godot_icall_SceneTree_get_nodes_in_group_Generic); +} + +#endif // MONO_GLUE_ENABLED diff --git a/modules/mono/glue/scene_tree_glue.h b/modules/mono/glue/scene_tree_glue.h new file mode 100644 index 0000000000..e9af35a30b --- /dev/null +++ b/modules/mono/glue/scene_tree_glue.h @@ -0,0 +1,50 @@ +/*************************************************************************/ +/* scene_tree_glue.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* https://godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/*************************************************************************/ + +#ifndef SCENE_TREE_GLUE_H +#define SCENE_TREE_GLUE_H + +#ifdef MONO_GLUE_ENABLED + +#include "core/array.h" +#include "core/string_name.h" +#include "scene/main/scene_tree.h" + +#include "../mono_gd/gd_mono_marshal.h" + +Array *godot_icall_SceneTree_get_nodes_in_group_Generic(SceneTree *ptr, StringName *group, MonoReflectionType *refltype); + +// Register internal calls + +void godot_register_scene_tree_icalls(); + +#endif // MONO_GLUE_ENABLED + +#endif // SCENE_TREE_GLUE_H diff --git a/modules/mono/mono_gd/gd_mono.cpp b/modules/mono/mono_gd/gd_mono.cpp index 080f366692..39c3bd8934 100644 --- a/modules/mono/mono_gd/gd_mono.cpp +++ b/modules/mono/mono_gd/gd_mono.cpp @@ -422,6 +422,9 @@ 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."); + + if (Main::is_project_manager()) + return; #endif // Load the project's main assembly. This doesn't necessarily need to succeed. diff --git a/modules/mono/mono_gd/gd_mono_internals.cpp b/modules/mono/mono_gd/gd_mono_internals.cpp index 27e402d777..abb2761909 100644 --- a/modules/mono/mono_gd/gd_mono_internals.cpp +++ b/modules/mono/mono_gd/gd_mono_internals.cpp @@ -114,7 +114,7 @@ void tie_managed_to_unmanaged(MonoObject *managed, Object *unmanaged) { } void unhandled_exception(MonoException *p_exc) { - mono_unhandled_exception((MonoObject *)p_exc); // prints the exception as well + mono_print_unhandled_exception((MonoObject *)p_exc); if (GDMono::get_singleton()->get_unhandled_exception_policy() == GDMono::POLICY_TERMINATE_APP) { // Too bad 'mono_invoke_unhandled_exception_hook' is not exposed to embedders diff --git a/modules/mono/mono_gd/gd_mono_marshal.cpp b/modules/mono/mono_gd/gd_mono_marshal.cpp index 085062261d..158742846b 100644 --- a/modules/mono/mono_gd/gd_mono_marshal.cpp +++ b/modules/mono/mono_gd/gd_mono_marshal.cpp @@ -624,8 +624,8 @@ MonoObject *variant_to_mono_object(const Variant *p_var, const ManagedType &p_ty return BOX_BOOLEAN(val); } case Variant::INT: { - int32_t val = p_var->operator signed int(); - return BOX_INT32(val); + int64_t val = p_var->operator int64_t(); + return BOX_INT64(val); } case Variant::FLOAT: { #ifdef REAL_T_IS_DOUBLE diff --git a/modules/mono/utils/mono_reg_utils.cpp b/modules/mono/utils/mono_reg_utils.cpp index 1b4fe68582..e0cf916a01 100644 --- a/modules/mono/utils/mono_reg_utils.cpp +++ b/modules/mono/utils/mono_reg_utils.cpp @@ -75,7 +75,6 @@ LONG _RegKeyQueryString(HKEY hKey, const String &p_value_name, String &r_value) if (res == ERROR_MORE_DATA) { // dwBufferSize now contains the actual size - Vector<WCHAR> buffer; buffer.resize(dwBufferSize); res = RegQueryValueExW(hKey, p_value_name.c_str(), 0, nullptr, (LPBYTE)buffer.ptr(), &dwBufferSize); } 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/regex/SCsub b/modules/regex/SCsub index 753650adcb..2afacc1d9c 100644 --- a/modules/regex/SCsub +++ b/modules/regex/SCsub @@ -7,7 +7,7 @@ env_regex = env_modules.Clone() if env["builtin_pcre2"]: thirdparty_dir = "#thirdparty/pcre2/src/" - thirdparty_flags = ["PCRE2_STATIC", "HAVE_CONFIG_H"] + thirdparty_flags = ["PCRE2_STATIC", "HAVE_CONFIG_H", "SUPPORT_UNICODE"] if env["builtin_pcre2_with_jit"]: thirdparty_flags.append("SUPPORT_JIT") diff --git a/modules/regex/doc_classes/RegEx.xml b/modules/regex/doc_classes/RegEx.xml index 3130c53331..c00fa96b2e 100644 --- a/modules/regex/doc_classes/RegEx.xml +++ b/modules/regex/doc_classes/RegEx.xml @@ -32,8 +32,7 @@ [codeblock] for result in regex.search_all("d01, d03, d0c, x3f and x42"): print(result.get_string("digit")) - # Would print 01 03 3f 42 - # Note that d0c would not match + # Would print 01 03 0 3f 42 [/codeblock] [b]Note:[/b] Godot's regex implementation is based on the [url=https://www.pcre.org/]PCRE2[/url] library. You can view the full pattern reference [url=https://www.pcre.org/current/doc/html/pcre2pattern.html]here[/url]. [b]Tip:[/b] You can use [url=https://regexr.com/]Regexr[/url] to test regular expressions online. diff --git a/modules/regex/doc_classes/RegExMatch.xml b/modules/regex/doc_classes/RegExMatch.xml index 151e881b6f..a45de60aef 100644 --- a/modules/regex/doc_classes/RegExMatch.xml +++ b/modules/regex/doc_classes/RegExMatch.xml @@ -49,7 +49,7 @@ </methods> <members> <member name="names" type="Dictionary" setter="" getter="get_names" default="{}"> - A dictionary of named groups and its corresponding group number. Only groups with that were matched are included. If multiple groups have the same name, that name would refer to the first matching one. + A dictionary of named groups and its corresponding group number. Only groups that were matched are included. If multiple groups have the same name, that name would refer to the first matching one. </member> <member name="strings" type="Array" setter="" getter="get_strings" default="[ ]"> An [Array] of the match and its capturing groups. 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/theora/video_stream_theora.cpp b/modules/theora/video_stream_theora.cpp index 4d83e6a4a5..498391e44a 100644 --- a/modules/theora/video_stream_theora.cpp +++ b/modules/theora/video_stream_theora.cpp @@ -581,9 +581,8 @@ bool VideoStreamPlaybackTheora::is_paused() const { return paused; }; -void VideoStreamPlaybackTheora::set_loop(bool p_enable){ - -}; +void VideoStreamPlaybackTheora::set_loop(bool p_enable) { +} bool VideoStreamPlaybackTheora::has_loop() const { return false; @@ -605,10 +604,8 @@ float VideoStreamPlaybackTheora::get_playback_position() const { return get_time(); }; -void VideoStreamPlaybackTheora::seek(float p_time){ - - // no -}; +void VideoStreamPlaybackTheora::seek(float p_time) { +} void VideoStreamPlaybackTheora::set_mix_callback(AudioMixCallback p_callback, void *p_userdata) { mix_callback = p_callback; diff --git a/modules/visual_script/config.py b/modules/visual_script/config.py index bd459ca344..b15479797c 100644 --- a/modules/visual_script/config.py +++ b/modules/visual_script/config.py @@ -8,7 +8,6 @@ def configure(env): def get_doc_classes(): return [ - "@VisualScript", "VisualScriptBasicTypeConstant", "VisualScriptBuiltinFunc", "VisualScriptClassConstant", diff --git a/modules/visual_script/doc_classes/@VisualScript.xml b/modules/visual_script/doc_classes/@VisualScript.xml deleted file mode 100644 index a2b966bfbb..0000000000 --- a/modules/visual_script/doc_classes/@VisualScript.xml +++ /dev/null @@ -1,15 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" ?> -<class name="@VisualScript" version="4.0"> - <brief_description> - Built-in visual script functions. - </brief_description> - <description> - A list of built-in visual script functions, see [VisualScriptBuiltinFunc] and [VisualScript]. - </description> - <tutorials> - </tutorials> - <methods> - </methods> - <constants> - </constants> -</class> 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"> diff --git a/modules/xatlas_unwrap/register_types.cpp b/modules/xatlas_unwrap/register_types.cpp index b996be2a4c..6242009f67 100644 --- a/modules/xatlas_unwrap/register_types.cpp +++ b/modules/xatlas_unwrap/register_types.cpp @@ -145,7 +145,7 @@ bool xatlas_mesh_lightmap_unwrap_callback(float p_texel_size, const float *p_ver ERR_FAIL_COND_V_MSG(err != xatlas::AddMeshError::Enum::Success, false, xatlas::StringForEnum(err)); printf("Generate..\n"); - xatlas::Generate(atlas, chart_options, nullptr, pack_options); + xatlas::Generate(atlas, chart_options, xatlas::ParameterizeOptions(), pack_options); *r_size_hint_x = atlas->width; *r_size_hint_y = atlas->height; |