diff options
author | toasteater <48371905+toasteater@users.noreply.github.com> | 2020-01-10 11:55:49 +0000 |
---|---|---|
committer | toasteater <48371905+toasteater@users.noreply.github.com> | 2020-01-10 11:59:37 +0000 |
commit | 677e72d2f67ca13deb796d323367eb6c5a893721 (patch) | |
tree | 1e680dadb1bcf7d44859fe020a27523ac6f48679 /modules/gdnative/include | |
parent | ff173ff770c4498f4527676838ef8097917d0dda (diff) |
Expose instance_from_id to GDNative
This function is available to GDScript but not to GDNative. When exposed, it
allows building more ergonomic safe abstractions over the GDNative APIs, and
covers the use cases of the original PR.
Close #28478. Supersedes #28791.
Co-authored-by: Markus Ewald <cygon@nuclex.org>
Diffstat (limited to 'modules/gdnative/include')
-rw-r--r-- | modules/gdnative/include/gdnative/gdnative.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/modules/gdnative/include/gdnative/gdnative.h b/modules/gdnative/include/gdnative/gdnative.h index 2fe59b8a73..e19a2ec149 100644 --- a/modules/gdnative/include/gdnative/gdnative.h +++ b/modules/gdnative/include/gdnative/gdnative.h @@ -290,6 +290,9 @@ bool GDAPI godot_is_instance_valid(const godot_object *p_object); 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); + #ifdef __cplusplus } #endif |