Commit Graph

78 Commits

Author SHA1 Message Date
basta 3e664b4e29 Changed bool to GdNativeBool 2022-07-16 18:09:36 +02:00
bruvzg cbe3a2dcb7
Use BitField hint for the TextServer enums. Add missing parts for BitField support to the GDextension API. 2022-07-15 08:49:50 +03:00
kobewi 2f777b9a1e Remove unused hints 2022-07-12 00:44:13 +02:00
reduz 5ac42cf576 Implement a BitField hint
Allows to specify the binder that an enum must be treated as a bitfield.
2022-07-05 22:13:37 +02:00
Jan Haller 60ffadd133 GDExtension: reuse code with constructor PropertyInfo(const GDNativePropertyInfo&) 2022-06-29 19:30:01 +02:00
K. S. Ernest (iFire) Lee 9ddebc0c22 Add a const call mode to Object, Variant and Script.
For this to work safely (user not call queue_free or something in the expression), a const call mode was added to Object and Variant (and optionally Script).

This mode ensures only const functions can be called, making it safe to use from the editor.

Co-Authored-By: reduz <reduzio@gmail.com>
2022-06-27 13:33:06 -07:00
Pierre-Thomas Meisels c28936ba6d Add core types enums description to extension api json 2022-06-23 19:19:22 +02:00
Jan Haller d2dba74bae GDExtension: print error messages for different error paths during loading 2022-06-19 10:14:41 +02:00
bruvzg 860e24683f
Make enum/constant binds 64-bit. 2022-06-17 16:36:26 +03:00
Emmanuel Leblond 228ce1d2b6
Fix NativeExtension::open_library return value when the undelying lib fails to initialize 2022-06-12 00:18:08 +02:00
bruvzg b3bbf3db47
[GDExtension] Expose Variant, NodePath and StringName hash functions. 2022-06-06 12:19:56 +03:00
reduz 746dddc067 Replace most uses of Map by HashMap
* Map is unnecessary and inefficient in almost every case.
* Replaced by the new HashMap.
* Renamed Map to RBMap and Set to RBSet for cases that still make sense
  (order matters) but use is discouraged.

There were very few cases where replacing by HashMap was undesired because
keeping the key order was intended.
I tried to keep those (as RBMap) as much as possible, but might have missed
some. Review appreciated!
2022-05-16 10:37:48 +02:00
Yuri Roubinsky dbd7a31507 Implement exponential operator (**) to GDScript/Expressions 2022-05-11 16:30:37 +03:00
Rémi Verschelde b9b78fdaee
Merge pull request #55876 from bradc6/feature/AllowForAbsoluteLibraryPaths 2022-05-10 13:38:41 +02:00
Rémi Verschelde 943b509952
Merge pull request #60886 from touilleMan/gdextension-header-duplicated-GDNativeExtensionClassGetPropertyList
Fix duplication of GDNativeExtensionClassGetPropertyList definition in gdnative_interface.h
2022-05-08 19:54:12 +02:00
Emmanuel Leblond f3a8574ede
Fix duplication of GDNativeExtensionClassGetPropertyList definition in gdnative_interface.h 2022-05-08 14:41:31 +02:00
Emmanuel Leblond 2bdeed156f
Fix extension_api.json builtin_class_member_offsets member names for Color 2022-05-08 11:33:43 +02:00
bruvzg 70755d873b
[GDExtension] Fix static method binds and default arguments. 2022-05-06 10:06:12 +03:00
Rémi Verschelde 84f64ddde9
Merge pull request #60723 from reduz/refactor-module-initialization 2022-05-04 19:08:43 +02:00
reduz de0ca3b999 Refactor module initialization
* Changed to use the same stages as extensions.
* Makes the initialization more coherent, helping solve problems due to lack of stages.
* Makes it easier to port between module and extension.
* removed the DRIVER initialization level (no longer needed).
2022-05-04 17:34:51 +02:00
Rémi Verschelde 297241f368
Merge pull request #60714 from Calinou/typedef-remove-ref
Remove `RES` and `REF` typedefs in favor of spelled out `Ref<>`
2022-05-03 14:28:18 +02:00
Hugo Locurcio 180e5d3028
Remove `RES` and `REF` typedefs in favor of spelled out `Ref<>`
These typedefs don't save much typing compared to the full `Ref<Resource>`
and `Ref<RefCounted>`, yet they sometimes introduce confusion among
new contributors.
2022-05-03 01:43:50 +02:00
Emmanuel Leblond 80f61352fb
Add GDNativeInterface::get_library_path to GDExtension 2022-04-29 00:51:04 +02:00
bruvzg de4c97758a
Fix more issues found by cppcheck. 2022-04-20 10:34:00 +03:00
Rémi Verschelde 8ada85ef1d
Merge pull request #60093 from TokageItLab/reset-blend
Make blend animation to use ResetTrack as default value
2022-04-13 22:46:45 +02:00
bruvzg 9381acb6a4
Make FileAccess and DirAccess classes reference counted. 2022-04-11 13:28:51 +03:00
Silc 'Tokage' Renew 860fac4e6f Make blend animation to use ResetTrack as default value 2022-04-10 13:00:00 +09:00
bruvzg f851c4aa33
Fix some issues found by cppcheck. 2022-04-06 14:34:37 +03:00
Rémi Verschelde 143d13717b
Merge pull request #59553 from reduz/script-extension-support 2022-03-28 13:35:21 +02:00
Jan Haller f88bdac403 GDExtension: change to_string signature to accept GDNativeStringPtr instead of returning const char* 2022-03-27 21:31:00 +02:00
reduz 360dea5348 Add GDExtension support to Script
* Ability to create script languages from GDExtension
* Some additions to gdnative_extension.h to make this happen
* Moved the GDExtension binder to core

This now allows creating scripting languages from GDExtension, with the same ease as if it was a module. It replaces the old PluginScript from Godot 3.x.
Warning: GodotCPP will need to be updated to support this (it may be a bit of work as ScriptInstance needs to be created over there again).
2022-03-27 16:13:00 +02:00
reduz 2f651277da Add static method support to ClassDB
* Based on the work done for Variant in the past.
* Added `ClassDB::bind_static_method`
* Cleaned up ClassDB::bind_method to use variadic templates.

This adds support for having static methods in Object derived classes.
Note that this does not make it work yet in GDScript or Mono and, while it works for GDExtension, GodotCPP needs to be updated.
2022-03-22 16:27:34 +01:00
reduz 8b547331be Create GDExtension clases for PhysicsServer3D
* Allows creating a GDExtension based 3D Physics Server (for Bullet, PhysX, etc. support)
* Some changes on native struct binding for PhysicsServer

This allows a 3D Physics server created entirely from GDExtension. Once it works, the idea is to port the 2D one to it.
2022-03-15 18:39:31 +01:00
reduz 6f51eca1e3 Discern between virtual and abstract class bindings
* Previous "virtual" classes (which can't be instantiated) are not corretly named "abstract".
* Added a new "virtual" category for classes, they can't be instantiated from the editor, but can be inherited from script and extensions.
* Converted a large amount of classes from "abstract" to "virtual" where it makes sense.

Most classes that make sense have been converted. Missing:

* Physics servers
* VideoStream
* Script* classes.

which will go in a separate PR due to the complexity involved.
2022-03-10 12:28:11 +01:00
reduz 21637dfc25 Remove VARIANT_ARG* macros
* Very old macros from the time Godot was created.
* Limited arguments to 5 (then later changed to 8) in many places.
* They were replaced by C++11 Variadic Templates.
* Renamed methods that take argument pointers to have a "p" suffix. This was used in some places and not in others, so made it standard.
* Also added a dereference check for Variant*. Helped catch a couple of bugs.
2022-03-09 18:39:13 +01:00
Gilles Roudière ce512b35c1 Reorder native extension types initialization, initializing editor last 2022-02-28 16:03:26 +01:00
Rémi Verschelde e6c11e4dfd
Merge pull request #58331 from poiati/fix-extension-registration-order-2 2022-02-22 09:07:28 +01:00
Paulo Poiati fe95aa2c90 Fix extension registration order. 2022-02-20 10:58:46 -03:00
Anish Bhobe b7ff421b55
Resolving suggestions on comment formatting. 2022-02-20 14:56:58 +01:00
Anish Bhobe 102d9fc1b3
Fixing iteration for extension level loading.
Extensions are not getting instantiating properly due to iteration calling the wrong levels for loading.
2022-02-20 11:41:39 +01:00
Rémi Verschelde fe52458154
Update copyright statements to 2022
Happy new year to the wonderful Godot community!
2022-01-03 21:27:34 +01:00
Bradley Clemetson 4fd2706afd
If a gdextension library filepath is an absolute path do not attempt to append the base directory on top of that. While this is a uncommon if not unused case for a release version it is helpful for development builds.
Fix formatting
2021-12-23 14:20:07 -08:00
Nathan Franke 49403cbfa0
Replace String comparisons with "", String() to is_empty()
Also:
- Adds two stress tests to test_string.h
- Changes to .empty() on std::strings
2021-12-09 04:48:38 -06:00
Gilles Roudière 4fc0fb826a Change gdnative interface so that Godot object initialization should be triggered from the extension side 2021-11-30 16:55:48 +01:00
bruvzg f214b2b194 [GDExtension] Implement missing Dictionary index operators.
Co-authored-by: Bastiaan Olij <mux213@gmail.com>
2021-11-22 12:43:00 +02:00
Bastiaan Olij 035468669a Fix array access in gdextensions 2021-11-17 10:36:29 +11:00
Gilles Roudière 0587e5e018 Implement toast notifications in the editor 2021-10-14 13:30:54 +02:00
Colin Kinloch a66e59be84 Add typedef to GDNativeInstanceBindingCallbacks 2021-10-07 11:59:18 +01:00
Rémi Verschelde a7ba227631
Merge pull request #52711 from m4gr3d/provide_getter_for_project_data_dir_master 2021-10-05 21:02:27 +02:00
bruvzg 0c0b5c84b0 Implement TextServer GDExtension interface, remove TextServer GDNative interface. 2021-10-01 15:13:29 +03:00