From 13807c1292ea8956165e64c3595a4d3d1fccca2e Mon Sep 17 00:00:00 2001 From: Relintai Date: Sat, 20 Jan 2024 12:47:21 +0100 Subject: [PATCH] Fix smaller issues in variant op. --- sfw/object/variant_op.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/sfw/object/variant_op.cpp b/sfw/object/variant_op.cpp index a079c40..5b44f80 100644 --- a/sfw/object/variant_op.cpp +++ b/sfw/object/variant_op.cpp @@ -3244,7 +3244,11 @@ void Variant::set(const Variant &p_index, const Variant &p_value, bool *r_valid) DEFAULT_OP_DVECTOR_SET(POOL_REAL_ARRAY, real_t, p_value.type != Variant::REAL && p_value.type != Variant::INT) DEFAULT_OP_DVECTOR_SET(POOL_STRING_ARRAY, String, p_value.type != Variant::STRING) DEFAULT_OP_DVECTOR_SET(POOL_VECTOR2_ARRAY, Vector2, p_value.type != Variant::VECTOR2) // 25 + DEFAULT_OP_DVECTOR_SET(POOL_VECTOR2I_ARRAY, Vector2i, p_value.type != Variant::VECTOR2I) DEFAULT_OP_DVECTOR_SET(POOL_VECTOR3_ARRAY, Vector3, p_value.type != Variant::VECTOR3) + DEFAULT_OP_DVECTOR_SET(POOL_VECTOR3I_ARRAY, Vector3i, p_value.type != Variant::VECTOR3I) + DEFAULT_OP_DVECTOR_SET(POOL_VECTOR4_ARRAY, Vector4, p_value.type != Variant::VECTOR4) + DEFAULT_OP_DVECTOR_SET(POOL_VECTOR4I_ARRAY, Vector4i, p_value.type != Variant::VECTOR4I) DEFAULT_OP_DVECTOR_SET(POOL_COLOR_ARRAY, Color, p_value.type != Variant::COLOR) default: return; @@ -5058,7 +5062,7 @@ void Variant::blend(const Variant &a, const Variant &b, float c, Variant &r_dst) case RECT2I: { const Rect2i *ra = reinterpret_cast(a._data._mem); const Rect2i *rb = reinterpret_cast(b._data._mem); - r_dst = Rect2(ra->position + rb->position * c, ra->size + rb->size * c); + r_dst = Rect2i(ra->position + rb->position * c, ra->size + rb->size * c); } return; case VECTOR2: { @@ -5436,7 +5440,6 @@ void Variant::interpolate(const Variant &a, const Variant &b, float c, Variant & } return; case POOL_VECTOR4I_ARRAY: { - /* const PoolVector *arr_a = reinterpret_cast *>(a._data._mem); const PoolVector *arr_b = reinterpret_cast *>(b._data._mem); int sz = arr_a->size(); @@ -5451,12 +5454,12 @@ void Variant::interpolate(const Variant &a, const Variant &b, float c, Variant & PoolVector::Read br = arr_b->read(); for (int i = 0; i < sz; i++) { - vw[i] = ar[i].lerp(br[i], c); + vw[i] = ar[i].linear_interpolate(br[i], c); } } r_dst = v; } - */ + r_dst = a; } return;