From 78b63203d437c84802a13d558201f78bfefb823f Mon Sep 17 00:00:00 2001 From: Chris Cranford Date: Tue, 18 Jun 2024 20:18:30 -0400 Subject: [PATCH] Add missing enum & ctor for PackedVector4Array implementation --- include/godot_cpp/variant/variant.hpp | 3 +++ src/variant/variant.cpp | 8 ++++++++ 2 files changed, 11 insertions(+) diff --git a/include/godot_cpp/variant/variant.hpp b/include/godot_cpp/variant/variant.hpp index 5b09a15e..b0d57fbb 100644 --- a/include/godot_cpp/variant/variant.hpp +++ b/include/godot_cpp/variant/variant.hpp @@ -100,6 +100,7 @@ public: PACKED_VECTOR2_ARRAY, PACKED_VECTOR3_ARRAY, PACKED_COLOR_ARRAY, + PACKED_VECTOR4_ARRAY, VARIANT_MAX }; @@ -212,6 +213,7 @@ public: Variant(const PackedVector2Array &v); Variant(const PackedVector3Array &v); Variant(const PackedColorArray &v); + Variant(const PackedVector4Array &v); ~Variant(); operator bool() const; @@ -260,6 +262,7 @@ public: operator PackedVector2Array() const; operator PackedVector3Array() const; operator PackedColorArray() const; + operator PackedVector4Array() const; Variant &operator=(const Variant &other); Variant &operator=(Variant &&other); diff --git a/src/variant/variant.cpp b/src/variant/variant.cpp index 161362b2..e2ed8ba8 100644 --- a/src/variant/variant.cpp +++ b/src/variant/variant.cpp @@ -248,6 +248,10 @@ Variant::Variant(const PackedColorArray &v) { from_type_constructor[PACKED_COLOR_ARRAY](_native_ptr(), v._native_ptr()); } +Variant::Variant(const PackedVector4Array &v) { + from_type_constructor[PACKED_VECTOR4_ARRAY](_native_ptr(), v._native_ptr()); +} + Variant::~Variant() { internal::gdextension_interface_variant_destroy(_native_ptr()); } @@ -506,6 +510,10 @@ Variant::operator PackedColorArray() const { return PackedColorArray(this); } +Variant::operator PackedVector4Array() const { + return PackedVector4Array(this); +} + Variant &Variant::operator=(const Variant &other) { clear(); internal::gdextension_interface_variant_new_copy(_native_ptr(), other._native_ptr());