Commit Graph

263 Commits

Author SHA1 Message Date
Lukas Tenbrink 7852cb7887 Update GDCLASS / GDSOFTCLASS comments. 2026-05-08 23:47:35 +02:00
Enzo Novoselic 1b98247ef8 Fix RequiredResult<T> not being parsed properly by include-cleaner 2026-05-02 14:02:01 -04:00
Thaddeus Crews 790c68368f Merge pull request #118590 from Bromeon/feature/required-ptr-conversion
Add `RequiredParam` -> `RequiredResult` conversion
2026-04-16 09:41:12 -05:00
Thaddeus Crews 66dd6fe737 Merge pull request #118582 from Ivorforce/is_class_sn
Change `Object::is_class` to take `StringName` instead of `String`, for better performance
2026-04-15 14:02:32 -05:00
Lukas Tenbrink 299b0f69f9 Change Object::is_class to take StringName for better performance (intended for GDExtension casting and inheritance checks). 2026-04-15 13:08:43 +02:00
Jan Haller 71d44651c4 Add RequiredParam -> RequiredResult conversion
Adds implicit conversion from `RequiredResult<T_Other>` to `RequiredParam<T>` (where
`T_Other` derives from `T`). This allows passing a `RequiredResult` directly to a
`RequiredParam` without an intermediate variable.

Also changes `SceneTree::get_root()` to return `RequiredResult<Window>`. It is used in a
conversion as described above.

Why non-null: The root window is created in the `SceneTree` constructor and only set to
null in the destructor, so it is always valid during normal use. The function is no longer
`_FORCE_INLINE_` because `RequiredResult<Window>` requires Window to be a complete type.
2026-04-15 01:23:48 +02:00
Lukas Tenbrink c9279c1e53 Add classdb_construct_object3 and classdb_register_extension_class6, which are refcount-aware initialization functions (establishing RefCounted objects with a refcount of 1). 2026-04-12 12:29:04 +02:00
Thaddeus Crews 4e7fefbf62 Merge pull request #117474 from Ivorforce/gdtype-signals
Move signal ownership from `ClassDB` to `GDType`
2026-03-18 11:43:30 -05:00
Mikael Hermansson 64f7bbbf12 Improve thread-safety of Object signals 2026-03-17 14:02:35 +01:00
Lukas Tenbrink 7a73d3f16b Move signal ownership from ClassDB to GDType. 2026-03-17 11:58:10 +01:00
Leandro (cerberus1746) Benedet Garcia 7482600828 Separate method and property info into separate files 2026-03-16 09:59:10 -03:00
Lukas Tenbrink efcc97ee8a Move enum registration from ClassDB / ClassInfo to GDType.
Create caches across supertypes for faster lookup.
2026-03-13 19:20:30 +01:00
Rémi Verschelde e015e8bde4 Remove unused includes in core with clangd-tidy 2026-03-11 06:41:36 +01:00
Lukas Tenbrink a6adb12240 Remove message_queue.h include from object.h. 2026-02-20 00:27:41 +01:00
Thaddeus Crews 7dae5da198 Style: Convert *.gen.inc to *.gen.h 2026-02-05 19:47:56 -06:00
Lukas Tenbrink c5df0cb82b Don't right-align escaped newlines, e.g. for #define. This has previously led to long diffs in the commit history. 2026-02-04 19:31:28 +01:00
David Snopek 5d995a9558 Fix crash when converting Variant to incompatible RequiredPtr<T> 2026-01-20 19:12:15 -06:00
Lukas Tenbrink aa33b53e67 Use GDType for GDExtension types as well.
Co-authored-by: David Snopek <dsnopek@gmail.com>
2025-12-03 21:32:46 +01:00
Thaddeus Crews 6e69760134 Merge pull request #111967 from Ivorforce/object-cast-to-protect
Statically protect `Object::cast_to` for unrelated `Object` types.
2025-11-25 07:06:48 -06:00
Lukas Tenbrink 0f047944e4 Statically protect Object::cast_to for unrelated Object types.
Fix a handful of bugs associated with it.
2025-11-24 23:03:22 +01:00
David Snopek d95d49ee12 Add RequiredParam<T> and RequiredValue<T> to mark Object * arguments and return values as required
Co-authored-by: Thaddeus Crews <repiteo@outlook.com>
2025-11-24 12:12:09 -06:00
David Snopek 2c681794cd GDExtension: Store source of gdextension_interface.h in JSON 2025-11-11 14:58:45 -06:00
Mike Precup abfc63b483 Speed up signal disconnects in the editor 2025-10-22 22:27:25 -07:00
Thaddeus Crews 60710df3b6 Merge pull request #94047 from KoBeWi/resource_printer
Improve `to_string()` and add it to Resource
2025-10-16 12:48:11 -05:00
Thaddeus Crews 9e96c7d9b8 Merge pull request #110378 from timothyqiu/rtl-preview
Make text-related nodes translation domain aware
2025-10-16 12:48:05 -05:00
Yufeng Ying 7d3c25d083 Remove callable_bind.h from object.h 2025-10-14 16:24:05 +08:00
Thaddeus Crews e33f89fe27 Merge pull request #111323 from HolonProduction/rm-script
Remove `Object::script`
2025-10-10 10:26:09 -05:00
Raul Santos 09ad9e535b Rename MTVIRTUAL to DEBUG_VIRTUAL 2025-10-09 22:11:18 +02:00
kobewi e6783dbdd1 Improve to_string() and add it to Resource 2025-10-09 00:54:38 +02:00
Thaddeus Crews 89e3587cd8 Merge pull request #111339 from HolonProduction/obj-pack
Bitpack more `Object` booleans
2025-10-07 11:54:34 -05:00
Thaddeus Crews 1c643549f3 Merge pull request #111337 from Ivorforce/gdvirtual-init-virtual-ptr
Abstract `Object` virtual pointer init into a method instead of duplicating it across `gdvirtual.gen.inc`
2025-10-07 11:54:31 -05:00
Lukas Tenbrink 91c48b3151 Abstract Object virtual pointer init into a method instead of duplicating it across gdvirtual.gen.inc. 2025-10-07 00:12:40 +02:00
HolonProduction 7b2e148687 Bitpack more Object booleans 2025-10-06 22:01:22 +02:00
HolonProduction 2adecffbc3 Remove Object::script 2025-10-06 16:27:53 +02:00
Thaddeus Crews 5935a32e32 Core: Cleanup headers in core/config
- `MainLoop` now forward-declared in `OS`
2025-10-06 09:20:56 -05:00
Thaddeus Crews 686b56fae9 Merge pull request #106434 from Ivorforce/invert-hashfuncs
Reduce cross project includes by rewriting `HashMapHasherDefault`.
2025-10-06 09:06:37 -05:00
Thaddeus Crews dd6ffaabdc Merge pull request #105793 from Ivorforce/gdtype-the-first
Core: Add initial architecture for first-class `Object` types. Optimize `is_class`
2025-10-06 09:06:36 -05:00
Lukas Tenbrink 9d44b68867 Remove rw_lock.h and rb_map.h includes from object.h. 2025-10-05 23:29:04 +02:00
Lukas Tenbrink ad600125df Rewrite HashMapHasherDefault based on type traits - it is now possible to declare a default hashing function for any type.
Remove cross-project includes from `hashfuncs.h`.
Improve hashing function for `Color` (based on values instead of `String`).
Move `Variant` comparison from `hash_map.h` to `dictionary.cpp` (`VariantComparatorDictionary`), where it's used.
Remove now unnecessary `HashableHasher`.
2025-10-05 01:49:11 +02:00
Thaddeus Crews f6aa5ba23c Merge pull request #97210 from AleksLitynski/object-snapshot-debugger
Add an ObjectDB Profiling Tool
2025-10-03 12:01:11 -05:00
Lukas Tenbrink ac85d24e64 Add GDType and Object::_gdtype_ptr for first-class Object typing.
The type is currently bare-bones, but will be expanded in future PRs.
2025-10-01 18:49:48 +02:00
David Snopek 2c707a911f GDExtension: Prevent breaking compatibility for unexposed classes that can only be created once 2025-09-30 14:48:06 -05:00
Thaddeus Crews a20ca7bbfe Merge pull request #110459 from YeldhamDev/let_the_poor_ints_slide
Allow to use sliders for integers in `EditorSpinSlider`
2025-09-22 13:28:52 -05:00
Michael Alexsander f16ff829f0 Allow to use sliders for integers in EditorSpinSlider 2025-09-22 11:23:15 -03:00
Lukas Tenbrink 96619d46a1 Use AncestralClass to speed up Object::cast_to when possible. 2025-09-22 13:21:51 +02:00
Haoyu Qiu 172c80df67 Make text-related nodes translation domain aware
- Makes `is_layout_rtl()` translation domain aware
- Makes various text-drawing controls translation domain aware
- Makes translation preview use the project's fallback locale when disabled
2025-09-22 09:39:14 +08:00
Thaddeus Crews 149a4b4ca1 Merge pull request #107868 from lawnjelly/quick_ancestry4
Provide quick access to `Object` ancestry
2025-09-20 13:41:39 -05:00
Thaddeus Crews 555e7ad073 Core: Handle disabled class detection in ClassDB 2025-08-26 09:31:14 -05:00
Aleksander Litynski 78f1543e35 Add an ObjectDB Profiling Tool
A new tab is added to the debugger that can help profile a game's memory usage.

Specifically, this lets you save a snapshot of all the objects in a running
game's ObjectDB to disk. It then lets you view the snapshot and diff two
snapshots against each other. This is meant to work similarly to Chrome's
heap snapshot tool or Unity's memory profiler.
2025-07-08 16:39:24 +02:00
lawnjelly 14a814586a Provide quick access to Object ancestry 2025-06-23 07:11:11 +01:00