diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2022-05-04 11:00:42 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-04 11:00:42 +0200 |
commit | f262ae9a6f01be8da4ee351f27d5d300674373a7 (patch) | |
tree | 1965b906c4342bcfd8f1eee4547aca64db4d68e9 | |
parent | 20a17eb71d4a0b665231fc4a9df3da5e8a3d7812 (diff) | |
parent | 8bf5a532de66d1a84c553edc0a081440220f6a2c (diff) | |
download | redot-cpp-f262ae9a6f01be8da4ee351f27d5d300674373a7.tar.gz |
Merge pull request #750 from bruvzg/init_levels
Change registered initializers / terminators to the single function with level argument.
-rw-r--r-- | godot-headers/extension_api.json | 1292 | ||||
-rw-r--r-- | godot-headers/godot/gdnative_interface.h | 4 | ||||
-rw-r--r-- | include/godot_cpp/godot.hpp | 27 | ||||
-rw-r--r-- | src/godot.cpp | 63 | ||||
-rw-r--r-- | test/src/register_types.cpp | 17 | ||||
-rw-r--r-- | test/src/register_types.h | 7 |
6 files changed, 536 insertions, 874 deletions
diff --git a/godot-headers/extension_api.json b/godot-headers/extension_api.json index a19494f..4a0658f 100644 --- a/godot-headers/extension_api.json +++ b/godot-headers/extension_api.json @@ -3,9 +3,9 @@ "version_major": 4, "version_minor": 0, "version_patch": 0, - "version_status": "alpha7", - "version_build": "official", - "version_full_name": "Godot Engine v4.0.alpha7.official" + "version_status": "alpha", + "version_build": "custom_build", + "version_full_name": "Godot Engine v4.0.alpha.custom_build" }, "builtin_class_sizes": [ { @@ -2896,7 +2896,7 @@ }, { "name": "KEY_MASK_CMD", - "value": 268435456 + "value": 134217728 }, { "name": "KEY_MASK_KPAD", @@ -70296,6 +70296,10 @@ { "name": "FEATURE_CLIPBOARD_PRIMARY", "value": 18 + }, + { + "name": "FEATURE_TEXT_TO_SPEECH", + "value": 19 } ] }, @@ -70477,6 +70481,27 @@ ] }, { + "name": "TTSUtteranceEvent", + "values": [ + { + "name": "TTS_UTTERANCE_STARTED", + "value": 0 + }, + { + "name": "TTS_UTTERANCE_ENDED", + "value": 1 + }, + { + "name": "TTS_UTTERANCE_CANCELED", + "value": 2 + }, + { + "name": "TTS_UTTERANCE_BOUNDARY", + "value": 3 + } + ] + }, + { "name": "VSyncMode", "values": [ { @@ -71570,6 +71595,145 @@ ] }, { + "name": "tts_is_speaking", + "is_const": true, + "is_vararg": false, + "is_static": false, + "is_virtual": false, + "hash": 135338183, + "return_value": { + "type": "bool" + } + }, + { + "name": "tts_is_paused", + "is_const": true, + "is_vararg": false, + "is_static": false, + "is_virtual": false, + "hash": 135338183, + "return_value": { + "type": "bool" + } + }, + { + "name": "tts_get_voices", + "is_const": true, + "is_vararg": false, + "is_static": false, + "is_virtual": false, + "hash": 135338183, + "return_value": { + "type": "Array" + } + }, + { + "name": "tts_get_voices_for_language", + "is_const": true, + "is_vararg": false, + "is_static": false, + "is_virtual": false, + "hash": 135374120, + "return_value": { + "type": "PackedStringArray" + }, + "arguments": [ + { + "name": "language", + "type": "String" + } + ] + }, + { + "name": "tts_speak", + "is_const": false, + "is_vararg": false, + "is_static": false, + "is_virtual": false, + "hash": 839004078, + "arguments": [ + { + "name": "text", + "type": "String" + }, + { + "name": "voice", + "type": "String" + }, + { + "name": "volume", + "type": "int", + "meta": "int32", + "default_value": "50" + }, + { + "name": "pitch", + "type": "float", + "meta": "float", + "default_value": "1.0" + }, + { + "name": "rate", + "type": "float", + "meta": "float", + "default_value": "1.0" + }, + { + "name": "utterance_id", + "type": "int", + "meta": "int32", + "default_value": "0" + }, + { + "name": "interrupt", + "type": "bool", + "default_value": "false" + } + ] + }, + { + "name": "tts_pause", + "is_const": false, + "is_vararg": false, + "is_static": false, + "is_virtual": false, + "hash": 134152229 + }, + { + "name": "tts_resume", + "is_const": false, + "is_vararg": false, + "is_static": false, + "is_virtual": false, + "hash": 134152229 + }, + { + "name": "tts_stop", + "is_const": false, + "is_vararg": false, + "is_static": false, + "is_virtual": false, + "hash": 134152229 + }, + { + "name": "tts_set_utterance_callback", + "is_const": false, + "is_vararg": false, + "is_static": false, + "is_virtual": false, + "hash": 134224103, + "arguments": [ + { + "name": "event", + "type": "enum::DisplayServer.TTSUtteranceEvent" + }, + { + "name": "callable", + "type": "Callable" + } + ] + }, + { "name": "mouse_set_mode", "is_const": false, "is_vararg": false, @@ -71692,6 +71856,28 @@ } }, { + "name": "get_display_cutouts", + "is_const": true, + "is_vararg": false, + "is_static": false, + "is_virtual": false, + "hash": 135338183, + "return_value": { + "type": "Array" + } + }, + { + "name": "get_display_safe_area", + "is_const": true, + "is_vararg": false, + "is_static": false, + "is_virtual": false, + "hash": 135338183, + "return_value": { + "type": "Rect2i" + } + }, + { "name": "get_screen_count", "is_const": true, "is_vararg": false, @@ -73127,6 +73313,13 @@ ] }, { + "name": "DisplayServerOSX", + "is_refcounted": false, + "is_instantiable": false, + "inherits": "DisplayServer", + "api_type": "core" + }, + { "name": "ENetConnection", "is_refcounted": true, "is_instantiable": true, @@ -112571,6 +112764,60 @@ } }, { + "name": "set_render_priority", + "is_const": false, + "is_vararg": false, + "is_static": false, + "is_virtual": false, + "hash": 134188166, + "arguments": [ + { + "name": "priority", + "type": "int", + "meta": "int32" + } + ] + }, + { + "name": "get_render_priority", + "is_const": true, + "is_vararg": false, + "is_static": false, + "is_virtual": false, + "hash": 135338183, + "return_value": { + "type": "int", + "meta": "int32" + } + }, + { + "name": "set_outline_render_priority", + "is_const": false, + "is_vararg": false, + "is_static": false, + "is_virtual": false, + "hash": 134188166, + "arguments": [ + { + "name": "priority", + "type": "int", + "meta": "int32" + } + ] + }, + { + "name": "get_outline_render_priority", + "is_const": true, + "is_vararg": false, + "is_static": false, + "is_virtual": false, + "hash": 135338183, + "return_value": { + "type": "int", + "meta": "int32" + } + }, + { "name": "set_font", "is_const": false, "is_vararg": false, @@ -112756,6 +113003,31 @@ } }, { + "name": "set_offset", + "is_const": false, + "is_vararg": false, + "is_static": false, + "is_virtual": false, + "hash": 134188166, + "arguments": [ + { + "name": "offset", + "type": "Vector2" + } + ] + }, + { + "name": "get_offset", + "is_const": true, + "is_vararg": false, + "is_static": false, + "is_virtual": false, + "hash": 135338183, + "return_value": { + "type": "Vector2" + } + }, + { "name": "set_draw_flag", "is_const": false, "is_vararg": false, @@ -112913,6 +113185,13 @@ "index": -1 }, { + "type": "Vector2", + "name": "offset", + "setter": "set_offset", + "getter": "get_offset", + "index": -1 + }, + { "type": "int", "name": "billboard", "setter": "set_billboard_mode", @@ -112969,6 +113248,20 @@ "index": -1 }, { + "type": "int", + "name": "render_priority", + "setter": "set_render_priority", + "getter": "get_render_priority", + "index": -1 + }, + { + "type": "int", + "name": "outline_render_priority", + "setter": "set_outline_render_priority", + "getter": "get_outline_render_priority", + "index": -1 + }, + { "type": "Color", "name": "modulate", "setter": "set_modulate", @@ -121869,12 +122162,8 @@ "value": 2 }, { - "name": "INITIALIZATION_LEVEL_DRIVER", - "value": 3 - }, - { "name": "INITIALIZATION_LEVEL_EDITOR", - "value": 4 + "value": 3 } ] } @@ -124449,6 +124738,17 @@ "type": "int", "meta": "uint32" } + }, + { + "name": "get_region_rid", + "is_const": true, + "is_vararg": false, + "is_static": false, + "is_virtual": false, + "hash": 135338183, + "return_value": { + "type": "RID" + } } ], "properties": [ @@ -124560,6 +124860,17 @@ } }, { + "name": "get_region_rid", + "is_const": true, + "is_vararg": false, + "is_static": false, + "is_virtual": false, + "hash": 135338183, + "return_value": { + "type": "RID" + } + }, + { "name": "bake_navigation_mesh", "is_const": false, "is_vararg": false, @@ -132217,779 +132528,6 @@ ] }, { - "name": "OpenXRAction", - "is_refcounted": true, - "is_instantiable": true, - "inherits": "Resource", - "api_type": "core", - "enums": [ - { - "name": "ActionType", - "values": [ - { - "name": "OPENXR_ACTION_BOOL", - "value": 0 - }, - { - "name": "OPENXR_ACTION_FLOAT", - "value": 1 - }, - { - "name": "OPENXR_ACTION_VECTOR2", - "value": 2 - }, - { - "name": "OPENXR_ACTION_POSE", - "value": 3 - } - ] - } - ], - "methods": [ - { - "name": "set_localized_name", - "is_const": false, - "is_vararg": false, - "is_static": false, - "is_virtual": false, - "hash": 134188166, - "arguments": [ - { - "name": "localized_name", - "type": "String" - } - ] - }, - { - "name": "get_localized_name", - "is_const": true, - "is_vararg": false, - "is_static": false, - "is_virtual": false, - "hash": 135338183, - "return_value": { - "type": "String" - } - }, - { - "name": "set_action_type", - "is_const": false, - "is_vararg": false, - "is_static": false, - "is_virtual": false, - "hash": 134188166, - "arguments": [ - { - "name": "action_type", - "type": "enum::OpenXRAction.ActionType" - } - ] - }, - { - "name": "get_action_type", - "is_const": true, - "is_vararg": false, - "is_static": false, - "is_virtual": false, - "hash": 135338183, - "return_value": { - "type": "enum::OpenXRAction.ActionType" - } - }, - { - "name": "set_toplevel_paths", - "is_const": false, - "is_vararg": false, - "is_static": false, - "is_virtual": false, - "hash": 134188166, - "arguments": [ - { - "name": "toplevel_paths", - "type": "PackedStringArray" - } - ] - }, - { - "name": "get_toplevel_paths", - "is_const": true, - "is_vararg": false, - "is_static": false, - "is_virtual": false, - "hash": 135338183, - "return_value": { - "type": "PackedStringArray" - } - } - ], - "properties": [ - { - "type": "String", - "name": "localized_name", - "setter": "set_localized_name", - "getter": "get_localized_name", - "index": -1 - }, - { - "type": "int", - "name": "action_type", - "setter": "set_action_type", - "getter": "get_action_type", - "index": -1 - }, - { - "type": "Array", - "name": "toplevel_paths", - "setter": "set_toplevel_paths", - "getter": "get_toplevel_paths", - "index": -1 - } - ] - }, - { - "name": "OpenXRActionMap", - "is_refcounted": true, - "is_instantiable": true, - "inherits": "Resource", - "api_type": "core", - "methods": [ - { - "name": "set_action_sets", - "is_const": false, - "is_vararg": false, - "is_static": false, - "is_virtual": false, - "hash": 134188166, - "arguments": [ - { - "name": "action_sets", - "type": "Array" - } - ] - }, - { - "name": "get_action_sets", - "is_const": true, - "is_vararg": false, - "is_static": false, - "is_virtual": false, - "hash": 135338183, - "return_value": { - "type": "Array" - } - }, - { - "name": "get_action_set_count", - "is_const": true, - "is_vararg": false, - "is_static": false, - "is_virtual": false, - "hash": 135338183, - "return_value": { - "type": "int", - "meta": "int32" - } - }, - { - "name": "find_action_set", - "is_const": true, - "is_vararg": false, - "is_static": false, - "is_virtual": false, - "hash": 135374120, - "return_value": { - "type": "OpenXRActionSet" - }, - "arguments": [ - { - "name": "name", - "type": "String" - } - ] - }, - { - "name": "get_action_set", - "is_const": true, - "is_vararg": false, - "is_static": false, - "is_virtual": false, - "hash": 135374120, - "return_value": { - "type": "OpenXRActionSet" - }, - "arguments": [ - { - "name": "idx", - "type": "int", - "meta": "int32" - } - ] - }, - { - "name": "add_action_set", - "is_const": false, - "is_vararg": false, - "is_static": false, - "is_virtual": false, - "hash": 134188166, - "arguments": [ - { - "name": "action_set", - "type": "OpenXRActionSet" - } - ] - }, - { - "name": "remove_action_set", - "is_const": false, - "is_vararg": false, - "is_static": false, - "is_virtual": false, - "hash": 134188166, - "arguments": [ - { - "name": "action_set", - "type": "OpenXRActionSet" - } - ] - }, - { - "name": "set_interaction_profiles", - "is_const": false, - "is_vararg": false, - "is_static": false, - "is_virtual": false, - "hash": 134188166, - "arguments": [ - { - "name": "interaction_profiles", - "type": "Array" - } - ] - }, - { - "name": "get_interaction_profiles", - "is_const": true, - "is_vararg": false, - "is_static": false, - "is_virtual": false, - "hash": 135338183, - "return_value": { - "type": "Array" - } - }, - { - "name": "get_interaction_profile_count", - "is_const": true, - "is_vararg": false, - "is_static": false, - "is_virtual": false, - "hash": 135338183, - "return_value": { - "type": "int", - "meta": "int32" - } - }, - { - "name": "find_interaction_profile", - "is_const": true, - "is_vararg": false, - "is_static": false, - "is_virtual": false, - "hash": 135374120, - "return_value": { - "type": "OpenXRInteractionProfile" - }, - "arguments": [ - { - "name": "name", - "type": "String" - } - ] - }, - { - "name": "get_interaction_profile", - "is_const": true, - "is_vararg": false, - "is_static": false, - "is_virtual": false, - "hash": 135374120, - "return_value": { - "type": "OpenXRInteractionProfile" - }, - "arguments": [ - { - "name": "idx", - "type": "int", - "meta": "int32" - } - ] - }, - { - "name": "add_interaction_profile", - "is_const": false, - "is_vararg": false, - "is_static": false, - "is_virtual": false, - "hash": 134188166, - "arguments": [ - { - "name": "interaction_profile", - "type": "OpenXRInteractionProfile" - } - ] - }, - { - "name": "remove_interaction_profile", - "is_const": false, - "is_vararg": false, - "is_static": false, - "is_virtual": false, - "hash": 134188166, - "arguments": [ - { - "name": "interaction_profile", - "type": "OpenXRInteractionProfile" - } - ] - }, - { - "name": "create_default_action_sets", - "is_const": false, - "is_vararg": false, - "is_static": false, - "is_virtual": false, - "hash": 134152229 - } - ], - "properties": [ - { - "type": "OpenXRActionSet", - "name": "action_sets", - "setter": "set_action_sets", - "getter": "get_action_sets", - "index": -1 - }, - { - "type": "OpenXRInteractionProfile", - "name": "interaction_profiles", - "setter": "set_interaction_profiles", - "getter": "get_interaction_profiles", - "index": -1 - } - ] - }, - { - "name": "OpenXRActionSet", - "is_refcounted": true, - "is_instantiable": true, - "inherits": "Resource", - "api_type": "core", - "methods": [ - { - "name": "set_localized_name", - "is_const": false, - "is_vararg": false, - "is_static": false, - "is_virtual": false, - "hash": 134188166, - "arguments": [ - { - "name": "localized_name", - "type": "String" - } - ] - }, - { - "name": "get_localized_name", - "is_const": true, - "is_vararg": false, - "is_static": false, - "is_virtual": false, - "hash": 135338183, - "return_value": { - "type": "String" - } - }, - { - "name": "set_priority", - "is_const": false, - "is_vararg": false, - "is_static": false, - "is_virtual": false, - "hash": 134188166, - "arguments": [ - { - "name": "priority", - "type": "int", - "meta": "int32" - } - ] - }, - { - "name": "get_priority", - "is_const": true, - "is_vararg": false, - "is_static": false, - "is_virtual": false, - "hash": 135338183, - "return_value": { - "type": "int", - "meta": "int32" - } - }, - { - "name": "get_action_count", - "is_const": true, - "is_vararg": false, - "is_static": false, - "is_virtual": false, - "hash": 135338183, - "return_value": { - "type": "int", - "meta": "int32" - } - }, - { - "name": "set_actions", - "is_const": false, - "is_vararg": false, - "is_static": false, - "is_virtual": false, - "hash": 134188166, - "arguments": [ - { - "name": "actions", - "type": "Array" - } - ] - }, - { - "name": "get_actions", - "is_const": true, - "is_vararg": false, - "is_static": false, - "is_virtual": false, - "hash": 135338183, - "return_value": { - "type": "Array" - } - }, - { - "name": "add_action", - "is_const": false, - "is_vararg": false, - "is_static": false, - "is_virtual": false, - "hash": 134188166, - "arguments": [ - { - "name": "action", - "type": "OpenXRAction" - } - ] - }, - { - "name": "remove_action", - "is_const": false, - "is_vararg": false, - "is_static": false, - "is_virtual": false, - "hash": 134188166, - "arguments": [ - { - "name": "action", - "type": "OpenXRAction" - } - ] - } - ], - "properties": [ - { - "type": "String", - "name": "localized_name", - "setter": "set_localized_name", - "getter": "get_localized_name", - "index": -1 - }, - { - "type": "int", - "name": "priority", - "setter": "set_priority", - "getter": "get_priority", - "index": -1 - }, - { - "type": "OpenXRAction", - "name": "actions", - "setter": "set_actions", - "getter": "get_actions", - "index": -1 - } - ] - }, - { - "name": "OpenXRIPBinding", - "is_refcounted": true, - "is_instantiable": true, - "inherits": "Resource", - "api_type": "core", - "methods": [ - { - "name": "set_action", - "is_const": false, - "is_vararg": false, - "is_static": false, - "is_virtual": false, - "hash": 134188166, - "arguments": [ - { - "name": "action", - "type": "OpenXRAction" - } - ] - }, - { - "name": "get_action", - "is_const": true, - "is_vararg": false, - "is_static": false, - "is_virtual": false, - "hash": 135338183, - "return_value": { - "type": "OpenXRAction" - } - }, - { - "name": "get_path_count", - "is_const": true, - "is_vararg": false, - "is_static": false, - "is_virtual": false, - "hash": 135338183, - "return_value": { - "type": "int", - "meta": "int32" - } - }, - { - "name": "set_paths", - "is_const": false, - "is_vararg": false, - "is_static": false, - "is_virtual": false, - "hash": 134188166, - "arguments": [ - { - "name": "paths", - "type": "PackedStringArray" - } - ] - }, - { - "name": "get_paths", - "is_const": true, - "is_vararg": false, - "is_static": false, - "is_virtual": false, - "hash": 135338183, - "return_value": { - "type": "PackedStringArray" - } - }, - { - "name": "has_path", - "is_const": true, - "is_vararg": false, - "is_static": false, - "is_virtual": false, - "hash": 135374120, - "return_value": { - "type": "bool" - }, - "arguments": [ - { - "name": "arg0", - "type": "String" - } - ] - }, - { - "name": "add_path", - "is_const": false, - "is_vararg": false, - "is_static": false, - "is_virtual": false, - "hash": 134188166, - "arguments": [ - { - "name": "path", - "type": "String" - } - ] - }, - { - "name": "remove_path", - "is_const": false, - "is_vararg": false, - "is_static": false, - "is_virtual": false, - "hash": 134188166, - "arguments": [ - { - "name": "path", - "type": "String" - } - ] - } - ], - "properties": [ - { - "type": "OpenXRAction", - "name": "action", - "setter": "set_action", - "getter": "get_action", - "index": -1 - }, - { - "type": "Array", - "name": "paths", - "setter": "set_paths", - "getter": "get_paths", - "index": -1 - } - ] - }, - { - "name": "OpenXRInteractionProfile", - "is_refcounted": true, - "is_instantiable": true, - "inherits": "Resource", - "api_type": "core", - "methods": [ - { - "name": "set_interaction_profile_path", - "is_const": false, - "is_vararg": false, - "is_static": false, - "is_virtual": false, - "hash": 134188166, - "arguments": [ - { - "name": "interaction_profile_path", - "type": "String" - } - ] - }, - { - "name": "get_interaction_profile_path", - "is_const": true, - "is_vararg": false, - "is_static": false, - "is_virtual": false, - "hash": 135338183, - "return_value": { - "type": "String" - } - }, - { - "name": "get_binding_count", - "is_const": true, - "is_vararg": false, - "is_static": false, - "is_virtual": false, - "hash": 135338183, - "return_value": { - "type": "int", - "meta": "int32" - } - }, - { - "name": "get_binding", - "is_const": true, - "is_vararg": false, - "is_static": false, - "is_virtual": false, - "hash": 135374120, - "return_value": { - "type": "OpenXRIPBinding" - }, - "arguments": [ - { - "name": "index", - "type": "int", - "meta": "int32" - } - ] - }, - { - "name": "set_bindings", - "is_const": false, - "is_vararg": false, - "is_static": false, - "is_virtual": false, - "hash": 134188166, - "arguments": [ - { - "name": "bindings", - "type": "Array" - } - ] - }, - { - "name": "get_bindings", - "is_const": true, - "is_vararg": false, - "is_static": false, - "is_virtual": false, - "hash": 135338183, - "return_value": { - "type": "Array" - } - } - ], - "properties": [ - { - "type": "String", - "name": "interaction_profile_path", - "setter": "set_interaction_profile_path", - "getter": "get_interaction_profile_path", - "index": -1 - }, - { - "type": "OpenXRIPBinding", - "name": "bindings", - "setter": "set_bindings", - "getter": "get_bindings", - "index": -1 - } - ] - }, - { - "name": "OpenXRInterface", - "is_refcounted": true, - "is_instantiable": true, - "inherits": "XRInterface", - "api_type": "core", - "signals": [ - { - "name": "session_begun" - }, - { - "name": "pose_recentered" - }, - { - "name": "session_focussed" - }, - { - "name": "session_stopping" - }, - { - "name": "session_visible" - } - ] - }, - { "name": "OptimizedTranslation", "is_refcounted": true, "is_instantiable": true, @@ -155105,6 +154643,33 @@ "type": "float", "meta": "float" } + }, + { + "name": "set_dither_strength", + "is_const": false, + "is_vararg": false, + "is_static": false, + "is_virtual": false, + "hash": 134188166, + "arguments": [ + { + "name": "strength", + "type": "float", + "meta": "float" + } + ] + }, + { + "name": "get_dither_strength", + "is_const": true, + "is_vararg": false, + "is_static": false, + "is_virtual": false, + "hash": 135338183, + "return_value": { + "type": "float", + "meta": "float" + } } ], "properties": [ @@ -155191,6 +154756,13 @@ "setter": "set_sun_curve", "getter": "get_sun_curve", "index": -1 + }, + { + "type": "float", + "name": "dither_strength", + "setter": "set_dither_strength", + "getter": "get_dither_strength", + "index": -1 } ] }, @@ -196838,6 +196410,33 @@ } }, { + "name": "set_render_priority", + "is_const": false, + "is_vararg": false, + "is_static": false, + "is_virtual": false, + "hash": 134188166, + "arguments": [ + { + "name": "priority", + "type": "int", + "meta": "int32" + } + ] + }, + { + "name": "get_render_priority", + "is_const": true, + "is_vararg": false, + "is_static": false, + "is_virtual": false, + "hash": 135338183, + "return_value": { + "type": "int", + "meta": "int32" + } + }, + { "name": "set_pixel_size", "is_const": false, "is_vararg": false, @@ -197127,6 +196726,13 @@ "setter": "set_texture_filter", "getter": "get_texture_filter", "index": -1 + }, + { + "type": "int", + "name": "render_priority", + "setter": "set_render_priority", + "getter": "get_render_priority", + "index": -1 } ] }, @@ -198931,17 +198537,17 @@ }, { "type": "float", - "name": "content_margin_right", + "name": "content_margin_top", "setter": "set_default_margin", "getter": "get_default_margin", - "index": 2 + "index": 1 }, { "type": "float", - "name": "content_margin_top", + "name": "content_margin_right", "setter": "set_default_margin", "getter": "get_default_margin", - "index": 1 + "index": 2 }, { "type": "float", @@ -199295,6 +198901,31 @@ } }, { + "name": "set_skew", + "is_const": false, + "is_vararg": false, + "is_static": false, + "is_virtual": false, + "hash": 134188166, + "arguments": [ + { + "name": "skew", + "type": "Vector2" + } + ] + }, + { + "name": "get_skew", + "is_const": true, + "is_vararg": false, + "is_static": false, + "is_virtual": false, + "hash": 135338183, + "return_value": { + "type": "Vector2" + } + }, + { "name": "set_shadow_color", "is_const": false, "is_vararg": false, @@ -199467,6 +199098,13 @@ "index": -1 }, { + "type": "Vector2", + "name": "skew", + "setter": "set_skew", + "getter": "get_skew", + "index": -1 + }, + { "type": "int", "name": "border_width_left", "setter": "set_border_width", @@ -199552,17 +199190,17 @@ }, { "type": "float", - "name": "expand_margin_right", + "name": "expand_margin_top", "setter": "set_expand_margin", "getter": "get_expand_margin", - "index": 2 + "index": 1 }, { "type": "float", - "name": "expand_margin_top", + "name": "expand_margin_right", "setter": "set_expand_margin", "getter": "get_expand_margin", - "index": 1 + "index": 2 }, { "type": "float", @@ -200105,17 +199743,17 @@ }, { "type": "float", - "name": "margin_right", + "name": "margin_top", "setter": "set_margin_size", "getter": "get_margin_size", - "index": 2 + "index": 1 }, { "type": "float", - "name": "margin_top", + "name": "margin_right", "setter": "set_margin_size", "getter": "get_margin_size", - "index": 1 + "index": 2 }, { "type": "float", @@ -200133,17 +199771,17 @@ }, { "type": "float", - "name": "expand_margin_right", + "name": "expand_margin_top", "setter": "set_expand_margin_size", "getter": "get_expand_margin_size", - "index": 2 + "index": 1 }, { "type": "float", - "name": "expand_margin_top", + "name": "expand_margin_right", "setter": "set_expand_margin_size", "getter": "get_expand_margin_size", - "index": 1 + "index": 2 }, { "type": "float", @@ -211760,6 +211398,28 @@ ] }, { + "name": "string_get_word_breaks", + "is_const": true, + "is_vararg": false, + "is_static": false, + "is_virtual": false, + "hash": 173599466, + "return_value": { + "type": "PackedInt32Array" + }, + "arguments": [ + { + "name": "string", + "type": "String" + }, + { + "name": "language", + "type": "String", + "default_value": "\"\"" + } + ] + }, + { "name": "strip_diacritics", "is_const": true, "is_vararg": false, @@ -215269,6 +214929,26 @@ ] }, { + "name": "string_get_word_breaks", + "is_const": true, + "is_static": false, + "is_vararg": false, + "is_virtual": true, + "return_value": { + "type": "PackedInt32Array" + }, + "arguments": [ + { + "name": "string", + "type": "String" + }, + { + "name": "language", + "type": "String" + } + ] + }, + { "name": "string_to_upper", "is_const": true, "is_static": false, @@ -251456,14 +251136,6 @@ "type": "ResourceUID" }, { - "name": "JavaClassWrapper", - "type": "JavaClassWrapper" - }, - { - "name": "JavaScript", - "type": "JavaScript" - }, - { "name": "NavigationMeshGenerator", "type": "NavigationMeshGenerator" }, @@ -251472,6 +251144,14 @@ "type": "VisualScriptCustomNodes" }, { + "name": "JavaClassWrapper", + "type": "JavaClassWrapper" + }, + { + "name": "JavaScript", + "type": "JavaScript" + }, + { "name": "DisplayServer", "type": "DisplayServer" }, diff --git a/godot-headers/godot/gdnative_interface.h b/godot-headers/godot/gdnative_interface.h index 2bac52d..4d2682b 100644 --- a/godot-headers/godot/gdnative_interface.h +++ b/godot-headers/godot/gdnative_interface.h @@ -545,6 +545,9 @@ typedef struct { void (*classdb_register_extension_class_property_subgroup)(const GDNativeExtensionClassLibraryPtr p_library, const char *p_class_name, const char *p_subgroup_name, const char *p_prefix); void (*classdb_register_extension_class_signal)(const GDNativeExtensionClassLibraryPtr p_library, const char *p_class_name, const char *p_signal_name, const GDNativePropertyInfo *p_argument_info, GDNativeInt p_argument_count); void (*classdb_unregister_extension_class)(const GDNativeExtensionClassLibraryPtr p_library, const char *p_class_name); /* Unregistering a parent class before a class that inherits it will result in failure. Inheritors must be unregistered first. */ + + void (*get_library_path)(const GDNativeExtensionClassLibraryPtr p_library, GDNativeStringPtr r_path); + } GDNativeInterface; /* INITIALIZATION */ @@ -553,7 +556,6 @@ typedef enum { GDNATIVE_INITIALIZATION_CORE, GDNATIVE_INITIALIZATION_SERVERS, GDNATIVE_INITIALIZATION_SCENE, - GDNATIVE_INITIALIZATION_DRIVER, GDNATIVE_INITIALIZATION_EDITOR, GDNATIVE_MAX_INITIALIZATION_LEVEL, } GDNativeInitializationLevel; diff --git a/include/godot_cpp/godot.hpp b/include/godot_cpp/godot.hpp index e8fcca2..b478f5e 100644 --- a/include/godot_cpp/godot.hpp +++ b/include/godot_cpp/godot.hpp @@ -43,12 +43,20 @@ extern "C" void *token; } // namespace internal +enum ModuleInitializationLevel { + MODULE_INITIALIZATION_LEVEL_CORE = GDNATIVE_INITIALIZATION_CORE, + MODULE_INITIALIZATION_LEVEL_SERVERS = GDNATIVE_INITIALIZATION_SERVERS, + MODULE_INITIALIZATION_LEVEL_SCENE = GDNATIVE_INITIALIZATION_SCENE, + MODULE_INITIALIZATION_LEVEL_EDITOR = GDNATIVE_INITIALIZATION_EDITOR +}; + class GDExtensionBinding { public: - using Callback = void (*)(); + using Callback = void (*)(ModuleInitializationLevel p_level); - static Callback init_callbacks[GDNATIVE_MAX_INITIALIZATION_LEVEL]; - static Callback terminate_callbacks[GDNATIVE_MAX_INITIALIZATION_LEVEL]; + static Callback init_callback; + static Callback terminate_callback; + static GDNativeInitializationLevel minimum_initialization_level; static GDNativeBool init(const GDNativeInterface *p_interface, const GDNativeExtensionClassLibraryPtr p_library, GDNativeInitialization *r_initialization); public: @@ -66,16 +74,9 @@ public: library(p_library), initialization(r_initialization){}; - void register_core_initializer(Callback p_core_init) const; - void register_server_initializer(Callback p_server_init) const; - void register_driver_initializer(Callback p_driver_init) const; - void register_scene_initializer(Callback p_scene_init) const; - void register_editor_initializer(Callback p_editor_init) const; - void register_core_terminator(Callback p_core_terminate) const; - void register_server_terminator(Callback p_server_terminate) const; - void register_scene_terminator(Callback p_scene_terminate) const; - void register_driver_terminator(Callback p_driver_terminate) const; - void register_editor_terminator(Callback p_editor_terminate) const; + void register_initializer(Callback p_init) const; + void register_terminator(Callback p_init) const; + void set_minimum_library_initialization_level(ModuleInitializationLevel p_level) const; GDNativeBool init() const; }; diff --git a/src/godot.cpp b/src/godot.cpp index 0ea0344..7e7f2eb 100644 --- a/src/godot.cpp +++ b/src/godot.cpp @@ -47,8 +47,9 @@ void *token = nullptr; } // namespace internal -GDExtensionBinding::Callback GDExtensionBinding::init_callbacks[GDNATIVE_MAX_INITIALIZATION_LEVEL] = {}; -GDExtensionBinding::Callback GDExtensionBinding::terminate_callbacks[GDNATIVE_MAX_INITIALIZATION_LEVEL] = {}; +GDExtensionBinding::Callback GDExtensionBinding::init_callback = nullptr; +GDExtensionBinding::Callback GDExtensionBinding::terminate_callback = nullptr; +GDNativeInitializationLevel GDExtensionBinding::minimum_initialization_level = GDNATIVE_INITIALIZATION_CORE; GDNativeBool GDExtensionBinding::init(const GDNativeInterface *p_interface, const GDNativeExtensionClassLibraryPtr p_library, GDNativeInitialization *r_initialization) { internal::gdn_interface = p_interface; @@ -57,15 +58,9 @@ GDNativeBool GDExtensionBinding::init(const GDNativeInterface *p_interface, cons r_initialization->initialize = initialize_level; r_initialization->deinitialize = deinitialize_level; + r_initialization->minimum_initialization_level = minimum_initialization_level; - bool has_init = false; - for (int i = 0; i < GDNATIVE_MAX_INITIALIZATION_LEVEL; i++) { - if (init_callbacks[i]) { - r_initialization->minimum_initialization_level = GDNativeInitializationLevel(i); - has_init = true; - } - } - ERR_FAIL_COND_V_MSG(!has_init, false, "At least one initialization callback must be defined."); + ERR_FAIL_COND_V_MSG(init_callback == nullptr, false, "Initialization callback must be defined."); Variant::init_bindings(); @@ -75,8 +70,8 @@ GDNativeBool GDExtensionBinding::init(const GDNativeInterface *p_interface, cons void GDExtensionBinding::initialize_level(void *userdata, GDNativeInitializationLevel p_level) { ClassDB::current_level = p_level; - if (init_callbacks[p_level]) { - init_callbacks[p_level](); + if (init_callback) { + init_callback(static_cast<ModuleInitializationLevel>(p_level)); } ClassDB::initialize(p_level); @@ -86,49 +81,21 @@ void GDExtensionBinding::deinitialize_level(void *userdata, GDNativeInitializati ClassDB::current_level = p_level; ClassDB::deinitialize(p_level); - if (terminate_callbacks[p_level]) { - terminate_callbacks[p_level](); + if (terminate_callback) { + terminate_callback(static_cast<ModuleInitializationLevel>(p_level)); } } -void GDExtensionBinding::InitObject::register_core_initializer(Callback p_core_init) const { - GDExtensionBinding::init_callbacks[GDNATIVE_INITIALIZATION_CORE] = p_core_init; -} - -void GDExtensionBinding::InitObject::register_server_initializer(Callback p_server_init) const { - GDExtensionBinding::init_callbacks[GDNATIVE_INITIALIZATION_SERVERS] = p_server_init; -} - -void GDExtensionBinding::InitObject::register_scene_initializer(Callback p_scene_init) const { - GDExtensionBinding::init_callbacks[GDNATIVE_INITIALIZATION_SCENE] = p_scene_init; -} - -void GDExtensionBinding::InitObject::register_driver_initializer(Callback p_driver_init) const { - GDExtensionBinding::init_callbacks[GDNATIVE_INITIALIZATION_DRIVER] = p_driver_init; -} - -void GDExtensionBinding::InitObject::register_editor_initializer(Callback p_editor_init) const { - GDExtensionBinding::init_callbacks[GDNATIVE_INITIALIZATION_EDITOR] = p_editor_init; -} - -void GDExtensionBinding::InitObject::register_core_terminator(Callback p_core_terminate) const { - GDExtensionBinding::terminate_callbacks[GDNATIVE_INITIALIZATION_CORE] = p_core_terminate; -} - -void GDExtensionBinding::InitObject::register_server_terminator(Callback p_server_terminate) const { - GDExtensionBinding::terminate_callbacks[GDNATIVE_INITIALIZATION_SERVERS] = p_server_terminate; -} - -void GDExtensionBinding::InitObject::register_scene_terminator(Callback p_scene_terminate) const { - GDExtensionBinding::terminate_callbacks[GDNATIVE_INITIALIZATION_SCENE] = p_scene_terminate; +void GDExtensionBinding::InitObject::register_initializer(Callback p_init) const { + GDExtensionBinding::init_callback = p_init; } -void GDExtensionBinding::InitObject::register_driver_terminator(Callback p_driver_terminate) const { - GDExtensionBinding::terminate_callbacks[GDNATIVE_INITIALIZATION_DRIVER] = p_driver_terminate; +void GDExtensionBinding::InitObject::register_terminator(Callback p_terminate) const { + GDExtensionBinding::terminate_callback = p_terminate; } -void GDExtensionBinding::InitObject::register_editor_terminator(Callback p_editor_terminate) const { - GDExtensionBinding::terminate_callbacks[GDNATIVE_INITIALIZATION_EDITOR] = p_editor_terminate; +void GDExtensionBinding::InitObject::set_minimum_library_initialization_level(ModuleInitializationLevel p_level) const { + GDExtensionBinding::minimum_initialization_level = static_cast<GDNativeInitializationLevel>(p_level); } GDNativeBool GDExtensionBinding::InitObject::init() const { diff --git a/test/src/register_types.cpp b/test/src/register_types.cpp index 216482f..b05f43d 100644 --- a/test/src/register_types.cpp +++ b/test/src/register_types.cpp @@ -40,12 +40,20 @@ using namespace godot; -void register_example_types() { +void initialize_example_module(ModuleInitializationLevel p_level) { + if (p_level != MODULE_INITIALIZATION_LEVEL_SCENE) { + return; + } + ClassDB::register_class<ExampleRef>(); ClassDB::register_class<Example>(); } -void unregister_example_types() {} +void uninitialize_example_module(ModuleInitializationLevel p_level) { + if (p_level != MODULE_INITIALIZATION_LEVEL_SCENE) { + return; + } +} extern "C" { @@ -54,8 +62,9 @@ extern "C" { GDNativeBool GDN_EXPORT example_library_init(const GDNativeInterface *p_interface, const GDNativeExtensionClassLibraryPtr p_library, GDNativeInitialization *r_initialization) { godot::GDExtensionBinding::InitObject init_obj(p_interface, p_library, r_initialization); - init_obj.register_scene_initializer(register_example_types); - init_obj.register_scene_terminator(unregister_example_types); + init_obj.register_initializer(initialize_example_module); + init_obj.register_terminator(uninitialize_example_module); + init_obj.set_minimum_library_initialization_level(MODULE_INITIALIZATION_LEVEL_SCENE); return init_obj.init(); } diff --git a/test/src/register_types.h b/test/src/register_types.h index 04235e4..0d3d513 100644 --- a/test/src/register_types.h +++ b/test/src/register_types.h @@ -31,7 +31,10 @@ #ifndef EXAMPLE_REGISTER_TYPES_H #define EXAMPLE_REGISTER_TYPES_H -void register_example_types(); -void unregister_example_types(); +#include <godot_cpp/core/class_db.hpp> +using namespace godot; + +void initialize_example_module(ModuleInitializationLevel p_level); +void uninitialize_example_module(ModuleInitializationLevel p_level); #endif // ! EXAMPLE_REGISTER_TYPES_H |