Skip to content

Conversation

@groud
Copy link
Member

@groud groud commented Nov 30, 2021

The previous approach was to make the Godot object initialize the extension object by calling an extension instance constructor. This used to create some issues, with recursive object creation for example (objects constructed into the extension object constructor nowt working).

This solves the issue by reversing the processus, making extension object requesting the corresponding Godot object creation using gdnative_classdb_construct_object, and then registering itself as an instance of this object using gdnative_object_set_instance.

This still need some work, as i am not sure that gdnative_object_set_instance_binding and gdnative_object_get_instance_binding would still be useful.

@groud groud force-pushed the move_godot_object_init_to_extension branch from 228339d to 4fc0fb8 Compare November 30, 2021 15:56
@groud groud marked this pull request as ready for review December 3, 2021 13:25
@groud groud requested a review from a team as a code owner December 3, 2021 13:25
@akien-mga
Copy link
Member

The godot-cpp test build in CI fails, but that's expected, as godotengine/godot-cpp#663 needs to be merged for the test to pass (and this PR here needs to be merged before godotengine/godot-cpp#663 can build...).

So let's merge despite the failed check, this should be fairly exceptional.

@akien-mga akien-mga merged commit 8762d8f into godotengine:master Dec 3, 2021
@akien-mga
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants