summaryrefslogtreecommitdiffstats
path: root/modules/gdscript/gdscript_analyzer.cpp
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2024-05-03 12:25:26 +0200
committerRémi Verschelde <rverschelde@gmail.com>2024-05-03 12:25:26 +0200
commit03e6fbb010c3546593bd91a0dabc045a9882705a (patch)
tree3fecc6c86700d555245a71ac2b6421c5296a3132 /modules/gdscript/gdscript_analyzer.cpp
parentd898f37e35ac4966fc7d54a009d05181fd3b232e (diff)
parentf9b488508ccc294db03d427c15c182864fae74de (diff)
downloadredot-engine-03e6fbb010c3546593bd91a0dabc045a9882705a.tar.gz
Merge pull request #85474 from fire/packedvector4array
Add `PackedVector4Array` Variant type
Diffstat (limited to 'modules/gdscript/gdscript_analyzer.cpp')
-rw-r--r--modules/gdscript/gdscript_analyzer.cpp16
1 files changed, 11 insertions, 5 deletions
diff --git a/modules/gdscript/gdscript_analyzer.cpp b/modules/gdscript/gdscript_analyzer.cpp
index ec20811385..279be65f03 100644
--- a/modules/gdscript/gdscript_analyzer.cpp
+++ b/modules/gdscript/gdscript_analyzer.cpp
@@ -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: