diff options
author | Rémi Verschelde <remi@verschelde.fr> | 2020-12-21 17:30:01 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-21 17:30:01 +0100 |
commit | 6532596d97d90474738283e0f2662719d10aaac0 (patch) | |
tree | cb39cd13521cae7b28c8e083a673ed52a9381274 /core/variant/variant_setget.cpp | |
parent | 0923494c78130d69ff6d53737c53e5b6cfc163a2 (diff) | |
parent | 2d56e092765affde1904e76fe912329db0e9eab6 (diff) | |
download | redot-engine-6532596d97d90474738283e0f2662719d10aaac0.tar.gz |
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
Diffstat (limited to 'core/variant/variant_setget.cpp')
-rw-r--r-- | core/variant/variant_setget.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/core/variant/variant_setget.cpp b/core/variant/variant_setget.cpp index cee7465205..28cf8ef967 100644 --- a/core/variant/variant_setget.cpp +++ b/core/variant/variant_setget.cpp @@ -2023,6 +2023,24 @@ Variant Variant::duplicate(bool deep) const { return operator Dictionary().duplicate(deep); case ARRAY: return operator Array().duplicate(deep); + case PACKED_BYTE_ARRAY: + return operator Vector<uint8_t>().duplicate(); + case PACKED_INT32_ARRAY: + return operator Vector<int32_t>().duplicate(); + case PACKED_INT64_ARRAY: + return operator Vector<int64_t>().duplicate(); + case PACKED_FLOAT32_ARRAY: + return operator Vector<float>().duplicate(); + case PACKED_FLOAT64_ARRAY: + return operator Vector<double>().duplicate(); + case PACKED_STRING_ARRAY: + return operator Vector<String>().duplicate(); + case PACKED_VECTOR2_ARRAY: + return operator Vector<Vector2>().duplicate(); + case PACKED_VECTOR3_ARRAY: + return operator Vector<Vector3>().duplicate(); + case PACKED_COLOR_ARRAY: + return operator Vector<Color>().duplicate(); default: return *this; } |