summaryrefslogtreecommitdiff
path: root/core/extension
AgeCommit message (Collapse)Author
2021-08-22Replace BIND_VMETHOD by new GDVIRTUAL syntaxreduz
* New syntax is type safe. * New syntax allows for type safe virtuals in native extensions. * New syntax permits extremely fast calling. Note: Everything was replaced where possible except for `_gui_input` `_input` and `_unhandled_input`. These will require API rework on a separate PR as they work different than the rest of the functions. Added a new method flag METHOD_FLAG_OBJECT_CORE, used internally. Allows to not dump the core virtuals like `_notification` to the json API, since each language will implement those as it is best fits.
2021-08-17Properly set up virtual calls for extensionsGeorge Marques
2021-08-17A few fixes in the extension C APIGeorge Marques
- Add MethodBind call (besides ptrcall), since vararg methods don't work with ptrcall. - Fix argument name in register constant function to the way it actually is used in the engine. - Change the integer constant type to GDNativeInt to keep it consistent.
2021-08-17Initialize call error struct when calling extensionsGeorge Marques
This allows users to not need to set it when the call is correct.
2021-08-13Refactors the memnew_placement.AndreaCatania
With this commit the macro `memnew_placement` uses the standard memory placement syntax: `new (mem) TheClass()`, and removes the outdated and not used syntax: ``` _ALWAYS_INLINE_ void *operator new(size_t p_size, void *p_pointer, size_t check, const char *p_description) { ``` Thanks to this change, the function `memnew_placement` call is compatible with any class, and can also initialize classes with non-empty constructor: ``` // This is valid, like before. memnew_placement(mem, Variant); // This works too: memnew_placement(mem, Variant(123)); ```
2021-08-09Rename GDNative call error enum values to use GDNATIVE prefixGeorge Marques
To make sure it does not clash with other libraries.
2021-08-05Improve extension systemGeorge Marques
- Fix library loading and initialization. - Add extra methods/parameters in the interface needed by extenstions. - Add Variant destructors and functions for extracting values and creating Variants from values.
2021-08-05Improve extension API dumpGeorge Marques
- Fix type size information. - Validate sizes at compile time (for the current build configuration only). - Normalize type names. - Add extra information.
2021-07-27Change Variant bool conversion to uint8_tGeorge Marques
This ensures more portable conversion since not every path assume bool is 32-bits and there's no loss converting to 8-bits anyway.
2021-07-25Fix dead code in `gdnative_interface.cpp`Nicholas Huelin
This pull request fixes dead code found in `gdnative_interface.cpp`
2021-07-25Merge pull request #50809 from akien-mga/iterators-const-referencesRémi Verschelde
2021-07-25Use const references where possible for List range iteratorsRémi Verschelde
2021-07-25Fix various typos with codespellluz paz
Found via `codespell -q 3 -S ./thirdparty,*.po,./DONORS.md -L ackward,ang,ans,ba,beng,cas,childs,childrens,dof,doubleclick,fave,findn,hist,inout,leapyear,lod,nd,numer,ois,ony,paket,seeked,sinc,switchs,te,uint`
2021-07-23Use C++ iterators for Lists in many situationsAaron Franke
2021-07-08Redo how instance bindings workreduz
* The harcoded 8 slots are no more and impose limits in the new extension system. * New system is limitless, although it will impose small performance hit with a mutex. * Use a token to request the instance binding. **Warning**: Mono will most likely break as a result of this, will need to be modified to use the new system.
2021-06-25Implement native extension systemreduz
* Deprecates GDNative in favor of a simpler, lower level interface. * New extension system allows registering core engine classes. * Simple header interface in gdnative_interace.h