Commit Graph

83 Commits

Author SHA1 Message Date
9e9ac9f6ad Merge pull request #46476 from DarknessCatt/master
Add fill method to Arrays and PackedArrays
2021-04-28 16:52:31 +02:00
305b2a15bf Merge pull request #48239 from akien-mga/goodbye-copymem
Core: Drop custom `copymem`/`zeromem` defines
2021-04-28 11:04:05 +02:00
a2c419bdc9 Raise error if Resource is of wrong type as function argument 2021-04-27 21:24:08 +02:00
8247667a3e Core: Drop custom copymem/zeromem defines
We've been using standard C library functions `memcpy`/`memset` for these since
2016 with 67f65f6639.

There was still the possibility for third-party platform ports to override the
definitions with a custom header, but this doesn't seem useful anymore.
2021-04-27 16:26:27 +02:00
efd27a63c1 Add fill method to Arrays and PackedArrays 2021-04-21 11:33:53 -03:00
a6c5938909 Remove return value type adjust of builtin method calls
Make calls faster with the caveat that the caller needs to make sure
that the return value type is already correct.
2021-04-16 12:04:34 -03:00
026b8497d1 Fix PackedFloat32Array get index not working 2021-04-12 23:33:06 +02:00
e67c63108b Add marshalling to PackedByteArray
-Decode/Encode functions for u8,s8,u16,s16,u32,s32,u64,s64,half,float,double,variant
-Improved binder template to allow this

Given in Godot 4.0 PackedByteArray is passed as reference, it is now possible to have these functions there, which makes the most sense.
2021-04-10 13:09:22 -03:00
d83761ba80 Style: Apply clang-tidy's readability-braces-around-statements 2021-04-05 14:09:59 +02:00
4b6e9f3157 Merge pull request #46991 from madmiraal/rename-invert-reverse
Rename Array.invert() to Array.reverse()
2021-04-01 13:32:22 +02:00
aba03110ba Merge pull request #46830 from vnen/gdscript-typed-arrays
GDScript typed arrays
2021-03-29 16:47:38 +02:00
755c70b871 Rename Array.invert() to Array.reverse()
Does the same internally for List and Vector<>, which includes all
PackedArray types.
2021-03-21 10:20:08 +00:00
affe3c817a Use real_t in GridMap and VariantParser 2021-03-19 00:56:34 -04:00
997a8ae9e8 Make Variant setget use set() method of Array
This ensure that typed arrays are properly checked when setting an
element.

Moved the macro to a straight declaration since the macro was only used
for Array and it now is quite specific to the Array class.
2021-03-18 10:18:59 -03:00
fbfdd5e110 Add functions to retrieve type of a typed Array 2021-03-18 10:18:58 -03:00
497dab94be Don't check type when assigning Array
The array should just assimilate the type of the other one since
assignment in this case means a change in the reference.

This also adds a `typed_assign` function for the cases where type
validation is wanted.
2021-03-18 10:18:58 -03:00
224f5cab99 Merge pull request #46378 from reduz/static-method-in-variant-types
Add static method support to core Variant types
2021-03-16 15:44:04 +01:00
ecfa570ccb Add static method support to core Variant types
* Properly exposed, including validated and variant call
* Bound static functions in String and Color
* Did not add support for scripting languages, will have to be added manually.
2021-03-16 10:53:05 -03:00
91181c2086 Fixes small typos and grammar correction 2021-03-12 19:05:16 +05:30
83b1acdc60 Merge pull request #45545 from abaire/relaxes_gltf_name_sanitization
Relaxes node name sanitization in gltf documents.
2021-03-09 14:54:33 +01:00
6985967c3b Add missing ERR_FAIL_INDEX check to Variant::construct
Other functions in the same file validate parameters using the ERR_FAIL
macros. This validation was missing for Variant::construct resulting in
a crash when called with invalid data (p_type < 0).

fix #46067
2021-03-04 18:50:37 +01:00
61cc1c8624 Relaxes Node naming constraints in glTF documents to match the Editor. 2021-02-24 08:22:27 -08:00
f1088e1b70 Bind ClockDirection enum
It's the only enum in math_defs.h not bound, and it's used by Plane.
2021-02-23 13:56:28 -03:00
7d9ad2b845 Use Vector3.UP as a default value for look_at's up vector 2021-02-16 18:33:23 -05:00
2c71ff1119 Added signed_angle_to for Vector3 2021-02-16 05:07:33 -05:00
fb83d905da Change sort_custom/bsearch_custom to use Callables 2021-02-04 14:37:52 +01:00
f55445079a Replace ColorN and from HTML with a string constructor 2021-02-01 17:27:19 -05:00
e829b7aee4 Unify URI encoding/decoding and add to C#
http_escape and percent_encode have been unified into uri_encode, and http_unescape and percent_decode have been unified into uri_decode.
2021-01-28 07:45:01 -05:00
a3e3bf8227 Make hex_to_int and bin_to_int handle the prefix automatically
Also add BinToInt to C#
2021-01-28 07:43:53 -05:00
976e768e71 Merge pull request #45489 from aaronfranke/core
Type consistencies in core
2021-01-27 21:16:20 +01:00
1be0d6b30e Type consistencies in core 2021-01-26 13:04:22 -05:00
38a5d22079 Renamed String.ord_at to unicode_at 2021-01-26 20:36:12 +03:00
8b983bddfb Remove Quat set methods in favour of constructors 2021-01-26 06:52:04 +00:00
f6be114d02 Merge pull request #44427 from briansemrau/fix-variant-bitand-validated-eval
Fix bitwise-and eval not updating return type
2021-01-11 13:53:27 +01:00
eea3287c2d Merge pull request #44661 from AndreaCatania/AndreaCatania-patch-5
Fixes: GDscript min and max are inverted
2021-01-05 13:42:08 +01:00
b5334d14f7 Update copyright statements to 2021
Happy new year to the wonderful Godot community!

2020 has been a tough year for most of us personally, but a good year for
Godot development nonetheless with a huge amount of work done towards Godot
4.0 and great improvements backported to the long-lived 3.2 branch.

We've had close to 400 contributors to engine code this year, authoring near
7,000 commit! (And that's only for the `master` branch and for the engine code,
there's a lot more when counting docs, demos and other first-party repos.)

Here's to a great year 2021 for all Godot users 🎆
2021-01-01 20:19:21 +01:00
6cebb8c117 Merge pull request #44586 from madmiraal/rename-stepify
Rename Math::stepify to snapped
2020-12-28 21:46:43 +01:00
058f3fe069 Merge pull request #44149 from madmiraal/rename-tangent-orthogonal
Rename Vector2.tangent() to Vector2.orthogonal()
2020-12-28 16:00:12 +01:00
b743a2ef3c Rename Math::stepify to snapped 2020-12-28 13:01:30 +00:00
b628912af0 Rename Rect2 and Rect2i grow_margin() to grow_side() 2020-12-28 12:47:33 +00:00
5b937d493f Rename empty() to is_empty() 2020-12-28 10:39:56 +00:00
d66a58a4d4 Add helper count function to Variant
To get counts of items before getting the list, which is useful for
GDNative so users can pre-allocate the buffer with the correct size
without having to get the list twice.
2020-12-27 11:14:29 -03:00
7c6506e028 Fixes: GDscript min and max are inverted 2020-12-24 18:03:50 +01:00
4b8b803931 Rename Control margin to offset 2020-12-23 06:25:56 +00:00
6532596d97 Merge pull request #44472 from winterpixelgames/PR-duplicate-packedarrays
Add support for duplicate() for Packed*Array, and they are pass by ref in godot 4.0
2020-12-21 17:30:01 +01:00
2df9a8ccad Rename Rect2 and Rect2i clip() to intersection() 2020-12-19 12:59:08 +00:00
2d56e09276 packed*arrays are pass by ref now. support duplicate and update documentation 2020-12-17 16:09:32 -06:00
1b745c7bae Fix crash parsing a serialized Reference 2020-12-17 12:24:57 +01:00
bb4d44102d Fix bitwise-and eval not updating return type 2020-12-16 08:59:06 -05:00
cb42bf113c Merge pull request #44406 from vnen/variant-ptr-construct
Add PtrConstruct template to use in Variant constructors
2020-12-15 22:59:32 +01:00