Commit Graph

4 Commits (f58a2f25a2ac9f1af4964c047f30461f4ed4f40e)

Author SHA1 Message Date
Bastiaan Olij 94efe3d410 Fixing compiler warnings around implicit type casting loosing precision 2021-11-22 21:48:20 +11:00
George Marques 38ee8bfcf7 Change constructor/destructor management of extension classes
This makes sure custom constructors are always called on extension
classes. However, note that constructors should not take any parameters,
since Godot doesn't support that. Parameters are ignore in memnew macro.

Use memnew(MyClass()) instead of memnew(MyClass) since it now needs a
value instead of a class name. This macro calls MyClass::_new() (define
in GDCLASS macro) which ultimately calls Godot to create the object,
ensuring that both the Godot and the extension instances are created.

Non Godot classes (that don't derive godot::Object) are constructed as
usual an can have parameters.

memdelete is also changed for the same reason, as it needs to destroy
the Godot object as well, and that automatically frees the bound
extension instance.
2021-09-27 23:08:11 +10:00
George Marques a0634cca3f Auto-bind virtual method overrides 2021-09-27 23:08:08 +10:00
George Marques e4ed48976a Replace bindgins to work with extensions 2021-09-27 23:08:08 +10:00