Commit Graph

268 Commits (7b31f39beaca1a98307402f53d69f3657f3bed86)

Author SHA1 Message Date
Joël Lamotte (Klaim) 5134c82573 Fixes crash in ClassDB::deinitialize due to usage of invalid iterator.
After the removed call to `std::vector::erase` all iterators,
`i` included, are invalidated and therefore this code has undefined
behavior (which can or not lead to a crash).
This change delays the removal of class names from
`class_register_order` to after having gone through it's content,
removing the undefined behavior.
2023-10-05 16:58:49 +02:00
David Snopek df849651d9 Changes necessary for hot reload to work 2023-09-25 22:13:33 -05:00
gilzoide 60dfa3445a Fix return value and r_valid value in Variant::iter_init and iter_next 2023-09-24 17:10:29 -03:00
David Snopek c18c1916c3 Implement `callable_mp()` and `callable_mp_static()` 2023-09-21 15:17:50 -05:00
David Snopek 4314f91b7d
Merge pull request #1238 from dsnopek/variant-call-callp
Fix variant call compiler error (alternate)
2023-09-21 15:07:05 -05:00
David Snopek db15731e4d
Merge pull request #1165 from dsnopek/missing-classes
Handle missing instance binding callbacks by finding the closest parent
2023-09-21 15:06:51 -05:00
David Snopek b1fd1b65fd
Merge pull request #1242 from AThousandShips/null_check
Replace `ERR_FAIL_COND` with `ERR_FAIL_NULL` where applicable
2023-09-20 07:32:14 -05:00
David Snopek 52ca3ef547 Handle missing instance binding callbacks by finding the closest parent 2023-09-19 10:54:07 -05:00
David Snopek 634ed09ec0 Load 'print_error_with_message' function 2023-09-15 14:08:27 -05:00
A Thousand Ships 1e5767693e Replace `ERR_FAIL_COND` with `ERR_FAIL_NULL` where applicable 2023-09-13 14:34:04 +02:00
Matthew Murphy ca3e25de04 Fix variant call compiler error
Co-authored-by: David Snopek <dsnopek@gmail.com>
2023-09-09 11:30:29 -05:00
David Snopek b488f009bd
Merge pull request #1208 from dsnopek/check-godot-version
Check that GDExtension is opened by compatible Godot version
2023-09-09 09:30:36 -05:00
Markus Sauermann c2d99fd519 Fix `Object::notification` order
For the notification-order to work correctly, it is necessary to
allow the `p_reversed` argument to be used within cpp.
This PR changes the necessary bindings.
2023-08-30 00:07:28 +02:00
David Snopek f0405f18a3 Add support for placeholder_script_instance_create/update 2023-08-28 17:02:13 -05:00
David Snopek fecb2959b4 Check that GDExtension is opened by compatible Godot version 2023-08-14 17:01:12 -05:00
David Snopek 8bc1c1dbeb Implement `String::resize()` 2023-07-31 15:14:10 -05:00
David Snopek 1d49bef096
Merge pull request #1184 from Zylann/fix_get_property_list_calling_parent
Don't call parent _get_property_list when a class doesn't define it (for internal binding).
2023-07-26 15:31:15 -05:00
David Snopek d15550fdee
Merge pull request #1186 from mihe/indexed-properties
Add support for indexed properties
2023-07-26 14:22:34 -05:00
Marc Gilleron baf0b9e0f7 Don't call parent _get_property_list when a class doesn't define it.
Godot is already supposed to call _get_property_list of parent classes,
so this binding function must really only return procedural properties of
the class it belongs to, and not parent or child classes.
2023-07-26 20:12:25 +01:00
Mikael Hermansson 7d8cb7c155 Add support for indexed properties 2023-07-26 00:31:53 +02:00
David Snopek 3162be28e5
Merge pull request #1150 from dsnopek/charstring-full
Attempt to fully implement CharString
2023-07-22 09:04:27 -05:00
Mikael Hermansson 4b1072e4da Remove unused free-standing `initialize_level` and `deinitialize_level` 2023-06-30 19:36:46 +02:00
David Snopek 4df112cd95 Attempt to fully implement CharString 2023-06-22 21:03:30 -05:00
Kehom 20be441026 Unregister custom classes in reverse registration order 2023-06-19 11:04:11 -03:00
Rémi Verschelde 130644c061
Merge pull request #1138 from dsnopek/editor-plugins-deinitialize
Automatically remove editor plugins when deinitializing GDExtension
2023-06-19 10:43:34 +02:00
Andy Maloney db2394dbe7 Identifiers containing double underscore are reserved according to the C++ standard
Rename __* to _gde_*

https://timsong-cpp.github.io/cppwp/n3337/global.names

https://en.cppreference.com/w/cpp/language/identifiers

Identifiers appearing as a token or preprocessing token (i.e., not in user-defined-string-literal like operator ""id) (since C++11) of one of the following forms are reserved:
 - identifiers with a double underscore anywhere;
 - identifiers that begin with an underscore followed by an uppercase letter;
 - in the global namespace, identifiers that begin with an underscore.
2023-06-15 20:45:01 -04:00
David Snopek d28a3cbbd5 Automatically remove editor plugins when deinitializing GDExtension 2023-06-13 14:24:33 -05:00
David Snopek ee5cf3a11d
Merge pull request #1137 from dsnopek/no-more-legacy-mode
Clarify error message because there isn't a legacy Godot 4.0 mode anymore
2023-06-08 10:11:29 -05:00
David Snopek 3074d22815 Clarify error message because there isn't a legacy Godot 4.0 mode anymore 2023-06-08 09:42:03 -05:00
David Snopek 59bffc94a8 Correctly load gdextension_interface_print_error 2023-05-31 01:32:44 -05:00
Rémi Verschelde 2078c00bab
Merge pull request #1114 from dsnopek/editor-plugins
Add support for adding/removing editor plugins
2023-05-26 11:04:35 +02:00
David Snopek e75ebffb70 Add support for adding/removing editor plugins 2023-05-16 22:02:35 -05:00
David Snopek 431e30bc32 Ensure GDExtension class is the correct type for the Godot engine class 2023-05-16 15:18:48 -05:00
David Snopek a5c6ca5920 Update to load function pointers for GDExtension interface 2023-05-09 21:45:48 -05:00
bruvzg ba4b50118d
Fix incorrect memory allocation in release builds.
Co-authored-by: lightyears <lightyears1998@hotmail.com>
2023-02-21 15:32:26 +02:00
Zhehang Ding 07c914b479 Fix compilation error: const GDExtensionStringPtr -> GDExtensionConstStringPtr 2023-02-14 18:53:11 -08:00
Jan Haller 706006ec83 Update array_set_typed() call to use GDExtensionVariantType instead of uint32_t 2023-02-09 11:12:51 +01:00
Rémi Verschelde fccceb8736
Merge pull request #1011 from mihe/error-macros
Update error macros to match core
2023-02-07 13:47:51 +01:00
bruvzg 37f6e35974
Update typed array API to match "GDScript: Fix typed arrays". 2023-01-31 11:28:55 +02:00
bruvzg 40d3cfd97b
Move Array:set_typed to internal GDExtension structure. 2023-01-30 13:27:25 +02:00
Mikael Hermansson 6b92eda819 Added missing `string.hpp` include in `transform2d.cpp` 2023-01-22 17:35:24 +01:00
Mikael Hermansson d174b47e51 Update error macros to match core 2023-01-22 14:24:57 +01:00
Andy Maloney 1ae0147aad Fix sign comparison warnings in class_db.cpp
Part of #999
2023-01-19 08:30:08 -05:00
bruvzg abca497b72
Expose some low level functions and String operators. 2023-01-19 13:12:21 +02:00
Fabio Alessandrelli 69b525494b
Merge pull request #1001 from Faless/ext/basis_abs
Fix Basis::scaled_orthogonal using incorrect abs function.
2023-01-19 10:16:51 +01:00
Fabio Alessandrelli 72a7c61750 Fix Basis::scaled_orthogonal using incorrect abs function. 2023-01-19 02:53:53 +01:00
Fabio Alessandrelli d64d97cb17 Fix Variant::can_convert[_strict] returning gibberish.
An uninitialized value was being returned instead of the function return
value.
2023-01-19 02:17:53 +01:00
Rémi Verschelde cf3d995e8c
Merge pull request #997 from asmaloney/fix-shadow-eulerorder
Fix a shadowed enum (EulerOrder)
2023-01-18 18:36:21 +01:00
Rémi Verschelde 0dfe0d0166
Merge pull request #983 from rburing/variant_to_from_objectid
Add conversions between `Variant` and `ObjectID`
2023-01-18 11:41:57 +01:00
Andy Maloney dbd43ac107 Fix a shadowed enum (EulerOrder)
Use the global constants.
2023-01-17 18:38:24 -05:00
Rémi Verschelde 931f1a3f34
Sync license copyright with upstream GH-70885 2023-01-10 16:15:31 +01:00
Ricardo Buring d4e1dfe5dc Add conversions between Variant and ObjectID 2023-01-01 21:27:08 +01:00
Rémi Verschelde 104997e83e
Merge pull request #961 from mihe/char-string-length
Fix incorrect length passed to `CharString`
2022-12-20 10:44:08 +01:00
Jan Haller fce753c05d Extension header: amend const correctness of `p_args` parameters 2022-12-14 15:47:42 +01:00
Mikael Hermansson 1f6b0118dc Fix incorrect length passed to `CharString` 2022-12-14 15:08:45 +01:00
Gilles Roudière c02e644679 Rename GDNative to GDExtension
Non-exhaustive list of case-sensitive renames:

GDExtension -> GDNative
GDNATIVE -> GDEXTENSION
gdextension -> gdnative
ExtensionExtension -> Extension (for where there was GDNativeExtension)
EXTENSION_EXTENSION -> EXTENSION (for where there was GDNATIVE_EXTENSION)
gdnlib -> gdextension
gdn_interface -> gde_interface
gdni -> gde_interface
2022-12-12 11:06:38 +01:00
Emmanuel Leblond fe86a94dcf
Fix const qualifier for parameters in GDExtension api functions 2022-12-03 00:27:07 +01:00
Rémi Verschelde 4a4e2b0239
Merge pull request #930 from rune-scape/rune-missing-string-ops
Add missing String operators
2022-11-22 10:25:02 +01:00
rune-scape d04ce481c4 Add missing String operators 2022-11-20 03:44:54 -05:00
Andy Maloney c7e34c2f9d Basic static analysis fixes
- remove extraneous semicolons
- use "nullptr" instead of "0"
- remove "break" after "return"
- use <cstdio> instead of <stdio.h>
2022-11-18 17:46:13 -05:00
Rémi Verschelde d9c72c6773
Fixup after 243ec87918 2022-11-16 10:33:39 +01:00
Emmanuel Leblond b6ba0dca13
StringName is working fine with demo \o/ 2022-11-08 21:44:33 +01:00
Emmanuel Leblond e24b6b0e51
Use StringName in the whole GDExtension API instead of const char * 2022-11-08 21:44:31 +01:00
Emmanuel Leblond 0e81f89dd3
Uses `StringName` in GDExtension perf critical instance creation & method/properties setter/getter 2022-11-08 21:44:30 +01:00
Emmanuel Leblond b21931c4a3
Type `GDNativePropertyInfo.type` field as `GDNativeVariantType` 2022-10-13 14:04:54 +02:00
Mikael Hermansson cddaf50ff8 Fix use-after-free when deleting objects from extension terminator 2022-10-11 00:59:35 +02:00
Rémi Verschelde db8679443f Merge pull request #885 from aaronfranke/core-data-structs
Update core data structures to match the engine
2022-10-07 22:25:54 +02:00
Rémi Verschelde 0eba81ef79 Merge pull request #876 from Daylily-Zeleen/Daylily-Zeleen/master
Add detail infos for binding error message.
2022-10-07 22:25:49 +02:00
Aaron Franke 65eeb94f75
Update core data structures to match the engine 2022-10-07 11:27:41 -05:00
Rémi Verschelde 50a534bf55 Merge pull request #880 from aaronfranke/struct
Use `struct` instead of `class` for core structures
2022-10-05 10:35:59 +02:00
Rémi Verschelde 91afc08de1 Merge pull request #855 from Zylann/fix_issue854_virtual_methods
Fix deriving a custom class with virtual methods
2022-10-05 10:35:54 +02:00
Aaron Franke 0455f72ede
Use struct instead of class for core structures 2022-10-05 01:46:15 -05:00
Rémi Verschelde d25cae9b61 Merge pull request #859 from aaronfranke/basis-transform-quat
Update Basis/Transform3D/Quaternion to match the engine
2022-10-04 16:39:46 +02:00
Aaron Franke fc879c04c8
Update Vector4/4i to match the engine 2022-10-01 21:09:05 -05:00
Aaron Franke d479208a8f
Update Vector2/2i/3/3i to match the engine 2022-10-01 21:09:05 -05:00
daylilyzeleen 3e91ec1729 Add detail infos for binding error message. 2022-09-30 15:16:43 +08:00
Marc Gilleron 5de2c059d1 Fix deriving a custom class with virtual methods 2022-09-21 19:31:30 +01:00
Aaron Franke e83d472c00
Update Basis/Transform3D/Quaternion to match the engine 2022-09-20 01:07:45 -05:00
Aaron Franke e26a75cd0c
Rename Basis "elements" to "rows"
https://github.com/godotengine/godot/pull/60627
2022-09-19 18:22:52 -05:00
Aaron Franke e30c858c5d
Rename Transform2D "elements" to "columns"
https://github.com/godotengine/godot/pull/60627
2022-09-19 18:22:52 -05:00
Aaron Franke 942cd466ed
Split is_equal_approx into float and double versions to match Godot
https://github.com/godotengine/godot/pull/48882
2022-09-19 02:47:27 -05:00
Rémi Verschelde 3450a1ab16 Merge pull request #847 from ninfur/issue-65997
Add missing Vector4 function bindings
2022-09-19 09:31:23 +02:00
Rémi Verschelde 03d1120d6a Merge pull request #850 from Zylann/transform_local
Add Transform3D `translated_local`, `rotated_local`, `scaled_local`
2022-09-19 09:30:11 +02:00
Marc Gilleron c543a3cbe1 Add Transform3D `translated_local`, `rotated_local`, `scaled_local` 2022-09-18 23:04:38 +01:00
Marc Gilleron a35994ce7b Use `quaternion` instead of `quat` in method names 2022-09-18 22:44:18 +01:00
Johannes Sinander e7372cbe85 Add missing Vector4 function bindings 2022-09-18 11:27:49 +02:00
Rémi Verschelde f24cc8be03
Merge pull request #826 from bruvzg/string_info 2022-09-15 21:10:13 +02:00
Silc Renew 440c4ed703 Mode some methods to Animation from Variant 2022-09-15 04:13:51 +09:00
bruvzg 36273baa7e
Change PropertyInfo members to String. 2022-09-14 08:41:09 +03:00
bruvzg 91c56a0ad1
Add bindings for Vector4, Vector4i, Projection built-in types. 2022-07-21 09:36:38 +03:00
bruvzg 713b122b84
Add support for BitField hint, sync API files. 2022-07-11 15:00:17 +03:00
bruvzg e3119e7d05
Sync containers with new HashMap/HashSet, sync API headers. 2022-06-06 12:18:07 +03:00
bruvzg 031a83b0ea
[Method Bind] Add support for default argument values and static method binding. Sync headers. 2022-05-06 10:17:51 +03:00
bruvzg 8bf5a532de
Change registered initializers / terminators to the single function with level argument. 2022-05-04 11:14:51 +03:00
Rémi Verschelde 1632322ce0 Update copyright year 2022-03-15 10:17:53 +01:00
Gilles Roudière a94148ca4c Reorder native extension initialization steps 2022-02-28 15:44:54 +01:00
Rémi Verschelde 76bad22978
Merge pull request #701 from bruvzg/port_templates 2022-02-21 11:25:40 +01:00
Rémi Verschelde 7e3321d1b2 Use forward declares for vector math types
Adds operators to convert from int vector types to float vector types
as done in the upstream engine implementations.
2022-02-20 12:04:08 +01:00
Rémi Verschelde 917b0c2ca3
Merge pull request #688 from zhehangd/master 2022-02-19 16:31:32 +01:00
bruvzg e36180f377
Port a bunch of Godot container templates to GDExtension. 2022-02-18 21:07:53 +02:00