diff options
Diffstat (limited to 'modules/gdnative')
89 files changed, 6546 insertions, 3762 deletions
diff --git a/modules/gdnative/SCsub b/modules/gdnative/SCsub index a18c75fa27..cab05549d2 100644 --- a/modules/gdnative/SCsub +++ b/modules/gdnative/SCsub @@ -1,7 +1,7 @@ #!/usr/bin/env python -Import('env') -Import('env_modules') +Import("env") +Import("env_modules") env_gdnative = env_modules.Clone() env_gdnative.add_source_files(env.modules_sources, "gdnative.cpp") @@ -12,12 +12,12 @@ env_gdnative.add_source_files(env.modules_sources, "nativescript/*.cpp") env_gdnative.add_source_files(env.modules_sources, "gdnative_library_singleton_editor.cpp") env_gdnative.add_source_files(env.modules_sources, "gdnative_library_editor_plugin.cpp") -env_gdnative.Prepend(CPPPATH=['#modules/gdnative/include/']) +env_gdnative.Prepend(CPPPATH=["#modules/gdnative/include/"]) -Export('env_gdnative') +Export("env_gdnative") SConscript("net/SCsub") -SConscript("arvr/SCsub") +SConscript("xr/SCsub") SConscript("pluginscript/SCsub") SConscript("videodecoder/SCsub") @@ -25,8 +25,11 @@ SConscript("videodecoder/SCsub") from platform_methods import run_in_subprocess import gdnative_builders -_, gensource = env_gdnative.CommandNoCache(['include/gdnative_api_struct.gen.h', 'gdnative_api_struct.gen.cpp'], - 'gdnative_api.json', run_in_subprocess(gdnative_builders.build_gdnative_api_struct)) +_, gensource = env_gdnative.CommandNoCache( + ["include/gdnative_api_struct.gen.h", "gdnative_api_struct.gen.cpp"], + "gdnative_api.json", + run_in_subprocess(gdnative_builders.build_gdnative_api_struct), +) env_gdnative.add_source_files(env.modules_sources, [gensource]) env.use_ptrcall = True diff --git a/modules/gdnative/android/android_gdn.cpp b/modules/gdnative/android/android_gdn.cpp index 4be489cd46..bc39be1813 100644 --- a/modules/gdnative/android/android_gdn.cpp +++ b/modules/gdnative/android/android_gdn.cpp @@ -50,7 +50,7 @@ JNIEnv *GDAPI godot_android_get_env() { #ifdef __ANDROID__ return ThreadAndroid::get_env(); #else - return NULL; + return nullptr; #endif } @@ -59,7 +59,7 @@ jobject GDAPI godot_android_get_activity() { OS_Android *os_android = (OS_Android *)OS::get_singleton(); return os_android->get_godot_java()->get_activity(); #else - return NULL; + return nullptr; #endif } @@ -68,7 +68,7 @@ jobject GDAPI godot_android_get_surface() { OS_Android *os_android = (OS_Android *)OS::get_singleton(); return os_android->get_godot_java()->get_surface(); #else - return NULL; + return nullptr; #endif } @@ -83,4 +83,4 @@ bool GDAPI godot_android_is_activity_resumed() { #ifdef __cplusplus } -#endif
\ No newline at end of file +#endif diff --git a/modules/gdnative/arvr/SCsub b/modules/gdnative/arvr/SCsub deleted file mode 100644 index 20eaa99592..0000000000 --- a/modules/gdnative/arvr/SCsub +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/env python - -Import('env') -Import('env_gdnative') - -env_gdnative.add_source_files(env.modules_sources, '*.cpp') diff --git a/modules/gdnative/arvr/arvr_interface_gdnative.cpp b/modules/gdnative/arvr/arvr_interface_gdnative.cpp deleted file mode 100644 index a033c2b7f9..0000000000 --- a/modules/gdnative/arvr/arvr_interface_gdnative.cpp +++ /dev/null @@ -1,439 +0,0 @@ -/*************************************************************************/ -/* arvr_interface_gdnative.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 "arvr_interface_gdnative.h" -#include "main/input_default.h" -#include "servers/arvr/arvr_positional_tracker.h" -#include "servers/visual/visual_server_globals.h" - -void ARVRInterfaceGDNative::_bind_methods() { - ADD_PROPERTY_DEFAULT("interface_is_initialized", false); - ADD_PROPERTY_DEFAULT("ar_is_anchor_detection_enabled", false); -} - -ARVRInterfaceGDNative::ARVRInterfaceGDNative() { - print_verbose("Construct gdnative interface\n"); - - // we won't have our data pointer until our library gets set - data = NULL; - - interface = NULL; -} - -ARVRInterfaceGDNative::~ARVRInterfaceGDNative() { - print_verbose("Destruct gdnative interface\n"); - - if (interface != NULL && is_initialized()) { - uninitialize(); - }; - - // cleanup after ourselves - cleanup(); -} - -void ARVRInterfaceGDNative::cleanup() { - if (interface != NULL) { - interface->destructor(data); - data = NULL; - interface = NULL; - } -} - -void ARVRInterfaceGDNative::set_interface(const godot_arvr_interface_gdnative *p_interface) { - // this should only be called once, just being paranoid.. - if (interface) { - cleanup(); - } - - // bind to our interface - interface = p_interface; - - // Now we do our constructing... - data = interface->constructor((godot_object *)this); -} - -StringName ARVRInterfaceGDNative::get_name() const { - - ERR_FAIL_COND_V(interface == NULL, StringName()); - - godot_string result = interface->get_name(data); - - StringName name = *(String *)&result; - - godot_string_destroy(&result); - - return name; -} - -int ARVRInterfaceGDNative::get_capabilities() const { - int capabilities; - - ERR_FAIL_COND_V(interface == NULL, 0); // 0 = None - - capabilities = interface->get_capabilities(data); - - return capabilities; -} - -bool ARVRInterfaceGDNative::get_anchor_detection_is_enabled() const { - - ERR_FAIL_COND_V(interface == NULL, false); - - return interface->get_anchor_detection_is_enabled(data); -} - -void ARVRInterfaceGDNative::set_anchor_detection_is_enabled(bool p_enable) { - - ERR_FAIL_COND(interface == NULL); - - interface->set_anchor_detection_is_enabled(data, p_enable); -} - -int ARVRInterfaceGDNative::get_camera_feed_id() { - - ERR_FAIL_COND_V(interface == NULL, 0); - - if ((interface->version.major > 1) || ((interface->version.major) == 1 && (interface->version.minor >= 1))) { - return (unsigned int)interface->get_camera_feed_id(data); - } else { - return 0; - } -} - -bool ARVRInterfaceGDNative::is_stereo() { - bool stereo; - - ERR_FAIL_COND_V(interface == NULL, false); - - stereo = interface->is_stereo(data); - - return stereo; -} - -bool ARVRInterfaceGDNative::is_initialized() const { - - ERR_FAIL_COND_V(interface == NULL, false); - - return interface->is_initialized(data); -} - -bool ARVRInterfaceGDNative::initialize() { - ERR_FAIL_COND_V(interface == NULL, false); - - bool initialized = interface->initialize(data); - - if (initialized) { - // if we successfully initialize our interface and we don't have a primary interface yet, this becomes our primary interface - - ARVRServer *arvr_server = ARVRServer::get_singleton(); - if ((arvr_server != NULL) && (arvr_server->get_primary_interface() == NULL)) { - arvr_server->set_primary_interface(this); - }; - }; - - return initialized; -} - -void ARVRInterfaceGDNative::uninitialize() { - ERR_FAIL_COND(interface == NULL); - - ARVRServer *arvr_server = ARVRServer::get_singleton(); - if (arvr_server != NULL) { - // Whatever happens, make sure this is no longer our primary interface - arvr_server->clear_primary_interface_if(this); - } - - interface->uninitialize(data); -} - -Size2 ARVRInterfaceGDNative::get_render_targetsize() { - - ERR_FAIL_COND_V(interface == NULL, Size2()); - - godot_vector2 result = interface->get_render_targetsize(data); - Vector2 *vec = (Vector2 *)&result; - - return *vec; -} - -Transform ARVRInterfaceGDNative::get_transform_for_eye(ARVRInterface::Eyes p_eye, const Transform &p_cam_transform) { - Transform *ret; - - ERR_FAIL_COND_V(interface == NULL, Transform()); - - godot_transform t = interface->get_transform_for_eye(data, (int)p_eye, (godot_transform *)&p_cam_transform); - - ret = (Transform *)&t; - - return *ret; -} - -CameraMatrix ARVRInterfaceGDNative::get_projection_for_eye(ARVRInterface::Eyes p_eye, real_t p_aspect, real_t p_z_near, real_t p_z_far) { - CameraMatrix cm; - - ERR_FAIL_COND_V(interface == NULL, CameraMatrix()); - - interface->fill_projection_for_eye(data, (godot_real *)cm.matrix, (godot_int)p_eye, p_aspect, p_z_near, p_z_far); - - return cm; -} - -unsigned int ARVRInterfaceGDNative::get_external_texture_for_eye(ARVRInterface::Eyes p_eye) { - - ERR_FAIL_COND_V(interface == NULL, 0); - - if ((interface->version.major > 1) || ((interface->version.major) == 1 && (interface->version.minor >= 1))) { - return (unsigned int)interface->get_external_texture_for_eye(data, (godot_int)p_eye); - } else { - return 0; - } -} - -void ARVRInterfaceGDNative::commit_for_eye(ARVRInterface::Eyes p_eye, RID p_render_target, const Rect2 &p_screen_rect) { - - ERR_FAIL_COND(interface == NULL); - - interface->commit_for_eye(data, (godot_int)p_eye, (godot_rid *)&p_render_target, (godot_rect2 *)&p_screen_rect); -} - -void ARVRInterfaceGDNative::process() { - ERR_FAIL_COND(interface == NULL); - - interface->process(data); -} - -void ARVRInterfaceGDNative::notification(int p_what) { - ERR_FAIL_COND(interface == NULL); - - // this is only available in interfaces that implement 1.1 or later - if ((interface->version.major > 1) || ((interface->version.major == 1) && (interface->version.minor > 0))) { - interface->notification(data, p_what); - } -} - -///////////////////////////////////////////////////////////////////////////////////// -// some helper callbacks - -extern "C" { - -void GDAPI godot_arvr_register_interface(const godot_arvr_interface_gdnative *p_interface) { - // If our major version is 0 or bigger then 10, we're likely looking at our constructor pointer from an older plugin - ERR_FAIL_COND_MSG((p_interface->version.major == 0) || (p_interface->version.major > 10), "GDNative ARVR interfaces build for Godot 3.0 are not supported."); - - Ref<ARVRInterfaceGDNative> new_interface; - new_interface.instance(); - new_interface->set_interface((const godot_arvr_interface_gdnative *)p_interface); - ARVRServer::get_singleton()->add_interface(new_interface); -} - -godot_real GDAPI godot_arvr_get_worldscale() { - ARVRServer *arvr_server = ARVRServer::get_singleton(); - ERR_FAIL_NULL_V(arvr_server, 1.0); - - return arvr_server->get_world_scale(); -} - -godot_transform GDAPI godot_arvr_get_reference_frame() { - godot_transform reference_frame; - Transform *reference_frame_ptr = (Transform *)&reference_frame; - - ARVRServer *arvr_server = ARVRServer::get_singleton(); - if (arvr_server != NULL) { - *reference_frame_ptr = arvr_server->get_reference_frame(); - } else { - godot_transform_new_identity(&reference_frame); - } - - return reference_frame; -} - -void GDAPI godot_arvr_blit(godot_int p_eye, godot_rid *p_render_target, godot_rect2 *p_rect) { - // blits out our texture as is, handy for preview display of one of the eyes that is already rendered with lens distortion on an external HMD - ARVRInterface::Eyes eye = (ARVRInterface::Eyes)p_eye; -#if 0 - RID *render_target = (RID *)p_render_target; -#endif - Rect2 screen_rect = *(Rect2 *)p_rect; - - if (eye == ARVRInterface::EYE_LEFT) { - screen_rect.size.x /= 2.0; - } else if (p_eye == ARVRInterface::EYE_RIGHT) { - screen_rect.size.x /= 2.0; - screen_rect.position.x += screen_rect.size.x; - } -#ifndef _MSC_VER -#warning this needs to be redone -#endif -#if 0 - VSG::rasterizer->blit_render_target_to_screen(*render_target, screen_rect, 0); -#endif -} - -godot_int GDAPI godot_arvr_get_texid(godot_rid *p_render_target) { - // In order to send off our textures to display on our hardware we need the opengl texture ID instead of the render target RID - // This is a handy function to expose that. -#if 0 - RID *render_target = (RID *)p_render_target; - - RID eye_texture = VSG::storage->render_target_get_texture(*render_target); -#endif - -#ifndef _MSC_VER -#warning need to obtain this ID again -#endif - uint32_t texid = 0; //VS::get_singleton()->texture_get_texid(eye_texture); - - return texid; -} - -godot_int GDAPI godot_arvr_add_controller(char *p_device_name, godot_int p_hand, godot_bool p_tracks_orientation, godot_bool p_tracks_position) { - ARVRServer *arvr_server = ARVRServer::get_singleton(); - ERR_FAIL_NULL_V(arvr_server, 0); - - InputDefault *input = (InputDefault *)Input::get_singleton(); - ERR_FAIL_NULL_V(input, 0); - - ARVRPositionalTracker *new_tracker = memnew(ARVRPositionalTracker); - new_tracker->set_name(p_device_name); - new_tracker->set_type(ARVRServer::TRACKER_CONTROLLER); - if (p_hand == 1) { - new_tracker->set_hand(ARVRPositionalTracker::TRACKER_LEFT_HAND); - } else if (p_hand == 2) { - new_tracker->set_hand(ARVRPositionalTracker::TRACKER_RIGHT_HAND); - } - - // also register as joystick... - int joyid = input->get_unused_joy_id(); - if (joyid != -1) { - new_tracker->set_joy_id(joyid); - input->joy_connection_changed(joyid, true, p_device_name, ""); - } - - if (p_tracks_orientation) { - Basis orientation; - new_tracker->set_orientation(orientation); - } - if (p_tracks_position) { - Vector3 position; - new_tracker->set_position(position); - } - - // add our tracker to our server and remember its pointer - arvr_server->add_tracker(new_tracker); - - // note, this ID is only unique within controllers! - return new_tracker->get_tracker_id(); -} - -void GDAPI godot_arvr_remove_controller(godot_int p_controller_id) { - ARVRServer *arvr_server = ARVRServer::get_singleton(); - ERR_FAIL_NULL(arvr_server); - - InputDefault *input = (InputDefault *)Input::get_singleton(); - ERR_FAIL_NULL(input); - - ARVRPositionalTracker *remove_tracker = arvr_server->find_by_type_and_id(ARVRServer::TRACKER_CONTROLLER, p_controller_id); - if (remove_tracker != NULL) { - // unset our joystick if applicable - int joyid = remove_tracker->get_joy_id(); - if (joyid != -1) { - input->joy_connection_changed(joyid, false, "", ""); - remove_tracker->set_joy_id(-1); - } - - // remove our tracker from our server - arvr_server->remove_tracker(remove_tracker); - memdelete(remove_tracker); - } -} - -void GDAPI godot_arvr_set_controller_transform(godot_int p_controller_id, godot_transform *p_transform, godot_bool p_tracks_orientation, godot_bool p_tracks_position) { - ARVRServer *arvr_server = ARVRServer::get_singleton(); - ERR_FAIL_NULL(arvr_server); - - ARVRPositionalTracker *tracker = arvr_server->find_by_type_and_id(ARVRServer::TRACKER_CONTROLLER, p_controller_id); - if (tracker != NULL) { - Transform *transform = (Transform *)p_transform; - if (p_tracks_orientation) { - tracker->set_orientation(transform->basis); - } - if (p_tracks_position) { - tracker->set_rw_position(transform->origin); - } - } -} - -void GDAPI godot_arvr_set_controller_button(godot_int p_controller_id, godot_int p_button, godot_bool p_is_pressed) { - ARVRServer *arvr_server = ARVRServer::get_singleton(); - ERR_FAIL_NULL(arvr_server); - - InputDefault *input = (InputDefault *)Input::get_singleton(); - ERR_FAIL_NULL(input); - - ARVRPositionalTracker *tracker = arvr_server->find_by_type_and_id(ARVRServer::TRACKER_CONTROLLER, p_controller_id); - if (tracker != NULL) { - int joyid = tracker->get_joy_id(); - if (joyid != -1) { - input->joy_button(joyid, p_button, p_is_pressed); - } - } -} - -void GDAPI godot_arvr_set_controller_axis(godot_int p_controller_id, godot_int p_axis, godot_real p_value, godot_bool p_can_be_negative) { - ARVRServer *arvr_server = ARVRServer::get_singleton(); - ERR_FAIL_NULL(arvr_server); - - InputDefault *input = (InputDefault *)Input::get_singleton(); - ERR_FAIL_NULL(input); - - ARVRPositionalTracker *tracker = arvr_server->find_by_type_and_id(ARVRServer::TRACKER_CONTROLLER, p_controller_id); - if (tracker != NULL) { - int joyid = tracker->get_joy_id(); - if (joyid != -1) { - InputDefault::JoyAxis jx; - jx.min = p_can_be_negative ? -1 : 0; - jx.value = p_value; - input->joy_axis(joyid, p_axis, jx); - } - } -} - -godot_real GDAPI godot_arvr_get_controller_rumble(godot_int p_controller_id) { - ARVRServer *arvr_server = ARVRServer::get_singleton(); - ERR_FAIL_NULL_V(arvr_server, 0.0); - - ARVRPositionalTracker *tracker = arvr_server->find_by_type_and_id(ARVRServer::TRACKER_CONTROLLER, p_controller_id); - if (tracker != NULL) { - return tracker->get_rumble(); - } - - return 0.0; -} -} diff --git a/modules/gdnative/config.py b/modules/gdnative/config.py index b9e5afcdf3..7603e7d69d 100644 --- a/modules/gdnative/config.py +++ b/modules/gdnative/config.py @@ -1,13 +1,14 @@ def can_build(env, platform): return True + def configure(env): env.use_ptrcall = True + def get_doc_classes(): return [ - "@NativeScript", - "ARVRInterfaceGDNative", + "XRInterfaceGDNative", "GDNative", "GDNativeLibrary", "MultiplayerPeerGDNative", @@ -20,5 +21,6 @@ def get_doc_classes(): "WebRTCDataChannelGDNative", ] + def get_doc_path(): return "doc_classes" 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/doc_classes/ARVRInterfaceGDNative.xml b/modules/gdnative/doc_classes/ARVRInterfaceGDNative.xml deleted file mode 100644 index e8405b64a3..0000000000 --- a/modules/gdnative/doc_classes/ARVRInterfaceGDNative.xml +++ /dev/null @@ -1,15 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" ?> -<class name="ARVRInterfaceGDNative" inherits="ARVRInterface" version="4.0"> - <brief_description> - GDNative wrapper for an ARVR interface. - </brief_description> - <description> - This is a wrapper class for GDNative implementations of the ARVR interface. To use a GDNative ARVR interface, simply instantiate this object and set your GDNative library containing the ARVR interface implementation. - </description> - <tutorials> - </tutorials> - <methods> - </methods> - <constants> - </constants> -</class> diff --git a/modules/gdnative/doc_classes/GDNativeLibrary.xml b/modules/gdnative/doc_classes/GDNativeLibrary.xml index 601e132d42..1aab864102 100644 --- a/modules/gdnative/doc_classes/GDNativeLibrary.xml +++ b/modules/gdnative/doc_classes/GDNativeLibrary.xml @@ -4,7 +4,7 @@ An external library containing functions or script classes to use in Godot. </brief_description> <description> - A GDNative library can implement [NativeScript]s, global functions to call with the [GDNative] class, or low-level engine extensions through interfaces such as [ARVRInterfaceGDNative]. The library must be compiled for each platform and architecture that the project will run on. + A GDNative library can implement [NativeScript]s, global functions to call with the [GDNative] class, or low-level engine extensions through interfaces such as [XRInterfaceGDNative]. The library must be compiled for each platform and architecture that the project will run on. </description> <tutorials> <link>https://docs.godotengine.org/en/latest/tutorials/plugins/gdnative/gdnative-c-example.html</link> diff --git a/modules/gdnative/doc_classes/XRInterfaceGDNative.xml b/modules/gdnative/doc_classes/XRInterfaceGDNative.xml new file mode 100644 index 0000000000..13de815793 --- /dev/null +++ b/modules/gdnative/doc_classes/XRInterfaceGDNative.xml @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="XRInterfaceGDNative" inherits="XRInterface" version="4.0"> + <brief_description> + GDNative wrapper for an XR interface. + </brief_description> + <description> + This is a wrapper class for GDNative implementations of the XR interface. To use a GDNative XR interface, simply instantiate this object and set your GDNative library containing the XR interface implementation. + </description> + <tutorials> + </tutorials> + <methods> + </methods> + <constants> + </constants> +</class> diff --git a/modules/gdnative/gdnative.cpp b/modules/gdnative/gdnative.cpp index 33b734f672..3d747ba41e 100644 --- a/modules/gdnative/gdnative.cpp +++ b/modules/gdnative/gdnative.cpp @@ -48,7 +48,7 @@ static const bool default_reloadable = true; // Defined in gdnative_api_struct.gen.cpp extern const godot_gdnative_core_api_struct api_struct; -Map<String, Vector<Ref<GDNative> > > GDNativeLibrary::loaded_libraries; +Map<String, Vector<Ref<GDNative>>> GDNativeLibrary::loaded_libraries; GDNativeLibrary::GDNativeLibrary() { config_file.instance(); @@ -63,7 +63,6 @@ GDNativeLibrary::~GDNativeLibrary() { } bool GDNativeLibrary::_set(const StringName &p_name, const Variant &p_property) { - String name = p_name; if (name.begins_with("entry/")) { @@ -115,8 +114,9 @@ void GDNativeLibrary::_get_property_list(List<PropertyInfo> *p_list) const { // set entries List<String> entry_key_list; - if (config_file->has_section("entry")) + if (config_file->has_section("entry")) { config_file->get_section_keys("entry", &entry_key_list); + } for (List<String>::Element *E = entry_key_list.front(); E; E = E->next()) { String key = E->get(); @@ -132,8 +132,9 @@ void GDNativeLibrary::_get_property_list(List<PropertyInfo> *p_list) const { // set dependencies List<String> dependency_key_list; - if (config_file->has_section("dependencies")) + if (config_file->has_section("dependencies")) { config_file->get_section_keys("dependencies", &dependency_key_list); + } for (List<String>::Element *E = dependency_key_list.front(); E; E = E->next()) { String key = E->get(); @@ -148,7 +149,6 @@ void GDNativeLibrary::_get_property_list(List<PropertyInfo> *p_list) const { } void GDNativeLibrary::set_config_file(Ref<ConfigFile> p_config_file) { - set_singleton(p_config_file->get_value("general", "singleton", default_singleton)); set_load_once(p_config_file->get_value("general", "load_once", default_load_once)); set_symbol_prefix(p_config_file->get_value("general", "symbol_prefix", default_symbol_prefix)); @@ -156,11 +156,11 @@ void GDNativeLibrary::set_config_file(Ref<ConfigFile> p_config_file) { String entry_lib_path; { - List<String> entry_keys; - if (p_config_file->has_section("entry")) + if (p_config_file->has_section("entry")) { p_config_file->get_section_keys("entry", &entry_keys); + } for (List<String>::Element *E = entry_keys.front(); E; E = E->next()) { String key = E->get(); @@ -188,11 +188,11 @@ void GDNativeLibrary::set_config_file(Ref<ConfigFile> p_config_file) { Vector<String> dependency_paths; { - List<String> dependency_keys; - if (p_config_file->has_section("dependencies")) + if (p_config_file->has_section("dependencies")) { p_config_file->get_section_keys("dependencies", &dependency_keys); + } for (List<String>::Element *E = dependency_keys.front(); E; E = E->next()) { String key = E->get(); @@ -248,7 +248,7 @@ void GDNativeLibrary::_bind_methods() { } GDNative::GDNative() { - native_handle = NULL; + native_handle = nullptr; initialized = false; } @@ -338,7 +338,7 @@ bool GDNative::initialize() { if (err || !library_init) { OS::get_singleton()->close_dynamic_library(native_handle); - native_handle = NULL; + native_handle = nullptr; ERR_PRINT("Failed to obtain " + library->get_symbol_prefix() + "gdnative_init symbol"); return false; } @@ -373,7 +373,7 @@ bool GDNative::initialize() { initialized = true; if (library->should_load_once() && !GDNativeLibrary::loaded_libraries.has(lib_path)) { - Vector<Ref<GDNative> > gdnatives; + Vector<Ref<GDNative>> gdnatives; gdnatives.resize(1); gdnatives.write[0] = Ref<GDNative>(this); GDNativeLibrary::loaded_libraries.insert(lib_path, gdnatives); @@ -383,14 +383,13 @@ bool GDNative::initialize() { } bool GDNative::terminate() { - if (!initialized) { ERR_PRINT("No valid library handle, can't terminate GDNative object"); return false; } if (library->should_load_once()) { - Vector<Ref<GDNative> > *gdnatives = &GDNativeLibrary::loaded_libraries[library->get_current_library_path()]; + Vector<Ref<GDNative>> *gdnatives = &GDNativeLibrary::loaded_libraries[library->get_current_library_path()]; if (gdnatives->size() > 1) { // there are other GDNative's still using this library, so we actually don't terminate gdnatives->erase(Ref<GDNative>(this)); @@ -408,7 +407,7 @@ bool GDNative::terminate() { Error error = get_symbol(library->get_symbol_prefix() + terminate_symbol, library_terminate); if (error || !library_terminate) { OS::get_singleton()->close_dynamic_library(native_handle); - native_handle = NULL; + native_handle = nullptr; initialized = false; return true; } @@ -426,7 +425,7 @@ bool GDNative::terminate() { // GDNativeScriptLanguage::get_singleton()->initialized_libraries.erase(p_native_lib->path); OS::get_singleton()->close_dynamic_library(native_handle); - native_handle = NULL; + native_handle = nullptr; return true; } @@ -452,7 +451,6 @@ Vector<StringName> GDNativeCallRegistry::get_native_call_types() { } Variant GDNative::call_native(StringName p_native_call_type, StringName p_procedure_name, Array p_arguments) { - Map<StringName, native_call_cb>::Element *E = GDNativeCallRegistry::singleton->native_calls.find(p_native_call_type); if (!E) { ERR_PRINT((String("No handler for native call type \"" + p_native_call_type) + "\" found").utf8().get_data()); @@ -466,7 +464,7 @@ Variant GDNative::call_native(StringName p_native_call_type, StringName p_proced p_procedure_name, procedure_handle); - if (err != OK || procedure_handle == NULL) { + if (err != OK || procedure_handle == nullptr) { return Variant(); } @@ -478,7 +476,6 @@ Variant GDNative::call_native(StringName p_native_call_type, StringName p_proced } Error GDNative::get_symbol(StringName p_procedure_name, void *&r_handle, bool p_optional) const { - if (!initialized) { ERR_PRINT("No valid library handle, can't get symbol from GDNative object"); return ERR_CANT_OPEN; @@ -493,7 +490,7 @@ Error GDNative::get_symbol(StringName p_procedure_name, void *&r_handle, bool p_ return result; } -RES GDNativeLibraryResourceLoader::load(const String &p_path, const String &p_original_path, Error *r_error, bool p_use_sub_threads, float *r_progress) { +RES GDNativeLibraryResourceLoader::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) { Ref<GDNativeLibrary> lib; lib.instance(); @@ -520,13 +517,13 @@ bool GDNativeLibraryResourceLoader::handles_type(const String &p_type) const { String GDNativeLibraryResourceLoader::get_resource_type(const String &p_path) const { String el = p_path.get_extension().to_lower(); - if (el == "gdnlib") + if (el == "gdnlib") { return "GDNativeLibrary"; + } return ""; } Error GDNativeLibraryResourceSaver::save(const String &p_path, const RES &p_resource, uint32_t p_flags) { - Ref<GDNativeLibrary> lib = p_resource; if (lib.is_null()) { @@ -544,11 +541,11 @@ Error GDNativeLibraryResourceSaver::save(const String &p_path, const RES &p_reso } bool GDNativeLibraryResourceSaver::recognize(const RES &p_resource) const { - return Object::cast_to<GDNativeLibrary>(*p_resource) != NULL; + return Object::cast_to<GDNativeLibrary>(*p_resource) != nullptr; } void GDNativeLibraryResourceSaver::get_recognized_extensions(const RES &p_resource, List<String> *p_extensions) const { - if (Object::cast_to<GDNativeLibrary>(*p_resource) != NULL) { + if (Object::cast_to<GDNativeLibrary>(*p_resource) != nullptr) { p_extensions->push_back("gdnlib"); } } diff --git a/modules/gdnative/gdnative.h b/modules/gdnative/gdnative.h index b4c5ec9d00..6d26c2141d 100644 --- a/modules/gdnative/gdnative.h +++ b/modules/gdnative/gdnative.h @@ -47,7 +47,7 @@ class GDNative; class GDNativeLibrary : public Resource { GDCLASS(GDNativeLibrary, Resource); - static Map<String, Vector<Ref<GDNative> > > loaded_libraries; + static Map<String, Vector<Ref<GDNative>>> loaded_libraries; friend class GDNativeLibraryResourceLoader; friend class GDNative; @@ -166,7 +166,7 @@ public: class GDNativeLibraryResourceLoader : public ResourceFormatLoader { public: - virtual RES load(const String &p_path, const String &p_original_path, Error *r_error, bool p_use_sub_threads = false, float *r_progress = nullptr); + virtual RES load(const String &p_path, const String &p_original_path, Error *r_error, bool p_use_sub_threads = false, float *r_progress = nullptr, bool p_no_cache = false); virtual void get_recognized_extensions(List<String> *p_extensions) const; virtual bool handles_type(const String &p_type) const; virtual String get_resource_type(const String &p_path) const; diff --git a/modules/gdnative/gdnative/aabb.cpp b/modules/gdnative/gdnative/aabb.cpp index 246e5d4e8d..7f22c7dfe3 100644 --- a/modules/gdnative/gdnative/aabb.cpp +++ b/modules/gdnative/gdnative/aabb.cpp @@ -37,6 +37,8 @@ extern "C" { #endif +static_assert(sizeof(godot_aabb) == sizeof(AABB), "AABB size mismatch"); + void GDAPI godot_aabb_new(godot_aabb *r_dest, const godot_vector3 *p_pos, const godot_vector3 *p_size) { const Vector3 *pos = (const Vector3 *)p_pos; const Vector3 *size = (const Vector3 *)p_size; diff --git a/modules/gdnative/gdnative/array.cpp b/modules/gdnative/gdnative/array.cpp index 0c764ab8fd..59953f5182 100644 --- a/modules/gdnative/gdnative/array.cpp +++ b/modules/gdnative/gdnative/array.cpp @@ -41,6 +41,8 @@ extern "C" { #endif +static_assert(sizeof(godot_array) == sizeof(Array), "Array size mismatch"); + void GDAPI godot_array_new(godot_array *r_dest) { Array *dest = (Array *)r_dest; memnew_placement(dest, Array); @@ -100,9 +102,33 @@ 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<float> *pca = (Vector<float> *)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_float64_array(godot_array *r_dest, const godot_packed_float64_array *p_pra) { + Array *dest = (Array *)r_dest; + 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<godot_real> *pca = (Vector<godot_real> *)p_pra; + Vector<int32_t> *pca = (Vector<int32_t> *)p_pia; memnew_placement(dest, Array); dest->resize(pca->size()); @@ -112,9 +138,9 @@ 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_int64_array(godot_array *r_dest, const godot_packed_int64_array *p_pia) { Array *dest = (Array *)r_dest; - Vector<godot_int> *pca = (Vector<godot_int> *)p_pia; + Vector<int64_t> *pca = (Vector<int64_t> *)p_pia; memnew_placement(dest, Array); dest->resize(pca->size()); diff --git a/modules/gdnative/gdnative/basis.cpp b/modules/gdnative/gdnative/basis.cpp index 4f489287b9..990fd3795d 100644 --- a/modules/gdnative/gdnative/basis.cpp +++ b/modules/gdnative/gdnative/basis.cpp @@ -37,6 +37,8 @@ extern "C" { #endif +static_assert(sizeof(godot_basis) == sizeof(Basis), "Basis size mismatch"); + void GDAPI godot_basis_new_with_rows(godot_basis *r_dest, const godot_vector3 *p_x_axis, const godot_vector3 *p_y_axis, const godot_vector3 *p_z_axis) { const Vector3 *x_axis = (const Vector3 *)p_x_axis; const Vector3 *y_axis = (const Vector3 *)p_y_axis; 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/color.cpp b/modules/gdnative/gdnative/color.cpp index 914d5b03f4..c75e74daba 100644 --- a/modules/gdnative/gdnative/color.cpp +++ b/modules/gdnative/gdnative/color.cpp @@ -37,14 +37,14 @@ extern "C" { #endif -void GDAPI godot_color_new_rgba(godot_color *r_dest, const godot_real p_r, const godot_real p_g, const godot_real p_b, const godot_real p_a) { +static_assert(sizeof(godot_color) == sizeof(Color), "Color size mismatch"); +void GDAPI godot_color_new_rgba(godot_color *r_dest, const godot_real p_r, const godot_real p_g, const godot_real p_b, const godot_real p_a) { Color *dest = (Color *)r_dest; *dest = Color(p_r, p_g, p_b, p_a); } void GDAPI godot_color_new_rgb(godot_color *r_dest, const godot_real p_r, const godot_real p_g, const godot_real p_b) { - Color *dest = (Color *)r_dest; *dest = Color(p_r, p_g, p_b); } @@ -155,11 +155,11 @@ godot_color GDAPI godot_color_contrasted(const godot_color *p_self) { return dest; } -godot_color GDAPI godot_color_linear_interpolate(const godot_color *p_self, const godot_color *p_b, const godot_real p_t) { +godot_color GDAPI godot_color_lerp(const godot_color *p_self, const godot_color *p_b, const godot_real p_t) { godot_color dest; const Color *self = (const Color *)p_self; const Color *b = (const Color *)p_b; - *((Color *)&dest) = self->linear_interpolate(*b, p_t); + *((Color *)&dest) = self->lerp(*b, p_t); return dest; } diff --git a/modules/gdnative/gdnative/dictionary.cpp b/modules/gdnative/gdnative/dictionary.cpp index b145b88934..a126974815 100644 --- a/modules/gdnative/gdnative/dictionary.cpp +++ b/modules/gdnative/gdnative/dictionary.cpp @@ -39,6 +39,8 @@ extern "C" { #endif +static_assert(sizeof(godot_dictionary) == sizeof(Dictionary), "Dictionary size mismatch"); + void GDAPI godot_dictionary_new(godot_dictionary *r_dest) { Dictionary *dest = (Dictionary *)r_dest; memnew_placement(dest, Dictionary); diff --git a/modules/gdnative/gdnative/gdnative.cpp b/modules/gdnative/gdnative/gdnative.cpp index d996b006a5..e94190b07b 100644 --- a/modules/gdnative/gdnative/gdnative.cpp +++ b/modules/gdnative/gdnative/gdnative.cpp @@ -56,14 +56,12 @@ godot_object GDAPI *godot_global_get_singleton(char *p_name) { // MethodBind API godot_method_bind GDAPI *godot_method_bind_get_method(const char *p_classname, const char *p_methodname) { - MethodBind *mb = ClassDB::get_method(StringName(p_classname), StringName(p_methodname)); // MethodBind *mb = ClassDB::get_method("Node", "get_name"); return (godot_method_bind *)mb; } void GDAPI godot_method_bind_ptrcall(godot_method_bind *p_method_bind, godot_object *p_instance, const void **p_args, void *p_ret) { - MethodBind *mb = (MethodBind *)p_method_bind; Object *o = (Object *)p_instance; mb->ptrcall(o, p_args, p_ret); @@ -93,9 +91,10 @@ godot_variant GDAPI godot_method_bind_call(godot_method_bind *p_method_bind, god godot_class_constructor GDAPI godot_get_class_constructor(const char *p_classname) { ClassDB::ClassInfo *class_info = ClassDB::classes.getptr(StringName(p_classname)); - if (class_info) + if (class_info) { return (godot_class_constructor)class_info->creation_func; - return NULL; + } + return nullptr; } godot_dictionary GDAPI godot_get_global_constants() { @@ -166,21 +165,28 @@ 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)); } void *godot_get_class_tag(const godot_string_name *p_class) { StringName class_name = *(StringName *)p_class; ClassDB::ClassInfo *class_info = ClassDB::classes.getptr(class_name); - return class_info ? class_info->class_ptr : NULL; + return class_info ? class_info->class_ptr : nullptr; } godot_object *godot_object_cast_to(const godot_object *p_object, void *p_class_tag) { - if (!p_object) return NULL; + if (!p_object) { + return nullptr; + } Object *o = (Object *)p_object; - return o->is_class_ptr(p_class_tag) ? (godot_object *)o : NULL; + 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 diff --git a/modules/gdnative/gdnative/node_path.cpp b/modules/gdnative/gdnative/node_path.cpp index 93f43835c8..88ed650ebe 100644 --- a/modules/gdnative/gdnative/node_path.cpp +++ b/modules/gdnative/gdnative/node_path.cpp @@ -37,6 +37,8 @@ extern "C" { #endif +static_assert(sizeof(godot_node_path) == sizeof(NodePath), "NodePath size mismatch"); + void GDAPI godot_node_path_new(godot_node_path *r_dest, const godot_string *p_from) { NodePath *dest = (NodePath *)r_dest; const String *from = (const String *)p_from; diff --git a/modules/gdnative/gdnative/pool_arrays.cpp b/modules/gdnative/gdnative/packed_arrays.cpp index 589b4d4dfe..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" @@ -42,6 +42,16 @@ extern "C" { #endif +static_assert(sizeof(godot_packed_byte_array) == sizeof(Vector<uint8_t>), "Vector<uint8_t> 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"); +static_assert(sizeof(godot_packed_color_array) == sizeof(Vector<Color>), "Vector<Color> size mismatch"); + #define memnew_placement_custom(m_placement, m_class, m_constr) _post_initialize(new (m_placement, sizeof(m_class), "") m_constr) // byte @@ -68,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); @@ -128,23 +148,117 @@ 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_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_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_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)); +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_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_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<godot_int>); + memnew_placement(dest, Vector<int64_t>); dest->resize(a->size()); for (int i = 0; i < a->size(); i++) { @@ -152,83 +266,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 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_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_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_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_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_int_array_invert(godot_packed_int_array *p_self) { - Vector<godot_int> *self = (Vector<godot_int> *)p_self; +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_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_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_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_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_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_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_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_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); } -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; +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); } -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_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_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_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_destroy(godot_packed_int_array *p_self) { - ((Vector<godot_int> *)p_self)->~Vector(); +void GDAPI godot_packed_int64_array_destroy(godot_packed_int64_array *p_self) { + ((Vector<int64_t> *)p_self)->~Vector(); } -// real +// float32 -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_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_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_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_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_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_real>); + memnew_placement(dest, Vector<float>); dest->resize(a->size()); for (int i = 0; i < a->size(); i++) { @@ -236,64 +360,168 @@ 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 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_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_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_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_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_real_array_invert(godot_packed_real_array *p_self) { - Vector<godot_real> *self = (Vector<godot_real> *)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_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_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_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_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_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_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_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_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_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; +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_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_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_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_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_real_array_destroy(godot_packed_real_array *p_self) { - ((Vector<godot_real> *)p_self)->~Vector(); +void GDAPI godot_packed_float32_array_destroy(godot_packed_float32_array *p_self) { + ((Vector<float> *)p_self)->~Vector(); +} + +// float64 + +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_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_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<double>); + + dest->resize(a->size()); + for (int i = 0; i < a->size(); i++) { + dest->set(i, (*a)[i]); + } +} + +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_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_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_float64_array_invert(godot_packed_float64_array *p_self) { + Vector<double> *self = (Vector<double> *)p_self; + self->invert(); +} + +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_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_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_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); +} + +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_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_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_float64_array_destroy(godot_packed_float64_array *p_self) { + ((Vector<double> *)p_self)->~Vector(); } // string @@ -320,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; @@ -412,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; @@ -503,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; @@ -594,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/plane.cpp b/modules/gdnative/gdnative/plane.cpp index 17221fe081..663937f906 100644 --- a/modules/gdnative/gdnative/plane.cpp +++ b/modules/gdnative/gdnative/plane.cpp @@ -37,8 +37,9 @@ extern "C" { #endif -void GDAPI godot_plane_new_with_reals(godot_plane *r_dest, const godot_real p_a, const godot_real p_b, const godot_real p_c, const godot_real p_d) { +static_assert(sizeof(godot_plane) == sizeof(Plane), "Plane size mismatch"); +void GDAPI godot_plane_new_with_reals(godot_plane *r_dest, const godot_real p_a, const godot_real p_b, const godot_real p_c, const godot_real p_d) { Plane *dest = (Plane *)r_dest; *dest = Plane(p_a, p_b, p_c, p_d); } diff --git a/modules/gdnative/gdnative/quat.cpp b/modules/gdnative/gdnative/quat.cpp index be30b89e5f..de6308ad2a 100644 --- a/modules/gdnative/gdnative/quat.cpp +++ b/modules/gdnative/gdnative/quat.cpp @@ -37,8 +37,9 @@ extern "C" { #endif -void GDAPI godot_quat_new(godot_quat *r_dest, const godot_real p_x, const godot_real p_y, const godot_real p_z, const godot_real p_w) { +static_assert(sizeof(godot_quat) == sizeof(Quat), "Quat size mismatch"); +void GDAPI godot_quat_new(godot_quat *r_dest, const godot_real p_x, const godot_real p_y, const godot_real p_z, const godot_real p_w) { Quat *dest = (Quat *)r_dest; *dest = Quat(p_x, p_y, p_z, p_w); } diff --git a/modules/gdnative/gdnative/rect2.cpp b/modules/gdnative/gdnative/rect2.cpp index 906b4f0932..516f4d75ce 100644 --- a/modules/gdnative/gdnative/rect2.cpp +++ b/modules/gdnative/gdnative/rect2.cpp @@ -37,6 +37,11 @@ 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; const Vector2 *size = (const Vector2 *)p_size; @@ -45,7 +50,6 @@ void GDAPI godot_rect2_new_with_position_and_size(godot_rect2 *r_dest, const god } 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) { - Rect2 *dest = (Rect2 *)r_dest; *dest = Rect2(p_x, p_y, p_width, p_height); } @@ -57,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(); @@ -172,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/rid.cpp b/modules/gdnative/gdnative/rid.cpp index 7ea80123a3..d7a63f33a7 100644 --- a/modules/gdnative/gdnative/rid.cpp +++ b/modules/gdnative/gdnative/rid.cpp @@ -38,6 +38,8 @@ extern "C" { #endif +static_assert(sizeof(godot_rid) == sizeof(RID), "RID size mismatch"); + void GDAPI godot_rid_new(godot_rid *r_dest) { RID *dest = (RID *)r_dest; memnew_placement(dest, RID); diff --git a/modules/gdnative/gdnative/string.cpp b/modules/gdnative/gdnative/string.cpp index 4cb55900b0..f89f647aca 100644 --- a/modules/gdnative/gdnative/string.cpp +++ b/modules/gdnative/gdnative/string.cpp @@ -40,6 +40,10 @@ extern "C" { #endif +static_assert(sizeof(godot_char_string) == sizeof(CharString), "CharString size mismatch"); +static_assert(sizeof(godot_string) == sizeof(String), "String size mismatch"); +static_assert(sizeof(godot_char_type) == sizeof(CharType), "CharType size mismatch"); + godot_int GDAPI godot_char_string_length(const godot_char_string *p_cs) { const CharString *cs = (const CharString *)p_cs; @@ -137,6 +141,7 @@ signed char GDAPI godot_string_nocasecmp_to(const godot_string *p_self, const go return self->nocasecmp_to(*str); } + signed char GDAPI godot_string_naturalnocasecmp_to(const godot_string *p_self, const godot_string *p_str) { const String *self = (const String *)p_self; const String *str = (const String *)p_str; @@ -608,19 +613,19 @@ int64_t GDAPI godot_string_char_to_int64_with_len(const wchar_t *p_str, int p_le int64_t GDAPI godot_string_hex_to_int64(const godot_string *p_self) { const String *self = (const String *)p_self; - return self->hex_to_int64(false); + return self->hex_to_int(false); } int64_t GDAPI godot_string_hex_to_int64_with_prefix(const godot_string *p_self) { const String *self = (const String *)p_self; - return self->hex_to_int64(); + return self->hex_to_int(); } int64_t GDAPI godot_string_to_int64(const godot_string *p_self) { const String *self = (const String *)p_self; - return self->to_int64(); + return self->to_int(); } double GDAPI godot_string_unicode_char_to_double(const wchar_t *p_str, const wchar_t **r_end) { diff --git a/modules/gdnative/gdnative/string_name.cpp b/modules/gdnative/gdnative/string_name.cpp index 1abb4486b1..7bbaaeeaa0 100644 --- a/modules/gdnative/gdnative/string_name.cpp +++ b/modules/gdnative/gdnative/string_name.cpp @@ -39,6 +39,8 @@ extern "C" { #endif +static_assert(sizeof(godot_string_name) == sizeof(StringName), "StringName size mismatch"); + void GDAPI godot_string_name_new(godot_string_name *r_dest, const godot_string *p_name) { StringName *dest = (StringName *)r_dest; const String *name = (const String *)p_name; diff --git a/modules/gdnative/gdnative/transform.cpp b/modules/gdnative/gdnative/transform.cpp index c9b3e37fb2..d19de93e9b 100644 --- a/modules/gdnative/gdnative/transform.cpp +++ b/modules/gdnative/gdnative/transform.cpp @@ -37,6 +37,8 @@ extern "C" { #endif +static_assert(sizeof(godot_transform) == sizeof(Transform), "Transform size mismatch"); + void GDAPI godot_transform_new_with_axis_origin(godot_transform *r_dest, const godot_vector3 *p_x_axis, const godot_vector3 *p_y_axis, const godot_vector3 *p_z_axis, const godot_vector3 *p_origin) { const Vector3 *x_axis = (const Vector3 *)p_x_axis; const Vector3 *y_axis = (const Vector3 *)p_y_axis; diff --git a/modules/gdnative/gdnative/transform2d.cpp b/modules/gdnative/gdnative/transform2d.cpp index 26a71333b1..c0f7878eb0 100644 --- a/modules/gdnative/gdnative/transform2d.cpp +++ b/modules/gdnative/gdnative/transform2d.cpp @@ -37,6 +37,8 @@ extern "C" { #endif +static_assert(sizeof(godot_transform2d) == sizeof(Transform2D), "Transform2D size mismatch"); + void GDAPI godot_transform2d_new(godot_transform2d *r_dest, const godot_real p_rot, const godot_vector2 *p_pos) { const Vector2 *pos = (const Vector2 *)p_pos; Transform2D *dest = (Transform2D *)r_dest; diff --git a/modules/gdnative/gdnative/variant.cpp b/modules/gdnative/gdnative/variant.cpp index f0fc44ae8a..dac4feb0e5 100644 --- a/modules/gdnative/gdnative/variant.cpp +++ b/modules/gdnative/gdnative/variant.cpp @@ -37,6 +37,8 @@ extern "C" { #endif +static_assert(sizeof(godot_variant) == sizeof(Variant), "Variant size mismatch"); + // Workaround GCC ICE on armv7hl which was affected GCC 6.0 up to 8.0 (GH-16100). // It was fixed upstream in 8.1, and a fix was backported to 7.4. // This can be removed once no supported distro ships with versions older than 7.4. @@ -97,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; @@ -169,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; @@ -207,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; @@ -271,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; @@ -279,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; @@ -287,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; @@ -295,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; @@ -367,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; @@ -399,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 @@ -408,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 @@ -417,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; @@ -487,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 e9e2a8edf8..1ee716df86 100644 --- a/modules/gdnative/gdnative/vector2.cpp +++ b/modules/gdnative/gdnative/vector2.cpp @@ -37,8 +37,12 @@ extern "C" { #endif -void GDAPI godot_vector2_new(godot_vector2 *r_dest, const godot_real p_x, const godot_real p_y) { +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; *dest = Vector2(p_x, p_y); } @@ -50,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; @@ -109,11 +120,11 @@ godot_real GDAPI godot_vector2_angle_to_point(const godot_vector2 *p_self, const return self->angle_to_point(*to); } -godot_vector2 GDAPI godot_vector2_linear_interpolate(const godot_vector2 *p_self, const godot_vector2 *p_b, const godot_real p_t) { +godot_vector2 GDAPI godot_vector2_lerp(const godot_vector2 *p_self, const godot_vector2 *p_b, const godot_real p_t) { godot_vector2 dest; const Vector2 *self = (const Vector2 *)p_self; const Vector2 *b = (const Vector2 *)p_b; - *((Vector2 *)&dest) = self->linear_interpolate(*b, p_t); + *((Vector2 *)&dest) = self->lerp(*b, p_t); return dest; } @@ -157,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; @@ -307,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 e34a9370a5..32cad30c17 100644 --- a/modules/gdnative/gdnative/vector3.cpp +++ b/modules/gdnative/gdnative/vector3.cpp @@ -37,8 +37,12 @@ extern "C" { #endif -void GDAPI godot_vector3_new(godot_vector3 *r_dest, const godot_real p_x, const godot_real p_y, const godot_real p_z) { +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; *dest = Vector3(p_x, p_y, p_z); } @@ -50,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(); @@ -106,11 +117,11 @@ godot_vector3 GDAPI godot_vector3_rotated(const godot_vector3 *p_self, const god return dest; } -godot_vector3 GDAPI godot_vector3_linear_interpolate(const godot_vector3 *p_self, const godot_vector3 *p_b, const godot_real p_t) { +godot_vector3 GDAPI godot_vector3_lerp(const godot_vector3 *p_self, const godot_vector3 *p_b, const godot_real p_t) { godot_vector3 dest; const Vector3 *self = (const Vector3 *)p_self; const Vector3 *b = (const Vector3 *)p_b; - *((Vector3 *)&dest) = self->linear_interpolate(*b, p_t); + *((Vector3 *)&dest) = self->lerp(*b, p_t); return dest; } @@ -168,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; @@ -314,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 e1d6c0c867..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_linear_interpolate", - "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_linear_interpolate", - "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_linear_interpolate", - "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_int_array *", "r_dest"] + ["godot_packed_int32_array *", "r_dest"] ] }, { - "name": "godot_packed_int_array_new_copy", + "name": "godot_packed_int32_array_new_copy", "return_type": "void", "arguments": [ - ["godot_packed_int_array *", "r_dest"], - ["const godot_packed_int_array *", "p_src"] + ["godot_packed_int32_array *", "r_dest"], + ["const godot_packed_int32_array *", "p_src"] ] }, { - "name": "godot_packed_int_array_new_with_array", + "name": "godot_packed_int32_array_new_with_array", "return_type": "void", "arguments": [ - ["godot_packed_int_array *", "r_dest"], + ["godot_packed_int32_array *", "r_dest"], ["const godot_array *", "p_a"] ] }, { - "name": "godot_packed_int_array_append", + "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_int_array *", "p_self"], - ["const godot_int", "p_data"] + ["godot_packed_int32_array *", "p_self"], + ["const int32_t", "p_data"] ] }, { - "name": "godot_packed_int_array_append_array", + "name": "godot_packed_int32_array_append_array", "return_type": "void", "arguments": [ - ["godot_packed_int_array *", "p_self"], - ["const godot_packed_int_array *", "p_array"] + ["godot_packed_int32_array *", "p_self"], + ["const godot_packed_int32_array *", "p_array"] ] }, { - "name": "godot_packed_int_array_insert", + "name": "godot_packed_int32_array_insert", "return_type": "godot_error", "arguments": [ - ["godot_packed_int_array *", "p_self"], + ["godot_packed_int32_array *", "p_self"], ["const godot_int", "p_idx"], - ["const godot_int", "p_data"] + ["const int32_t", "p_data"] ] }, { - "name": "godot_packed_int_array_invert", + "name": "godot_packed_int32_array_invert", "return_type": "void", "arguments": [ - ["godot_packed_int_array *", "p_self"] + ["godot_packed_int32_array *", "p_self"] ] }, { - "name": "godot_packed_int_array_push_back", + "name": "godot_packed_int32_array_push_back", "return_type": "void", "arguments": [ - ["godot_packed_int_array *", "p_self"], - ["const godot_int", "p_data"] + ["godot_packed_int32_array *", "p_self"], + ["const int32_t", "p_data"] ] }, { - "name": "godot_packed_int_array_remove", + "name": "godot_packed_int32_array_remove", "return_type": "void", "arguments": [ - ["godot_packed_int_array *", "p_self"], + ["godot_packed_int32_array *", "p_self"], ["const godot_int", "p_idx"] ] }, { - "name": "godot_packed_int_array_resize", + "name": "godot_packed_int32_array_resize", "return_type": "void", "arguments": [ - ["godot_packed_int_array *", "p_self"], + ["godot_packed_int32_array *", "p_self"], ["const godot_int", "p_size"] ] }, { - "name": "godot_packed_int_array_set", + "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_int_array *", "p_self"], + ["godot_packed_int32_array *", "p_self"], ["const godot_int", "p_idx"], - ["const godot_int", "p_data"] + ["const int32_t", "p_data"] ] }, { - "name": "godot_packed_int_array_get", + "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_int32_array_size", "return_type": "godot_int", "arguments": [ - ["const godot_packed_int_array *", "p_self"], + ["const godot_packed_int32_array *", "p_self"] + ] + }, + { + "name": "godot_packed_int32_array_destroy", + "return_type": "void", + "arguments": [ + ["godot_packed_int32_array *", "p_self"] + ] + }, + { + "name": "godot_packed_int64_array_new", + "return_type": "void", + "arguments": [ + ["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_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_int64_array *", "p_self"], + ["const int64_t", "p_data"] + ] + }, + { + "name": "godot_packed_int64_array_append_array", + "return_type": "void", + "arguments": [ + ["godot_packed_int64_array *", "p_self"], + ["const godot_packed_int64_array *", "p_array"] + ] + }, + { + "name": "godot_packed_int64_array_insert", + "return_type": "godot_error", + "arguments": [ + ["godot_packed_int64_array *", "p_self"], + ["const godot_int", "p_idx"], + ["const int64_t", "p_data"] + ] + }, + { + "name": "godot_packed_int64_array_invert", + "return_type": "void", + "arguments": [ + ["godot_packed_int64_array *", "p_self"] + ] + }, + { + "name": "godot_packed_int64_array_push_back", + "return_type": "void", + "arguments": [ + ["godot_packed_int64_array *", "p_self"], + ["const int64_t", "p_data"] + ] + }, + { + "name": "godot_packed_int64_array_remove", + "return_type": "void", + "arguments": [ + ["godot_packed_int64_array *", "p_self"], ["const godot_int", "p_idx"] ] }, { - "name": "godot_packed_int_array_size", + "name": "godot_packed_int64_array_resize", + "return_type": "void", + "arguments": [ + ["godot_packed_int64_array *", "p_self"], + ["const godot_int", "p_size"] + ] + }, + { + "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_int64_array *", "p_self"], + ["const godot_int", "p_idx"], + ["const int64_t", "p_data"] + ] + }, + { + "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_int_array_destroy", + "name": "godot_packed_int64_array_destroy", "return_type": "void", "arguments": [ - ["godot_packed_int_array *", "p_self"] + ["godot_packed_int64_array *", "p_self"] ] }, { - "name": "godot_packed_real_array_new", + "name": "godot_packed_float32_array_new", "return_type": "void", "arguments": [ - ["godot_packed_real_array *", "r_dest"] + ["godot_packed_float32_array *", "r_dest"] ] }, { - "name": "godot_packed_real_array_new_copy", + "name": "godot_packed_float32_array_new_copy", "return_type": "void", "arguments": [ - ["godot_packed_real_array *", "r_dest"], - ["const godot_packed_real_array *", "p_src"] + ["godot_packed_float32_array *", "r_dest"], + ["const godot_packed_float32_array *", "p_src"] ] }, { - "name": "godot_packed_real_array_new_with_array", + "name": "godot_packed_float32_array_new_with_array", "return_type": "void", "arguments": [ - ["godot_packed_real_array *", "r_dest"], + ["godot_packed_float32_array *", "r_dest"], ["const godot_array *", "p_a"] ] }, { - "name": "godot_packed_real_array_append", + "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_real_array *", "p_self"], - ["const godot_real", "p_data"] + ["godot_packed_float32_array *", "p_self"], + ["const float", "p_data"] ] }, { - "name": "godot_packed_real_array_append_array", + "name": "godot_packed_float32_array_append_array", "return_type": "void", "arguments": [ - ["godot_packed_real_array *", "p_self"], - ["const godot_packed_real_array *", "p_array"] + ["godot_packed_float32_array *", "p_self"], + ["const godot_packed_float32_array *", "p_array"] ] }, { - "name": "godot_packed_real_array_insert", + "name": "godot_packed_float32_array_insert", "return_type": "godot_error", "arguments": [ - ["godot_packed_real_array *", "p_self"], + ["godot_packed_float32_array *", "p_self"], ["const godot_int", "p_idx"], - ["const godot_real", "p_data"] + ["const float", "p_data"] ] }, { - "name": "godot_packed_real_array_invert", + "name": "godot_packed_float32_array_invert", "return_type": "void", "arguments": [ - ["godot_packed_real_array *", "p_self"] + ["godot_packed_float32_array *", "p_self"] ] }, { - "name": "godot_packed_real_array_push_back", + "name": "godot_packed_float32_array_push_back", "return_type": "void", "arguments": [ - ["godot_packed_real_array *", "p_self"], - ["const godot_real", "p_data"] + ["godot_packed_float32_array *", "p_self"], + ["const float", "p_data"] ] }, { - "name": "godot_packed_real_array_remove", + "name": "godot_packed_float32_array_remove", "return_type": "void", "arguments": [ - ["godot_packed_real_array *", "p_self"], + ["godot_packed_float32_array *", "p_self"], ["const godot_int", "p_idx"] ] }, { - "name": "godot_packed_real_array_resize", + "name": "godot_packed_float32_array_resize", "return_type": "void", "arguments": [ - ["godot_packed_real_array *", "p_self"], + ["godot_packed_float32_array *", "p_self"], ["const godot_int", "p_size"] ] }, { - "name": "godot_packed_real_array_set", + "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_real_array *", "p_self"], + ["godot_packed_float32_array *", "p_self"], ["const godot_int", "p_idx"], - ["const godot_real", "p_data"] + ["const float", "p_data"] ] }, { - "name": "godot_packed_real_array_get", - "return_type": "godot_real", + "name": "godot_packed_float32_array_get", + "return_type": "float", "arguments": [ - ["const godot_packed_real_array *", "p_self"], + ["const godot_packed_float32_array *", "p_self"], ["const godot_int", "p_idx"] ] }, { - "name": "godot_packed_real_array_size", + "name": "godot_packed_float32_array_size", "return_type": "godot_int", "arguments": [ - ["const godot_packed_real_array *", "p_self"] + ["const godot_packed_float32_array *", "p_self"] + ] + }, + { + "name": "godot_packed_float32_array_destroy", + "return_type": "void", + "arguments": [ + ["godot_packed_float32_array *", "p_self"] + ] + }, + { + "name": "godot_packed_float64_array_new", + "return_type": "void", + "arguments": [ + ["godot_packed_float64_array *", "r_dest"] ] }, { - "name": "godot_packed_real_array_destroy", + "name": "godot_packed_float64_array_new_copy", "return_type": "void", "arguments": [ - ["godot_packed_real_array *", "p_self"] + ["godot_packed_float64_array *", "r_dest"], + ["const godot_packed_float64_array *", "p_src"] + ] + }, + { + "name": "godot_packed_float64_array_new_with_array", + "return_type": "void", + "arguments": [ + ["godot_packed_float64_array *", "r_dest"], + ["const godot_array *", "p_a"] + ] + }, + { + "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_float64_array *", "p_self"], + ["const double", "p_data"] + ] + }, + { + "name": "godot_packed_float64_array_append_array", + "return_type": "void", + "arguments": [ + ["godot_packed_float64_array *", "p_self"], + ["const godot_packed_float64_array *", "p_array"] + ] + }, + { + "name": "godot_packed_float64_array_insert", + "return_type": "godot_error", + "arguments": [ + ["godot_packed_float64_array *", "p_self"], + ["const godot_int", "p_idx"], + ["const double", "p_data"] + ] + }, + { + "name": "godot_packed_float64_array_invert", + "return_type": "void", + "arguments": [ + ["godot_packed_float64_array *", "p_self"] + ] + }, + { + "name": "godot_packed_float64_array_push_back", + "return_type": "void", + "arguments": [ + ["godot_packed_float64_array *", "p_self"], + ["const double", "p_data"] + ] + }, + { + "name": "godot_packed_float64_array_remove", + "return_type": "void", + "arguments": [ + ["godot_packed_float64_array *", "p_self"], + ["const godot_int", "p_idx"] + ] + }, + { + "name": "godot_packed_float64_array_resize", + "return_type": "void", + "arguments": [ + ["godot_packed_float64_array *", "p_self"], + ["const godot_int", "p_size"] + ] + }, + { + "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_float64_array *", "p_self"], + ["const godot_int", "p_idx"], + ["const double", "p_data"] + ] + }, + { + "name": "godot_packed_float64_array_get", + "return_type": "double", + "arguments": [ + ["const godot_packed_float64_array *", "p_self"], + ["const godot_int", "p_idx"] + ] + }, + { + "name": "godot_packed_float64_array_size", + "return_type": "godot_int", + "arguments": [ + ["const godot_packed_float64_array *", "p_self"] + ] + }, + { + "name": "godot_packed_float64_array_destroy", + "return_type": "void", + "arguments": [ + ["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_int32_array *", "p_pia"] + ] + }, + { + "name": "godot_variant_new_packed_int64_array", + "return_type": "void", + "arguments": [ + ["godot_variant *", "r_dest"], + ["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_int_array *", "p_pia"] + ["const godot_packed_float32_array *", "p_pra"] ] }, { - "name": "godot_variant_new_packed_real_array", + "name": "godot_variant_new_packed_float64_array", "return_type": "void", "arguments": [ ["godot_variant *", "r_dest"], - ["const godot_packed_real_array *", "p_pra"] + ["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"] - ] - }, - { - "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"] + ["const godot_vector2i *", "p_self"] ] }, { - "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"] + ] } ] }, @@ -5935,8 +7157,8 @@ ] }, { - "name": "arvr", - "type": "ARVR", + "name": "xr", + "type": "XR", "version": { "major": 1, "minor": 1 @@ -5944,24 +7166,24 @@ "next": null, "api": [ { - "name": "godot_arvr_register_interface", + "name": "godot_xr_register_interface", "return_type": "void", "arguments": [ - ["const godot_arvr_interface_gdnative *", "p_interface"] + ["const godot_xr_interface_gdnative *", "p_interface"] ] }, { - "name": "godot_arvr_get_worldscale", + "name": "godot_xr_get_worldscale", "return_type": "godot_real", "arguments": [] }, { - "name": "godot_arvr_get_reference_frame", + "name": "godot_xr_get_reference_frame", "return_type": "godot_transform", "arguments": [] }, { - "name": "godot_arvr_blit", + "name": "godot_xr_blit", "return_type": "void", "arguments": [ ["godot_int", "p_eye"], @@ -5970,14 +7192,14 @@ ] }, { - "name": "godot_arvr_get_texid", + "name": "godot_xr_get_texid", "return_type": "godot_int", "arguments": [ ["godot_rid *", "p_render_target"] ] }, { - "name": "godot_arvr_add_controller", + "name": "godot_xr_add_controller", "return_type": "godot_int", "arguments": [ ["char *", "p_device_name"], @@ -5987,14 +7209,14 @@ ] }, { - "name": "godot_arvr_remove_controller", + "name": "godot_xr_remove_controller", "return_type": "void", "arguments": [ ["godot_int", "p_controller_id"] ] }, { - "name": "godot_arvr_set_controller_transform", + "name": "godot_xr_set_controller_transform", "return_type": "void", "arguments": [ ["godot_int", "p_controller_id"], @@ -6004,7 +7226,7 @@ ] }, { - "name": "godot_arvr_set_controller_button", + "name": "godot_xr_set_controller_button", "return_type": "void", "arguments": [ ["godot_int", "p_controller_id"], @@ -6013,7 +7235,7 @@ ] }, { - "name": "godot_arvr_set_controller_axis", + "name": "godot_xr_set_controller_axis", "return_type": "void", "arguments": [ ["godot_int", "p_controller_id"], @@ -6023,7 +7245,7 @@ ] }, { - "name": "godot_arvr_get_controller_rumble", + "name": "godot_xr_get_controller_rumble", "return_type": "godot_real", "arguments": [ ["godot_int", "p_controller_id"] @@ -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 0d95a65b7e..a6f8afb85b 100644 --- a/modules/gdnative/gdnative_builders.py +++ b/modules/gdnative/gdnative_builders.py @@ -8,209 +8,258 @@ from platform_methods import subprocess_main def _spaced(e): - return e if e[-1] == '*' else e + ' ' + return e if e[-1] == "*" else e + " " def _build_gdnative_api_struct_header(api): out = [ - '/* THIS FILE IS GENERATED DO NOT EDIT */', - '#ifndef GODOT_GDNATIVE_API_STRUCT_H', - '#define GODOT_GDNATIVE_API_STRUCT_H', - '', - '#include <gdnative/gdnative.h>', - '#include <android/godot_android.h>', - '#include <arvr/godot_arvr.h>', - '#include <nativescript/godot_nativescript.h>', - '#include <net/godot_net.h>', - '#include <pluginscript/godot_pluginscript.h>', - '#include <videodecoder/godot_videodecoder.h>', - '', - '#ifdef __cplusplus', + "/* THIS FILE IS GENERATED DO NOT EDIT */", + "#ifndef GODOT_GDNATIVE_API_STRUCT_H", + "#define GODOT_GDNATIVE_API_STRUCT_H", + "", + "#include <gdnative/gdnative.h>", + "#include <android/godot_android.h>", + "#include <xr/godot_xr.h>", + "#include <nativescript/godot_nativescript.h>", + "#include <net/godot_net.h>", + "#include <pluginscript/godot_pluginscript.h>", + "#include <videodecoder/godot_videodecoder.h>", + "", + "#ifdef __cplusplus", 'extern "C" {', - '#endif', - '', - 'enum GDNATIVE_API_TYPES {', - '\tGDNATIVE_' + api['core']['type'] + ',' + "#endif", + "", + "enum GDNATIVE_API_TYPES {", + "\tGDNATIVE_" + api["core"]["type"] + ",", ] - for ext in api['extensions']: - out += ['\tGDNATIVE_EXT_' + ext['type'] + ','] + for ext in api["extensions"]: + out += ["\tGDNATIVE_EXT_" + ext["type"] + ","] - out += ['};', ''] + out += ["};", ""] def generate_extension_struct(name, ext, include_version=True): ret_val = [] - if ext['next']: - ret_val += generate_extension_struct(name, ext['next']) + if ext["next"]: + ret_val += generate_extension_struct(name, ext["next"]) ret_val += [ - 'typedef struct godot_gdnative_ext_' + name + ('' if not include_version else ('_{0}_{1}'.format(ext['version']['major'], ext['version']['minor']))) + '_api_struct {', - '\tunsigned int type;', - '\tgodot_gdnative_api_version version;', - '\tconst godot_gdnative_api_struct *next;' + "typedef struct godot_gdnative_ext_" + + name + + ("" if not include_version else ("_{0}_{1}".format(ext["version"]["major"], ext["version"]["minor"]))) + + "_api_struct {", + "\tunsigned int type;", + "\tgodot_gdnative_api_version version;", + "\tconst godot_gdnative_api_struct *next;", ] - for funcdef in ext['api']: - args = ', '.join(['%s%s' % (_spaced(t), n) for t, n in funcdef['arguments']]) - ret_val.append('\t%s(*%s)(%s);' % (_spaced(funcdef['return_type']), funcdef['name'], args)) + for funcdef in ext["api"]: + args = ", ".join(["%s%s" % (_spaced(t), n) for t, n in funcdef["arguments"]]) + ret_val.append("\t%s(*%s)(%s);" % (_spaced(funcdef["return_type"]), funcdef["name"], args)) - ret_val += ['} godot_gdnative_ext_' + name + ('' if not include_version else ('_{0}_{1}'.format(ext['version']['major'], ext['version']['minor']))) + '_api_struct;', ''] + ret_val += [ + "} godot_gdnative_ext_" + + name + + ("" if not include_version else ("_{0}_{1}".format(ext["version"]["major"], ext["version"]["minor"]))) + + "_api_struct;", + "", + ] return ret_val - def generate_core_extension_struct(core): ret_val = [] - if core['next']: - ret_val += generate_core_extension_struct(core['next']) + if core["next"]: + ret_val += generate_core_extension_struct(core["next"]) ret_val += [ - 'typedef struct godot_gdnative_core_' + ('{0}_{1}'.format(core['version']['major'], core['version']['minor'])) + '_api_struct {', - '\tunsigned int type;', - '\tgodot_gdnative_api_version version;', - '\tconst godot_gdnative_api_struct *next;', + "typedef struct godot_gdnative_core_" + + ("{0}_{1}".format(core["version"]["major"], core["version"]["minor"])) + + "_api_struct {", + "\tunsigned int type;", + "\tgodot_gdnative_api_version version;", + "\tconst godot_gdnative_api_struct *next;", ] - for funcdef in core['api']: - args = ', '.join(['%s%s' % (_spaced(t), n) for t, n in funcdef['arguments']]) - ret_val.append('\t%s(*%s)(%s);' % (_spaced(funcdef['return_type']), funcdef['name'], args)) + for funcdef in core["api"]: + args = ", ".join(["%s%s" % (_spaced(t), n) for t, n in funcdef["arguments"]]) + ret_val.append("\t%s(*%s)(%s);" % (_spaced(funcdef["return_type"]), funcdef["name"], args)) - ret_val += ['} godot_gdnative_core_' + '{0}_{1}'.format(core['version']['major'], core['version']['minor']) + '_api_struct;', ''] + ret_val += [ + "} godot_gdnative_core_" + + "{0}_{1}".format(core["version"]["major"], core["version"]["minor"]) + + "_api_struct;", + "", + ] return ret_val - - for ext in api['extensions']: - name = ext['name'] + for ext in api["extensions"]: + name = ext["name"] out += generate_extension_struct(name, ext, False) - if api['core']['next']: - out += generate_core_extension_struct(api['core']['next']) + if api["core"]["next"]: + out += generate_core_extension_struct(api["core"]["next"]) out += [ - 'typedef struct godot_gdnative_core_api_struct {', - '\tunsigned int type;', - '\tgodot_gdnative_api_version version;', - '\tconst godot_gdnative_api_struct *next;', - '\tunsigned int num_extensions;', - '\tconst godot_gdnative_api_struct **extensions;', + "typedef struct godot_gdnative_core_api_struct {", + "\tunsigned int type;", + "\tgodot_gdnative_api_version version;", + "\tconst godot_gdnative_api_struct *next;", + "\tunsigned int num_extensions;", + "\tconst godot_gdnative_api_struct **extensions;", ] - for funcdef in api['core']['api']: - args = ', '.join(['%s%s' % (_spaced(t), n) for t, n in funcdef['arguments']]) - out.append('\t%s(*%s)(%s);' % (_spaced(funcdef['return_type']), funcdef['name'], args)) + for funcdef in api["core"]["api"]: + args = ", ".join(["%s%s" % (_spaced(t), n) for t, n in funcdef["arguments"]]) + out.append("\t%s(*%s)(%s);" % (_spaced(funcdef["return_type"]), funcdef["name"], args)) out += [ - '} godot_gdnative_core_api_struct;', - '', - '#ifdef __cplusplus', - '}', - '#endif', - '', - '#endif // GODOT_GDNATIVE_API_STRUCT_H', - '' + "} godot_gdnative_core_api_struct;", + "", + "#ifdef __cplusplus", + "}", + "#endif", + "", + "#endif // GODOT_GDNATIVE_API_STRUCT_H", + "", ] - return '\n'.join(out) + return "\n".join(out) def _build_gdnative_api_struct_source(api): - out = [ - '/* THIS FILE IS GENERATED DO NOT EDIT */', - '', - '#include <gdnative_api_struct.gen.h>', - '' - ] + out = ["/* THIS FILE IS GENERATED DO NOT EDIT */", "", "#include <gdnative_api_struct.gen.h>", ""] def get_extension_struct_name(name, ext, include_version=True): - return 'godot_gdnative_ext_' + name + ('' if not include_version else ('_{0}_{1}'.format(ext['version']['major'], ext['version']['minor']))) + '_api_struct' + return ( + "godot_gdnative_ext_" + + name + + ("" if not include_version else ("_{0}_{1}".format(ext["version"]["major"], ext["version"]["minor"]))) + + "_api_struct" + ) def get_extension_struct_instance_name(name, ext, include_version=True): - return 'api_extension_' + name + ('' if not include_version else ('_{0}_{1}'.format(ext['version']['major'], ext['version']['minor']))) + '_struct' + return ( + "api_extension_" + + name + + ("" if not include_version else ("_{0}_{1}".format(ext["version"]["major"], ext["version"]["minor"]))) + + "_struct" + ) def get_extension_struct_definition(name, ext, include_version=True): ret_val = [] - if ext['next']: - ret_val += get_extension_struct_definition(name, ext['next']) + if ext["next"]: + ret_val += get_extension_struct_definition(name, ext["next"]) ret_val += [ - 'extern const ' + get_extension_struct_name(name, ext, include_version) + ' ' + get_extension_struct_instance_name(name, ext, include_version) + ' = {', - '\tGDNATIVE_EXT_' + ext['type'] + ',', - '\t{' + str(ext['version']['major']) + ', ' + str(ext['version']['minor']) + '},', - '\t' + ('NULL' if not ext['next'] else ('(const godot_gdnative_api_struct *)&' + get_extension_struct_instance_name(name, ext['next']))) + ',' + "extern const " + + get_extension_struct_name(name, ext, include_version) + + " " + + get_extension_struct_instance_name(name, ext, include_version) + + " = {", + "\tGDNATIVE_EXT_" + ext["type"] + ",", + "\t{" + str(ext["version"]["major"]) + ", " + str(ext["version"]["minor"]) + "},", + "\t" + + ( + "nullptr" + if not ext["next"] + else ("(const godot_gdnative_api_struct *)&" + get_extension_struct_instance_name(name, ext["next"])) + ) + + ",", ] - for funcdef in ext['api']: - ret_val.append('\t%s,' % funcdef['name']) + for funcdef in ext["api"]: + ret_val.append("\t%s," % funcdef["name"]) - ret_val += ['};\n'] + ret_val += ["};\n"] return ret_val - def get_core_struct_definition(core): ret_val = [] - if core['next']: - ret_val += get_core_struct_definition(core['next']) + if core["next"]: + ret_val += get_core_struct_definition(core["next"]) ret_val += [ - 'extern const godot_gdnative_core_' + ('{0}_{1}_api_struct api_{0}_{1}'.format(core['version']['major'], core['version']['minor'])) + ' = {', - '\tGDNATIVE_' + core['type'] + ',', - '\t{' + str(core['version']['major']) + ', ' + str(core['version']['minor']) + '},', - '\t' + ('NULL' if not core['next'] else ('(const godot_gdnative_api_struct *)& api_{0}_{1}'.format(core['next']['version']['major'], core['next']['version']['minor']))) + ',' + "extern const godot_gdnative_core_" + + ("{0}_{1}_api_struct api_{0}_{1}".format(core["version"]["major"], core["version"]["minor"])) + + " = {", + "\tGDNATIVE_" + core["type"] + ",", + "\t{" + str(core["version"]["major"]) + ", " + str(core["version"]["minor"]) + "},", + "\t" + + ( + "nullptr" + if not core["next"] + else ( + "(const godot_gdnative_api_struct *)& api_{0}_{1}".format( + core["next"]["version"]["major"], core["next"]["version"]["minor"] + ) + ) + ) + + ",", ] - for funcdef in core['api']: - ret_val.append('\t%s,' % funcdef['name']) + for funcdef in core["api"]: + ret_val.append("\t%s," % funcdef["name"]) - ret_val += ['};\n'] + ret_val += ["};\n"] return ret_val - for ext in api['extensions']: - name = ext['name'] + for ext in api["extensions"]: + name = ext["name"] out += get_extension_struct_definition(name, ext, False) - out += ['', 'const godot_gdnative_api_struct *gdnative_extensions_pointers[] = {'] + out += ["", "const godot_gdnative_api_struct *gdnative_extensions_pointers[] = {"] - for ext in api['extensions']: - name = ext['name'] - out += ['\t(godot_gdnative_api_struct *)&api_extension_' + name + '_struct,'] + for ext in api["extensions"]: + name = ext["name"] + out += ["\t(godot_gdnative_api_struct *)&api_extension_" + name + "_struct,"] - out += ['};\n'] + out += ["};\n"] - if api['core']['next']: - out += get_core_struct_definition(api['core']['next']) + if api["core"]["next"]: + out += get_core_struct_definition(api["core"]["next"]) out += [ - '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' + str(len(api['extensions'])) + ',', - '\tgdnative_extensions_pointers,', + "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" + + ( + "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,", ] - for funcdef in api['core']['api']: - out.append('\t%s,' % funcdef['name']) - out.append('};\n') + for funcdef in api["core"]["api"]: + out.append("\t%s," % funcdef["name"]) + out.append("};\n") - return '\n'.join(out) + return "\n".join(out) def build_gdnative_api_struct(target, source, env): - with open(source[0], 'r') as fd: + with open(source[0], "r") as fd: api = json.load(fd) header, source = target - with open(header, 'w') as fd: + with open(header, "w") as fd: fd.write(_build_gdnative_api_struct_header(api)) - with open(source, 'w') as fd: + with open(source, "w") as fd: fd.write(_build_gdnative_api_struct_source(api)) -if __name__ == '__main__': +if __name__ == "__main__": subprocess_main(globals()) diff --git a/modules/gdnative/gdnative_library_editor_plugin.cpp b/modules/gdnative/gdnative_library_editor_plugin.cpp index db90199e63..5896da4640 100644 --- a/modules/gdnative/gdnative_library_editor_plugin.cpp +++ b/modules/gdnative/gdnative_library_editor_plugin.cpp @@ -40,7 +40,6 @@ void GDNativeLibraryEditor::edit(Ref<GDNativeLibrary> p_library) { for (Map<String, NativePlatformConfig>::Element *E = platforms.front(); E; E = E->next()) { for (List<String>::Element *it = E->value().entries.front(); it; it = it->next()) { - String target = E->key() + "." + it->get(); TargetConfig ecfg; ecfg.library = config->get_value("entry", target, ""); @@ -56,14 +55,12 @@ void GDNativeLibraryEditor::_bind_methods() { } void GDNativeLibraryEditor::_update_tree() { - tree->clear(); TreeItem *root = tree->create_item(); PopupMenu *filter_list = filter->get_popup(); String text = ""; for (int i = 0; i < filter_list->get_item_count(); i++) { - if (!filter_list->is_item_checked(i)) { continue; } @@ -77,71 +74,69 @@ void GDNativeLibraryEditor::_update_tree() { platform->set_text(0, E->get().name); platform->set_metadata(0, E->get().library_extension); - platform->set_custom_bg_color(0, get_color("prop_category", "Editor")); - platform->set_custom_bg_color(1, get_color("prop_category", "Editor")); - platform->set_custom_bg_color(2, get_color("prop_category", "Editor")); + platform->set_custom_bg_color(0, get_theme_color("prop_category", "Editor")); + platform->set_custom_bg_color(1, get_theme_color("prop_category", "Editor")); + platform->set_custom_bg_color(2, get_theme_color("prop_category", "Editor")); platform->set_selectable(0, false); platform->set_expand_right(0, true); for (List<String>::Element *it = E->value().entries.front(); it; it = it->next()) { - String target = E->key() + "." + it->get(); TreeItem *bit = tree->create_item(platform); bit->set_text(0, it->get()); bit->set_metadata(0, target); bit->set_selectable(0, false); - bit->set_custom_bg_color(0, get_color("prop_subsection", "Editor")); + bit->set_custom_bg_color(0, get_theme_color("prop_subsection", "Editor")); - bit->add_button(1, get_icon("Folder", "EditorIcons"), BUTTON_SELECT_LIBRARY, false, TTR("Select the dynamic library for this entry")); + bit->add_button(1, get_theme_icon("Folder", "EditorIcons"), BUTTON_SELECT_LIBRARY, false, TTR("Select the dynamic library for this entry")); String file = entry_configs[target].library; if (!file.empty()) { - bit->add_button(1, get_icon("Clear", "EditorIcons"), BUTTON_CLEAR_LIBRARY, false, TTR("Clear")); + bit->add_button(1, get_theme_icon("Clear", "EditorIcons"), BUTTON_CLEAR_LIBRARY, false, TTR("Clear")); } bit->set_text(1, file); - bit->add_button(2, get_icon("Folder", "EditorIcons"), BUTTON_SELECT_DEPENDENCES, false, TTR("Select dependencies of the library for this entry")); + bit->add_button(2, get_theme_icon("Folder", "EditorIcons"), BUTTON_SELECT_DEPENDENCES, false, TTR("Select dependencies of the library for this entry")); Array files = entry_configs[target].dependencies; if (files.size()) { - bit->add_button(2, get_icon("Clear", "EditorIcons"), BUTTON_CLEAR_DEPENDENCES, false, TTR("Clear")); + bit->add_button(2, get_theme_icon("Clear", "EditorIcons"), BUTTON_CLEAR_DEPENDENCES, false, TTR("Clear")); } bit->set_text(2, Variant(files)); - bit->add_button(3, get_icon("MoveUp", "EditorIcons"), BUTTON_MOVE_UP, false, TTR("Move Up")); - bit->add_button(3, get_icon("MoveDown", "EditorIcons"), BUTTON_MOVE_DOWN, false, TTR("Move Down")); - bit->add_button(3, get_icon("Remove", "EditorIcons"), BUTTON_ERASE_ENTRY, false, TTR("Remove current entry")); + bit->add_button(3, get_theme_icon("MoveUp", "EditorIcons"), BUTTON_MOVE_UP, false, TTR("Move Up")); + bit->add_button(3, get_theme_icon("MoveDown", "EditorIcons"), BUTTON_MOVE_DOWN, false, TTR("Move Down")); + bit->add_button(3, get_theme_icon("Remove", "EditorIcons"), BUTTON_ERASE_ENTRY, false, TTR("Remove current entry")); } TreeItem *new_arch = tree->create_item(platform); new_arch->set_text(0, TTR("Double click to create a new entry")); new_arch->set_text_align(0, TreeItem::ALIGN_CENTER); - new_arch->set_custom_color(0, get_color("accent_color", "Editor")); + new_arch->set_custom_color(0, get_theme_color("accent_color", "Editor")); new_arch->set_expand_right(0, true); new_arch->set_metadata(1, E->key()); - platform->set_collapsed(collapsed_items.find(E->get().name) != NULL); + platform->set_collapsed(collapsed_items.find(E->get().name) != nullptr); } filter->set_text(text); } void GDNativeLibraryEditor::_on_item_button(Object *item, int column, int id) { - String target = Object::cast_to<TreeItem>(item)->get_metadata(0); String platform = target.substr(0, target.find(".")); String entry = target.substr(platform.length() + 1, target.length()); String section = (id == BUTTON_SELECT_DEPENDENCES || id == BUTTON_CLEAR_DEPENDENCES) ? "dependencies" : "entry"; if (id == BUTTON_SELECT_LIBRARY || id == BUTTON_SELECT_DEPENDENCES) { - - EditorFileDialog::Mode mode = EditorFileDialog::MODE_OPEN_FILE; - if (id == BUTTON_SELECT_DEPENDENCES) - mode = EditorFileDialog::MODE_OPEN_FILES; + EditorFileDialog::FileMode mode = EditorFileDialog::FILE_MODE_OPEN_FILE; + if (id == BUTTON_SELECT_DEPENDENCES) { + mode = EditorFileDialog::FILE_MODE_OPEN_FILES; + } file_dialog->set_meta("target", target); file_dialog->set_meta("section", section); file_dialog->clear_filters(); file_dialog->add_filter(Object::cast_to<TreeItem>(item)->get_parent()->get_metadata(0)); - file_dialog->set_mode(mode); + file_dialog->set_file_mode(mode); file_dialog->popup_centered_ratio(); } else if (id == BUTTON_CLEAR_LIBRARY) { @@ -156,24 +151,20 @@ void GDNativeLibraryEditor::_on_item_button(Object *item, int column, int id) { } void GDNativeLibraryEditor::_on_library_selected(const String &file) { - _set_target_value(file_dialog->get_meta("section"), file_dialog->get_meta("target"), file); } void GDNativeLibraryEditor::_on_dependencies_selected(const PackedStringArray &files) { - _set_target_value(file_dialog->get_meta("section"), file_dialog->get_meta("target"), files); } void GDNativeLibraryEditor::_on_filter_selected(int index) { - PopupMenu *filter_list = filter->get_popup(); filter_list->set_item_checked(index, !filter_list->is_item_checked(index)); _update_tree(); } void GDNativeLibraryEditor::_on_item_collapsed(Object *p_item) { - TreeItem *item = Object::cast_to<TreeItem>(p_item); String name = item->get_text(0); @@ -185,7 +176,6 @@ void GDNativeLibraryEditor::_on_item_collapsed(Object *p_item) { } void GDNativeLibraryEditor::_on_item_activated() { - TreeItem *item = tree->get_selected(); if (item && tree->get_selected_column() == 0 && item->get_metadata(0).get_type() == Variant::NIL) { new_architecture_dialog->set_meta("platform", item->get_metadata(1)); @@ -194,7 +184,6 @@ void GDNativeLibraryEditor::_on_item_activated() { } void GDNativeLibraryEditor::_on_create_new_entry() { - String platform = new_architecture_dialog->get_meta("platform"); String entry = new_architecture_input->get_text().strip_edges(); if (!entry.empty()) { @@ -204,19 +193,18 @@ void GDNativeLibraryEditor::_on_create_new_entry() { } void GDNativeLibraryEditor::_set_target_value(const String §ion, const String &target, Variant file) { - if (section == "entry") + if (section == "entry") { entry_configs[target].library = file; - else if (section == "dependencies") + } else if (section == "dependencies") { entry_configs[target].dependencies = file; + } _translate_to_config_file(); _update_tree(); } void GDNativeLibraryEditor::_erase_entry(const String &platform, const String &entry) { - if (platforms.has(platform)) { if (List<String>::Element *E = platforms[platform].entries.find(entry)) { - String target = platform + "." + entry; platforms[platform].entries.erase(E); @@ -243,19 +231,17 @@ void GDNativeLibraryEditor::_move_entry(const String &platform, const String &en } void GDNativeLibraryEditor::_translate_to_config_file() { - if (!library.is_null()) { - Ref<ConfigFile> config = library->get_config_file(); config->erase_section("entry"); config->erase_section("dependencies"); for (Map<String, NativePlatformConfig>::Element *E = platforms.front(); E; E = E->next()) { for (List<String>::Element *it = E->value().entries.front(); it; it = it->next()) { - String target = E->key() + "." + it->get(); - if (entry_configs[target].library.empty() && entry_configs[target].dependencies.empty()) + if (entry_configs[target].library.empty() && entry_configs[target].dependencies.empty()) { continue; + } config->set_value("entry", target, entry_configs[target].library); config->set_value("dependencies", target, entry_configs[target].dependencies); @@ -267,7 +253,6 @@ void GDNativeLibraryEditor::_translate_to_config_file() { } GDNativeLibraryEditor::GDNativeLibraryEditor() { - { // Define platforms NativePlatformConfig platform_windows; platform_windows.name = "Windows"; @@ -298,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"); @@ -372,7 +357,7 @@ GDNativeLibraryEditor::GDNativeLibraryEditor() { file_dialog = memnew(EditorFileDialog); file_dialog->set_access(EditorFileDialog::ACCESS_RESOURCES); - file_dialog->set_resizable(true); + //file_dialog->set_resizable(true); add_child(file_dialog); file_dialog->connect("file_selected", callable_mp(this, &GDNativeLibraryEditor::_on_library_selected)); file_dialog->connect("files_selected", callable_mp(this, &GDNativeLibraryEditor::_on_dependencies_selected)); @@ -382,38 +367,36 @@ GDNativeLibraryEditor::GDNativeLibraryEditor() { new_architecture_dialog->set_title(TTR("Add an architecture entry")); new_architecture_input = memnew(LineEdit); new_architecture_dialog->add_child(new_architecture_input); - new_architecture_dialog->set_custom_minimum_size(Vector2(300, 80) * EDSCALE); + // new_architecture_dialog->set_custom_minimum_size(Vector2(300, 80) * EDSCALE); new_architecture_input->set_anchors_and_margins_preset(PRESET_HCENTER_WIDE, PRESET_MODE_MINSIZE, 5 * EDSCALE); new_architecture_dialog->get_ok()->connect("pressed", callable_mp(this, &GDNativeLibraryEditor::_on_create_new_entry)); } void GDNativeLibraryEditorPlugin::edit(Object *p_node) { - Ref<GDNativeLibrary> new_library = Object::cast_to<GDNativeLibrary>(p_node); - if (new_library.is_valid()) + if (new_library.is_valid()) { library_editor->edit(new_library); + } } bool GDNativeLibraryEditorPlugin::handles(Object *p_node) const { - return p_node->is_class("GDNativeLibrary"); } void GDNativeLibraryEditorPlugin::make_visible(bool p_visible) { - if (p_visible) { button->show(); EditorNode::get_singleton()->make_bottom_panel_item_visible(library_editor); } else { - if (library_editor->is_visible_in_tree()) + if (library_editor->is_visible_in_tree()) { EditorNode::get_singleton()->hide_bottom_panel(); + } button->hide(); } } GDNativeLibraryEditorPlugin::GDNativeLibraryEditorPlugin(EditorNode *p_node) { - library_editor = memnew(GDNativeLibraryEditor); library_editor->set_custom_minimum_size(Size2(0, 250 * EDSCALE)); button = p_node->add_bottom_panel_item(TTR("GDNativeLibrary"), library_editor); diff --git a/modules/gdnative/gdnative_library_editor_plugin.h b/modules/gdnative/gdnative_library_editor_plugin.h index b1274d08b3..5fdb860ca3 100644 --- a/modules/gdnative/gdnative_library_editor_plugin.h +++ b/modules/gdnative/gdnative_library_editor_plugin.h @@ -36,7 +36,6 @@ #include "gdnative.h" class GDNativeLibraryEditor : public Control { - GDCLASS(GDNativeLibraryEditor, Control); struct NativePlatformConfig { @@ -94,7 +93,6 @@ public: }; class GDNativeLibraryEditorPlugin : public EditorPlugin { - GDCLASS(GDNativeLibraryEditorPlugin, EditorPlugin); GDNativeLibraryEditor *library_editor; diff --git a/modules/gdnative/gdnative_library_singleton_editor.cpp b/modules/gdnative/gdnative_library_singleton_editor.cpp index 378339ecea..409b6cbffe 100644 --- a/modules/gdnative/gdnative_library_singleton_editor.cpp +++ b/modules/gdnative/gdnative_library_singleton_editor.cpp @@ -35,7 +35,6 @@ #include "editor/editor_node.h" Set<String> GDNativeLibrarySingletonEditor::_find_singletons_recursive(EditorFileSystemDirectory *p_dir) { - Set<String> file_paths; // check children @@ -67,7 +66,6 @@ Set<String> GDNativeLibrarySingletonEditor::_find_singletons_recursive(EditorFil } void GDNativeLibrarySingletonEditor::_discover_singletons() { - EditorFileSystemDirectory *dir = EditorFileSystem::get_singleton()->get_filesystem(); Set<String> file_paths = _find_singletons_recursive(dir); @@ -97,7 +95,6 @@ void GDNativeLibrarySingletonEditor::_discover_singletons() { } if (changed) { - ProjectSettings::get_singleton()->set("gdnative/singletons", files); _update_libraries(); // So singleton options (i.e. disabled) updates too ProjectSettings::get_singleton()->save(); @@ -105,7 +102,6 @@ void GDNativeLibrarySingletonEditor::_discover_singletons() { } void GDNativeLibrarySingletonEditor::_update_libraries() { - updating = true; libraries->clear(); libraries->create_item(); // root item @@ -139,19 +135,22 @@ void GDNativeLibrarySingletonEditor::_update_libraries() { } // The singletons list changed, we must update the settings - if (updated_disabled.size() != singletons_disabled.size()) + if (updated_disabled.size() != singletons_disabled.size()) { ProjectSettings::get_singleton()->set("gdnative/singletons_disabled", updated_disabled); + } updating = false; } void GDNativeLibrarySingletonEditor::_item_edited() { - if (updating) + if (updating) { return; + } TreeItem *item = libraries->get_edited(); - if (!item) + if (!item) { return; + } bool enabled = item->get_range(1); String path = item->get_metadata(0); @@ -169,8 +168,9 @@ void GDNativeLibrarySingletonEditor::_item_edited() { if (enabled) { disabled_paths.erase(path); } else { - if (disabled_paths.find(path) == -1) + if (disabled_paths.find(path) == -1) { disabled_paths.push_back(path); + } } undo_redo->create_action(enabled ? TTR("Enabled GDNative Singleton") : TTR("Disabled GDNative Singleton")); @@ -182,7 +182,6 @@ void GDNativeLibrarySingletonEditor::_item_edited() { } void GDNativeLibrarySingletonEditor::_notification(int p_what) { - if (p_what == NOTIFICATION_VISIBILITY_CHANGED) { if (is_visible_in_tree()) { _update_libraries(); @@ -191,7 +190,6 @@ void GDNativeLibrarySingletonEditor::_notification(int p_what) { } void GDNativeLibrarySingletonEditor::_bind_methods() { - ClassDB::bind_method(D_METHOD("_update_libraries"), &GDNativeLibrarySingletonEditor::_update_libraries); } diff --git a/modules/gdnative/icons/icon_g_d_native_library.svg b/modules/gdnative/icons/GDNativeLibrary.svg index b494c7af6e..b494c7af6e 100644 --- a/modules/gdnative/icons/icon_g_d_native_library.svg +++ b/modules/gdnative/icons/GDNativeLibrary.svg diff --git a/modules/gdnative/icons/icon_native_script.svg b/modules/gdnative/icons/NativeScript.svg index fb9e135627..fb9e135627 100644 --- a/modules/gdnative/icons/icon_native_script.svg +++ b/modules/gdnative/icons/NativeScript.svg 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/color.h b/modules/gdnative/include/gdnative/color.h index 47c01dbb20..e7737bf8e1 100644 --- a/modules/gdnative/include/gdnative/color.h +++ b/modules/gdnative/include/gdnative/color.h @@ -95,7 +95,7 @@ godot_color GDAPI godot_color_inverted(const godot_color *p_self); godot_color GDAPI godot_color_contrasted(const godot_color *p_self); -godot_color GDAPI godot_color_linear_interpolate(const godot_color *p_self, const godot_color *p_b, const godot_real p_t); +godot_color GDAPI godot_color_lerp(const godot_color *p_self, const godot_color *p_b, const godot_real p_t); godot_color GDAPI godot_color_blend(const godot_color *p_self, const godot_color *p_over); 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 c610377f54..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" { @@ -39,7 +39,7 @@ extern "C" { /////// PackedByteArray -#define GODOT_PACKED_BYTE_ARRAY_SIZE sizeof(void *) +#define GODOT_PACKED_BYTE_ARRAY_SIZE (2 * sizeof(void *)) #ifndef GODOT_CORE_API_GODOT_PACKED_BYTE_ARRAY_TYPE_DEFINED #define GODOT_CORE_API_GODOT_PACKED_BYTE_ARRAY_TYPE_DEFINED @@ -50,29 +50,51 @@ typedef struct { /////// PackedInt32Array -#define GODOT_PACKED_INT_ARRAY_SIZE 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 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 -#define GODOT_PACKED_STRING_ARRAY_SIZE sizeof(void *) +#define GODOT_PACKED_STRING_ARRAY_SIZE (2 * sizeof(void *)) #ifndef GODOT_CORE_API_GODOT_PACKED_STRING_ARRAY_TYPE_DEFINED #define GODOT_CORE_API_GODOT_PACKED_STRING_ARRAY_TYPE_DEFINED @@ -83,7 +105,7 @@ typedef struct { /////// PackedVector2Array -#define GODOT_PACKED_VECTOR2_ARRAY_SIZE sizeof(void *) +#define GODOT_PACKED_VECTOR2_ARRAY_SIZE (2 * sizeof(void *)) #ifndef GODOT_CORE_API_GODOT_PACKED_VECTOR2_ARRAY_TYPE_DEFINED #define GODOT_CORE_API_GODOT_PACKED_VECTOR2_ARRAY_TYPE_DEFINED @@ -94,7 +116,7 @@ typedef struct { /////// PackedVector3Array -#define GODOT_PACKED_VECTOR3_ARRAY_SIZE sizeof(void *) +#define GODOT_PACKED_VECTOR3_ARRAY_SIZE (2 * sizeof(void *)) #ifndef GODOT_CORE_API_GODOT_PACKED_VECTOR3_ARRAY_TYPE_DEFINED #define GODOT_CORE_API_GODOT_PACKED_VECTOR3_ARRAY_TYPE_DEFINED @@ -105,7 +127,7 @@ typedef struct { /////// PackedColorArray -#define GODOT_PACKED_COLOR_ARRAY_SIZE sizeof(void *) +#define GODOT_PACKED_COLOR_ARRAY_SIZE (2 * sizeof(void *)) #ifndef GODOT_CORE_API_GODOT_PACKED_COLOR_ARRAY_TYPE_DEFINED #define GODOT_CORE_API_GODOT_PACKED_COLOR_ARRAY_TYPE_DEFINED @@ -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/rid.h b/modules/gdnative/include/gdnative/rid.h index 04661cedc8..73b601dc04 100644 --- a/modules/gdnative/include/gdnative/rid.h +++ b/modules/gdnative/include/gdnative/rid.h @@ -37,7 +37,7 @@ extern "C" { #include <stdint.h> -#define GODOT_RID_SIZE sizeof(void *) +#define GODOT_RID_SIZE sizeof(uint64_t) #ifndef GODOT_CORE_API_GODOT_RID_TYPE_DEFINED #define GODOT_CORE_API_GODOT_RID_TYPE_DEFINED diff --git a/modules/gdnative/include/gdnative/variant.h b/modules/gdnative/include/gdnative/variant.h index 934e856fbf..0a611b76e9 100644 --- a/modules/gdnative/include/gdnative/variant.h +++ b/modules/gdnative/include/gdnative/variant.h @@ -37,7 +37,7 @@ extern "C" { #include <stdint.h> -#define GODOT_VARIANT_SIZE (16 + sizeof(void *)) +#define GODOT_VARIANT_SIZE (16 + sizeof(int64_t)) #ifndef GODOT_CORE_API_GODOT_VARIANT_TYPE_DEFINED #define GODOT_CORE_API_GODOT_VARIANT_TYPE_DEFINED @@ -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 15a1a6063b..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); @@ -81,7 +94,7 @@ godot_real GDAPI godot_vector2_angle_to(const godot_vector2 *p_self, const godot godot_real GDAPI godot_vector2_angle_to_point(const godot_vector2 *p_self, const godot_vector2 *p_to); -godot_vector2 GDAPI godot_vector2_linear_interpolate(const godot_vector2 *p_self, const godot_vector2 *p_b, const godot_real p_t); +godot_vector2 GDAPI godot_vector2_lerp(const godot_vector2 *p_self, const godot_vector2 *p_b, const godot_real p_t); godot_vector2 GDAPI godot_vector2_cubic_interpolate(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); @@ -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 1b344590ea..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); @@ -86,7 +99,7 @@ godot_vector3 GDAPI godot_vector3_snapped(const godot_vector3 *p_self, const god godot_vector3 GDAPI godot_vector3_rotated(const godot_vector3 *p_self, const godot_vector3 *p_axis, const godot_real p_phi); -godot_vector3 GDAPI godot_vector3_linear_interpolate(const godot_vector3 *p_self, const godot_vector3 *p_b, const godot_real p_t); +godot_vector3 GDAPI godot_vector3_lerp(const godot_vector3 *p_self, const godot_vector3 *p_b, const godot_real p_t); godot_vector3 GDAPI godot_vector3_cubic_interpolate(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); @@ -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 1b131c8cf0..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. @@ -54,7 +54,6 @@ typedef enum { GODOT_PROPERTY_HINT_ENUM, ///< hint_text= "val1,val2,val3,etc" GODOT_PROPERTY_HINT_EXP_EASING, /// exponential easing function (Math::ease) GODOT_PROPERTY_HINT_LENGTH, ///< hint_text= "length" (as integer) - GODOT_PROPERTY_HINT_SPRITE_FRAME, // FIXME: Obsolete: drop whenever we can break compat GODOT_PROPERTY_HINT_KEY_ACCEL, ///< hint_text= "length" (as integer) GODOT_PROPERTY_HINT_FLAGS, ///< hint_text= "flag1,flag2,etc" (as bit flags) GODOT_PROPERTY_HINT_LAYERS_2D_RENDER, @@ -83,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 { @@ -96,8 +95,7 @@ typedef enum { GODOT_PROPERTY_USAGE_INTERNATIONALIZED = 64, //hint for internationalized strings GODOT_PROPERTY_USAGE_GROUP = 128, //used for grouping props in the editor GODOT_PROPERTY_USAGE_CATEGORY = 256, - GODOT_PROPERTY_USAGE_STORE_IF_NONZERO = 512, // FIXME: Obsolete: drop whenever we can break compat - GODOT_PROPERTY_USAGE_STORE_IF_NONONE = 1024, // FIXME: Obsolete: drop whenever we can break compat + GODOT_PROPERTY_USAGE_SUBGROUP = 512, GODOT_PROPERTY_USAGE_NO_INSTANCE_STATE = 2048, GODOT_PROPERTY_USAGE_RESTART_IF_CHANGED = 4096, GODOT_PROPERTY_USAGE_SCRIPT_VARIABLE = 8192, @@ -108,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); @@ -232,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/include/net/godot_net.h b/modules/gdnative/include/net/godot_net.h index d245f3b965..42804112f2 100644 --- a/modules/gdnative/include/net/godot_net.h +++ b/modules/gdnative/include/net/godot_net.h @@ -45,7 +45,6 @@ extern "C" { #define GODOT_NET_API_MINOR 1 typedef struct { - godot_gdnative_api_version version; /* version of our API */ godot_object *data; /* User reference */ diff --git a/modules/gdnative/include/pluginscript/godot_pluginscript.h b/modules/gdnative/include/pluginscript/godot_pluginscript.h index 341e7f9e2b..406c3ba663 100644 --- a/modules/gdnative/include/pluginscript/godot_pluginscript.h +++ b/modules/gdnative/include/pluginscript/godot_pluginscript.h @@ -60,7 +60,7 @@ typedef struct { //this is used by script languages that keep a reference counter of their own //you can make make Ref<> not die when it reaches zero, so deleting the reference //depends entirely from the script. - // Note: You can set those function pointer to NULL if not needed. + // Note: You can set those function pointer to nullptr if not needed. void (*refcount_incremented)(godot_pluginscript_instance_data *p_data); bool (*refcount_decremented)(godot_pluginscript_instance_data *p_data); // return true if it can die } godot_pluginscript_instance_desc; @@ -119,18 +119,18 @@ typedef struct { const char *name; const char *type; const char *extension; - const char **recognized_extensions; // NULL terminated array + const char **recognized_extensions; // nullptr terminated array godot_pluginscript_language_data *(*init)(); void (*finish)(godot_pluginscript_language_data *p_data); - const char **reserved_words; // NULL terminated array - const char **comment_delimiters; // NULL terminated array - const char **string_delimiters; // NULL terminated array + const char **reserved_words; // nullptr terminated array + const char **comment_delimiters; // nullptr terminated array + const char **string_delimiters; // nullptr terminated array godot_bool has_named_classes; godot_bool supports_builtin_mode; godot_string (*get_template_source_code)(godot_pluginscript_language_data *p_data, const godot_string *p_class_name, const godot_string *p_base_class_name); godot_bool (*validate)(godot_pluginscript_language_data *p_data, const godot_string *p_script, int *r_line_error, int *r_col_error, godot_string *r_test_error, const godot_string *p_path, godot_packed_string_array *r_functions); - int (*find_function)(godot_pluginscript_language_data *p_data, const godot_string *p_function, const godot_string *p_code); // Can be NULL + int (*find_function)(godot_pluginscript_language_data *p_data, const godot_string *p_function, const godot_string *p_code); // Can be nullptr godot_string (*make_function)(godot_pluginscript_language_data *p_data, const godot_string *p_class, const godot_string *p_name, const godot_packed_string_array *p_args); godot_error (*complete_code)(godot_pluginscript_language_data *p_data, const godot_string *p_code, const godot_string *p_path, godot_object *p_owner, godot_array *r_options, godot_bool *r_force, godot_string *r_call_hint); void (*auto_indent_code)(godot_pluginscript_language_data *p_data, godot_string *p_code, int p_from_line, int p_to_line); diff --git a/modules/gdnative/include/videodecoder/godot_videodecoder.h b/modules/gdnative/include/videodecoder/godot_videodecoder.h index 3e91a2e9ac..16c92abd22 100644 --- a/modules/gdnative/include/videodecoder/godot_videodecoder.h +++ b/modules/gdnative/include/videodecoder/godot_videodecoder.h @@ -46,7 +46,7 @@ typedef struct void *next; void *(*constructor)(godot_object *); void (*destructor)(void *); - const char *(*get_plugin_name)(void); + const char *(*get_plugin_name)(); const char **(*get_supported_extensions)(int *count); godot_bool (*open_file)(void *, void *); // data struct, and a FileAccess pointer godot_real (*get_length)(const void *); diff --git a/modules/gdnative/include/arvr/godot_arvr.h b/modules/gdnative/include/xr/godot_xr.h index aaef31a855..22f7f021c4 100644 --- a/modules/gdnative/include/arvr/godot_arvr.h +++ b/modules/gdnative/include/xr/godot_xr.h @@ -1,5 +1,5 @@ /*************************************************************************/ -/* godot_arvr.h */ +/* godot_xr.h */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ @@ -28,8 +28,8 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -#ifndef GODOT_NATIVEARVR_H -#define GODOT_NATIVEARVR_H +#ifndef GODOT_NATIVEXR_H +#define GODOT_NATIVEXR_H #include <gdnative/gdnative.h> @@ -61,32 +61,31 @@ typedef struct { void (*fill_projection_for_eye)(void *, godot_real *, godot_int, godot_real, godot_real, godot_real); void (*commit_for_eye)(void *, godot_int, godot_rid *, godot_rect2 *); void (*process)(void *); - // only in 1.1 onwards godot_int (*get_external_texture_for_eye)(void *, godot_int); void (*notification)(void *, godot_int); godot_int (*get_camera_feed_id)(void *); -} godot_arvr_interface_gdnative; +} godot_xr_interface_gdnative; -void GDAPI godot_arvr_register_interface(const godot_arvr_interface_gdnative *p_interface); +void GDAPI godot_xr_register_interface(const godot_xr_interface_gdnative *p_interface); -// helper functions to access ARVRServer data -godot_real GDAPI godot_arvr_get_worldscale(); -godot_transform GDAPI godot_arvr_get_reference_frame(); +// helper functions to access XRServer data +godot_real GDAPI godot_xr_get_worldscale(); +godot_transform GDAPI godot_xr_get_reference_frame(); // helper functions for rendering -void GDAPI godot_arvr_blit(godot_int p_eye, godot_rid *p_render_target, godot_rect2 *p_rect); -godot_int GDAPI godot_arvr_get_texid(godot_rid *p_render_target); +void GDAPI godot_xr_blit(godot_int p_eye, godot_rid *p_render_target, godot_rect2 *p_rect); +godot_int GDAPI godot_xr_get_texid(godot_rid *p_render_target); -// helper functions for updating ARVR controllers -godot_int GDAPI godot_arvr_add_controller(char *p_device_name, godot_int p_hand, godot_bool p_tracks_orientation, godot_bool p_tracks_position); -void GDAPI godot_arvr_remove_controller(godot_int p_controller_id); -void GDAPI godot_arvr_set_controller_transform(godot_int p_controller_id, godot_transform *p_transform, godot_bool p_tracks_orientation, godot_bool p_tracks_position); -void GDAPI godot_arvr_set_controller_button(godot_int p_controller_id, godot_int p_button, godot_bool p_is_pressed); -void GDAPI godot_arvr_set_controller_axis(godot_int p_controller_id, godot_int p_axis, godot_real p_value, godot_bool p_can_be_negative); -godot_real GDAPI godot_arvr_get_controller_rumble(godot_int p_controller_id); +// helper functions for updating XR controllers +godot_int GDAPI godot_xr_add_controller(char *p_device_name, godot_int p_hand, godot_bool p_tracks_orientation, godot_bool p_tracks_position); +void GDAPI godot_xr_remove_controller(godot_int p_controller_id); +void GDAPI godot_xr_set_controller_transform(godot_int p_controller_id, godot_transform *p_transform, godot_bool p_tracks_orientation, godot_bool p_tracks_position); +void GDAPI godot_xr_set_controller_button(godot_int p_controller_id, godot_int p_button, godot_bool p_is_pressed); +void GDAPI godot_xr_set_controller_axis(godot_int p_controller_id, godot_int p_axis, godot_real p_value, godot_bool p_can_be_negative); +godot_real GDAPI godot_xr_get_controller_rumble(godot_int p_controller_id); #ifdef __cplusplus } #endif -#endif /* !GODOT_NATIVEARVR_H */ +#endif /* !GODOT_NATIVEXR_H */ diff --git a/modules/gdnative/nativescript/SCsub b/modules/gdnative/nativescript/SCsub index 92c9d6630d..4212e87a87 100644 --- a/modules/gdnative/nativescript/SCsub +++ b/modules/gdnative/nativescript/SCsub @@ -1,9 +1,9 @@ #!/usr/bin/env python -Import('env') -Import('env_gdnative') +Import("env") +Import("env_gdnative") -env_gdnative.add_source_files(env.modules_sources, '*.cpp') +env_gdnative.add_source_files(env.modules_sources, "*.cpp") -if "platform" in env and env["platform"] in ["x11", "iphone"]: +if "platform" in env and env["platform"] in ["linuxbsd", "iphone"]: env.Append(LINKFLAGS=["-rdynamic"]) diff --git a/modules/gdnative/nativescript/api_generator.cpp b/modules/gdnative/nativescript/api_generator.cpp index 850871579b..62f2ec5024 100644 --- a/modules/gdnative/nativescript/api_generator.cpp +++ b/modules/gdnative/nativescript/api_generator.cpp @@ -41,12 +41,11 @@ // helper stuff static Error save_file(const String &p_path, const List<String> &p_content) { - FileAccessRef file = FileAccess::open(p_path, FileAccess::WRITE); ERR_FAIL_COND_V(!file, ERR_FILE_CANT_WRITE); - for (const List<String>::Element *e = p_content.front(); e != NULL; e = e->next()) { + for (const List<String>::Element *e = p_content.front(); e != nullptr; e = e->next()) { file->store_string(e->get()); } @@ -98,7 +97,7 @@ struct SignalAPI { struct EnumAPI { String name; - List<Pair<int, String> > values; + List<Pair<int, String>> values; }; struct ClassAPI { @@ -146,7 +145,6 @@ static String get_type_name(const PropertyInfo &info) { struct MethodInfoComparator { StringName::AlphCompare compare; bool operator()(const MethodInfo &p_a, const MethodInfo &p_b) const { - return compare(p_a.name, p_b.name); } }; @@ -154,7 +152,6 @@ struct MethodInfoComparator { struct PropertyInfoComparator { StringName::AlphCompare compare; bool operator()(const PropertyInfo &p_a, const PropertyInfo &p_b) const { - return compare(p_a.name, p_b.name); } }; @@ -162,7 +159,6 @@ struct PropertyInfoComparator { struct ConstantAPIComparator { NoCaseComparator compare; bool operator()(const ConstantAPI &p_a, const ConstantAPI &p_b) const { - return compare(p_a.constant_name, p_b.constant_name); } }; @@ -171,7 +167,6 @@ struct ConstantAPIComparator { * Reads the entire Godot API to a list */ List<ClassAPI> generate_c_api_classes() { - List<ClassAPI> api; List<StringName> classes; @@ -197,7 +192,7 @@ List<ClassAPI> generate_c_api_classes() { api.push_back(global_constants_api); } - for (List<StringName>::Element *e = classes.front(); e != NULL; e = e->next()) { + for (List<StringName>::Element *e = classes.front(); e != nullptr; e = e->next()) { StringName class_name = e->get(); ClassAPI class_api; @@ -229,7 +224,7 @@ List<ClassAPI> generate_c_api_classes() { List<String> constant; ClassDB::get_integer_constant_list(class_name, &constant, true); constant.sort_custom<NoCaseComparator>(); - for (List<String>::Element *c = constant.front(); c != NULL; c = c->next()) { + for (List<String>::Element *c = constant.front(); c != nullptr; c = c->next()) { ConstantAPI constant_api; constant_api.constant_name = c->get(); constant_api.constant_value = ClassDB::get_integer_constant(class_name, c->get()); @@ -284,7 +279,7 @@ List<ClassAPI> generate_c_api_classes() { ClassDB::get_property_list(class_name, &properties, true); properties.sort_custom<PropertyInfoComparator>(); - for (List<PropertyInfo>::Element *p = properties.front(); p != NULL; p = p->next()) { + for (List<PropertyInfo>::Element *p = properties.front(); p != nullptr; p = p->next()) { PropertyAPI property_api; property_api.name = p->get().name; @@ -312,7 +307,7 @@ List<ClassAPI> generate_c_api_classes() { ClassDB::get_method_list(class_name, &methods, true); methods.sort_custom<MethodInfoComparator>(); - for (List<MethodInfo>::Element *m = methods.front(); m != NULL; m = m->next()) { + for (List<MethodInfo>::Element *m = methods.front(); m != nullptr; m = m->next()) { MethodAPI method_api; MethodBind *method_bind = ClassDB::get_method(class_name, m->get().name); MethodInfo &method_info = m->get(); @@ -392,10 +387,10 @@ List<ClassAPI> generate_c_api_classes() { enum_api.name = E->get(); ClassDB::get_enum_constants(class_name, E->get(), &value_names, true); for (List<StringName>::Element *val_e = value_names.front(); val_e; val_e = val_e->next()) { - int int_val = ClassDB::get_integer_constant(class_name, val_e->get(), NULL); + int int_val = ClassDB::get_integer_constant(class_name, val_e->get(), nullptr); enum_api.values.push_back(Pair<int, String>(int_val, val_e->get())); } - enum_api.values.sort_custom<PairSort<int, String> >(); + enum_api.values.sort_custom<PairSort<int, String>>(); class_api.enums.push_back(enum_api); } } @@ -410,14 +405,13 @@ List<ClassAPI> generate_c_api_classes() { * Generates the JSON source from the API in p_api */ static List<String> generate_c_api_json(const List<ClassAPI> &p_api) { - // I'm sorry for the \t mess List<String> source; source.push_back("[\n"); - for (const List<ClassAPI>::Element *c = p_api.front(); c != NULL; c = c->next()) { + for (const List<ClassAPI>::Element *c = p_api.front(); c != nullptr; c = c->next()) { ClassAPI api = c->get(); source.push_back("\t{\n"); @@ -497,7 +491,7 @@ static List<String> generate_c_api_json(const List<ClassAPI> &p_api) { source.push_back("\t\t\t{\n"); source.push_back("\t\t\t\t\"name\": \"" + e->get().name + "\",\n"); source.push_back("\t\t\t\t\"values\": {\n"); - for (List<Pair<int, String> >::Element *val_e = e->get().values.front(); val_e; val_e = val_e->next()) { + for (List<Pair<int, String>>::Element *val_e = e->get().values.front(); val_e; val_e = val_e->next()) { source.push_back("\t\t\t\t\t\"" + val_e->get().second + "\": " + itos(val_e->get().first)); source.push_back(String((val_e->next() ? "," : "")) + "\n"); } @@ -520,7 +514,6 @@ static List<String> generate_c_api_json(const List<ClassAPI> &p_api) { * p_path */ Error generate_c_api(const String &p_path) { - #ifndef TOOLS_ENABLED return ERR_BUG; #else diff --git a/modules/gdnative/nativescript/godot_nativescript.cpp b/modules/gdnative/nativescript/godot_nativescript.cpp index f953206a34..e47548f3e9 100644 --- a/modules/gdnative/nativescript/godot_nativescript.cpp +++ b/modules/gdnative/nativescript/godot_nativescript.cpp @@ -51,8 +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]; @@ -77,15 +76,14 @@ void GDAPI godot_nativescript_register_class(void *p_gdnative_handle, const char } } else { - desc.base_data = NULL; + desc.base_data = nullptr; desc.base_native_type = p_base; } 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]; @@ -111,15 +109,14 @@ void GDAPI godot_nativescript_register_tool_class(void *p_gdnative_handle, const } } else { - desc.base_data = NULL; + desc.base_data = nullptr; desc.base_native_type = p_base; } 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); @@ -138,8 +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); @@ -163,8 +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); @@ -176,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; @@ -189,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; @@ -209,12 +204,13 @@ void GDAPI godot_nativescript_register_signal(void *p_gdnative_handle, const cha void GDAPI *godot_nativescript_get_userdata(godot_object *p_instance) { Object *instance = (Object *)p_instance; - if (!instance) - return NULL; + if (!instance) { + return nullptr; + } if (instance->get_script_instance() && instance->get_script_instance()->get_language() == NativeScriptLanguage::get_singleton()) { return ((NativeScriptInstance *)instance->get_script_instance())->userdata; } - return NULL; + return nullptr; } /* @@ -225,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); @@ -239,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; @@ -315,25 +311,25 @@ void GDAPI godot_nativescript_set_type_tag(void *p_gdnative_handle, const char * } const void GDAPI *godot_nativescript_get_type_tag(const godot_object *p_object) { - const Object *o = (Object *)p_object; if (!o->get_script_instance()) { - return NULL; + return nullptr; } else { NativeScript *script = Object::cast_to<NativeScript>(o->get_script_instance()->get_script().ptr()); if (!script) { - return NULL; + return nullptr; } - if (script->get_script_desc()) + if (script->get_script_desc()) { return script->get_script_desc()->type_tag; + } } - return NULL; + 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 d0e196b3e6..94aa2125c2 100644 --- a/modules/gdnative/nativescript/nativescript.cpp +++ b/modules/gdnative/nativescript/nativescript.cpp @@ -111,6 +111,13 @@ void NativeScript::_placeholder_erased(PlaceHolderScriptInstance *p_placeholder) #endif +bool NativeScript::inherits_script(const Ref<Script> &p_script) const { +#ifndef _MSC_VER +#warning inheritance needs to be implemented in NativeScript +#endif + return false; +} + void NativeScript::set_class_name(String p_class_name) { class_name = p_class_name; } @@ -162,7 +169,6 @@ String NativeScript::get_script_class_icon_path() const { } bool NativeScript::can_instance() const { - NativeScriptDesc *script_data = get_script_desc(); #ifdef TOOLS_ENABLED @@ -178,8 +184,9 @@ bool NativeScript::can_instance() const { Ref<Script> NativeScript::get_base_script() const { NativeScriptDesc *script_data = get_script_desc(); - if (!script_data) + if (!script_data) { return Ref<Script>(); + } NativeScript *script = (NativeScript *)NSL->create_script(); Ref<NativeScript> ns = Ref<NativeScript>(script); @@ -193,18 +200,18 @@ Ref<Script> NativeScript::get_base_script() const { StringName NativeScript::get_instance_base_type() const { NativeScriptDesc *script_data = get_script_desc(); - if (!script_data) + if (!script_data) { return ""; + } return script_data->base_native_type; } ScriptInstance *NativeScript::instance_create(Object *p_this) { - NativeScriptDesc *script_data = get_script_desc(); if (!script_data) { - return NULL; + return nullptr; } NativeScriptInstance *nsi = memnew(NativeScriptInstance); @@ -214,7 +221,7 @@ ScriptInstance *NativeScript::instance_create(Object *p_this) { #ifndef TOOLS_ENABLED if (!ScriptServer::is_scripting_enabled()) { - nsi->userdata = NULL; + nsi->userdata = nullptr; } else { nsi->userdata = script_data->create_func.create_func((godot_object *)p_this, script_data->create_func.method_data); } @@ -240,7 +247,7 @@ PlaceHolderScriptInstance *NativeScript::placeholder_instance_create(Object *p_t return sins; #else - return NULL; + return nullptr; #endif } @@ -267,8 +274,9 @@ bool NativeScript::has_method(const StringName &p_method) const { NativeScriptDesc *script_data = get_script_desc(); while (script_data) { - if (script_data->methods.has(p_method)) + if (script_data->methods.has(p_method)) { return true; + } script_data = script_data->base_data; } @@ -278,14 +286,16 @@ bool NativeScript::has_method(const StringName &p_method) const { MethodInfo NativeScript::get_method_info(const StringName &p_method) const { NativeScriptDesc *script_data = get_script_desc(); - if (!script_data) + if (!script_data) { return MethodInfo(); + } while (script_data) { Map<StringName, NativeScriptDesc::Method>::Element *M = script_data->methods.find(p_method); - if (M) + if (M) { return M->get().info; + } script_data = script_data->base_data; } @@ -299,8 +309,9 @@ bool NativeScript::is_valid() const { bool NativeScript::is_tool() const { NativeScriptDesc *script_data = get_script_desc(); - if (script_data) + if (script_data) { return script_data->is_tool; + } return false; } @@ -313,8 +324,9 @@ bool NativeScript::has_script_signal(const StringName &p_signal) const { NativeScriptDesc *script_data = get_script_desc(); while (script_data) { - if (script_data->signals_.has(p_signal)) + if (script_data->signals_.has(p_signal)) { return true; + } script_data = script_data->base_data; } return false; @@ -323,13 +335,13 @@ bool NativeScript::has_script_signal(const StringName &p_signal) const { void NativeScript::get_script_signal_list(List<MethodInfo> *r_signals) const { NativeScriptDesc *script_data = get_script_desc(); - if (!script_data) + if (!script_data) { return; + } Set<MethodInfo> signals_; while (script_data) { - for (Map<StringName, NativeScriptDesc::Signal>::Element *S = script_data->signals_.front(); S; S = S->next()) { signals_.insert(S->get().signal); } @@ -350,8 +362,9 @@ bool NativeScript::get_property_default_value(const StringName &p_property, Vari P = script_data->properties.find(p_property); script_data = script_data->base_data; } - if (!P) + if (!P) { return false; + } r_value = P.get().default_value; return true; @@ -363,13 +376,13 @@ void NativeScript::update_exports() { void NativeScript::get_script_method_list(List<MethodInfo> *p_list) const { NativeScriptDesc *script_data = get_script_desc(); - if (!script_data) + if (!script_data) { return; + } Set<MethodInfo> methods; while (script_data) { - for (Map<StringName, NativeScriptDesc::Method>::Element *E = script_data->methods.front(); E; E = E->next()) { methods.insert(E->get().info); } @@ -401,13 +414,11 @@ void NativeScript::get_script_property_list(List<PropertyInfo> *p_list) const { } Vector<ScriptNetData> NativeScript::get_rpc_methods() const { - Vector<ScriptNetData> v; NativeScriptDesc *script_data = get_script_desc(); while (script_data) { - for (Map<StringName, NativeScriptDesc::Method>::Element *E = script_data->methods.front(); E; E = E->next()) { if (E->get().rpc_mode != GODOT_METHOD_RPC_MODE_DISABLED) { ScriptNetData nd; @@ -427,7 +438,6 @@ uint16_t NativeScript::get_rpc_method_id(const StringName &p_method) const { NativeScriptDesc *script_data = get_script_desc(); while (script_data) { - Map<StringName, NativeScriptDesc::Method>::Element *E = script_data->methods.find(p_method); if (E) { return E->get().rpc_method_id; @@ -445,7 +455,6 @@ StringName NativeScript::get_rpc_method(uint16_t p_id) const { NativeScriptDesc *script_data = get_script_desc(); while (script_data) { - for (Map<StringName, NativeScriptDesc::Method>::Element *E = script_data->methods.front(); E; E = E->next()) { if (E->get().rpc_method_id == p_id) { return E->key(); @@ -459,13 +468,11 @@ StringName NativeScript::get_rpc_method(uint16_t p_id) const { } MultiplayerAPI::RPCMode NativeScript::get_rpc_mode_by_id(uint16_t p_id) const { - ERR_FAIL_COND_V(p_id == UINT16_MAX, MultiplayerAPI::RPC_MODE_DISABLED); NativeScriptDesc *script_data = get_script_desc(); while (script_data) { - for (Map<StringName, NativeScriptDesc::Method>::Element *E = script_data->methods.front(); E; E = E->next()) { if (E->get().rpc_method_id == p_id) { switch (E->get().rpc_mode) { @@ -496,11 +503,9 @@ MultiplayerAPI::RPCMode NativeScript::get_rpc_mode_by_id(uint16_t p_id) const { } MultiplayerAPI::RPCMode NativeScript::get_rpc_mode(const StringName &p_method) const { - NativeScriptDesc *script_data = get_script_desc(); while (script_data) { - Map<StringName, NativeScriptDesc::Method>::Element *E = script_data->methods.find(p_method); if (E) { switch (E->get().rpc_mode) { @@ -535,7 +540,6 @@ Vector<ScriptNetData> NativeScript::get_rset_properties() const { NativeScriptDesc *script_data = get_script_desc(); while (script_data) { - for (OrderedHashMap<StringName, NativeScriptDesc::Property>::Element E = script_data->properties.front(); E; E = E.next()) { if (E.get().rset_mode != GODOT_METHOD_RPC_MODE_DISABLED) { ScriptNetData nd; @@ -554,7 +558,6 @@ uint16_t NativeScript::get_rset_property_id(const StringName &p_variable) const NativeScriptDesc *script_data = get_script_desc(); while (script_data) { - OrderedHashMap<StringName, NativeScriptDesc::Property>::Element E = script_data->properties.find(p_variable); if (E) { return E.get().rset_property_id; @@ -572,7 +575,6 @@ StringName NativeScript::get_rset_property(uint16_t p_id) const { NativeScriptDesc *script_data = get_script_desc(); while (script_data) { - for (OrderedHashMap<StringName, NativeScriptDesc::Property>::Element E = script_data->properties.front(); E; E = E.next()) { if (E.get().rset_property_id == p_id) { return E.key(); @@ -586,13 +588,11 @@ StringName NativeScript::get_rset_property(uint16_t p_id) const { } MultiplayerAPI::RPCMode NativeScript::get_rset_mode_by_id(uint16_t p_id) const { - ERR_FAIL_COND_V(p_id == UINT16_MAX, MultiplayerAPI::RPC_MODE_DISABLED); NativeScriptDesc *script_data = get_script_desc(); while (script_data) { - for (OrderedHashMap<StringName, NativeScriptDesc::Property>::Element E = script_data->properties.front(); E; E = E.next()) { if (E.get().rset_property_id == p_id) { switch (E.get().rset_mode) { @@ -623,11 +623,9 @@ MultiplayerAPI::RPCMode NativeScript::get_rset_mode_by_id(uint16_t p_id) const { } MultiplayerAPI::RPCMode NativeScript::get_rset_mode(const StringName &p_variable) const { - NativeScriptDesc *script_data = get_script_desc(); while (script_data) { - OrderedHashMap<StringName, NativeScriptDesc::Property>::Element E = script_data->properties.find(p_variable); if (E) { switch (E.get().rset_mode) { @@ -670,7 +668,6 @@ String NativeScript::get_method_documentation(const StringName &p_method) const ERR_FAIL_COND_V_MSG(!script_data, "", "Attempt to get method documentation on invalid NativeScript."); while (script_data) { - Map<StringName, NativeScriptDesc::Method>::Element *method = script_data->methods.find(p_method); if (method) { @@ -689,7 +686,6 @@ String NativeScript::get_signal_documentation(const StringName &p_signal_name) c ERR_FAIL_COND_V_MSG(!script_data, "", "Attempt to get signal documentation on invalid NativeScript."); while (script_data) { - Map<StringName, NativeScriptDesc::Signal>::Element *signal = script_data->signals_.find(p_signal_name); if (signal) { @@ -708,7 +704,6 @@ String NativeScript::get_property_documentation(const StringName &p_path) const ERR_FAIL_COND_V_MSG(!script_data, "", "Attempt to get property documentation on invalid NativeScript."); while (script_data) { - OrderedHashMap<StringName, NativeScriptDesc::Property>::Element property = script_data->properties.find(p_path); if (property) { @@ -722,7 +717,6 @@ String NativeScript::get_property_documentation(const StringName &p_path) const } Variant NativeScript::_new(const Variant **p_args, int p_argcount, Callable::CallError &r_error) { - if (lib_path.empty() || class_name.empty() || library.is_null()) { r_error.error = Callable::CallError::CALL_ERROR_INSTANCE_IS_NULL; return Variant(); @@ -738,7 +732,7 @@ Variant NativeScript::_new(const Variant **p_args, int p_argcount, Callable::Cal r_error.error = Callable::CallError::CALL_OK; REF ref; - Object *owner = NULL; + Object *owner = nullptr; if (!(script_data->base_native_type == "")) { owner = ClassDB::instance(script_data->base_native_type); @@ -833,6 +827,7 @@ bool NativeScriptInstance::set(const StringName &p_name, const Variant &p_value) } return false; } + bool NativeScriptInstance::get(const StringName &p_name, Variant &r_ret) const { NativeScriptDesc *script_data = GET_SCRIPT_DESC(); @@ -877,16 +872,14 @@ void NativeScriptInstance::get_property_list(List<PropertyInfo> *p_properties) c NativeScriptDesc *script_data = GET_SCRIPT_DESC(); while (script_data) { - Map<StringName, NativeScriptDesc::Method>::Element *E = script_data->methods.find("_get_property_list"); if (E) { - godot_variant result; result = E->get().method.method((godot_object *)owner, E->get().method.method_data, userdata, 0, - NULL); + nullptr); Variant res = *(Variant *)&result; godot_variant_destroy(&result); @@ -929,11 +922,9 @@ void NativeScriptInstance::get_property_list(List<PropertyInfo> *p_properties) c } Variant::Type NativeScriptInstance::get_property_type(const StringName &p_name, bool *r_is_valid) const { - NativeScriptDesc *script_data = GET_SCRIPT_DESC(); while (script_data) { - OrderedHashMap<StringName, NativeScriptDesc::Property>::Element P = script_data->properties.find(p_name); if (P) { *r_is_valid = true; @@ -954,7 +945,6 @@ bool NativeScriptInstance::has_method(const StringName &p_method) const { } Variant NativeScriptInstance::call(const StringName &p_method, const Variant **p_args, int p_argcount, Callable::CallError &r_error) { - NativeScriptDesc *script_data = GET_SCRIPT_DESC(); while (script_data) { @@ -1007,26 +997,29 @@ void NativeScriptInstance::notification(int p_notification) { String NativeScriptInstance::to_string(bool *r_valid) { if (has_method(CoreStringNames::get_singleton()->_to_string)) { Callable::CallError ce; - Variant ret = call(CoreStringNames::get_singleton()->_to_string, NULL, 0, ce); + Variant ret = call(CoreStringNames::get_singleton()->_to_string, nullptr, 0, ce); if (ce.error == Callable::CallError::CALL_OK) { if (ret.get_type() != Variant::STRING) { - if (r_valid) + if (r_valid) { *r_valid = false; + } ERR_FAIL_V_MSG(String(), "Wrong type for " + CoreStringNames::get_singleton()->_to_string + ", must be a String."); } - if (r_valid) + if (r_valid) { *r_valid = true; + } return ret.operator String(); } } - if (r_valid) + if (r_valid) { *r_valid = false; + } return String(); } void NativeScriptInstance::refcount_incremented() { Callable::CallError err; - call("_refcount_incremented", NULL, 0, err); + call("_refcount_incremented", nullptr, 0, err); if (err.error != Callable::CallError::CALL_OK && err.error != Callable::CallError::CALL_ERROR_INVALID_METHOD) { ERR_PRINT("Failed to invoke _refcount_incremented - should not happen"); } @@ -1034,7 +1027,7 @@ void NativeScriptInstance::refcount_incremented() { bool NativeScriptInstance::refcount_decremented() { Callable::CallError err; - Variant ret = call("_refcount_decremented", NULL, 0, err); + Variant ret = call("_refcount_decremented", nullptr, 0, err); if (err.error != Callable::CallError::CALL_OK && err.error != Callable::CallError::CALL_ERROR_INVALID_METHOD) { ERR_PRINT("Failed to invoke _refcount_decremented - should not happen"); return true; // assume we can destroy the object @@ -1120,11 +1113,11 @@ void NativeScriptInstance::call_multilevel_reversed(const StringName &p_method, } NativeScriptInstance::~NativeScriptInstance() { - NativeScriptDesc *script_data = GET_SCRIPT_DESC(); - if (!script_data) + if (!script_data) { return; + } script_data->destroy_func.destroy_func((godot_object *)owner, script_data->destroy_func.method_data, userdata); @@ -1138,17 +1131,14 @@ NativeScriptInstance::~NativeScriptInstance() { NativeScriptLanguage *NativeScriptLanguage::singleton; void NativeScriptLanguage::_unload_stuff(bool p_reload) { + Map<String, Ref<GDNative>> erase_and_unload; - Map<String, Ref<GDNative> > erase_and_unload; - - for (Map<String, Map<StringName, NativeScriptDesc> >::Element *L = library_classes.front(); L; L = L->next()) { - + for (Map<String, Map<StringName, NativeScriptDesc>>::Element *L = library_classes.front(); L; L = L->next()) { String lib_path = L->key(); Map<StringName, NativeScriptDesc> classes = L->get(); if (p_reload) { - - Map<String, Ref<GDNative> >::Element *E = library_gdnatives.find(lib_path); + Map<String, Ref<GDNative>>::Element *E = library_gdnatives.find(lib_path); Ref<GDNative> gdn; if (E) { @@ -1169,7 +1159,7 @@ void NativeScriptLanguage::_unload_stuff(bool p_reload) { } } - Map<String, Ref<GDNative> >::Element *E = library_gdnatives.find(lib_path); + Map<String, Ref<GDNative>>::Element *E = library_gdnatives.find(lib_path); Ref<GDNative> gdn; if (E) { @@ -1177,34 +1167,38 @@ void NativeScriptLanguage::_unload_stuff(bool p_reload) { } for (Map<StringName, NativeScriptDesc>::Element *C = classes.front(); C; C = C->next()) { - // free property stuff first for (OrderedHashMap<StringName, NativeScriptDesc::Property>::Element P = C->get().properties.front(); P; P = P.next()) { - if (P.get().getter.free_func) + if (P.get().getter.free_func) { P.get().getter.free_func(P.get().getter.method_data); + } - if (P.get().setter.free_func) + if (P.get().setter.free_func) { P.get().setter.free_func(P.get().setter.method_data); + } } // free method stuff for (Map<StringName, NativeScriptDesc::Method>::Element *M = C->get().methods.front(); M; M = M->next()) { - if (M->get().method.free_func) + if (M->get().method.free_func) { M->get().method.free_func(M->get().method.method_data); + } } // free constructor/destructor - if (C->get().create_func.free_func) + if (C->get().create_func.free_func) { C->get().create_func.free_func(C->get().create_func.method_data); + } - if (C->get().destroy_func.free_func) + if (C->get().destroy_func.free_func) { C->get().destroy_func.free_func(C->get().destroy_func.method_data); + } } erase_and_unload.insert(lib_path, gdn); } - for (Map<String, Ref<GDNative> >::Element *E = erase_and_unload.front(); E; E = E->next()) { + for (Map<String, Ref<GDNative>>::Element *E = erase_and_unload.front(); E; E = E->next()) { String lib_path = E->key(); Ref<GDNative> gdn = E->get(); @@ -1246,13 +1240,10 @@ NativeScriptLanguage::NativeScriptLanguage() { } NativeScriptLanguage::~NativeScriptLanguage() { - - for (Map<String, Ref<GDNative> >::Element *L = NSL->library_gdnatives.front(); L; L = L->next()) { - + for (Map<String, Ref<GDNative>>::Element *L = NSL->library_gdnatives.front(); L; L = L->next()) { Ref<GDNative> lib = L->get(); // only shut down valid libs, duh! if (lib.is_valid()) { - // If it's a singleton-library then the gdnative module // manages the destruction at engine shutdown, not NativeScript. if (!lib->get_library()->is_singleton()) { @@ -1278,7 +1269,6 @@ void _add_reload_node() { } void NativeScriptLanguage::init() { - #if defined(TOOLS_ENABLED) && defined(DEBUG_METHODS_ENABLED) List<String> args = OS::get_singleton()->get_cmdline_args(); @@ -1297,22 +1287,29 @@ void NativeScriptLanguage::init() { EditorNode::add_init_callback(&_add_reload_node); #endif } + String NativeScriptLanguage::get_type() const { return "NativeScript"; } + String NativeScriptLanguage::get_extension() const { return "gdns"; } + Error NativeScriptLanguage::execute_file(const String &p_path) { return OK; // Qué? } + void NativeScriptLanguage::finish() { _unload_stuff(); } + void NativeScriptLanguage::get_reserved_words(List<String> *p_words) const { } + void NativeScriptLanguage::get_comment_delimiters(List<String> *p_delimiters) const { } + void NativeScriptLanguage::get_string_delimiters(List<String> *p_delimiters) const { } @@ -1321,6 +1318,7 @@ Ref<Script> NativeScriptLanguage::get_template(const String &p_class_name, const s->set_class_name(p_class_name); return Ref<NativeScript>(s); } + bool NativeScriptLanguage::validate(const String &p_script, int &r_line_error, int &r_col_error, String &r_test_error, const String &p_path, List<String> *r_functions, List<ScriptLanguage::Warning> *r_warnings, Set<int> *r_safe_lines) const { return true; } @@ -1329,20 +1327,26 @@ Script *NativeScriptLanguage::create_script() const { NativeScript *script = memnew(NativeScript); return script; } + bool NativeScriptLanguage::has_named_classes() const { return true; } + bool NativeScriptLanguage::supports_builtin_mode() const { return true; } + int NativeScriptLanguage::find_function(const String &p_function, const String &p_code) const { return -1; } + String NativeScriptLanguage::make_function(const String &p_class, const String &p_name, const PackedStringArray &p_args) const { return ""; } + void NativeScriptLanguage::auto_indent_code(String &p_code, int p_from_line, int p_to_line) const { } + void NativeScriptLanguage::add_global_constant(const StringName &p_variable, const Variant &p_value) { } @@ -1350,27 +1354,36 @@ void NativeScriptLanguage::add_global_constant(const StringName &p_variable, con String NativeScriptLanguage::debug_get_error() const { return ""; } + int NativeScriptLanguage::debug_get_stack_level_count() const { return -1; } + int NativeScriptLanguage::debug_get_stack_level_line(int p_level) const { return -1; } + String NativeScriptLanguage::debug_get_stack_level_function(int p_level) const { return ""; } + String NativeScriptLanguage::debug_get_stack_level_source(int p_level) const { return ""; } + void NativeScriptLanguage::debug_get_stack_level_locals(int p_level, List<String> *p_locals, List<Variant> *p_values, int p_max_subitems, int p_max_depth) { } + void NativeScriptLanguage::debug_get_stack_level_members(int p_level, List<String> *p_members, List<Variant> *p_values, int p_max_subitems, int p_max_depth) { } + void NativeScriptLanguage::debug_get_globals(List<String> *p_locals, List<Variant> *p_values, int p_max_subitems, int p_max_depth) { } + String NativeScriptLanguage::debug_parse_stack_level_expression(int p_level, const String &p_expression, int p_max_subitems, int p_max_depth) { return ""; } + // Debugging stuff end. void NativeScriptLanguage::reload_all_scripts() { @@ -1378,6 +1391,7 @@ void NativeScriptLanguage::reload_all_scripts() { void NativeScriptLanguage::reload_tool_script(const Ref<Script> &p_script, bool p_soft_reload) { } + void NativeScriptLanguage::get_recognized_extensions(List<String> *p_extensions) const { p_extensions->push_back("gdns"); } @@ -1385,7 +1399,7 @@ void NativeScriptLanguage::get_recognized_extensions(List<String> *p_extensions) void NativeScriptLanguage::get_public_functions(List<MethodInfo> *p_functions) const { } -void NativeScriptLanguage::get_public_constants(List<Pair<String, Variant> > *p_constants) const { +void NativeScriptLanguage::get_public_constants(List<Pair<String, Variant>> *p_constants) const { } void NativeScriptLanguage::profiling_start() { @@ -1412,8 +1426,9 @@ int NativeScriptLanguage::profiling_get_accumulated_data(ProfilingInfo *p_info_a int current = 0; for (Map<StringName, ProfileData>::Element *d = profile_data.front(); d; d = d->next()) { - if (current >= p_info_max) + if (current >= p_info_max) { break; + } p_info_arr[current].call_count = d->get().call_count; p_info_arr[current].self_time = d->get().self_time; @@ -1435,8 +1450,9 @@ int NativeScriptLanguage::profiling_get_frame_data(ProfilingInfo *p_info_arr, in int current = 0; for (Map<StringName, ProfileData>::Element *d = profile_data.front(); d; d = d->next()) { - if (current >= p_info_max) + if (current >= p_info_max) { break; + } if (d->get().last_frame_call_count) { p_info_arr[current].call_count = d->get().last_frame_call_count; @@ -1482,8 +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; @@ -1514,25 +1529,28 @@ void NativeScriptLanguage::unregister_binding_functions(int p_idx) { for (Set<Vector<void *> *>::Element *E = binding_instances.front(); E; E = E->next()) { Vector<void *> &binding_data = *E->get(); - if (p_idx < binding_data.size() && binding_data[p_idx] && binding_functions[p_idx].second.free_instance_binding_data) + if (p_idx < binding_data.size() && binding_data[p_idx] && binding_functions[p_idx].second.free_instance_binding_data) { binding_functions[p_idx].second.free_instance_binding_data(binding_functions[p_idx].second.data, binding_data[p_idx]); + } } binding_functions.write[p_idx].first = false; - if (binding_functions[p_idx].second.free_func) + if (binding_functions[p_idx].second.free_func) { binding_functions[p_idx].second.free_func(binding_functions[p_idx].second.data); + } } void *NativeScriptLanguage::get_instance_binding_data(int p_idx, Object *p_object) { - ERR_FAIL_INDEX_V(p_idx, binding_functions.size(), NULL); + ERR_FAIL_INDEX_V(p_idx, binding_functions.size(), nullptr); - ERR_FAIL_COND_V_MSG(!binding_functions[p_idx].first, NULL, "Tried to get binding data for a nativescript binding that does not exist."); + ERR_FAIL_COND_V_MSG(!binding_functions[p_idx].first, nullptr, "Tried to get binding data for a nativescript binding that does not exist."); Vector<void *> *binding_data = (Vector<void *> *)p_object->get_script_instance_binding(lang_idx); - if (!binding_data) - return NULL; // should never happen. + if (!binding_data) { + return nullptr; // should never happen. + } if (binding_data->size() <= p_idx) { // okay, add new elements here. @@ -1541,12 +1559,11 @@ void *NativeScriptLanguage::get_instance_binding_data(int p_idx, Object *p_objec binding_data->resize(p_idx + 1); for (int i = old_size; i <= p_idx; i++) { - (*binding_data).write[i] = NULL; + (*binding_data).write[i] = nullptr; } } if (!(*binding_data)[p_idx]) { - const void *global_type_tag = get_global_type_tag(p_idx, p_object->get_class_name()); // no binding data yet, soooooo alloc new one \o/ @@ -1557,13 +1574,12 @@ void *NativeScriptLanguage::get_instance_binding_data(int p_idx, Object *p_objec } void *NativeScriptLanguage::alloc_instance_binding_data(Object *p_object) { - Vector<void *> *binding_data = new Vector<void *>; binding_data->resize(binding_functions.size()); for (int i = 0; i < binding_functions.size(); i++) { - (*binding_data).write[i] = NULL; + (*binding_data).write[i] = nullptr; } binding_instances.insert(binding_data); @@ -1572,15 +1588,16 @@ void *NativeScriptLanguage::alloc_instance_binding_data(Object *p_object) { } void NativeScriptLanguage::free_instance_binding_data(void *p_data) { - - if (!p_data) + if (!p_data) { return; + } Vector<void *> &binding_data = *(Vector<void *> *)p_data; for (int i = 0; i < binding_data.size(); i++) { - if (!binding_data[i]) + if (!binding_data[i]) { continue; + } if (binding_functions[i].first && binding_functions[i].second.free_instance_binding_data) { binding_functions[i].second.free_instance_binding_data(binding_functions[i].second.data, binding_data[i]); @@ -1593,20 +1610,22 @@ void NativeScriptLanguage::free_instance_binding_data(void *p_data) { } void NativeScriptLanguage::refcount_incremented_instance_binding(Object *p_object) { - void *data = p_object->get_script_instance_binding(lang_idx); - if (!data) + if (!data) { return; + } Vector<void *> &binding_data = *(Vector<void *> *)data; for (int i = 0; i < binding_data.size(); i++) { - if (!binding_data[i]) + if (!binding_data[i]) { continue; + } - if (!binding_functions[i].first) + if (!binding_functions[i].first) { continue; + } if (binding_functions[i].second.refcount_incremented_instance_binding) { binding_functions[i].second.refcount_incremented_instance_binding(binding_data[i], p_object); @@ -1615,22 +1634,24 @@ void NativeScriptLanguage::refcount_incremented_instance_binding(Object *p_objec } bool NativeScriptLanguage::refcount_decremented_instance_binding(Object *p_object) { - void *data = p_object->get_script_instance_binding(lang_idx); - if (!data) + if (!data) { return true; + } Vector<void *> &binding_data = *(Vector<void *> *)data; bool can_die = true; for (int i = 0; i < binding_data.size(); i++) { - if (!binding_data[i]) + if (!binding_data[i]) { continue; + } - if (!binding_functions[i].first) + if (!binding_functions[i].first) { continue; + } if (binding_functions[i].second.refcount_decremented_instance_binding) { can_die = can_die && binding_functions[i].second.refcount_decremented_instance_binding(binding_data[i], p_object); @@ -1651,13 +1672,15 @@ void NativeScriptLanguage::set_global_type_tag(int p_idx, StringName p_class_nam } const void *NativeScriptLanguage::get_global_type_tag(int p_idx, StringName p_class_name) const { - if (!global_type_tags.has(p_idx)) - return NULL; + if (!global_type_tags.has(p_idx)) { + return nullptr; + } const HashMap<StringName, const void *> &tags = global_type_tags[p_idx]; - if (!tags.has(p_class_name)) - return NULL; + if (!tags.has(p_class_name)) { + return nullptr; + } const void *tag = tags.get(p_class_name); @@ -1679,7 +1702,7 @@ void NativeScriptLanguage::init_library(const Ref<GDNativeLibrary> &lib) { // See if this library was "registered" already. const String &lib_path = lib->get_current_library_path(); ERR_FAIL_COND_MSG(lib_path.length() == 0, lib->get_name() + " does not have a library for the current platform."); - Map<String, Ref<GDNative> >::Element *E = library_gdnatives.find(lib_path); + Map<String, Ref<GDNative>>::Element *E = library_gdnatives.find(lib_path); if (!E) { Ref<GDNative> gdn; @@ -1693,8 +1716,9 @@ void NativeScriptLanguage::init_library(const Ref<GDNativeLibrary> &lib) { library_classes.insert(lib_path, Map<StringName, NativeScriptDesc>()); - if (!library_script_users.has(lib_path)) + if (!library_script_users.has(lib_path)) { library_script_users.insert(lib_path, Set<NativeScript *>()); + } void *proc_ptr; @@ -1719,7 +1743,7 @@ void NativeScriptLanguage::register_script(NativeScript *script) { void NativeScriptLanguage::unregister_script(NativeScript *script) { MutexLock lock(mutex); - Map<String, Set<NativeScript *> >::Element *S = library_script_users.find(script->lib_path); + Map<String, Set<NativeScript *>>::Element *S = library_script_users.find(script->lib_path); if (S) { S->get().erase(script); if (S->get().size() == 0) { @@ -1733,14 +1757,12 @@ void NativeScriptLanguage::unregister_script(NativeScript *script) { void NativeScriptLanguage::call_libraries_cb(const StringName &name) { // library_gdnatives is modified only from the main thread, so it's safe not to use mutex here - for (Map<String, Ref<GDNative> >::Element *L = library_gdnatives.front(); L; L = L->next()) { - + for (Map<String, Ref<GDNative>>::Element *L = library_gdnatives.front(); L; L = L->next()) { if (L->get().is_null()) { continue; } if (L->get()->is_initialized()) { - void *proc_ptr; Error err = L->get()->get_symbol(L->get()->get_library()->get_symbol_prefix() + name, proc_ptr); @@ -1755,7 +1777,7 @@ void NativeScriptLanguage::frame() { #ifndef NO_THREADS if (has_objects_to_register) { MutexLock lock(mutex); - for (Set<Ref<GDNativeLibrary> >::Element *L = libs_to_init.front(); L; L = L->next()) { + for (Set<Ref<GDNativeLibrary>>::Element *L = libs_to_init.front(); L; L = L->next()) { init_library(L->get()); } libs_to_init.clear(); @@ -1805,16 +1827,20 @@ String NativeScriptLanguage::get_global_class_name(const String &p_path, String if (!p_path.empty()) { Ref<NativeScript> script = ResourceLoader::load(p_path, "NativeScript"); if (script.is_valid()) { - if (r_base_type) + if (r_base_type) { *r_base_type = script->get_instance_base_type(); - if (r_icon_path) + } + if (r_icon_path) { *r_icon_path = script->get_script_class_icon_path(); + } return script->get_script_class_name(); } - if (r_base_type) + if (r_base_type) { *r_base_type = String(); - if (r_icon_path) + } + if (r_icon_path) { *r_icon_path = String(); + } } return String(); } @@ -1827,15 +1853,14 @@ void NativeReloadNode::_notification(int p_what) { #ifdef TOOLS_ENABLED switch (p_what) { - case MainLoop::NOTIFICATION_WM_FOCUS_OUT: { - - if (unloaded) + case NOTIFICATION_APPLICATION_FOCUS_OUT: { + if (unloaded) { break; + } MutexLock lock(NSL->mutex); NSL->_unload_stuff(true); - for (Map<String, Ref<GDNative> >::Element *L = NSL->library_gdnatives.front(); L; L = L->next()) { - + for (Map<String, Ref<GDNative>>::Element *L = NSL->library_gdnatives.front(); L; L = L->next()) { Ref<GDNative> gdn = L->get(); if (gdn.is_null()) { @@ -1862,15 +1887,14 @@ void NativeReloadNode::_notification(int p_what) { } break; - case MainLoop::NOTIFICATION_WM_FOCUS_IN: { - - if (!unloaded) + case NOTIFICATION_APPLICATION_FOCUS_IN: { + if (!unloaded) { break; + } MutexLock lock(NSL->mutex); Set<StringName> libs_to_remove; - for (Map<String, Ref<GDNative> >::Element *L = NSL->library_gdnatives.front(); L; L = L->next()) { - + for (Map<String, Ref<GDNative>>::Element *L = NSL->library_gdnatives.front(); L; L = L->next()) { Ref<GDNative> gdn = L->get(); if (gdn.is_null()) { @@ -1904,12 +1928,13 @@ void NativeReloadNode::_notification(int p_what) { ((void (*)(void *))proc_ptr)((void *)&L->key()); } - for (Map<String, Set<NativeScript *> >::Element *U = NSL->library_script_users.front(); U; U = U->next()) { + for (Map<String, Set<NativeScript *>>::Element *U = NSL->library_script_users.front(); U; U = U->next()) { for (Set<NativeScript *>::Element *S = U->get().front(); S; S = S->next()) { NativeScript *script = S->get(); - if (script->placeholders.size() == 0) + if (script->placeholders.size() == 0) { continue; + } for (Set<PlaceHolderScriptInstance *>::Element *P = script->placeholders.front(); P; P = P->next()) { script->_update_placeholder(P->get()); @@ -1931,7 +1956,7 @@ void NativeReloadNode::_notification(int p_what) { #endif } -RES ResourceFormatLoaderNativeScript::load(const String &p_path, const String &p_original_path, Error *r_error, bool p_use_sub_threads, float *r_progress) { +RES ResourceFormatLoaderNativeScript::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) { return ResourceFormatLoaderText::singleton->load(p_path, p_original_path, r_error); } @@ -1945,8 +1970,9 @@ bool ResourceFormatLoaderNativeScript::handles_type(const String &p_type) const String ResourceFormatLoaderNativeScript::get_resource_type(const String &p_path) const { String el = p_path.get_extension().to_lower(); - if (el == "gdns") + if (el == "gdns") { return "NativeScript"; + } return ""; } @@ -1956,7 +1982,7 @@ Error ResourceFormatSaverNativeScript::save(const String &p_path, const RES &p_r } bool ResourceFormatSaverNativeScript::recognize(const RES &p_resource) const { - return Object::cast_to<NativeScript>(*p_resource) != NULL; + return Object::cast_to<NativeScript>(*p_resource) != nullptr; } void ResourceFormatSaverNativeScript::get_recognized_extensions(const RES &p_resource, List<String> *p_extensions) const { diff --git a/modules/gdnative/nativescript/nativescript.h b/modules/gdnative/nativescript/nativescript.h index 90542c96b7..fabf4bb87e 100644 --- a/modules/gdnative/nativescript/nativescript.h +++ b/modules/gdnative/nativescript/nativescript.h @@ -43,20 +43,21 @@ #include "scene/main/node.h" #include "modules/gdnative/gdnative.h" + #include <nativescript/godot_nativescript.h> struct NativeScriptDesc { - struct Method { - godot_instance_method method; + godot_nativescript_instance_method method; MethodInfo info; int rpc_mode; uint16_t rpc_method_id; String documentation; }; + 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; @@ -69,35 +70,26 @@ struct NativeScriptDesc { String documentation; }; - uint16_t rpc_count; + uint16_t rpc_count = 0; Map<StringName, Method> methods; - uint16_t rset_count; + uint16_t rset_count = 0; OrderedHashMap<StringName, Property> properties; Map<StringName, Signal> signals_; // QtCreator doesn't like the name signals 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; - const void *type_tag; + const void *type_tag = nullptr; bool is_tool; - inline NativeScriptDesc() : - rpc_count(0), - methods(), - rset_count(0), - properties(), - signals_(), - base(), - base_native_type(), - documentation(), - type_tag(NULL) { - zeromem(&create_func, sizeof(godot_instance_create_func)); - zeromem(&destroy_func, sizeof(godot_instance_destroy_func)); + inline NativeScriptDesc() { + zeromem(&create_func, sizeof(godot_nativescript_instance_create_func)); + zeromem(&destroy_func, sizeof(godot_nativescript_instance_destroy_func)); } }; @@ -133,6 +125,8 @@ protected: public: inline NativeScriptDesc *get_script_desc() const; + bool inherits_script(const Ref<Script> &p_script) const; + void set_class_name(String p_class_name); String get_class_name() const; @@ -199,7 +193,6 @@ public: }; class NativeScriptInstance : public ScriptInstance { - friend class NativeScript; Object *owner; @@ -250,7 +243,6 @@ public: class NativeReloadNode; class NativeScriptLanguage : public ScriptLanguage { - friend class NativeScript; friend class NativeScriptInstance; friend class NativeReloadNode; @@ -263,7 +255,7 @@ private: Mutex mutex; #ifndef NO_THREADS - Set<Ref<GDNativeLibrary> > libs_to_init; + Set<Ref<GDNativeLibrary>> libs_to_init; Set<NativeScript *> scripts_to_register; volatile bool has_objects_to_register; // so that we don't lock mutex every frame - it's rarely needed void defer_init_library(Ref<GDNativeLibrary> lib, NativeScript *script); @@ -275,10 +267,10 @@ 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; + Map<int, HashMap<StringName, const void *>> global_type_tags; struct ProfileData { StringName signature; @@ -298,10 +290,10 @@ private: public: // These two maps must only be touched on the main thread - Map<String, Map<StringName, NativeScriptDesc> > library_classes; - Map<String, Ref<GDNative> > library_gdnatives; + Map<String, Map<StringName, NativeScriptDesc>> library_classes; + Map<String, Ref<GDNative>> library_gdnatives; - Map<String, Set<NativeScript *> > library_script_users; + Map<String, Set<NativeScript *>> library_script_users; StringName _init_call_type; StringName _init_call_name; @@ -341,7 +333,7 @@ public: virtual void get_comment_delimiters(List<String> *p_delimiters) const; virtual void get_string_delimiters(List<String> *p_delimiters) const; virtual Ref<Script> get_template(const String &p_class_name, const String &p_base_class_name) const; - virtual bool validate(const String &p_script, int &r_line_error, int &r_col_error, String &r_test_error, const String &p_path, List<String> *r_functions, List<ScriptLanguage::Warning> *r_warnings = NULL, Set<int> *r_safe_lines = NULL) const; + virtual bool validate(const String &p_script, int &r_line_error, int &r_col_error, String &r_test_error, const String &p_path, List<String> *r_functions, List<ScriptLanguage::Warning> *r_warnings = nullptr, Set<int> *r_safe_lines = nullptr) const; virtual Script *create_script() const; virtual bool has_named_classes() const; virtual bool supports_builtin_mode() const; @@ -362,13 +354,13 @@ public: virtual void reload_tool_script(const Ref<Script> &p_script, bool p_soft_reload); virtual void get_recognized_extensions(List<String> *p_extensions) const; virtual void get_public_functions(List<MethodInfo> *p_functions) const; - virtual void get_public_constants(List<Pair<String, Variant> > *p_constants) const; + virtual void get_public_constants(List<Pair<String, Variant>> *p_constants) const; virtual void profiling_start(); virtual void profiling_stop(); 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); @@ -389,24 +381,23 @@ public: inline NativeScriptDesc *NativeScript::get_script_desc() const { Map<StringName, NativeScriptDesc>::Element *E = NativeScriptLanguage::singleton->library_classes[lib_path].find(class_name); - return E ? &E->get() : NULL; + return E ? &E->get() : nullptr; } class NativeReloadNode : public Node { GDCLASS(NativeReloadNode, Node); - bool unloaded; + bool unloaded = false; public: static void _bind_methods(); void _notification(int p_what); - NativeReloadNode() : - unloaded(false) {} + NativeReloadNode() {} }; class ResourceFormatLoaderNativeScript : public ResourceFormatLoader { public: - virtual RES load(const String &p_path, const String &p_original_path = "", Error *r_error = NULL, bool p_use_sub_threads = false, float *r_progress = nullptr); + virtual RES load(const String &p_path, const String &p_original_path = "", Error *r_error = nullptr, bool p_use_sub_threads = false, float *r_progress = nullptr, bool p_no_cache = false); virtual void get_recognized_extensions(List<String> *p_extensions) const; virtual bool handles_type(const String &p_type) const; virtual String get_resource_type(const String &p_path) const; diff --git a/modules/gdnative/nativescript/register_types.cpp b/modules/gdnative/nativescript/register_types.cpp index b5e8174e43..ac8c7ab2fd 100644 --- a/modules/gdnative/nativescript/register_types.cpp +++ b/modules/gdnative/nativescript/register_types.cpp @@ -58,7 +58,6 @@ void register_nativescript_types() { } void unregister_nativescript_types() { - ResourceLoader::remove_resource_format_loader(resource_loader_gdns); resource_loader_gdns.unref(); diff --git a/modules/gdnative/nativescript/register_types.h b/modules/gdnative/nativescript/register_types.h index 8fcecb9836..088bf38dd5 100644 --- a/modules/gdnative/nativescript/register_types.h +++ b/modules/gdnative/nativescript/register_types.h @@ -28,5 +28,10 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ +#ifndef NATIVESCRIPT_REGISTER_TYPES_H +#define NATIVESCRIPT_REGISTER_TYPES_H + void register_nativescript_types(); void unregister_nativescript_types(); + +#endif // NATIVESCRIPT_REGISTER_TYPES_H diff --git a/modules/gdnative/net/SCsub b/modules/gdnative/net/SCsub index 18ab9986b0..b76500c003 100644 --- a/modules/gdnative/net/SCsub +++ b/modules/gdnative/net/SCsub @@ -1,13 +1,12 @@ #!/usr/bin/env python -Import('env') -Import('env_gdnative') +Import("env") +Import("env_gdnative") env_net = env_gdnative.Clone() has_webrtc = env_net["module_webrtc_enabled"] if has_webrtc: - env_net.Append(CPPDEFINES=['WEBRTC_GDNATIVE_ENABLED']) - -env_net.add_source_files(env.modules_sources, '*.cpp') + env_net.Append(CPPDEFINES=["WEBRTC_GDNATIVE_ENABLED"]) +env_net.add_source_files(env.modules_sources, "*.cpp") diff --git a/modules/gdnative/net/multiplayer_peer_gdnative.cpp b/modules/gdnative/net/multiplayer_peer_gdnative.cpp index 8c43a79cc5..997eec6425 100644 --- a/modules/gdnative/net/multiplayer_peer_gdnative.cpp +++ b/modules/gdnative/net/multiplayer_peer_gdnative.cpp @@ -31,7 +31,7 @@ #include "multiplayer_peer_gdnative.h" MultiplayerPeerGDNative::MultiplayerPeerGDNative() { - interface = NULL; + interface = nullptr; } MultiplayerPeerGDNative::~MultiplayerPeerGDNative() { @@ -42,73 +42,73 @@ void MultiplayerPeerGDNative::set_native_multiplayer_peer(const godot_net_multip } Error MultiplayerPeerGDNative::get_packet(const uint8_t **r_buffer, int &r_buffer_size) { - ERR_FAIL_COND_V(interface == NULL, ERR_UNCONFIGURED); + ERR_FAIL_COND_V(interface == nullptr, ERR_UNCONFIGURED); return (Error)interface->get_packet(interface->data, r_buffer, &r_buffer_size); } Error MultiplayerPeerGDNative::put_packet(const uint8_t *p_buffer, int p_buffer_size) { - ERR_FAIL_COND_V(interface == NULL, ERR_UNCONFIGURED); + ERR_FAIL_COND_V(interface == nullptr, ERR_UNCONFIGURED); return (Error)interface->put_packet(interface->data, p_buffer, p_buffer_size); } int MultiplayerPeerGDNative::get_max_packet_size() const { - ERR_FAIL_COND_V(interface == NULL, 0); + ERR_FAIL_COND_V(interface == nullptr, 0); return interface->get_max_packet_size(interface->data); } int MultiplayerPeerGDNative::get_available_packet_count() const { - ERR_FAIL_COND_V(interface == NULL, 0); + ERR_FAIL_COND_V(interface == nullptr, 0); return interface->get_available_packet_count(interface->data); } /* NetworkedMultiplayerPeer */ void MultiplayerPeerGDNative::set_transfer_mode(TransferMode p_mode) { - ERR_FAIL_COND(interface == NULL); + ERR_FAIL_COND(interface == nullptr); interface->set_transfer_mode(interface->data, (godot_int)p_mode); } NetworkedMultiplayerPeer::TransferMode MultiplayerPeerGDNative::get_transfer_mode() const { - ERR_FAIL_COND_V(interface == NULL, TRANSFER_MODE_UNRELIABLE); + ERR_FAIL_COND_V(interface == nullptr, TRANSFER_MODE_UNRELIABLE); return (TransferMode)interface->get_transfer_mode(interface->data); } void MultiplayerPeerGDNative::set_target_peer(int p_peer_id) { - ERR_FAIL_COND(interface == NULL); + ERR_FAIL_COND(interface == nullptr); interface->set_target_peer(interface->data, p_peer_id); } int MultiplayerPeerGDNative::get_packet_peer() const { - ERR_FAIL_COND_V(interface == NULL, 0); + ERR_FAIL_COND_V(interface == nullptr, 0); return interface->get_packet_peer(interface->data); } bool MultiplayerPeerGDNative::is_server() const { - ERR_FAIL_COND_V(interface == NULL, false); + ERR_FAIL_COND_V(interface == nullptr, false); return interface->is_server(interface->data); } void MultiplayerPeerGDNative::poll() { - ERR_FAIL_COND(interface == NULL); + ERR_FAIL_COND(interface == nullptr); interface->poll(interface->data); } int MultiplayerPeerGDNative::get_unique_id() const { - ERR_FAIL_COND_V(interface == NULL, 0); + ERR_FAIL_COND_V(interface == nullptr, 0); return interface->get_unique_id(interface->data); } void MultiplayerPeerGDNative::set_refuse_new_connections(bool p_enable) { - ERR_FAIL_COND(interface == NULL); + ERR_FAIL_COND(interface == nullptr); interface->set_refuse_new_connections(interface->data, p_enable); } bool MultiplayerPeerGDNative::is_refusing_new_connections() const { - ERR_FAIL_COND_V(interface == NULL, true); + ERR_FAIL_COND_V(interface == nullptr, true); return interface->is_refusing_new_connections(interface->data); } NetworkedMultiplayerPeer::ConnectionStatus MultiplayerPeerGDNative::get_connection_status() const { - ERR_FAIL_COND_V(interface == NULL, CONNECTION_DISCONNECTED); + ERR_FAIL_COND_V(interface == nullptr, CONNECTION_DISCONNECTED); return (ConnectionStatus)interface->get_connection_status(interface->data); } @@ -120,7 +120,6 @@ void MultiplayerPeerGDNative::_bind_methods() { extern "C" { void GDAPI godot_net_bind_multiplayer_peer(godot_object *p_obj, const godot_net_multiplayer_peer *p_impl) { - ((MultiplayerPeerGDNative *)p_obj)->set_native_multiplayer_peer(p_impl); } } diff --git a/modules/gdnative/net/packet_peer_gdnative.cpp b/modules/gdnative/net/packet_peer_gdnative.cpp index 75e1e0b824..6bb21cb48d 100644 --- a/modules/gdnative/net/packet_peer_gdnative.cpp +++ b/modules/gdnative/net/packet_peer_gdnative.cpp @@ -31,7 +31,7 @@ #include "packet_peer_gdnative.h" PacketPeerGDNative::PacketPeerGDNative() { - interface = NULL; + interface = nullptr; } PacketPeerGDNative::~PacketPeerGDNative() { @@ -45,29 +45,28 @@ void PacketPeerGDNative::_bind_methods() { } Error PacketPeerGDNative::get_packet(const uint8_t **r_buffer, int &r_buffer_size) { - ERR_FAIL_COND_V(interface == NULL, ERR_UNCONFIGURED); + ERR_FAIL_COND_V(interface == nullptr, ERR_UNCONFIGURED); return (Error)interface->get_packet(interface->data, r_buffer, &r_buffer_size); } Error PacketPeerGDNative::put_packet(const uint8_t *p_buffer, int p_buffer_size) { - ERR_FAIL_COND_V(interface == NULL, ERR_UNCONFIGURED); + ERR_FAIL_COND_V(interface == nullptr, ERR_UNCONFIGURED); return (Error)interface->put_packet(interface->data, p_buffer, p_buffer_size); } int PacketPeerGDNative::get_max_packet_size() const { - ERR_FAIL_COND_V(interface == NULL, 0); + ERR_FAIL_COND_V(interface == nullptr, 0); return interface->get_max_packet_size(interface->data); } int PacketPeerGDNative::get_available_packet_count() const { - ERR_FAIL_COND_V(interface == NULL, 0); + ERR_FAIL_COND_V(interface == nullptr, 0); return interface->get_available_packet_count(interface->data); } extern "C" { void GDAPI godot_net_bind_packet_peer(godot_object *p_obj, const godot_net_packet_peer *p_impl) { - ((PacketPeerGDNative *)p_obj)->set_native_packet_peer(p_impl); } } diff --git a/modules/gdnative/net/register_types.h b/modules/gdnative/net/register_types.h index 526bc49deb..70b266f9b9 100644 --- a/modules/gdnative/net/register_types.h +++ b/modules/gdnative/net/register_types.h @@ -28,5 +28,10 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ +#ifndef NET_REGISTER_TYPES_H +#define NET_REGISTER_TYPES_H + void register_net_types(); void unregister_net_types(); + +#endif // NET_REGISTER_TYPES_H diff --git a/modules/gdnative/net/stream_peer_gdnative.cpp b/modules/gdnative/net/stream_peer_gdnative.cpp index 22634daf5f..9dcb184115 100644 --- a/modules/gdnative/net/stream_peer_gdnative.cpp +++ b/modules/gdnative/net/stream_peer_gdnative.cpp @@ -31,7 +31,7 @@ #include "stream_peer_gdnative.h" StreamPeerGDNative::StreamPeerGDNative() { - interface = NULL; + interface = nullptr; } StreamPeerGDNative::~StreamPeerGDNative() { @@ -45,27 +45,27 @@ void StreamPeerGDNative::_bind_methods() { } Error StreamPeerGDNative::put_data(const uint8_t *p_data, int p_bytes) { - ERR_FAIL_COND_V(interface == NULL, ERR_UNCONFIGURED); + ERR_FAIL_COND_V(interface == nullptr, ERR_UNCONFIGURED); return (Error)(interface->put_data(interface->data, p_data, p_bytes)); } Error StreamPeerGDNative::put_partial_data(const uint8_t *p_data, int p_bytes, int &r_sent) { - ERR_FAIL_COND_V(interface == NULL, ERR_UNCONFIGURED); + ERR_FAIL_COND_V(interface == nullptr, ERR_UNCONFIGURED); return (Error)(interface->put_partial_data(interface->data, p_data, p_bytes, &r_sent)); } Error StreamPeerGDNative::get_data(uint8_t *p_buffer, int p_bytes) { - ERR_FAIL_COND_V(interface == NULL, ERR_UNCONFIGURED); + ERR_FAIL_COND_V(interface == nullptr, ERR_UNCONFIGURED); return (Error)(interface->get_data(interface->data, p_buffer, p_bytes)); } Error StreamPeerGDNative::get_partial_data(uint8_t *p_buffer, int p_bytes, int &r_received) { - ERR_FAIL_COND_V(interface == NULL, ERR_UNCONFIGURED); + ERR_FAIL_COND_V(interface == nullptr, ERR_UNCONFIGURED); return (Error)(interface->get_partial_data(interface->data, p_buffer, p_bytes, &r_received)); } int StreamPeerGDNative::get_available_bytes() const { - ERR_FAIL_COND_V(interface == NULL, 0); + ERR_FAIL_COND_V(interface == nullptr, 0); return interface->get_available_bytes(interface->data); } diff --git a/modules/gdnative/net/stream_peer_gdnative.h b/modules/gdnative/net/stream_peer_gdnative.h index f3711e0f0f..0b2f995aa7 100644 --- a/modules/gdnative/net/stream_peer_gdnative.h +++ b/modules/gdnative/net/stream_peer_gdnative.h @@ -36,7 +36,6 @@ #include "modules/gdnative/include/net/godot_net.h" class StreamPeerGDNative : public StreamPeer { - GDCLASS(StreamPeerGDNative, StreamPeer); protected: diff --git a/modules/gdnative/pluginscript/SCsub b/modules/gdnative/pluginscript/SCsub index 20eaa99592..0b2db3b504 100644 --- a/modules/gdnative/pluginscript/SCsub +++ b/modules/gdnative/pluginscript/SCsub @@ -1,6 +1,6 @@ #!/usr/bin/env python -Import('env') -Import('env_gdnative') +Import("env") +Import("env_gdnative") -env_gdnative.add_source_files(env.modules_sources, '*.cpp') +env_gdnative.add_source_files(env.modules_sources, "*.cpp") diff --git a/modules/gdnative/pluginscript/pluginscript_instance.cpp b/modules/gdnative/pluginscript/pluginscript_instance.cpp index 22e8372130..7d17a7d5ab 100644 --- a/modules/gdnative/pluginscript/pluginscript_instance.cpp +++ b/modules/gdnative/pluginscript/pluginscript_instance.cpp @@ -156,7 +156,7 @@ bool PluginScriptInstance::init(PluginScript *p_script, Object *p_owner) { _script = Ref<PluginScript>(p_script); _desc = &p_script->_desc->instance_desc; _data = _desc->init(p_script->_data, (godot_object *)p_owner); - ERR_FAIL_COND_V(_data == NULL, false); + ERR_FAIL_COND_V(_data == nullptr, false); p_owner->set_script_instance(this); return true; } diff --git a/modules/gdnative/pluginscript/pluginscript_instance.h b/modules/gdnative/pluginscript/pluginscript_instance.h index c91ad643a7..6309b6fde3 100644 --- a/modules/gdnative/pluginscript/pluginscript_instance.h +++ b/modules/gdnative/pluginscript/pluginscript_instance.h @@ -55,7 +55,7 @@ public: virtual bool set(const StringName &p_name, const Variant &p_value); virtual bool get(const StringName &p_name, Variant &r_ret) const; virtual void get_property_list(List<PropertyInfo> *p_properties) const; - virtual Variant::Type get_property_type(const StringName &p_name, bool *r_is_valid = NULL) const; + virtual Variant::Type get_property_type(const StringName &p_name, bool *r_is_valid = nullptr) const; virtual void get_method_list(List<MethodInfo> *p_list) const; virtual bool has_method(const StringName &p_method) const; diff --git a/modules/gdnative/pluginscript/pluginscript_language.cpp b/modules/gdnative/pluginscript/pluginscript_language.cpp index a40b59bb2e..bccbe95033 100644 --- a/modules/gdnative/pluginscript/pluginscript_language.cpp +++ b/modules/gdnative/pluginscript/pluginscript_language.cpp @@ -210,7 +210,7 @@ void PluginScriptLanguage::get_public_functions(List<MethodInfo> *p_functions) c } } -void PluginScriptLanguage::get_public_constants(List<Pair<String, Variant> > *p_constants) const { +void PluginScriptLanguage::get_public_constants(List<Pair<String, Variant>> *p_constants) const { // TODO: provide this statically in `godot_pluginscript_language_desc` ? if (_desc.get_public_constants) { Dictionary constants; diff --git a/modules/gdnative/pluginscript/pluginscript_language.h b/modules/gdnative/pluginscript/pluginscript_language.h index 3f0d2b8d3d..dd6758713f 100644 --- a/modules/gdnative/pluginscript/pluginscript_language.h +++ b/modules/gdnative/pluginscript/pluginscript_language.h @@ -74,7 +74,7 @@ public: virtual void get_comment_delimiters(List<String> *p_delimiters) const; virtual void get_string_delimiters(List<String> *p_delimiters) const; virtual Ref<Script> get_template(const String &p_class_name, const String &p_base_class_name) const; - virtual bool validate(const String &p_script, int &r_line_error, int &r_col_error, String &r_test_error, const String &p_path = "", List<String> *r_functions = NULL, List<ScriptLanguage::Warning> *r_warnings = NULL, Set<int> *r_safe_lines = NULL) const; + virtual bool validate(const String &p_script, int &r_line_error, int &r_col_error, String &r_test_error, const String &p_path = "", List<String> *r_functions = nullptr, List<ScriptLanguage::Warning> *r_warnings = nullptr, Set<int> *r_safe_lines = nullptr) const; virtual Script *create_script() const; virtual bool has_named_classes() const; virtual bool supports_builtin_mode() const; @@ -112,7 +112,7 @@ public: virtual void get_recognized_extensions(List<String> *p_extensions) const; virtual void get_public_functions(List<MethodInfo> *p_functions) const; - virtual void get_public_constants(List<Pair<String, Variant> > *p_constants) const; + virtual void get_public_constants(List<Pair<String, Variant>> *p_constants) const; virtual void profiling_start(); virtual void profiling_stop(); diff --git a/modules/gdnative/pluginscript/pluginscript_loader.cpp b/modules/gdnative/pluginscript/pluginscript_loader.cpp index 46db20b6c2..4feee4f4a5 100644 --- a/modules/gdnative/pluginscript/pluginscript_loader.cpp +++ b/modules/gdnative/pluginscript/pluginscript_loader.cpp @@ -39,9 +39,10 @@ ResourceFormatLoaderPluginScript::ResourceFormatLoaderPluginScript(PluginScriptL _language = language; } -RES ResourceFormatLoaderPluginScript::load(const String &p_path, const String &p_original_path, Error *r_error, bool p_use_sub_threads, float *r_progress) { - if (r_error) +RES ResourceFormatLoaderPluginScript::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) { + if (r_error) { *r_error = ERR_FILE_CANT_OPEN; + } PluginScript *script = memnew(PluginScript); script->init(_language); @@ -55,8 +56,9 @@ RES ResourceFormatLoaderPluginScript::load(const String &p_path, const String &p script->reload(); - if (r_error) + if (r_error) { *r_error = OK; + } return scriptres; } @@ -71,8 +73,9 @@ bool ResourceFormatLoaderPluginScript::handles_type(const String &p_type) const String ResourceFormatLoaderPluginScript::get_resource_type(const String &p_path) const { String el = p_path.get_extension().to_lower(); - if (el == _language->get_extension()) + if (el == _language->get_extension()) { return _language->get_type(); + } return ""; } @@ -101,13 +104,11 @@ Error ResourceFormatSaverPluginScript::save(const String &p_path, const RES &p_r } void ResourceFormatSaverPluginScript::get_recognized_extensions(const RES &p_resource, List<String> *p_extensions) const { - if (Object::cast_to<PluginScript>(*p_resource)) { p_extensions->push_back(_language->get_extension()); } } bool ResourceFormatSaverPluginScript::recognize(const RES &p_resource) const { - - return Object::cast_to<PluginScript>(*p_resource) != NULL; + return Object::cast_to<PluginScript>(*p_resource) != nullptr; } diff --git a/modules/gdnative/pluginscript/pluginscript_loader.h b/modules/gdnative/pluginscript/pluginscript_loader.h index a039072fdc..35fc79c2ca 100644 --- a/modules/gdnative/pluginscript/pluginscript_loader.h +++ b/modules/gdnative/pluginscript/pluginscript_loader.h @@ -39,19 +39,17 @@ class PluginScriptLanguage; class ResourceFormatLoaderPluginScript : public ResourceFormatLoader { - PluginScriptLanguage *_language; public: ResourceFormatLoaderPluginScript(PluginScriptLanguage *language); - virtual RES load(const String &p_path, const String &p_original_path = "", Error *r_error = NULL, bool p_use_sub_threads = false, float *r_progress = nullptr); + virtual RES load(const String &p_path, const String &p_original_path = "", Error *r_error = nullptr, bool p_use_sub_threads = false, float *r_progress = nullptr, bool p_no_cache = false); virtual void get_recognized_extensions(List<String> *p_extensions) const; virtual bool handles_type(const String &p_type) const; virtual String get_resource_type(const String &p_path) const; }; class ResourceFormatSaverPluginScript : public ResourceFormatSaver { - PluginScriptLanguage *_language; public: diff --git a/modules/gdnative/pluginscript/pluginscript_script.cpp b/modules/gdnative/pluginscript/pluginscript_script.cpp index fe1f63f6da..87c6288806 100644 --- a/modules/gdnative/pluginscript/pluginscript_script.cpp +++ b/modules/gdnative/pluginscript/pluginscript_script.cpp @@ -56,7 +56,6 @@ void PluginScript::_bind_methods() { } PluginScriptInstance *PluginScript::_create_instance(const Variant **p_args, int p_argcount, Object *p_owner, Callable::CallError &r_error) { - r_error.error = Callable::CallError::CALL_OK; // Create instance @@ -69,7 +68,7 @@ PluginScriptInstance *PluginScript::_create_instance(const Variant **p_args, int } else { r_error.error = Callable::CallError::CALL_ERROR_INSTANCE_IS_NULL; memdelete(instance); - ERR_FAIL_V(NULL); + ERR_FAIL_V(nullptr); } // Construct @@ -84,7 +83,6 @@ PluginScriptInstance *PluginScript::_create_instance(const Variant **p_args, int } Variant PluginScript::_new(const Variant **p_args, int p_argcount, Callable::CallError &r_error) { - r_error.error = Callable::CallError::CALL_OK; if (!_valid) { @@ -93,7 +91,7 @@ Variant PluginScript::_new(const Variant **p_args, int p_argcount, Callable::Cal } REF ref; - Object *owner = NULL; + Object *owner = nullptr; if (get_instance_base_type() == "") { owner = memnew(Reference); @@ -140,6 +138,13 @@ bool PluginScript::can_instance() const { return can; } +bool PluginScript::inherits_script(const Ref<Script> &p_script) const { +#ifndef _MSC_VER +#warning inheritance needs to be implemented in PluginScript +#endif + return false; +} + Ref<Script> PluginScript::get_base_script() const { if (_ref_base_parent.is_valid()) { return Ref<PluginScript>(_ref_base_parent); @@ -149,10 +154,12 @@ Ref<Script> PluginScript::get_base_script() const { } StringName PluginScript::get_instance_base_type() const { - if (_native_parent) + if (_native_parent) { return _native_parent; - if (_ref_base_parent.is_valid()) + } + if (_ref_base_parent.is_valid()) { return _ref_base_parent->get_instance_base_type(); + } return StringName(); } @@ -160,7 +167,6 @@ void PluginScript::update_exports() { #ifdef TOOLS_ENABLED ASSERT_SCRIPT_VALID(); if (placeholders.size()) { - //update placeholders if any Map<StringName, Variant> propdefvalues; List<PropertyInfo> propinfos; @@ -175,7 +181,7 @@ void PluginScript::update_exports() { // TODO: rename p_this "p_owner" ? ScriptInstance *PluginScript::instance_create(Object *p_this) { - ASSERT_SCRIPT_VALID_V(NULL); + ASSERT_SCRIPT_VALID_V(nullptr); // TODO check script validity ? if (!_tool && !ScriptServer::is_scripting_enabled()) { #ifdef TOOLS_ENABLED @@ -185,7 +191,7 @@ ScriptInstance *PluginScript::instance_create(Object *p_this) { update_exports(); return si; #else - return NULL; + return nullptr; #endif } @@ -194,15 +200,15 @@ ScriptInstance *PluginScript::instance_create(Object *p_this) { if (!ClassDB::is_parent_class(p_this->get_class_name(), base_type)) { String msg = "Script inherits from native type '" + String(base_type) + "', so it can't be instanced in object of type: '" + p_this->get_class() + "'"; // TODO: implement PluginscriptLanguage::debug_break_parse - // if (ScriptDebugger::get_singleton()) { + // if (EngineDebugger::is_active()) { // _language->debug_break_parse(get_path(), 0, msg); // } - ERR_FAIL_V_MSG(NULL, msg); + ERR_FAIL_V_MSG(nullptr, msg); } } Callable::CallError unchecked_error; - return _create_instance(NULL, 0, p_this, unchecked_error); + return _create_instance(nullptr, 0, p_this, unchecked_error); } bool PluginScript::instance_has(const Object *p_this) const { @@ -222,8 +228,9 @@ String PluginScript::get_source_code() const { } void PluginScript::set_source_code(const String &p_code) { - if (_source == p_code) + if (_source == p_code) { return; + } _source = p_code; } @@ -237,11 +244,13 @@ Error PluginScript::reload(bool p_keep_state) { _valid = false; String basedir = _path; - if (basedir == "") + if (basedir == "") { basedir = get_path(); + } - if (basedir != "") + if (basedir != "") { basedir = basedir.get_base_dir(); + } if (_data) { _desc->finish(_data); @@ -274,7 +283,6 @@ Error PluginScript::reload(bool p_keep_state) { // ClassDB name (i.e. `Node2D`) or a resource path (i.e. `res://foo/bar.gd`) StringName *base_name = (StringName *)&manifest.base; if (*base_name) { - if (ClassDB::class_exists(*base_name)) { _native_parent = *base_name; } else { @@ -296,7 +304,7 @@ Error PluginScript::reload(bool p_keep_state) { _tool = manifest.is_tool; Dictionary *members = (Dictionary *)&manifest.member_lines; - for (const Variant *key = members->next(); key != NULL; key = members->next(key)) { + for (const Variant *key = members->next(); key != nullptr; key = members->next(key)) { _member_lines[*key] = (*members)[*key]; } Array *methods = (Array *)&manifest.methods; @@ -366,14 +374,14 @@ Error PluginScript::reload(bool p_keep_state) { void PluginScript::get_script_method_list(List<MethodInfo> *r_methods) const { ASSERT_SCRIPT_VALID(); - for (Map<StringName, MethodInfo>::Element *e = _methods_info.front(); e != NULL; e = e->next()) { + for (Map<StringName, MethodInfo>::Element *e = _methods_info.front(); e != nullptr; e = e->next()) { r_methods->push_back(e->get()); } } void PluginScript::get_script_property_list(List<PropertyInfo> *r_properties) const { ASSERT_SCRIPT_VALID(); - for (Map<StringName, PropertyInfo>::Element *e = _properties_info.front(); e != NULL; e = e->next()) { + for (Map<StringName, PropertyInfo>::Element *e = _properties_info.front(); e != nullptr; e = e->next()) { r_properties->push_back(e->get()); } } @@ -386,7 +394,7 @@ bool PluginScript::has_method(const StringName &p_method) const { MethodInfo PluginScript::get_method_info(const StringName &p_method) const { ASSERT_SCRIPT_VALID_V(MethodInfo()); const Map<StringName, MethodInfo>::Element *e = _methods_info.find(p_method); - if (e != NULL) { + if (e != nullptr) { return e->get(); } else { return MethodInfo(); @@ -401,7 +409,7 @@ bool PluginScript::has_property(const StringName &p_method) const { PropertyInfo PluginScript::get_property_info(const StringName &p_property) const { ASSERT_SCRIPT_VALID_V(PropertyInfo()); const Map<StringName, PropertyInfo>::Element *e = _properties_info.find(p_property); - if (e != NULL) { + if (e != nullptr) { return e->get(); } else { return PropertyInfo(); @@ -412,7 +420,7 @@ bool PluginScript::get_property_default_value(const StringName &p_property, Vari ASSERT_SCRIPT_VALID_V(false); #ifdef TOOLS_ENABLED const Map<StringName, Variant>::Element *e = _properties_default_values.find(p_property); - if (e != NULL) { + if (e != nullptr) { r_value = e->get(); return true; } else { @@ -427,7 +435,6 @@ ScriptLanguage *PluginScript::get_language() const { } Error PluginScript::load_source_code(const String &p_path) { - Vector<uint8_t> sourcef; Error err; FileAccess *f = FileAccess::open(p_path, FileAccess::READ, &err); @@ -462,18 +469,18 @@ bool PluginScript::has_script_signal(const StringName &p_signal) const { void PluginScript::get_script_signal_list(List<MethodInfo> *r_signals) const { ASSERT_SCRIPT_VALID(); - for (Map<StringName, MethodInfo>::Element *e = _signals_info.front(); e != NULL; e = e->next()) { + for (Map<StringName, MethodInfo>::Element *e = _signals_info.front(); e != nullptr; e = e->next()) { r_signals->push_back(e->get()); } } int PluginScript::get_member_line(const StringName &p_member) const { #ifdef TOOLS_ENABLED - if (_member_lines.has(p_member)) + if (_member_lines.has(p_member)) { return _member_lines[p_member]; - else + } #endif - return -1; + return -1; } Vector<ScriptNetData> PluginScript::get_rpc_methods() const { @@ -492,15 +499,17 @@ uint16_t PluginScript::get_rpc_method_id(const StringName &p_method) const { StringName PluginScript::get_rpc_method(const uint16_t p_rpc_method_id) const { ASSERT_SCRIPT_VALID_V(StringName()); - if (p_rpc_method_id >= _rpc_methods.size()) + if (p_rpc_method_id >= _rpc_methods.size()) { return StringName(); + } return _rpc_methods[p_rpc_method_id].name; } MultiplayerAPI::RPCMode PluginScript::get_rpc_mode_by_id(const uint16_t p_rpc_method_id) const { ASSERT_SCRIPT_VALID_V(MultiplayerAPI::RPC_MODE_DISABLED); - if (p_rpc_method_id >= _rpc_methods.size()) + if (p_rpc_method_id >= _rpc_methods.size()) { return MultiplayerAPI::RPC_MODE_DISABLED; + } return _rpc_methods[p_rpc_method_id].mode; } @@ -525,15 +534,17 @@ uint16_t PluginScript::get_rset_property_id(const StringName &p_property) const StringName PluginScript::get_rset_property(const uint16_t p_rset_property_id) const { ASSERT_SCRIPT_VALID_V(StringName()); - if (p_rset_property_id >= _rpc_variables.size()) + if (p_rset_property_id >= _rpc_variables.size()) { return StringName(); + } return _rpc_variables[p_rset_property_id].name; } MultiplayerAPI::RPCMode PluginScript::get_rset_mode_by_id(const uint16_t p_rset_property_id) const { ASSERT_SCRIPT_VALID_V(MultiplayerAPI::RPC_MODE_DISABLED); - if (p_rset_property_id >= _rpc_variables.size()) + if (p_rset_property_id >= _rpc_variables.size()) { return MultiplayerAPI::RPC_MODE_DISABLED; + } return _rpc_variables[p_rset_property_id].mode; } @@ -543,11 +554,6 @@ MultiplayerAPI::RPCMode PluginScript::get_rset_mode(const StringName &p_variable } PluginScript::PluginScript() : - _data(NULL), - _desc(NULL), - _language(NULL), - _tool(false), - _valid(false), _script_list(this) { } diff --git a/modules/gdnative/pluginscript/pluginscript_script.h b/modules/gdnative/pluginscript/pluginscript_script.h index 5c93ae38f5..659289ef9b 100644 --- a/modules/gdnative/pluginscript/pluginscript_script.h +++ b/modules/gdnative/pluginscript/pluginscript_script.h @@ -38,18 +38,17 @@ #include <pluginscript/godot_pluginscript.h> class PluginScript : public Script { - GDCLASS(PluginScript, Script); friend class PluginScriptInstance; friend class PluginScriptLanguage; private: - godot_pluginscript_script_data *_data; - const godot_pluginscript_script_desc *_desc; - PluginScriptLanguage *_language; - bool _tool; - bool _valid; + godot_pluginscript_script_data *_data = nullptr; + const godot_pluginscript_script_desc *_desc = nullptr; + PluginScriptLanguage *_language = nullptr; + bool _tool = false; + bool _valid = false; Ref<Script> _ref_base_parent; StringName _native_parent; @@ -72,6 +71,8 @@ private: protected: static void _bind_methods(); + bool inherits_script(const Ref<Script> &p_script) const; + PluginScriptInstance *_create_instance(const Variant **p_args, int p_argcount, Object *p_owner, Callable::CallError &r_error); Variant _new(const Variant **p_args, int p_argcount, Callable::CallError &r_error); diff --git a/modules/gdnative/pluginscript/register_types.h b/modules/gdnative/pluginscript/register_types.h index a4f7284b54..c6a64b4f40 100644 --- a/modules/gdnative/pluginscript/register_types.h +++ b/modules/gdnative/pluginscript/register_types.h @@ -28,5 +28,10 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ +#ifndef PLUGINSCRIPT_REGISTER_TYPES_H +#define PLUGINSCRIPT_REGISTER_TYPES_H + void register_pluginscript_types(); void unregister_pluginscript_types(); + +#endif // PLUGINSCRIPT_REGISTER_TYPES_H diff --git a/modules/gdnative/register_types.cpp b/modules/gdnative/register_types.cpp index e5d688afd4..136af5bd1e 100644 --- a/modules/gdnative/register_types.cpp +++ b/modules/gdnative/register_types.cpp @@ -34,11 +34,11 @@ #include "gdnative.h" -#include "arvr/register_types.h" #include "nativescript/register_types.h" #include "net/register_types.h" #include "pluginscript/register_types.h" #include "videodecoder/register_types.h" +#include "xr/register_types.h" #include "core/engine.h" #include "core/io/resource_loader.h" @@ -53,7 +53,6 @@ #include "gdnative_library_singleton_editor.h" class GDNativeExportPlugin : public EditorExportPlugin { - protected: virtual void _export_file(const String &p_path, const String &p_type, const Set<String> &p_features); }; @@ -77,7 +76,6 @@ void GDNativeExportPlugin::_export_file(const String &p_path, const String &p_ty Ref<ConfigFile> config = lib->get_config_file(); { - List<String> entry_keys; config->get_section_keys("entry", &entry_keys); @@ -189,7 +187,6 @@ void GDNativeExportPlugin::_export_file(const String &p_path, const String &p_ty } static void editor_init_callback() { - GDNativeLibrarySingletonEditor *library_editor = memnew(GDNativeLibrarySingletonEditor); library_editor->set_name(TTR("GDNative")); ProjectSettingsEditor::get_singleton()->get_tabs()->add_child(library_editor); @@ -205,7 +202,6 @@ static void editor_init_callback() { #endif static godot_variant cb_standard_varcall(void *p_procedure_handle, godot_array *p_args) { - godot_gdnative_procedure_fn proc; proc = (godot_gdnative_procedure_fn)p_procedure_handle; @@ -214,13 +210,12 @@ static godot_variant cb_standard_varcall(void *p_procedure_handle, godot_array * GDNativeCallRegistry *GDNativeCallRegistry::singleton; -Vector<Ref<GDNative> > singleton_gdnatives; +Vector<Ref<GDNative>> singleton_gdnatives; Ref<GDNativeLibraryResourceLoader> resource_loader_gdnlib; Ref<GDNativeLibraryResourceSaver> resource_saver_gdnlib; void register_gdnative_types() { - #ifdef TOOLS_ENABLED EditorNode::add_init_callback(editor_init_callback); @@ -240,7 +235,7 @@ void register_gdnative_types() { GDNativeCallRegistry::singleton->register_native_call_type("standard_varcall", cb_standard_varcall); register_net_types(); - register_arvr_types(); + register_xr_types(); register_nativescript_types(); register_pluginscript_types(); register_videodecoder_types(); @@ -259,8 +254,9 @@ void register_gdnative_types() { for (int i = 0; i < singletons.size(); i++) { String path = singletons[i]; - if (excluded.has(path)) + if (excluded.has(path)) { continue; + } Ref<GDNativeLibrary> lib = ResourceLoader::load(path); Ref<GDNative> singleton; @@ -287,9 +283,7 @@ void register_gdnative_types() { } void unregister_gdnative_types() { - for (int i = 0; i < singleton_gdnatives.size(); i++) { - if (singleton_gdnatives[i].is_null()) { continue; } @@ -305,7 +299,7 @@ void unregister_gdnative_types() { unregister_videodecoder_types(); unregister_pluginscript_types(); unregister_nativescript_types(); - unregister_arvr_types(); + unregister_xr_types(); unregister_net_types(); memdelete(GDNativeCallRegistry::singleton); diff --git a/modules/gdnative/register_types.h b/modules/gdnative/register_types.h index 0091ef3f96..b5c182f8b7 100644 --- a/modules/gdnative/register_types.h +++ b/modules/gdnative/register_types.h @@ -28,5 +28,10 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ +#ifndef GDNATIVE_REGISTER_TYPES_H +#define GDNATIVE_REGISTER_TYPES_H + void register_gdnative_types(); void unregister_gdnative_types(); + +#endif // GDNATIVE_REGISTER_TYPES_H diff --git a/modules/gdnative/videodecoder/SCsub b/modules/gdnative/videodecoder/SCsub index 04cc8ed604..5948b9a3dd 100644 --- a/modules/gdnative/videodecoder/SCsub +++ b/modules/gdnative/videodecoder/SCsub @@ -1,9 +1,9 @@ #!/usr/bin/env python -Import('env') -Import('env_modules') +Import("env") +Import("env_modules") env_vsdecoder_gdnative = env_modules.Clone() -env_vsdecoder_gdnative.Prepend(CPPPATH=['#modules/gdnative/include/']) -env_vsdecoder_gdnative.add_source_files(env.modules_sources, '*.cpp') +env_vsdecoder_gdnative.Prepend(CPPPATH=["#modules/gdnative/include/"]) +env_vsdecoder_gdnative.add_source_files(env.modules_sources, "*.cpp") diff --git a/modules/gdnative/videodecoder/register_types.cpp b/modules/gdnative/videodecoder/register_types.cpp index c53e8f2c78..4181d8813f 100644 --- a/modules/gdnative/videodecoder/register_types.cpp +++ b/modules/gdnative/videodecoder/register_types.cpp @@ -36,7 +36,6 @@ static Ref<ResourceFormatLoaderVideoStreamGDNative> resource_loader_vsgdnative; void register_videodecoder_types() { - resource_loader_vsgdnative.instance(); ResourceLoader::add_resource_format_loader(resource_loader_vsgdnative, true); @@ -44,7 +43,6 @@ void register_videodecoder_types() { } void unregister_videodecoder_types() { - ResourceLoader::remove_resource_format_loader(resource_loader_vsgdnative); resource_loader_vsgdnative.unref(); } diff --git a/modules/gdnative/videodecoder/register_types.h b/modules/gdnative/videodecoder/register_types.h index d81d5c497b..b1a83d4071 100644 --- a/modules/gdnative/videodecoder/register_types.h +++ b/modules/gdnative/videodecoder/register_types.h @@ -28,5 +28,10 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ +#ifndef VIDEODECODER_REGISTER_TYPES_H +#define VIDEODECODER_REGISTER_TYPES_H + void register_videodecoder_types(); void unregister_videodecoder_types(); + +#endif // VIDEODECODER_REGISTER_TYPES_H diff --git a/modules/gdnative/videodecoder/video_stream_gdnative.cpp b/modules/gdnative/videodecoder/video_stream_gdnative.cpp index f6e2bad739..fe7c10cad9 100644 --- a/modules/gdnative/videodecoder/video_stream_gdnative.cpp +++ b/modules/gdnative/videodecoder/video_stream_gdnative.cpp @@ -33,7 +33,7 @@ #include "core/project_settings.h" #include "servers/audio_server.h" -VideoDecoderServer *VideoDecoderServer::instance = NULL; +VideoDecoderServer *VideoDecoderServer::instance = nullptr; static VideoDecoderServer decoder_server; @@ -105,7 +105,6 @@ int64_t GDAPI godot_videodecoder_file_seek(void *ptr, int64_t pos, int whence) { } void GDAPI godot_videodecoder_register_decoder(const godot_videodecoder_interface_gdnative *p_interface) { - decoder_server.register_decoder_interface(p_interface); } } @@ -113,7 +112,7 @@ void GDAPI godot_videodecoder_register_decoder(const godot_videodecoder_interfac // VideoStreamPlaybackGDNative starts here. bool VideoStreamPlaybackGDNative::open_file(const String &p_file) { - ERR_FAIL_COND_V(interface == NULL, false); + ERR_FAIL_COND_V(interface == nullptr, false); file = FileAccess::open(p_file, FileAccess::READ); bool file_opened = interface->open_file(data_struct, file); @@ -150,7 +149,7 @@ void VideoStreamPlaybackGDNative::update(float p_delta) { return; } time += p_delta; - ERR_FAIL_COND(interface == NULL); + ERR_FAIL_COND(interface == nullptr); interface->update(data_struct, p_delta); // Don't mix if there's no audio (num_channels == 0). @@ -189,7 +188,7 @@ void VideoStreamPlaybackGDNative::update(float p_delta) { void VideoStreamPlaybackGDNative::update_texture() { PackedByteArray *pba = (PackedByteArray *)interface->get_videoframe(data_struct); - if (pba == NULL) { + if (pba == nullptr) { playing = false; return; } @@ -202,42 +201,34 @@ void VideoStreamPlaybackGDNative::update_texture() { // ctor and dtor VideoStreamPlaybackGDNative::VideoStreamPlaybackGDNative() : - texture(Ref<ImageTexture>(memnew(ImageTexture))), - playing(false), - paused(false), - mix_udata(NULL), - mix_callback(NULL), - num_channels(-1), - time(0), - seek_backward(false), - mix_rate(0), - delay_compensation(0), - pcm(NULL), - pcm_write_idx(0), - samples_decoded(0), - file(NULL), - interface(NULL), - data_struct(NULL) {} + texture(Ref<ImageTexture>(memnew(ImageTexture))) {} VideoStreamPlaybackGDNative::~VideoStreamPlaybackGDNative() { cleanup(); } void VideoStreamPlaybackGDNative::cleanup() { - if (data_struct) + if (data_struct) { interface->destructor(data_struct); - if (pcm) + } + if (pcm) { memfree(pcm); - pcm = NULL; + } + if (file) { + file->close(); + memdelete(file); + file = nullptr; + } + pcm = nullptr; time = 0; num_channels = -1; - interface = NULL; - data_struct = NULL; + interface = nullptr; + data_struct = nullptr; } void VideoStreamPlaybackGDNative::set_interface(const godot_videodecoder_interface_gdnative *p_interface) { - ERR_FAIL_COND(p_interface == NULL); - if (interface != NULL) { + ERR_FAIL_COND(p_interface == nullptr); + if (interface != nullptr) { cleanup(); } interface = p_interface; @@ -255,7 +246,6 @@ bool VideoStreamPlaybackGDNative::is_paused() const { } void VideoStreamPlaybackGDNative::play() { - stop(); playing = true; @@ -272,10 +262,11 @@ void VideoStreamPlaybackGDNative::stop() { } void VideoStreamPlaybackGDNative::seek(float p_time) { - ERR_FAIL_COND(interface == NULL); + ERR_FAIL_COND(interface == nullptr); interface->seek(data_struct, p_time); - if (p_time < time) + if (p_time < time) { seek_backward = true; + } time = p_time; // reset audio buffers memset(pcm, 0, num_channels * AUX_BUFFER_SIZE * sizeof(float)); @@ -292,13 +283,12 @@ Ref<Texture2D> VideoStreamPlaybackGDNative::get_texture() const { } float VideoStreamPlaybackGDNative::get_length() const { - ERR_FAIL_COND_V(interface == NULL, 0); + ERR_FAIL_COND_V(interface == nullptr, 0); return interface->get_length(data_struct); } float VideoStreamPlaybackGDNative::get_playback_position() const { - - ERR_FAIL_COND_V(interface == NULL, 0); + ERR_FAIL_COND_V(interface == nullptr, 0); return interface->get_playback_position(data_struct); } @@ -312,24 +302,23 @@ void VideoStreamPlaybackGDNative::set_loop(bool p_enable) { } void VideoStreamPlaybackGDNative::set_audio_track(int p_idx) { - ERR_FAIL_COND(interface == NULL); + ERR_FAIL_COND(interface == nullptr); interface->set_audio_track(data_struct, p_idx); } void VideoStreamPlaybackGDNative::set_mix_callback(AudioMixCallback p_callback, void *p_userdata) { - mix_udata = p_userdata; mix_callback = p_callback; } int VideoStreamPlaybackGDNative::get_channels() const { - ERR_FAIL_COND_V(interface == NULL, 0); + ERR_FAIL_COND_V(interface == nullptr, 0); return (num_channels > 0) ? num_channels : 0; } int VideoStreamPlaybackGDNative::get_mix_rate() const { - ERR_FAIL_COND_V(interface == NULL, 0); + ERR_FAIL_COND_V(interface == nullptr, 0); return mix_rate; } @@ -339,27 +328,26 @@ int VideoStreamPlaybackGDNative::get_mix_rate() const { Ref<VideoStreamPlayback> VideoStreamGDNative::instance_playback() { Ref<VideoStreamPlaybackGDNative> pb = memnew(VideoStreamPlaybackGDNative); VideoDecoderGDNative *decoder = decoder_server.get_decoder(file.get_extension().to_lower()); - if (decoder == NULL) - return NULL; + if (decoder == nullptr) { + return nullptr; + } pb->set_interface(decoder->interface); pb->set_audio_track(audio_track); - if (pb->open_file(file)) + if (pb->open_file(file)) { return pb; - return NULL; + } + return nullptr; } void VideoStreamGDNative::set_file(const String &p_file) { - file = p_file; } String VideoStreamGDNative::get_file() { - return file; } void VideoStreamGDNative::_bind_methods() { - ClassDB::bind_method(D_METHOD("set_file", "file"), &VideoStreamGDNative::set_file); ClassDB::bind_method(D_METHOD("get_file"), &VideoStreamGDNative::get_file); @@ -367,13 +355,12 @@ void VideoStreamGDNative::_bind_methods() { } void VideoStreamGDNative::set_audio_track(int p_track) { - audio_track = p_track; } /* --- NOTE ResourceFormatLoaderVideoStreamGDNative starts here. ----- */ -RES ResourceFormatLoaderVideoStreamGDNative::load(const String &p_path, const String &p_original_path, Error *r_error, bool p_use_sub_threads, float *r_progress) { +RES ResourceFormatLoaderVideoStreamGDNative::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) { FileAccess *f = FileAccess::open(p_path, FileAccess::READ); if (!f) { if (r_error) { @@ -405,7 +392,8 @@ bool ResourceFormatLoaderVideoStreamGDNative::handles_type(const String &p_type) String ResourceFormatLoaderVideoStreamGDNative::get_resource_type(const String &p_path) const { String el = p_path.get_extension().to_lower(); - if (VideoDecoderServer::get_instance()->get_extensions().has(el)) + if (VideoDecoderServer::get_instance()->get_extensions().has(el)) { return "VideoStreamGDNative"; + } return ""; } diff --git a/modules/gdnative/videodecoder/video_stream_gdnative.h b/modules/gdnative/videodecoder/video_stream_gdnative.h index 21b5245a16..53017a6a97 100644 --- a/modules/gdnative/videodecoder/video_stream_gdnative.h +++ b/modules/gdnative/videodecoder/video_stream_gdnative.h @@ -37,13 +37,11 @@ #include "scene/resources/video_stream.h" struct VideoDecoderGDNative { - const godot_videodecoder_interface_gdnative *interface; - String plugin_name; + const godot_videodecoder_interface_gdnative *interface = nullptr; + String plugin_name = "none"; Vector<String> supported_extensions; - VideoDecoderGDNative() : - interface(NULL), - plugin_name("none") {} + VideoDecoderGDNative() {} VideoDecoderGDNative(const godot_videodecoder_interface_gdnative *p_interface) : interface(p_interface), @@ -88,8 +86,9 @@ public: } VideoDecoderGDNative *get_decoder(const String &extension) { - if (extensions.size() == 0 || !extensions.has(extension)) - return NULL; + if (extensions.size() == 0 || !extensions.has(extension)) { + return nullptr; + } return decoders[extensions[extension]]; } @@ -102,32 +101,31 @@ public: memdelete(decoders[i]); } decoders.clear(); - instance = NULL; + instance = nullptr; } }; class VideoStreamPlaybackGDNative : public VideoStreamPlayback { - GDCLASS(VideoStreamPlaybackGDNative, VideoStreamPlayback); Ref<ImageTexture> texture; - bool playing; - bool paused; + bool playing = false; + bool paused = false; Vector2 texture_size; - void *mix_udata; - AudioMixCallback mix_callback; + void *mix_udata = nullptr; + AudioMixCallback mix_callback = nullptr; - int num_channels; - float time; - bool seek_backward; - int mix_rate; - double delay_compensation; + int num_channels = -1; + float time = 0; + bool seek_backward = false; + int mix_rate = 0; + double delay_compensation = 0; - float *pcm; - int pcm_write_idx; - int samples_decoded; + float *pcm = nullptr; + int pcm_write_idx = 0; + int samples_decoded = 0; void cleanup(); void update_texture(); @@ -135,10 +133,10 @@ class VideoStreamPlaybackGDNative : public VideoStreamPlayback { protected: String file_name; - FileAccess *file; + FileAccess *file = nullptr; - const godot_videodecoder_interface_gdnative *interface; - void *data_struct; + const godot_videodecoder_interface_gdnative *interface = nullptr; + void *data_struct = nullptr; public: VideoStreamPlaybackGDNative(); @@ -177,11 +175,10 @@ public: }; class VideoStreamGDNative : public VideoStream { - GDCLASS(VideoStreamGDNative, VideoStream); String file; - int audio_track; + int audio_track = 0; protected: static void @@ -199,7 +196,7 @@ public: class ResourceFormatLoaderVideoStreamGDNative : public ResourceFormatLoader { public: - virtual RES load(const String &p_path, const String &p_original_path = "", Error *r_error = NULL, bool p_use_sub_threads = false, float *r_progress = nullptr); + virtual RES load(const String &p_path, const String &p_original_path = "", Error *r_error = nullptr, bool p_use_sub_threads = false, float *r_progress = nullptr, bool p_no_cache = false); virtual void get_recognized_extensions(List<String> *p_extensions) const; virtual bool handles_type(const String &p_type) const; virtual String get_resource_type(const String &p_path) const; diff --git a/modules/gdnative/xr/SCsub b/modules/gdnative/xr/SCsub new file mode 100644 index 0000000000..0b2db3b504 --- /dev/null +++ b/modules/gdnative/xr/SCsub @@ -0,0 +1,6 @@ +#!/usr/bin/env python + +Import("env") +Import("env_gdnative") + +env_gdnative.add_source_files(env.modules_sources, "*.cpp") diff --git a/modules/gdnative/arvr/config.py b/modules/gdnative/xr/config.py index 53bc827027..d22f9454ed 100644 --- a/modules/gdnative/arvr/config.py +++ b/modules/gdnative/xr/config.py @@ -1,5 +1,6 @@ def can_build(env, platform): - return True + return True + def configure(env): - pass + pass diff --git a/modules/gdnative/arvr/register_types.cpp b/modules/gdnative/xr/register_types.cpp index 0f6e2bca1a..da3a7dc4b8 100644 --- a/modules/gdnative/arvr/register_types.cpp +++ b/modules/gdnative/xr/register_types.cpp @@ -29,11 +29,12 @@ /*************************************************************************/ #include "register_types.h" -#include "arvr_interface_gdnative.h" +#include "xr_interface_gdnative.h" -void register_arvr_types() { - ClassDB::register_class<ARVRInterfaceGDNative>(); +void register_xr_types() { + ClassDB::register_class<XRInterfaceGDNative>(); + ClassDB::add_compatibility_class("ARVRInterfaceGDNative", "XRInterfaceGDNative"); } -void unregister_arvr_types() { +void unregister_xr_types() { } diff --git a/modules/gdnative/arvr/register_types.h b/modules/gdnative/xr/register_types.h index 815f112fbf..2501d28651 100644 --- a/modules/gdnative/arvr/register_types.h +++ b/modules/gdnative/xr/register_types.h @@ -28,5 +28,10 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -void register_arvr_types(); -void unregister_arvr_types(); +#ifndef XR_REGISTER_TYPES_H +#define XR_REGISTER_TYPES_H + +void register_xr_types(); +void unregister_xr_types(); + +#endif // XR_REGISTER_TYPES_H diff --git a/modules/gdnative/xr/xr_interface_gdnative.cpp b/modules/gdnative/xr/xr_interface_gdnative.cpp new file mode 100644 index 0000000000..d03fc33935 --- /dev/null +++ b/modules/gdnative/xr/xr_interface_gdnative.cpp @@ -0,0 +1,420 @@ +/*************************************************************************/ +/* xr_interface_gdnative.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 "xr_interface_gdnative.h" +#include "core/input/input.h" +#include "servers/rendering/rendering_server_globals.h" +#include "servers/xr/xr_positional_tracker.h" + +void XRInterfaceGDNative::_bind_methods() { + ADD_PROPERTY_DEFAULT("interface_is_initialized", false); + ADD_PROPERTY_DEFAULT("ar_is_anchor_detection_enabled", false); +} + +XRInterfaceGDNative::XRInterfaceGDNative() { + print_verbose("Construct gdnative interface\n"); + + // we won't have our data pointer until our library gets set + data = nullptr; + + interface = nullptr; +} + +XRInterfaceGDNative::~XRInterfaceGDNative() { + print_verbose("Destruct gdnative interface\n"); + + if (interface != nullptr && is_initialized()) { + uninitialize(); + }; + + // cleanup after ourselves + cleanup(); +} + +void XRInterfaceGDNative::cleanup() { + if (interface != nullptr) { + interface->destructor(data); + data = nullptr; + interface = nullptr; + } +} + +void XRInterfaceGDNative::set_interface(const godot_xr_interface_gdnative *p_interface) { + // this should only be called once, just being paranoid.. + if (interface) { + cleanup(); + } + + // bind to our interface + interface = p_interface; + + // Now we do our constructing... + data = interface->constructor((godot_object *)this); +} + +StringName XRInterfaceGDNative::get_name() const { + ERR_FAIL_COND_V(interface == nullptr, StringName()); + + godot_string result = interface->get_name(data); + + StringName name = *(String *)&result; + + godot_string_destroy(&result); + + return name; +} + +int XRInterfaceGDNative::get_capabilities() const { + int capabilities; + + ERR_FAIL_COND_V(interface == nullptr, 0); // 0 = None + + capabilities = interface->get_capabilities(data); + + return capabilities; +} + +bool XRInterfaceGDNative::get_anchor_detection_is_enabled() const { + ERR_FAIL_COND_V(interface == nullptr, false); + + return interface->get_anchor_detection_is_enabled(data); +} + +void XRInterfaceGDNative::set_anchor_detection_is_enabled(bool p_enable) { + ERR_FAIL_COND(interface == nullptr); + + interface->set_anchor_detection_is_enabled(data, p_enable); +} + +int XRInterfaceGDNative::get_camera_feed_id() { + ERR_FAIL_COND_V(interface == nullptr, 0); + + return (unsigned int)interface->get_camera_feed_id(data); +} + +bool XRInterfaceGDNative::is_stereo() { + bool stereo; + + ERR_FAIL_COND_V(interface == nullptr, false); + + stereo = interface->is_stereo(data); + + return stereo; +} + +bool XRInterfaceGDNative::is_initialized() const { + ERR_FAIL_COND_V(interface == nullptr, false); + + return interface->is_initialized(data); +} + +bool XRInterfaceGDNative::initialize() { + ERR_FAIL_COND_V(interface == nullptr, false); + + bool initialized = interface->initialize(data); + + if (initialized) { + // if we successfully initialize our interface and we don't have a primary interface yet, this becomes our primary interface + + XRServer *xr_server = XRServer::get_singleton(); + if ((xr_server != nullptr) && (xr_server->get_primary_interface() == nullptr)) { + xr_server->set_primary_interface(this); + }; + }; + + return initialized; +} + +void XRInterfaceGDNative::uninitialize() { + ERR_FAIL_COND(interface == nullptr); + + XRServer *xr_server = XRServer::get_singleton(); + if (xr_server != nullptr) { + // Whatever happens, make sure this is no longer our primary interface + xr_server->clear_primary_interface_if(this); + } + + interface->uninitialize(data); +} + +Size2 XRInterfaceGDNative::get_render_targetsize() { + ERR_FAIL_COND_V(interface == nullptr, Size2()); + + godot_vector2 result = interface->get_render_targetsize(data); + Vector2 *vec = (Vector2 *)&result; + + return *vec; +} + +Transform XRInterfaceGDNative::get_transform_for_eye(XRInterface::Eyes p_eye, const Transform &p_cam_transform) { + Transform *ret; + + ERR_FAIL_COND_V(interface == nullptr, Transform()); + + godot_transform t = interface->get_transform_for_eye(data, (int)p_eye, (godot_transform *)&p_cam_transform); + + ret = (Transform *)&t; + + return *ret; +} + +CameraMatrix XRInterfaceGDNative::get_projection_for_eye(XRInterface::Eyes p_eye, real_t p_aspect, real_t p_z_near, real_t p_z_far) { + CameraMatrix cm; + + ERR_FAIL_COND_V(interface == nullptr, CameraMatrix()); + + interface->fill_projection_for_eye(data, (godot_real *)cm.matrix, (godot_int)p_eye, p_aspect, p_z_near, p_z_far); + + return cm; +} + +unsigned int XRInterfaceGDNative::get_external_texture_for_eye(XRInterface::Eyes p_eye) { + ERR_FAIL_COND_V(interface == nullptr, 0); + + return (unsigned int)interface->get_external_texture_for_eye(data, (godot_int)p_eye); +} + +void XRInterfaceGDNative::commit_for_eye(XRInterface::Eyes p_eye, RID p_render_target, const Rect2 &p_screen_rect) { + ERR_FAIL_COND(interface == nullptr); + + interface->commit_for_eye(data, (godot_int)p_eye, (godot_rid *)&p_render_target, (godot_rect2 *)&p_screen_rect); +} + +void XRInterfaceGDNative::process() { + ERR_FAIL_COND(interface == nullptr); + + interface->process(data); +} + +void XRInterfaceGDNative::notification(int p_what) { + ERR_FAIL_COND(interface == nullptr); + + interface->notification(data, p_what); +} + +///////////////////////////////////////////////////////////////////////////////////// +// some helper callbacks + +extern "C" { + +void GDAPI godot_xr_register_interface(const godot_xr_interface_gdnative *p_interface) { + // Must be on a version 4 plugin + ERR_FAIL_COND_MSG(p_interface->version.major < 4, "GDNative XR interfaces build for Godot 3.x are not supported."); + + Ref<XRInterfaceGDNative> new_interface; + new_interface.instance(); + new_interface->set_interface((const godot_xr_interface_gdnative *)p_interface); + XRServer::get_singleton()->add_interface(new_interface); +} + +godot_real GDAPI godot_xr_get_worldscale() { + XRServer *xr_server = XRServer::get_singleton(); + ERR_FAIL_NULL_V(xr_server, 1.0); + + return xr_server->get_world_scale(); +} + +godot_transform GDAPI godot_xr_get_reference_frame() { + godot_transform reference_frame; + Transform *reference_frame_ptr = (Transform *)&reference_frame; + + XRServer *xr_server = XRServer::get_singleton(); + if (xr_server != nullptr) { + *reference_frame_ptr = xr_server->get_reference_frame(); + } else { + godot_transform_new_identity(&reference_frame); + } + + return reference_frame; +} + +void GDAPI godot_xr_blit(godot_int p_eye, godot_rid *p_render_target, godot_rect2 *p_rect) { + // blits out our texture as is, handy for preview display of one of the eyes that is already rendered with lens distortion on an external HMD + XRInterface::Eyes eye = (XRInterface::Eyes)p_eye; +#if 0 + RID *render_target = (RID *)p_render_target; +#endif + Rect2 screen_rect = *(Rect2 *)p_rect; + + if (eye == XRInterface::EYE_LEFT) { + screen_rect.size.x /= 2.0; + } else if (p_eye == XRInterface::EYE_RIGHT) { + screen_rect.size.x /= 2.0; + screen_rect.position.x += screen_rect.size.x; + } +#ifndef _MSC_VER +#warning this needs to be redone +#endif +#if 0 + RSG::rasterizer->blit_render_target_to_screen(*render_target, screen_rect, 0); +#endif +} + +godot_int GDAPI godot_xr_get_texid(godot_rid *p_render_target) { + // In order to send off our textures to display on our hardware we need the opengl texture ID instead of the render target RID + // This is a handy function to expose that. +#if 0 + RID *render_target = (RID *)p_render_target; + + RID eye_texture = RSG::storage->render_target_get_texture(*render_target); +#endif + +#ifndef _MSC_VER +#warning need to obtain this ID again +#endif + uint32_t texid = 0; //RS::get_singleton()->texture_get_texid(eye_texture); + + return texid; +} + +godot_int GDAPI godot_xr_add_controller(char *p_device_name, godot_int p_hand, godot_bool p_tracks_orientation, godot_bool p_tracks_position) { + XRServer *xr_server = XRServer::get_singleton(); + ERR_FAIL_NULL_V(xr_server, 0); + + Input *input = Input::get_singleton(); + ERR_FAIL_NULL_V(input, 0); + + XRPositionalTracker *new_tracker = memnew(XRPositionalTracker); + new_tracker->set_name(p_device_name); + new_tracker->set_type(XRServer::TRACKER_CONTROLLER); + if (p_hand == 1) { + new_tracker->set_hand(XRPositionalTracker::TRACKER_LEFT_HAND); + } else if (p_hand == 2) { + new_tracker->set_hand(XRPositionalTracker::TRACKER_RIGHT_HAND); + } + + // also register as joystick... + int joyid = input->get_unused_joy_id(); + if (joyid != -1) { + new_tracker->set_joy_id(joyid); + input->joy_connection_changed(joyid, true, p_device_name, ""); + } + + if (p_tracks_orientation) { + Basis orientation; + new_tracker->set_orientation(orientation); + } + if (p_tracks_position) { + Vector3 position; + new_tracker->set_position(position); + } + + // add our tracker to our server and remember its pointer + xr_server->add_tracker(new_tracker); + + // note, this ID is only unique within controllers! + return new_tracker->get_tracker_id(); +} + +void GDAPI godot_xr_remove_controller(godot_int p_controller_id) { + XRServer *xr_server = XRServer::get_singleton(); + ERR_FAIL_NULL(xr_server); + + Input *input = Input::get_singleton(); + ERR_FAIL_NULL(input); + + XRPositionalTracker *remove_tracker = xr_server->find_by_type_and_id(XRServer::TRACKER_CONTROLLER, p_controller_id); + if (remove_tracker != nullptr) { + // unset our joystick if applicable + int joyid = remove_tracker->get_joy_id(); + if (joyid != -1) { + input->joy_connection_changed(joyid, false, "", ""); + remove_tracker->set_joy_id(-1); + } + + // remove our tracker from our server + xr_server->remove_tracker(remove_tracker); + memdelete(remove_tracker); + } +} + +void GDAPI godot_xr_set_controller_transform(godot_int p_controller_id, godot_transform *p_transform, godot_bool p_tracks_orientation, godot_bool p_tracks_position) { + XRServer *xr_server = XRServer::get_singleton(); + ERR_FAIL_NULL(xr_server); + + XRPositionalTracker *tracker = xr_server->find_by_type_and_id(XRServer::TRACKER_CONTROLLER, p_controller_id); + if (tracker != nullptr) { + Transform *transform = (Transform *)p_transform; + if (p_tracks_orientation) { + tracker->set_orientation(transform->basis); + } + if (p_tracks_position) { + tracker->set_rw_position(transform->origin); + } + } +} + +void GDAPI godot_xr_set_controller_button(godot_int p_controller_id, godot_int p_button, godot_bool p_is_pressed) { + XRServer *xr_server = XRServer::get_singleton(); + ERR_FAIL_NULL(xr_server); + + Input *input = Input::get_singleton(); + ERR_FAIL_NULL(input); + + XRPositionalTracker *tracker = xr_server->find_by_type_and_id(XRServer::TRACKER_CONTROLLER, p_controller_id); + if (tracker != nullptr) { + int joyid = tracker->get_joy_id(); + if (joyid != -1) { + input->joy_button(joyid, p_button, p_is_pressed); + } + } +} + +void GDAPI godot_xr_set_controller_axis(godot_int p_controller_id, godot_int p_axis, godot_real p_value, godot_bool p_can_be_negative) { + XRServer *xr_server = XRServer::get_singleton(); + ERR_FAIL_NULL(xr_server); + + Input *input = Input::get_singleton(); + ERR_FAIL_NULL(input); + + XRPositionalTracker *tracker = xr_server->find_by_type_and_id(XRServer::TRACKER_CONTROLLER, p_controller_id); + if (tracker != nullptr) { + int joyid = tracker->get_joy_id(); + if (joyid != -1) { + Input::JoyAxis jx; + jx.min = p_can_be_negative ? -1 : 0; + jx.value = p_value; + input->joy_axis(joyid, p_axis, jx); + } + } +} + +godot_real GDAPI godot_xr_get_controller_rumble(godot_int p_controller_id) { + XRServer *xr_server = XRServer::get_singleton(); + ERR_FAIL_NULL_V(xr_server, 0.0); + + XRPositionalTracker *tracker = xr_server->find_by_type_and_id(XRServer::TRACKER_CONTROLLER, p_controller_id); + if (tracker != nullptr) { + return tracker->get_rumble(); + } + + return 0.0; +} +} diff --git a/modules/gdnative/arvr/arvr_interface_gdnative.h b/modules/gdnative/xr/xr_interface_gdnative.h index e38eb435c6..64f1282a7e 100644 --- a/modules/gdnative/arvr/arvr_interface_gdnative.h +++ b/modules/gdnative/xr/xr_interface_gdnative.h @@ -1,5 +1,5 @@ /*************************************************************************/ -/* arvr_interface_gdnative.h */ +/* xr_interface_gdnative.h */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ @@ -28,11 +28,11 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -#ifndef ARVR_INTERFACE_GDNATIVE_H -#define ARVR_INTERFACE_GDNATIVE_H +#ifndef XR_INTERFACE_GDNATIVE_H +#define XR_INTERFACE_GDNATIVE_H #include "modules/gdnative/gdnative.h" -#include "servers/arvr/arvr_interface.h" +#include "servers/xr/xr_interface.h" /** @authors Hinsbart & Karroffel & Mux213 @@ -40,23 +40,23 @@ This subclass of our AR/VR interface forms a bridge to GDNative. */ -class ARVRInterfaceGDNative : public ARVRInterface { - GDCLASS(ARVRInterfaceGDNative, ARVRInterface); +class XRInterfaceGDNative : public XRInterface { + GDCLASS(XRInterfaceGDNative, XRInterface); void cleanup(); protected: - const godot_arvr_interface_gdnative *interface; + const godot_xr_interface_gdnative *interface; void *data; static void _bind_methods(); public: /** general interface information **/ - ARVRInterfaceGDNative(); - ~ARVRInterfaceGDNative(); + XRInterfaceGDNative(); + ~XRInterfaceGDNative(); - void set_interface(const godot_arvr_interface_gdnative *p_interface); + void set_interface(const godot_xr_interface_gdnative *p_interface); virtual StringName get_name() const; virtual int get_capabilities() const; @@ -73,19 +73,19 @@ public: /** rendering and internal **/ virtual Size2 get_render_targetsize(); virtual bool is_stereo(); - virtual Transform get_transform_for_eye(ARVRInterface::Eyes p_eye, const Transform &p_cam_transform); + virtual Transform get_transform_for_eye(XRInterface::Eyes p_eye, const Transform &p_cam_transform); // we expose a Vector<float> version of this function to GDNative - Vector<float> _get_projection_for_eye(ARVRInterface::Eyes p_eye, real_t p_aspect, real_t p_z_near, real_t p_z_far); + Vector<float> _get_projection_for_eye(XRInterface::Eyes p_eye, real_t p_aspect, real_t p_z_near, real_t p_z_far); - // and a CameraMatrix version to ARVRServer - virtual CameraMatrix get_projection_for_eye(ARVRInterface::Eyes p_eye, real_t p_aspect, real_t p_z_near, real_t p_z_far); + // and a CameraMatrix version to XRServer + virtual CameraMatrix get_projection_for_eye(XRInterface::Eyes p_eye, real_t p_aspect, real_t p_z_near, real_t p_z_far); - virtual unsigned int get_external_texture_for_eye(ARVRInterface::Eyes p_eye); - virtual void commit_for_eye(ARVRInterface::Eyes p_eye, RID p_render_target, const Rect2 &p_screen_rect); + virtual unsigned int get_external_texture_for_eye(XRInterface::Eyes p_eye); + 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); }; -#endif // ARVR_INTERFACE_GDNATIVE_H +#endif // XR_INTERFACE_GDNATIVE_H |