1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-07 12:30:27 +00:00

Add PackedVector4Array Variant type

Co-authored-by: A Thousand Ships <96648715+AThousandShips@users.noreply.github.com>
Co-authored-by: Rémi Verschelde <rverschelde@gmail.com>
This commit is contained in:
K. S. Ernest (iFire) Lee
2024-04-08 07:51:34 -07:00
committed by Rémi Verschelde
parent b9e022302a
commit f9b488508c
79 changed files with 1037 additions and 89 deletions

View File

@@ -3030,6 +3030,7 @@ void GDScriptAnalyzer::reduce_call(GDScriptParser::CallNode *p_call, bool p_is_a
case Variant::PACKED_VECTOR2_ARRAY:
case Variant::PACKED_VECTOR3_ARRAY:
case Variant::PACKED_COLOR_ARRAY:
case Variant::PACKED_VECTOR4_ARRAY:
safe_to_fold = false;
break;
default:
@@ -4425,7 +4426,6 @@ void GDScriptAnalyzer::reduce_subscript(GDScriptParser::SubscriptNode *p_subscri
switch (base_type.builtin_type) {
// Expect int or real as index.
case Variant::PACKED_BYTE_ARRAY:
case Variant::PACKED_COLOR_ARRAY:
case Variant::PACKED_FLOAT32_ARRAY:
case Variant::PACKED_FLOAT64_ARRAY:
case Variant::PACKED_INT32_ARRAY:
@@ -4433,6 +4433,8 @@ void GDScriptAnalyzer::reduce_subscript(GDScriptParser::SubscriptNode *p_subscri
case Variant::PACKED_STRING_ARRAY:
case Variant::PACKED_VECTOR2_ARRAY:
case Variant::PACKED_VECTOR3_ARRAY:
case Variant::PACKED_COLOR_ARRAY:
case Variant::PACKED_VECTOR4_ARRAY:
case Variant::ARRAY:
case Variant::STRING:
error = index_type.builtin_type != Variant::INT && index_type.builtin_type != Variant::FLOAT;
@@ -4531,10 +4533,6 @@ void GDScriptAnalyzer::reduce_subscript(GDScriptParser::SubscriptNode *p_subscri
case Variant::QUATERNION:
result_type.builtin_type = Variant::FLOAT;
break;
// Return Color.
case Variant::PACKED_COLOR_ARRAY:
result_type.builtin_type = Variant::COLOR;
break;
// Return String.
case Variant::PACKED_STRING_ARRAY:
case Variant::STRING:
@@ -4556,6 +4554,14 @@ void GDScriptAnalyzer::reduce_subscript(GDScriptParser::SubscriptNode *p_subscri
case Variant::BASIS:
result_type.builtin_type = Variant::VECTOR3;
break;
// Return Color.
case Variant::PACKED_COLOR_ARRAY:
result_type.builtin_type = Variant::COLOR;
break;
// Return Vector4.
case Variant::PACKED_VECTOR4_ARRAY:
result_type.builtin_type = Variant::VECTOR4;
break;
// Depends on the index.
case Variant::TRANSFORM3D:
case Variant::PROJECTION: