Commit Graph

285 Commits

Author SHA1 Message Date
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
Rémi Verschelde a1c476f9d7
Merge pull request #87680 from AThousandShips/the_angry_count
Add methods to get argument count of methods
2024-03-13 22:16:43 +01:00
Thaddeus Crews 5a6e3cbcb0
SCons: Remove `run_in_subprocess` dependency 2024-03-11 13:20:09 -05:00
Rémi Verschelde 810f127022
Merge pull request #89365 from Repiteo/scons/run_in_subprocess-to-env.Run
SCons: Convert remaining `run_in_subprocess` to `env.Run`
2024-03-10 21:13:22 +01:00
Thaddeus Crews 8116d70d4b
SCons: Convert remaining `run_in_subprocess` to `env.Run` 2024-03-10 14:01:23 -05:00
Thaddeus Crews fb299d0fb1
SCons: Ensure `with` statement where applicable 2024-03-10 12:57:57 -05:00
A Thousand Ships 59bcc2888c
Add methods to get argument count of methods
Added to:
* `Callable`s
* `Object`s
* `ClassDB`
* `Script(Instance)`s
2024-03-10 11:02:43 +01:00
Thaddeus Crews d9fa40f2df
Enforce `\n` eol for Python writes
• Ensure utf-8 encoding if previously unspecified
2024-03-09 14:29:24 -06:00
Rémi Verschelde 50ca190286
Merge pull request #89055 from dsnopek/gdextension-script-free-lists
GDExtension: Pass count when freeing method and property lists for script instances
2024-03-04 13:33:45 +01:00