diff options
Diffstat (limited to 'modules')
-rw-r--r-- | modules/gdnative/gdnative/gdnative.cpp | 4 | ||||
-rw-r--r-- | modules/gdnative/gdnative_api.json | 7 | ||||
-rw-r--r-- | modules/gdnative/include/gdnative/gdnative.h | 3 | ||||
-rw-r--r-- | modules/stb_vorbis/doc_classes/AudioStreamOGGVorbis.xml | 2 |
4 files changed, 16 insertions, 0 deletions
diff --git a/modules/gdnative/gdnative/gdnative.cpp b/modules/gdnative/gdnative/gdnative.cpp index 6ef1f2f4b9..06334556d9 100644 --- a/modules/gdnative/gdnative/gdnative.cpp +++ b/modules/gdnative/gdnative/gdnative.cpp @@ -170,6 +170,10 @@ bool GDAPI godot_is_instance_valid(const godot_object *p_object) { return ObjectDB::instance_validate((Object *)p_object); } +godot_object GDAPI *godot_instance_from_id(godot_int 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); diff --git a/modules/gdnative/gdnative_api.json b/modules/gdnative/gdnative_api.json index 7e2ca49f8d..8ccb8d2286 100644 --- a/modules/gdnative/gdnative_api.json +++ b/modules/gdnative/gdnative_api.json @@ -155,6 +155,13 @@ ["const godot_object *", "p_object"], ["void *", "p_class_tag"] ] + }, + { + "name": "godot_instance_from_id", + "return_type": "godot_object *", + "arguments": [ + ["godot_int", "p_instance_id"] + ] } ] }, 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 diff --git a/modules/stb_vorbis/doc_classes/AudioStreamOGGVorbis.xml b/modules/stb_vorbis/doc_classes/AudioStreamOGGVorbis.xml index 9403199398..102a9b4236 100644 --- a/modules/stb_vorbis/doc_classes/AudioStreamOGGVorbis.xml +++ b/modules/stb_vorbis/doc_classes/AudioStreamOGGVorbis.xml @@ -15,8 +15,10 @@ Contains the audio data in bytes. </member> <member name="loop" type="bool" setter="set_loop" getter="has_loop" default="false"> + If [code]true[/code], the stream will automatically loop when it reaches the end. </member> <member name="loop_offset" type="float" setter="set_loop_offset" getter="get_loop_offset" default="0.0"> + Time in seconds at which the stream starts after being looped. </member> </members> <constants> |