Browse Source

Merge pull request #63135 from aaronfranke/3.x-packing-pools

Rémi Verschelde 3 years ago
parent
commit
51e2c1990a
1 changed files with 7 additions and 13 deletions
  1. 7 13
      core/variant_parser.cpp

+ 7 - 13
core/variant_parser.cpp

@@ -1022,7 +1022,7 @@ Error VariantParser::parse_value(Token &token, Variant &value, Stream *p_stream,
 
 			value = ie;
 #endif
-		} else if (id == "PoolByteArray" || id == "ByteArray") {
+		} else if (id == "PoolByteArray" || id == "PackedByteArray" || id == "ByteArray") {
 			Vector<uint8_t> args;
 			Error err = _parse_construct<uint8_t>(p_stream, args, line, r_err_str);
 			if (err) {
@@ -1040,8 +1040,7 @@ Error VariantParser::parse_value(Token &token, Variant &value, Stream *p_stream,
 			}
 
 			value = arr;
-
-		} else if (id == "PoolIntArray" || id == "IntArray") {
+		} else if (id == "PoolIntArray" || id == "PackedInt32Array" || id == "PackedInt64Array" || id == "IntArray") {
 			Vector<int> args;
 			Error err = _parse_construct<int>(p_stream, args, line, r_err_str);
 			if (err) {
@@ -1059,8 +1058,7 @@ Error VariantParser::parse_value(Token &token, Variant &value, Stream *p_stream,
 			}
 
 			value = arr;
-
-		} else if (id == "PoolRealArray" || id == "FloatArray") {
+		} else if (id == "PoolRealArray" || id == "PackedFloat32Array" || id == "PackedFloat64Array" || id == "FloatArray") {
 			Vector<float> args;
 			Error err = _parse_construct<float>(p_stream, args, line, r_err_str);
 			if (err) {
@@ -1078,8 +1076,7 @@ Error VariantParser::parse_value(Token &token, Variant &value, Stream *p_stream,
 			}
 
 			value = arr;
-
-		} else if (id == "PoolStringArray" || id == "StringArray") {
+		} else if (id == "PoolStringArray" || id == "PackedStringArray" || id == "StringArray") {
 			get_token(p_stream, token, line, r_err_str);
 			if (token.type != TK_PARENTHESIS_OPEN) {
 				r_err_str = "Expected '('";
@@ -1125,8 +1122,7 @@ Error VariantParser::parse_value(Token &token, Variant &value, Stream *p_stream,
 			}
 
 			value = arr;
-
-		} else if (id == "PoolVector2Array" || id == "Vector2Array") {
+		} else if (id == "PoolVector2Array" || id == "PackedVector2Array" || id == "Vector2Array") {
 			Vector<float> args;
 			Error err = _parse_construct<float>(p_stream, args, line, r_err_str);
 			if (err) {
@@ -1144,8 +1140,7 @@ Error VariantParser::parse_value(Token &token, Variant &value, Stream *p_stream,
 			}
 
 			value = arr;
-
-		} else if (id == "PoolVector3Array" || id == "Vector3Array") {
+		} else if (id == "PoolVector3Array" || id == "PackedVector3Array" || id == "Vector3Array") {
 			Vector<float> args;
 			Error err = _parse_construct<float>(p_stream, args, line, r_err_str);
 			if (err) {
@@ -1163,8 +1158,7 @@ Error VariantParser::parse_value(Token &token, Variant &value, Stream *p_stream,
 			}
 
 			value = arr;
-
-		} else if (id == "PoolColorArray" || id == "ColorArray") {
+		} else if (id == "PoolColorArray" || id == "PackedColorArray" || id == "ColorArray") {
 			Vector<float> args;
 			Error err = _parse_construct<float>(p_stream, args, line, r_err_str);
 			if (err) {