Commit Graph

917 Commits (cb1569345a6f17da08241e645ab03cb2e1b78d2f)

Author SHA1 Message Date
Thaddeus Crews 2c11facde0
Merge pull request #112853 from aaronp64/dictionary_error_key
Include key in `Dictionary::operator[]` error message
2025-11-18 08:25:47 +07:00
kobewi e14263f917 Remove empty constructors and destructors from core/ 2025-11-17 20:09:05 +07:00
aaronp64 c18332740c Include key in Dictionary::operator[] error message
Include key in error message when lookup fails
2025-11-16 18:06:04 +07:00
David Snopek bc9f3c7d92 Make Vector<T>::duplicate() const
Co-authored-by: Aaron Franke <arnfranke@yahoo.com>
2025-11-04 17:13:11 +07:00
David Snopek fc58be9bfc GDExtension: Add system for builtin method compatibility 2025-11-04 17:12:31 +07:00
Thaddeus Crews f50d7fa1e8
Merge pull request #110709 from DeeJayLSP/dict-reserve
Add `reserve()` to `Dictionary`, apply to constructors on GDScript VM
2025-10-20 18:09:58 +07:00
Thaddeus Crews 7390c358f5
Core: Consolidate typed container logic 2025-10-15 08:04:51 +07:00
StarryWorm c17e76572d Fix `type_info.h` includes 2025-10-14 11:12:41 +07:00
Thaddeus Crews 16a11ac88b
Merge pull request #111358 from Ivorforce/no-variant-hasher
Remove `VariantHasher` and `VariantComparator` in favour of specialising `HashMapHasherDefault` and `HashMapComparatorDefault`.
2025-10-10 10:26:12 +07:00
Thaddeus Crews d4a87d9bb3
Merge pull request #106636 from Ivorforce/dictionary-mutating-fix
Fix `Dictionary::operator[]` from C++ accidentally modifying `const` dictionaries.
2025-10-10 10:26:01 +07:00
Thaddeus Crews c41e47034e
Merge pull request #111342 from Ivorforce/dict-assert-no-string
Assert that `dictionary.h` does not include `String`, and that neither of the fundamental containers include `Object`
2025-10-09 11:46:50 +07:00
Thaddeus Crews 7efb51c9d3
Merge pull request #111361 from Ivorforce/cleanup-hashfuncs
Clean up `hashfuncs.h`
2025-10-09 11:46:43 +07:00
Lukas Tenbrink f678729f89 Clean up `hashfuncs.h`: Move long functions to `hashfuncs.cpp` and replace `static` with `inline`. Remove `hash_make_uint64_t` and `hash_make_uint32_t`. 2025-10-07 13:50:18 +07:00
Lukas Tenbrink d2ee378d1c Remove `VariantHasher` and `VariantComparator` in favour of specializing `HashMapHasherDefault` and `HashMapComparatorDefault`. 2025-10-07 13:47:39 +07:00
Gergely Kis 6c44c80c62 LibGodot: Core - Build Godot Engine as a Library
* Add a new GodotInstance GDCLASS that provides startup and iteration commands to control a Godot instance.
* Adds a libgodot_create_godot_instance entry point that creates a new Godot instance and returns a GodotInstance object.
* Adds a libgodot_destroy_godot_instance entry point that destroys the Godot instance.

Sample Apps: https://github.com/migeran/libgodot_project

Developed by [Migeran](https://migeran.com)

Sponsors & Acknowledgements:

* Initial development sponsored by [Smirk Software](https://www.smirk.gg/)
* Rebasing to Godot 4.3 and further development sponsored by [Xibbon Inc.](https://xibbon.com)
* The GDExtension registration of the host process & build system changes were based
  on @Faolan-Rad's LibGodot PR: https://github.com/godotengine/godot/pull/72883
* Thanks to Ben Rog-Wilhelm (Zorbathut) for creating a smaller, minimal version for easier review.
* Thanks to Ernest Lee (iFire) for his support

Co-Authored-By: Gabor Koncz <gabor.koncz@migeran.com>
Co-Authored-By: Ben Rog-Wilhelm <zorba-github@pavlovian.net>
2025-10-07 02:15:41 +07:00
Lukas Tenbrink 839e0358b3 Assert that `dictionary.h` does not include `String`, and that neither of the fundamental containers include `Object`. 2025-10-06 23:03:27 +07:00
Lukas Tenbrink dc5e615a1d Remove `Array` include from `dictionary.h` and `ustring.h`. 2025-10-06 16:21:36 +07:00
Mounir Tohami 9ff5325642 Refactor `Array` iterators to be trivially copyable. 2025-10-02 14:30:55 +07:00
Lukas Tenbrink 712bc99668 Add `STATIC_ASSERT_INCOMPLETE_TYPE` to enforce include minimality.
Add enforcements against `Dictionary` for `ustring.h` and two for `Dictionary` and `String` from `array.h`.
2025-10-01 23:46:35 +07:00
Thaddeus Crews 726c4e9fba
Merge pull request #84658 from detomon/initialize-quaternion-variant-with-identity
Initialize `Quaternion` variant with identity
2025-09-30 11:19:19 +07:00
Thaddeus Crews 79d0eea742
Merge pull request #110616 from aaronfranke/fix-rtos-fix-32bit
Apply rtos_fix hack for handling 32-bit floats on all calls to rtos_fix
2025-09-30 11:19:16 +07:00
Lukas Tenbrink 1bf821c1e1 Store current capacity in `CowData` buffers, and rewrite most of it.
Add `reserve` to `CowData`, `Vector` and `Array`.

# Conflicts:
#	core/os/memory.h
#	core/templates/cowdata.h
2025-09-25 22:00:17 +07:00
DeeJayLSP 8a7a0faa75 Add `reserve()` to `Dictionary`, apply to constructors on GDScript VM 2025-09-23 16:57:52 +07:00
Lukas Tenbrink 406b22d2d5 Delete `VariantGetInternalPtr` and `VariantImplicitConvert`.
Replace uses with `VariantInternalAccessor`.
2025-09-19 00:20:07 +07:00
Lukas Tenbrink f81287d765 Introduce `VariantImplicitConvert<>` template for types that can be implicitly converted to and from `Variant`.
De-duplicate a lot of `VariantGetInternalPtr`, `VariantInternalAccessor`, `VariantInitializer` and `VariantDefaultInitializer`.
2025-09-19 00:20:07 +07:00
Lukas Tenbrink 0be2a77156 Fix `Dictionary::operator[]` from C++ accidentally modifying `const` dictionaries.
Fix `AudioStreamWav` inserting keys into the input dictionary.
2025-09-18 21:17:42 +07:00
Thaddeus Crews d90d8afa5a
Merge pull request #108118 from YYF233333/varray_and_vformat
Simplify `varray`
2025-09-18 12:42:25 +07:00
Lukas Tenbrink a916325e6a Use `Span` for `String.sprintf`, to accelerate `vformat` not needing to allocate an `Array`. 2025-09-18 19:29:04 +07:00
Aaron Franke 6bc6110a90
Apply rtos_fix hack for handling 32-bit floats on all calls to rtos_fix 2025-09-17 07:05:33 +07:00
Thaddeus Crews 1a89648c61
Merge pull request #110206 from aaronp64/remove_unused_enum_bitfield_param
Remove unused parameter in `__constant_get_enum_name`/`__constant_get_bitfield_name`
2025-09-16 20:29:01 +07:00
Thaddeus Crews c39edeca6d
Merge pull request #109744 from Repiteo/core/math-constants-semantic
Core: Integrate semantic constants in math structs
2025-09-16 11:44:49 +07:00
Yufeng Ying 8f36c97a49 Optimize varray. 2025-09-16 15:01:26 +07:00
aaronp64 4c3f2be16d Avoid repeated _copy_on_write() calls in Array::resize()
Updated Array::resize() to call ptrw() once before looping to initialize typed array elements, instead of accessing each through .write[].
2025-09-15 14:03:21 +07:00
aaronp64 cfde73ac17 Remove unused parameter in __constant_get_enum_name/__constant_get_bitfield_name
Removed unused String parameter in __constant_get_enum_name() and __constant_get_bitfield_name() to avoid creating/destroying extra Strings.
2025-09-02 13:13:12 +07:00
Thaddeus Crews 84c0ec04f3
Core: Integrate semantic constants in math structs
- Excludes self-explanatory constants (ZERO, ONE, etc)
2025-08-19 10:15:08 +07:00
Mikael Hermansson 494471dda2 Fix `printraw` causing infinite recursion in `Logger._log_message` 2025-07-31 20:24:47 +07:00
George Marques 28d3214acd
Expose type validator from Dictionary and allow testing without error
- Now you can get the ContainerTypeValidate from a Dictionary (both for
  keys and for values).
- ContainerTypeValidate exposes a validator function that does not show
  any error in case of failure. This allows testing values before trying
  to use them in Dictionary.
2025-07-24 13:35:48 +07:00
Rémi Verschelde a0f9f5d90a
Merge pull request #107770 from RandomShaper/fix_res_dupe_bindings
Enhance bindings of deep resource duplication
2025-06-21 11:14:19 +07:00
Pedro J. Estébanez 7dc37bdc9c Enhance bindings of deep resource duplication 2025-06-20 18:40:41 +07:00
Rémi Verschelde 6eb6e3e6e0
Merge pull request #107457 from akien-mga/improve-error-message-call-single-argument
Improve error messages for method calls expecting only 1 argument
2025-06-12 22:49:36 +07:00
Rémi Verschelde ae484828bb
Merge pull request #107408 from Ivorforce/node-path-string-explicit
Make conversions from `NodePath` to `String` explicit.
2025-06-12 22:49:03 +07:00
Rémi Verschelde 1a64b6b5b6
Merge pull request #106913 from Ivorforce/string-resize-uninitialized
Rename `String::resize` to `resize_uninitialized`
2025-06-12 22:48:45 +07:00
OsakiTsukiko 805ad87340
Add PackedByteArray conversion to PackedVector2Array, PackedVector3Array, PackedVector4Array and PackedColorArray 2025-06-12 17:05:57 +07:00
Rémi Verschelde d1083c9722
Improve error messages for method calls expecting only 1 argument 2025-06-12 17:02:59 +07:00
Rémi Verschelde d9cd011e2f
Merge pull request #107406 from Ivorforce/ip-to-string-explicit
Core: Remove implicit conversions from `IPAddress` to `String`, to avoid accidental conversions
2025-06-12 01:15:53 +07:00
Danil Alexeev f864d0ce11
GDScript: Re-add `ord()` function 2025-06-11 21:01:13 +07:00
Lukas Tenbrink b13a0e1834 Rename `String::resize` to `resize_uninitialized`, to better communicate to callers that new characters must be initialized. 2025-06-11 18:13:02 +07:00
Lukas Tenbrink e2931a5c19 Make conversions from `NodePath` to `String` explicit. 2025-06-11 16:50:27 +07:00
Lukas Tenbrink 1498eb327f Make `IPAddress` to `String` conversion explicit. 2025-06-11 15:44:16 +07:00
Lukas Tenbrink d2f9d31270 Make more types (`Callable`, `Signal`) conversion to `String` explicit. 2025-06-10 23:55:35 +07:00