Commit graph

547 commits

Author SHA1 Message Date
Yuri Sizov
3d04a22d7c
Merge pull request #79103 from AThousandShips/array_slice_range
Fix range error for `Array.slice`
2023-07-17 16:48:48 +02:00
Rémi Verschelde
0c1442f82a
Merge pull request #78551 from AThousandShips/call_rpc
Fix `rpc` calls with binds
2023-07-08 18:15:41 +02:00
Ninni Pipping
7752a0d8d1 Fix range error for Array.slice 2023-07-07 23:19:42 +02:00
Gabor Koncz
a2ede8c4da Fix GDVIRTUAL_NATIVE_PTR
This commit fixes the usage of GDExtensionPtr and GDExtensionConstPtr
in GDExtension by introducing the required VariantInternalAccessor
specializations.

Sponsored by Migeran (https://migeran.com)
2023-07-03 10:52:02 +02:00
Ninni Pipping
9159208ed1 Ensure RID, Callable, and Signal are stored as strings
Prevents parser errors in `.tscn` and `.tres` files where the assignment
would otherwise be empty.
2023-06-22 17:01:08 +02:00
Ninni Pipping
7d174c8dfe Fix rpc calls with binds 2023-06-22 11:07:53 +02:00
Rémi Verschelde
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
Rémi Verschelde
867ea7fe59
Merge pull request #74730 from MarioLiebisch/fix-74726
Fix read-only dictionaries adding missing keys
2023-06-19 21:38:38 +02:00
Rémi Verschelde
b8bf28e2b6
Merge pull request #75758 from Pylgos/fix-gdextension-variant-construction
Fix GDExtension Variant type conversion
2023-06-19 10:27:20 +02:00
Rémi Verschelde
1a62f1e4fc
Merge pull request #74741 from vnen/variant-not-for-everyone
Allow boolean operators for all Variant types
2023-06-18 16:28:10 +02:00
Aaron Franke
5654d40367
Don't use a const reference for the enum constructor in Variant 2023-06-11 15:13:05 -05:00
Pylgos
d7eb7108f0 Fix gdextension variant type conversion 2023-06-10 10:52:17 +09:00
David Snopek
77733faede Attempt to standardize Object ptrcall encoding on Object ** 2023-05-25 21:46:22 -05:00
Juan Linietsky
5fdc1232ef Add the ability to look-at in model-space.
This is a much simpler attempt to solve the same problem as #76060, but without breaking any compatibility.

* Adds a description of what model space is in the Vector3 enums (MODEL_* constants). This has the proper axes laid out for imported 3D assets.
* Adds the option to `look_at` using model_space, which uses Vector3.MODEL_FRONT as forward vector.

The attempt of this PR is to still break the assumption that there is a single direction of forward (which is not the case in Godot)
and make it easier to understand where 3D models are facing, as well as orienting them via look_at.
2023-05-24 10:10:24 +09:00
Emmanuel Leblond
e785dd9dd9
Improve user-friendliness of "return value as function param" pattern in GDExtension API
This commit introduce separate types (e.g. GDNativeStringPtr vs GDNativeUninitializedStringPtr)
depending on if the pointed data is already initialized (C++ style where constructor is alway
called when create a variable even if it is to be passed as return value) or not (C style).
On top of that, small changes has been made to `GDNativeInterface` so that it methods are
consistent on using uninitialized return value.
2023-05-15 17:14:57 +02:00
clayjohn
f83a90192f Revert "Add API for HSL conversion"
This reverts commit 0b7fd664c1.
2023-05-10 17:45:56 -03:00
Rémi Verschelde
0f444f101a
Merge pull request #76661 from bonjorno7/hsl
Add API for HSL conversion
2023-05-09 19:28:35 +02:00
Rémi Verschelde
5ade250c7d
Merge pull request #76735 from AThousandShips/natural_cmp
Add `naturalcasecmp_to` function to `String`
2023-05-09 17:44:37 +02:00
bonjorno7
0b7fd664c1 Add API for HSL conversion
Math ported pretty much 1:1 from https://en.wikipedia.org/wiki/HSL_and_HSV
Style doesn't match the existing HSV code exactly, but should be close enough.
2023-05-09 17:43:10 +02:00
Rémi Verschelde
491a437df5
Merge pull request #76540 from reduz/redo-remote-filesystem
Redo how the remote filesystem works
2023-05-08 13:52:51 +02:00
Rémi Verschelde
3e6a731904
Merge pull request #76418 from reduz/method-bind-validated-call
Add ValidatedCall to MethodBind
2023-05-08 13:52:42 +02:00
Juan Linietsky
273a6eeb66 Redo how the remote filesystem works
Instead of reading files over the network, the new version uses a local file cache and only updates files when it changes.

The original remote filesystem was created 14 years ago, when ethernet was faster than hard drives or even flash. Also, mobile devices have a very small amount of storage.
Nowadays, this is no longer the case so the approach is changed to using a persistent cache in the target device.

Co-authored-by: m4gr3d
2023-05-08 11:57:54 +02:00
Ninni Pipping
46a7018e3c Add naturalcasecmp_to function to String
Functions as a complement to `naturalnocasecmp_to`
2023-05-07 10:17:53 +02:00
Clay John
7a13cf9aeb
Merge pull request #75510 from SilicDev/string_erase
Reimplement `String.erase()` as immutable method
2023-05-05 10:03:49 -07:00
SilicDev
6fa4f71ca6 Reimplement String.erase 2023-05-04 00:52:35 +02:00
Juan Linietsky
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
Aaron Franke
290b09b36c
Expose determinant in Transform2D, rename internal method 2023-04-22 13:44:14 -05:00
Paweł
899da22002 Fix lerp error message 2023-04-21 10:01:59 +02:00
kleonc
7a871212ed Fix expected argument count in Callable call error text 2023-04-19 16:06:00 +02:00
Haoyu Qiu
6cd8e706fa Unify descriptions of vector methods
* is_equal_approx
* normalize
* length_squared
* posmod
* posmodv
2023-04-14 23:31:33 +08:00
Pedro J. Estébanez
33f674d0f7 Complete support of callables of static methods 2023-04-12 18:12:19 +02:00
bendn
ca0feabbb0
add hex_decode() to String 2023-04-05 19:44:00 +07:00
bruvzg
d72b563250
Add GDScript to_wchar_buffer and get_string_from_wchar functions. 2023-03-21 15:39:54 +02:00
Yuri Sizov
6f4646c6bf
Merge pull request #74909 from AThousandShips/array_slice
Fix `Array.slice()` rounding for `abs(step) != 1`
2023-03-15 14:25:16 +01:00
Ninni Pipping
10f385fb79 Fix Array.slice() rounding for abs(step) != 1 2023-03-14 15:46:45 +01:00
Ninni Pipping
c8c43997c7 Fix type check for max/min 2023-03-11 15:08:34 +01:00
Mario Liebisch
4e72e09343
Added the missing second case for string keys 2023-03-11 01:08:23 +01:00
George Marques
a1e3ef919c
Add operator NOT for all Variant types 2023-03-10 15:58:55 -03:00
Mario Liebisch
46e5311d5a
Fixed read-only dictionaries adding missing keys
When querying a non-existing key on a read-only
dictionary, the key was still added (albeit never set).

This fixes #74726.
2023-03-10 17:26:34 +01:00
Ninni Pipping
e6a9e0cdec Fix Variant hashing for floats
Incorrectly hashed floats as single precision
2023-03-08 12:52:50 +01:00
Rémi Verschelde
3863199ab9
Merge pull request #73881 from vnen/max-min-only-for-numbers
Make max() and min() global functions only accept numbers
2023-02-25 01:36:19 +01:00
Dmitrii Maganov
c5f7a89b0f Core: Identity compare objects by id, not by pointers 2023-02-24 23:33:29 +02:00
George Marques
ed81b165eb
Make max() and min() global functions only accept numbers
The behavior for those are not well defined for non-numeric arguments.
To avoid confusion the other types are forbidden.
2023-02-24 14:06:11 -03:00
mashumafi
2a12213c31 Fix: Typed arrays aren't working with + 2023-02-22 18:42:26 -05:00
Dmitrii Maganov
9cb2da89d6 GDScript: Fix usage of ints with typed array of floats 2023-02-13 22:06:38 +02:00
Rémi Verschelde
4a2c2170b4
Merge pull request #62921 from cdemirer/fix-variant-in
Fix `Variant::in()` error on invalid `evaluate`
2023-02-13 12:59:02 +01:00
cdemirer
44b2747dfd
Fix Variant::in() error on invalid evaluate 2023-02-13 12:37:41 +01:00
Gilles Roudière
a825f955ab Make sure Variant is not implicitely cast when using operator[]
Co-authored-by: Hein-Pieter van Braam-Stewart <hp@tmm.cx>
2023-02-13 10:50:22 +01:00
Dmitrii Maganov
8400308ab3 GDScript: Fix can_reference check for typed arrays 2023-02-06 22:00:16 +02:00
Rémi Verschelde
bbff9fd7a4
Merge pull request #71786 from raulsntos/dotnet/array
Sync C# Array with Core
2023-02-04 00:24:06 +01:00