Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add pointers support for virtual methods. #32

Closed
wants to merge 52 commits into from

Conversation

Faless
Copy link

@Faless Faless commented Sep 24, 2021

As introduced in godot for virtual methods.
Custom structs are not yet supported.

vnen and others added 30 commits August 18, 2021 11:03
The extension creators then don't need to create those just to redirect
to the bindings.
Fixed windows compile (MSVC) and moved test project files
Use, e.g. Engine::get_singleton() to get the singleton object();
Remove unused import that breaks on windows
Silence delete compile warning in memory.h/cpp on Windows
Fix add_custom_command OUTPUT paths
Bindings are generated using `generate_bindings` and the command contains the `COMMENT` parameter, which will display a message about the generation.
This should eventually be configurable with user callbacks, but for now
assume the lowest level to ensure the initialization is called.
BastiaanOlij and others added 22 commits September 5, 2021 11:25
Convert float to double even if `meta` is set to float.
…in_type_code

Re-introduce build-in type code for core types
Now it needs a callback for each level so custom logic (like loading
singletons) can be performed.
Add in driver types and rejig code to make it easier to extend
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.
{ 0 } initializes only first element with zero explicitly and other
elements with their default value (zeros too). Technically it will work
the same, but will be more correct.
_err_print_error only output p_message so swapped parameters around
It didn't set the return value at all, changing the local value instead.
Now instead correctly sets it as a generic pointer type from `_owner`.
…uctor

Add virtual destructor to Object class
Fix PtrToArg encoding for `Object *`.
@BastiaanOlij BastiaanOlij force-pushed the gdnative-extensions branch 3 times, most recently from 5b49003 to d5e0fc8 Compare September 27, 2021 13:08
@Faless
Copy link
Author

Faless commented Sep 27, 2021

Superseded by: godotengine#625

@Faless Faless closed this Sep 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants