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

This commit is contained in:
Rémi Verschelde 2022-07-18 21:33:12 +02:00 committed by GitHub
commit 51e2c1990a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 13 deletions

View File

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