Commit Graph

27 Commits

Author SHA1 Message Date
406b22d2d5 Delete VariantGetInternalPtr and VariantImplicitConvert.
Replace uses with `VariantInternalAccessor`.
2025-09-19 00:20:07 +02:00
75881f8322 Use initializer list in Arrays 2025-03-26 18:38:15 +01:00
324512e11c Style: Replace header guards with #pragma once 2025-03-07 17:33:47 -06:00
daa665c4cb fix copy/paste error (fixes #99518)
Replace erroneous use of `/` with `%`.
2024-11-22 13:21:02 -06:00
714357e55c Assign return value on Variant operator failure
Variant operators for String formatting and "in" could result in errors, which would return from validated_evaluate without assigning r_ret.  This would cause scripts using the return value from these operators to get results from previously run code.  Updated to return the original String value in the String formatting case, and false for "in" when an error occurs.
2024-09-19 11:22:35 -04:00
152d7c1bba Revert "Make freed object different than null in comparison operators"
This reverts commit 150b50cfcd.

As discussed with the GDScript team, this has some implications which aren't
fully consensual yet, and which we want to revisit.

For now we revert to the 4.2 behavior for the 4.3 release, to avoid breaking
user expectations.
2024-07-01 14:11:43 +02:00
413c11357d Use Core/Scene stringnames consistently 2024-05-13 23:41:07 +02:00
9903e6779b Enforce template syntax typename over class 2024-03-07 22:39:09 -06:00
ca19d34bde Merge pull request #73896 from vnen/object-null-boolean-consistency
Make freed object different than null in comparison operators
2023-12-16 17:49:05 +01:00
893f889d74 [Core] Replace ERR_FAIL_COND with ERR_FAIL_NULL where applicable 2023-09-11 19:45:49 +02:00
150b50cfcd Make freed object different than null in comparison operators
This is so everything is consistent, as a freed object is not equivalent
to `null` in general. The booleanization of a freed object still returns
`false` to work as an easy check for validity of objects. Similarly, the
negation of a freed object returns `true`.

Also makes freed objects different from each other (if they are not the
same reference).
2023-08-21 10:45:26 -03:00
510de82f43 Fix typo in modulo error message. 2023-08-01 04:47:18 -07:00
248e5245e4 Merge pull request #73540 from mashumafi/fix-typed-array-add
Fix: Typed arrays aren't working with +
2023-06-20 15:12:39 +02:00
a1e3ef919c Add operator NOT for all Variant types 2023-03-10 15:58:55 -03:00
2a12213c31 Fix: Typed arrays aren't working with + 2023-02-22 18:42:26 -05: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
e79be6ce07 Unify String and StringName 2022-12-05 21:46:47 -05:00
694ee1bf52 Fix suppressed error message on error when using % format string
Before, the valid flag would always be true. On formatting errors,
an error message is returned as the result. (No error prompts.)
2022-12-05 22:09:10 +08:00
455c06ecd4 Implement Vector4, Vector4i, Projection
Implement built-in classes Vector4, Vector4i and Projection.

* Two versions of Vector4 (float and integer).
* A Projection class, which is a 4x4 matrix specialized in projection types.

These types have been requested for a long time, but given they were very corner case they were not added before.
Because in Godot 4, reimplementing parts of the rendering engine is now possible, access to these types (heavily used by the rendering code) becomes a necessity.

**Q**: Why Projection and not Matrix4?
**A**: Godot does not use Matrix2, Matrix3, Matrix4x3, etc. naming convention because, within the engine, these types always have a *purpose*. As such, Godot names them: Transform2D, Transform3D or Basis. In this case, this 4x4 matrix is _always_ used as a _Projection_, hence the naming.
2022-07-23 14:00:01 +02:00
dbd7a31507 Implement exponential operator (**) to GDScript/Expressions 2022-05-11 16:30:37 +03:00
ff19feb8b8 Merge pull request #55939 from cdemirer/validated-array-add-fix
Fix validated version of array addition
2022-01-17 21:08:48 +01:00
fbe903909d Fix validated version of array addition 2022-01-18 03:00:39 +08:00
fe52458154 Update copyright statements to 2022
Happy new year to the wonderful Godot community!
2022-01-03 21:27:34 +01:00
13a2d03dde Add Variant in operator for any String/StringName operands
Allow using String or StringName types as operand in any position of the
`in` operator, which is more convenient in scripting when interacting
with data in the engine (such as a Node name).
2021-10-06 22:07:32 -03:00
221f5da857 Fix crash when dividing by 0 in Vector2/3i 2021-08-15 22:18:17 +02:00
0a823e85d2 Fix 'in' operator to check if an object member exists 2021-07-01 20:59:26 +02:00
2c81e5fa0e Make some variant internal functions public.
-Make constructors, ops and setget inline functions public
-Should help optimizing the GDScript VM
2021-06-17 19:59:28 -03:00