Commit Graph

31 Commits

Author SHA1 Message Date
e14263f917 Remove empty constructors and destructors from core/ 2025-11-17 20:09:05 +01:00
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
96619d46a1 Use AncestralClass to speed up Object::cast_to when possible. 2025-09-22 13:21:51 +02:00
8a93218aab Core: Natively convert enum/BitField with Variant 2025-04-05 12:35:34 -05:00
Tom
8a3f9846c5 Add missing initializer_list constructor for TypedDictionary 2025-04-03 00:17:44 +01:00
8f6bb119f4 Merge pull request #100602 from KoBeWi/over_100_changes_in_50_random_files_aka_the_best_kind_of_PR
Add templated version of `ObjectDB::get_instance()`
2025-03-31 12:03:47 -05:00
bc9d0c7835 Add templated version of ObjectDB::get_instance() 2025-03-27 15:43:23 +01:00
28d6cf859a Add move semantics to Ref. 2025-03-26 15:23:38 +01:00
d9ef361d12 Core: Isolate Ref forward declare logic 2025-03-23 08:22:00 -05:00
4320800621 Core: Expand is_zero_constructible coverage 2025-03-17 11:45:26 -05:00
324512e11c Style: Replace header guards with #pragma once 2025-03-07 17:33:47 -06:00
d58b2e879f Get rid of easily removable uses of const_cast 2024-12-01 17:50:13 -08:00
cee0e6667a Refactor ref-counting code and fix ref counted releasing before aquiring 2024-09-21 11:36:58 -07:00
df29cc696f [Core] Optionally delete Ref nullptr comparisons
Adds an optional (default false) compile option to enable comparing
`Ref` to `nullptr` to ensure correct use, as well as future expandsion
for more general dev checks (enabled with `dev_mode`)
2024-09-12 11:26:49 +02:00
9903e6779b Enforce template syntax typename over class 2024-03-07 22:39:09 -06:00
b3cac9c092 Allow Ref instantiate to accept constructor args 2024-02-10 13:19:14 -06:00
893f889d74 [Core] Replace ERR_FAIL_COND with ERR_FAIL_NULL where applicable 2023-09-11 19:45:49 +02:00
77733faede Attempt to standardize Object ptrcall encoding on Object ** 2023-05-25 21:46:22 -05:00
56fc6316b7 Merge pull request #64789 from derammo/derammo_const_ref
Change Ref<T> to allow non const access to ptr
2023-05-17 11:25:13 +02:00
1c93606e47 Add ValidatedCall to MethodBind
* This should optimize GDScript function calling _enormously_.
* It also should simplify the GDScript VM considerably.

NOTE: GDExtension calling performance has most likely been affected until going via ptrcall is fixed.
2023-04-30 20:01:26 +02:00
d95794ec8a One Copyright Update to rule them all
As many open source projects have started doing it, we're removing the
current year from the copyright notice, so that we don't need to bump
it every year.

It seems like only the first year of publication is technically
relevant for copyright notices, and even that seems to be something
that many companies stopped listing altogether (in a version controlled
codebase, the commits are a much better source of date of publication
than a hardcoded copyright statement).

We also now list Godot Engine contributors first as we're collectively
the current maintainers of the project, and we clarify that the
"exclusive" copyright of the co-founders covers the timespan before
opensourcing (their further contributions are included as part of Godot
Engine contributors).

Also fixed "cf." Frenchism - it's meant as "refer to / see".
2023-01-05 13:25:55 +01:00
7502e1dc0d Improve logic around using Ref<T> with GDExtension virtual functions 2022-12-13 10:54:29 +11:00
474cee7daf Rename and expose RefCounted::get_reference_count() 2022-09-21 21:18:54 +01:00
65116a7e91 change Ref<T> to allow non const access to ptr
allows non-const T* to be taken from const Ref<T> directly
instead of using hacky workarounds such as copying it to
another Ref

this fixes methods with const Ref<T>& arguments not being
able to access non-const methods on contained T
2022-08-23 11:34:26 -04:00
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
f851c4aa33 Fix some issues found by cppcheck. 2022-04-06 14:34:37 +03:00
fe52458154 Update copyright statements to 2022
Happy new year to the wonderful Godot community!
2022-01-03 21:27:34 +01:00
3682978aee Replace BIND_VMETHOD by new GDVIRTUAL syntax
* New syntax is type safe.
* New syntax allows for type safe virtuals in native extensions.
* New syntax permits extremely fast calling.

Note: Everything was replaced where possible except for `_gui_input` `_input` and `_unhandled_input`.
These will require API rework on a separate PR as they work different than the rest of the functions.

Added a new method flag METHOD_FLAG_OBJECT_CORE, used internally. Allows to not dump the core virtuals like `_notification` to the json API, since each language will implement those as it is best fits.
2021-08-22 08:23:58 -03:00
b1d15c51bc Implement native extension system
* Deprecates GDNative in favor of a simpler, lower level interface.
* New extension system allows registering core engine classes.
* Simple header interface in gdnative_interace.h
2021-06-25 17:32:45 -03:00
e28fd07b2b Rename instance()->instantiate() when it's a verb 2021-06-19 20:49:18 -06:00
04688b92ff Rename Reference to RefCounted 2021-06-11 18:48:42 +02:00