Commit Graph

293 Commits

Author SHA1 Message Date
Rémi Verschelde
4dd812f2ed
Merge pull request #97119 from dsnopek/gdextension-object-instance-id
GDExtension: Allow directly getting `ObjectID` from `Variant`
2024-10-04 17:18:06 +02:00
Gergely Kis
8a41b1d90f GDExtension: Use loader to check if the library exists. 2024-09-29 07:38:45 +02:00
Rémi Verschelde
8a9a26ef19
Merge pull request #93311 from dsnopek/gdextension-required-virtuals
GDExtension: Mark virtual function as `is_required` in `extension_api.json`
2024-09-27 13:53:16 +02:00
Thaddeus Crews
9f9ee0c813
SCons: Add unobtrusive type hints in SCons files 2024-09-25 09:34:35 -05:00
David Snopek
971e154588 GDExtension: Allow directly getting ObjectID from Variant 2024-09-17 11:58:55 -05:00
Rémi Verschelde
f8fbb860f5
Merge pull request #95840 from raulsntos/char_metadata
Add metadata for `char16_t` and `char32_t`
2024-09-12 09:25:19 +02:00
Raul Santos
aaffab8afb
Add metadata for char16_t and char32_t
We don't seem to expose any API that uses `char16_t` yet, but I added it anyway since we make the type info for it.

I didn't add anything for `wchar_t` because we are not making a type info so maybe we don't have a need for it yet, it could be added in the future.

To prevent breaking compatibility with the C# bindings, we ignore the `char32_t` metadata and still use `System.Int64`.
2024-09-12 02:15:55 +02:00
David Snopek
c2af6bcb59 GDExtension: Mark virtual function as is_required in extension_api.json
Co-authored-by: Jovan Gerodetti <jovan.gerodetti@titannano.de>
2024-09-11 16:48:14 -05:00
Rémi Verschelde
d8e5d61f22
Merge pull request #96787 from raulsntos/gdextension/remove-get-rid-func
Remove `get_rid_func` from `GDExtensionClassCreationInfo4`
2024-09-11 12:35:10 +02:00
Rémi Verschelde
3cad849b1f
Merge pull request #96586 from rune-scape/fix-empty-stringname-hash
StringName: Fix empty hash
2024-09-11 12:34:56 +02:00
Raul Santos
9e57674550
Remove get_rid_func from GDExtensionClassCreationInfo4 2024-09-10 12:35:24 +02:00
rune-scape
0dde931bc9 StringName: Fix empty hash
+Fixed compat hashes
2024-09-09 13:30:02 -07:00
scgm0
3badff1f53 Allow class names to be unicode 2024-09-07 05:46:28 +08:00
Thaddeus Crews
9853a69144
Implement typed dictionaries 2024-09-04 10:27:26 -05:00
Rémi Verschelde
d15de6f264
Merge pull request #96292 from AThousandShips/null_check_ref_fix
Cleanup of raw `nullptr` checks with `Ref`
2024-09-03 16:13:55 +02:00
Jan Haller
82b2a58f4c Fix bool type appearing in GDExtension header 2024-08-31 22:40:48 +02:00
A Thousand Ships
194bdde947
Cleanup of raw nullptr checks with Ref
Using `is_valid/null` over checks with `nullptr` or `ERR_FAIL_NULL` etc.
2024-08-31 15:01:09 +02:00
Danil Alexeev
49bcdf78a7
Core: Сheck r_error after calling callp() 2024-08-30 21:09:30 +03:00
Rémi Verschelde
f0ee0bdd37
Merge pull request #93972 from Hilderin/fix-editor-needs-restart-after-adding-gdextensions
Fix editor needs restart after adding GDExtensions
2024-08-30 09:59:05 +02:00
David Snopek
6d0a57c9fd Fix loading GDExtensions in exported games 2024-08-29 09:50:56 -05:00
Hilderin
ef6f873938 Fix editor needs restart after adding GDExtensions 2024-08-29 06:15:32 -04:00
Haoyu Qiu
8bf4ecc026 Add String.is_valid_unicode_identifier()
- Adds `is_valid_unicode_identifier()`
- Adds `is_valid_ascii_identifier()`
- Deprecates `is_valid_identifier()`
- Renames `validate_identifier()` to `validate_ascii_identifier()`
2024-08-27 11:34:08 +08:00
Rémi Verschelde
04f6321ecc
Merge pull request #91166 from raulsntos/gdextension/loader
GDExtension: Implement `GDExtensionLoader` concept
2024-08-26 10:51:21 +02:00
Raul Santos
4dd6e8eca5
GDExtension: Implement GDExtensionLoader concept
- Implements the concept of GDExtension loaders that can be used to customize how GDExtensions are loaded and initialized.
- Moves the parsing of `.gdextension` config files to the new `GDExtensionLibraryLoader`.
- `GDExtensionManager` is now meant to be the main way to load/unload extensions and can optionally take a `GDExtensionLoader`.
- `EditorFileSystem` avoids unloading extensions if the file still exists, this should prevent unloading extensions that are outside the user project.
2024-08-22 05:29:11 +02:00
Daylily-Zeleen
3d575801ce Allow ClassDB to create a Object without postinitialization for GDExtension. 2024-08-20 20:19:02 +08:00
Joel Croteau
f44d6a235f Fix reload of GDExtension libraries in framework package on macos
`GDExtension::open_library` has a check in it to see if the library was loaded
from a temp file, and if it was to restore the original name as that is the one
we actually care about. This check is breaking extension reloading on Mac when
the library path is to a framework folder, as the file inside the framework
will not generally be the same name as the folder.

This check also shouldn't be necessary even on Windows, which is the only
platform that uses `generate_temp_files`, since disposal of the created temp
file is handled within `OS_Windows::open_dynamic_library`, and
`GDExtension::open_library` (which is the only function to call
`open_dynamic_library` with a `p_data` argument) only cares about the original
library file path and has to do extra work to remove the name of the temp file.
Instead, I have removed that check and set `OS_Windows::open_dynamic_library`
to return the name of the original file and not the name of the copy.

This fixes GDExtension reloading on macOS. I do not have a Windows machine
available to test that it still works properly on Windows, so someone should
check that before merging this.
2024-08-08 08:31:49 -06:00
Rémi Verschelde
31f696cf03
Merge pull request #94373 from maiself/fix-library-path-as-abs
Fix to restore `library_path` as absolute path
2024-07-17 12:24:07 +02:00
Jan Haller
b2a9ea6d22 GDExtension docs: advise bindings to use uint64_t for bitfields 2024-07-15 22:37:33 +02:00
Mai Lavelle
16eea2c837
Fix to restore library_path as absolute path 2024-07-14 20:37:38 -04:00
bruvzg
e651421905
[TextServer, GDExtension] Fix building text servers as GDExtension, expose new/changed low-level methods to GDExtension API. 2024-06-12 19:30:19 +03:00
Rémi Verschelde
9d4a736d0c
Merge pull request #91502 from lyuma/gdextension_open_library_compat
Bind compatibility GDExtension methods removed in #88418
2024-05-30 11:47:43 +02:00
Jakub Marcowski
d9f8ef68df
Update pre-commit hooks configuration to use ruff instead of black 2024-05-21 18:02:29 -05:00
David Snopek
14506a4282 GDExtension: Prevent crash during shutdown as singletons are deleted 2024-05-10 13:17:36 -05:00
A Thousand Ships
a0dbdcc3ab
Replace find with contains/has where applicable
* Replaces `find(...) != -1` with `contains` for `String`
* Replaces `find(...) == -1` with `!contains` for `String`
* Replaces `find(...) != -1` with `has` for containers
* Replaces `find(...) == -1` with `!has` for containers
2024-05-08 12:37:42 +02:00
Lyuma
0e5e743258 Bind compatibility GDExtension methods removed in 88418
These functions were likely not used, but we must ensure they are still bound to ensure API stability.
2024-05-07 01:36:36 -07:00
Rémi Verschelde
4b070e8031
Fix various typos with codespell
Using 2.2.7.dev217+g10c2abcf.

Had to add `colour` to the ignore list as we used it as an alias/keyword for the
documentation of color-related APIs.
Also ignore recommendations to change `thirdparty` to either `third-party` or
`third party`, which are correct but we use the former fairly consistently.
2024-05-07 10:08:42 +02:00
A Thousand Ships
955d5affa8
Reduce and prevent unnecessary random-access to List
Random-access access to `List` when iterating is `O(n^2)` (`O(n)` when
accessing a single element)

* Removed subscript operator, in favor of a more explicit `get`
* Added conversion from `Iterator` to `ConstIterator`
* Remade existing operations into other solutions when applicable
2024-05-04 16:08:55 +02:00
K. S. Ernest (iFire) Lee
f9b488508c
Add PackedVector4Array Variant type
Co-authored-by: A Thousand Ships <96648715+AThousandShips@users.noreply.github.com>
Co-authored-by: Rémi Verschelde <rverschelde@gmail.com>
2024-05-03 00:58:27 +02:00
Jan Haller
27a637d287 GDExtension: provide free_property_list_func with length of array 2024-04-27 14:13:17 +02:00
David Snopek
45463f75d6 Fix ptrcalls to static GDExtension methods 2024-04-25 08:20:22 -05:00
Rémi Verschelde
e22743298a
Merge pull request #90961 from Lateasusual/gdextension-hot-reloading-borked
GDExtension: Fix missing library path breaking hot reloading
2024-04-22 22:18:34 +02:00
Chris Clyne
8564e94547 GDExtension: Fix missing library path breaking hot reloading 2024-04-20 21:08:11 +01:00
Fredia Huya-Kouadio
764de7fe31 Collapse the gdextension arguments into the GDExtensionData struct
This is used to reduce the number of arguments to `OS::open_dynamic_library(...)`.
2024-04-19 07:56:02 -07:00
Fredia Huya-Kouadio
ede88cf59d Fix loading GDExtension dependencies on Android 2024-04-19 07:55:08 -07:00
Rémi Verschelde
e73f40e260
Merge pull request #87117 from DmitriySalnikov/rename_pdb
Add renaming of PDB files to avoid blocking them
2024-04-11 11:02:31 +02:00
A Thousand Ships
64146cb7f3
[Core] Add iteration support to Array 2024-04-10 14:49:34 +02:00
DmitriySalnikov
b73e740786 Add renaming of PDB files to avoid blocking them 2024-04-05 00:14:23 +03:00
Samuel Nicholas
5f89b15098
Print correct path when unable to find GDExtension library 2024-03-26 00:13:56 +01:00
ppphp
d4e1a74efb Add 'override' mark to ResourceFormat class 2024-03-25 04:06:34 +08:00
A Thousand Ships
0c19d0f5a0
Add extension support for argument count to ScriptInstance 2024-03-13 22:40:09 +01:00