diff options
author | Juan Linietsky <reduzio@gmail.com> | 2017-01-11 00:52:51 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2017-01-11 00:52:51 -0300 |
commit | bc26f905817945300d397696330d1ab04a1af33c (patch) | |
tree | d06338399c8ea410042f6631fb3db3efcc100b05 /core/variant_parser.cpp | |
parent | 710692278d1353aad08bc7bceb655afc1d6c950c (diff) |
Type renames:
Matrix32 -> Transform2D
Matrix3 -> Basis
AABB -> Rect3
RawArray -> PoolByteArray
IntArray -> PoolIntArray
FloatArray -> PoolFloatArray
Vector2Array -> PoolVector2Array
Vector3Array -> PoolVector3Array
ColorArray -> PoolColorArray
Diffstat (limited to 'core/variant_parser.cpp')
-rw-r--r-- | core/variant_parser.cpp | 76 |
1 files changed, 38 insertions, 38 deletions
diff --git a/core/variant_parser.cpp b/core/variant_parser.cpp index 1a11eb80d5..402c8d41da 100644 --- a/core/variant_parser.cpp +++ b/core/variant_parser.cpp @@ -614,7 +614,7 @@ Error VariantParser::parse_value(Token& token,Variant &value,Stream *p_stream,in value=Vector3(args[0],args[1],args[2]); return OK; - } else if (id=="Matrix32"){ + } else if (id=="Transform2D" || id=="Matrix32"){ //compatibility Vector<float> args; Error err = _parse_construct<float>(p_stream,args,line,r_err_str); @@ -624,7 +624,7 @@ Error VariantParser::parse_value(Token& token,Variant &value,Stream *p_stream,in if (args.size()!=6) { r_err_str="Expected 6 arguments for constructor"; } - Matrix32 m; + Transform2D m; m[0]=Vector2(args[0],args[1]); m[1]=Vector2(args[2],args[3]); m[2]=Vector2(args[4],args[5]); @@ -657,7 +657,7 @@ Error VariantParser::parse_value(Token& token,Variant &value,Stream *p_stream,in value=Quat(args[0],args[1],args[2],args[3]); return OK; - } else if (id=="AABB"){ + } else if (id=="Rect3" || id=="AABB"){ Vector<float> args; Error err = _parse_construct<float>(p_stream,args,line,r_err_str); @@ -668,10 +668,10 @@ Error VariantParser::parse_value(Token& token,Variant &value,Stream *p_stream,in r_err_str="Expected 6 arguments for constructor"; } - value=AABB(Vector3(args[0],args[1],args[2]),Vector3(args[3],args[4],args[5])); + value=Rect3(Vector3(args[0],args[1],args[2]),Vector3(args[3],args[4],args[5])); return OK; - } else if (id=="Matrix3"){ + } else if (id=="Basis" || id=="Matrix3"){ //compatibility Vector<float> args; Error err = _parse_construct<float>(p_stream,args,line,r_err_str); @@ -682,7 +682,7 @@ Error VariantParser::parse_value(Token& token,Variant &value,Stream *p_stream,in r_err_str="Expected 9 arguments for constructor"; } - value=Matrix3(args[0],args[1],args[2],args[3],args[4],args[5],args[6],args[7],args[8]); + value=Basis(args[0],args[1],args[2],args[3],args[4],args[5],args[6],args[7],args[8]); return OK; } else if (id=="Transform"){ @@ -695,7 +695,7 @@ Error VariantParser::parse_value(Token& token,Variant &value,Stream *p_stream,in r_err_str="Expected 12 arguments for constructor"; } - value=Transform(Matrix3(args[0],args[1],args[2],args[3],args[4],args[5],args[6],args[7],args[8]),Vector3(args[9],args[10],args[11])); + value=Transform(Basis(args[0],args[1],args[2],args[3],args[4],args[5],args[6],args[7],args[8]),Vector3(args[9],args[10],args[11])); return OK; } else if (id=="Color") { @@ -1149,7 +1149,7 @@ Error VariantParser::parse_value(Token& token,Variant &value,Stream *p_stream,in return OK; - } else if (id=="ByteArray") { + } else if (id=="PoolByteArray"|| id=="ByteArray") { Vector<uint8_t> args; Error err = _parse_construct<uint8_t>(p_stream,args,line,r_err_str); @@ -1170,7 +1170,7 @@ Error VariantParser::parse_value(Token& token,Variant &value,Stream *p_stream,in return OK; - } else if (id=="IntArray") { + } else if (id=="PoolIntArray"|| id=="IntArray") { Vector<int> args; Error err = _parse_construct<int>(p_stream,args,line,r_err_str); @@ -1191,7 +1191,7 @@ Error VariantParser::parse_value(Token& token,Variant &value,Stream *p_stream,in return OK; - } else if (id=="FloatArray") { + } else if (id=="PoolFloatArray"|| id=="FloatArray") { Vector<float> args; Error err = _parse_construct<float>(p_stream,args,line,r_err_str); @@ -1211,7 +1211,7 @@ Error VariantParser::parse_value(Token& token,Variant &value,Stream *p_stream,in value=arr; return OK; - } else if (id=="StringArray") { + } else if (id=="PoolStringArray"|| id=="StringArray") { get_token(p_stream,token,line,r_err_str); @@ -1266,7 +1266,7 @@ Error VariantParser::parse_value(Token& token,Variant &value,Stream *p_stream,in return OK; - } else if (id=="Vector2Array") { + } else if (id=="PoolVector2Array"|| id=="Vector2Array") { Vector<float> args; Error err = _parse_construct<float>(p_stream,args,line,r_err_str); @@ -1287,7 +1287,7 @@ Error VariantParser::parse_value(Token& token,Variant &value,Stream *p_stream,in return OK; - } else if (id=="Vector3Array") { + } else if (id=="PoolVector3Array"|| id=="Vector3Array") { Vector<float> args; Error err = _parse_construct<float>(p_stream,args,line,r_err_str); @@ -1308,7 +1308,7 @@ Error VariantParser::parse_value(Token& token,Variant &value,Stream *p_stream,in return OK; - } else if (id=="ColorArray") { + } else if (id=="PoolColorArray"|| id=="ColorArray") { Vector<float> args; Error err = _parse_construct<float>(p_stream,args,line,r_err_str); @@ -1898,10 +1898,10 @@ Error VariantWriter::write(const Variant& p_variant, StoreStringFunc p_store_str p_store_string_func(p_store_string_ud,"Plane( "+rtosfix(p.normal.x) +", "+rtosfix(p.normal.y)+", "+rtosfix(p.normal.z)+", "+rtosfix(p.d)+" )" ); } break; - case Variant::_AABB: { + case Variant::RECT3: { - AABB aabb = p_variant; - p_store_string_func(p_store_string_ud,"AABB( "+rtosfix(aabb.pos.x) +", "+rtosfix(aabb.pos.y) +", "+rtosfix(aabb.pos.z) +", "+rtosfix(aabb.size.x) +", "+rtosfix(aabb.size.y) +", "+rtosfix(aabb.size.z)+" )" ); + Rect3 aabb = p_variant; + p_store_string_func(p_store_string_ud,"Rect3( "+rtosfix(aabb.pos.x) +", "+rtosfix(aabb.pos.y) +", "+rtosfix(aabb.pos.z) +", "+rtosfix(aabb.size.x) +", "+rtosfix(aabb.size.y) +", "+rtosfix(aabb.size.z)+" )" ); } break; case Variant::QUAT: { @@ -1910,10 +1910,10 @@ Error VariantWriter::write(const Variant& p_variant, StoreStringFunc p_store_str p_store_string_func(p_store_string_ud,"Quat( "+rtosfix(quat.x)+", "+rtosfix(quat.y)+", "+rtosfix(quat.z)+", "+rtosfix(quat.w)+" )"); } break; - case Variant::MATRIX32: { + case Variant::TRANSFORM2D: { - String s="Matrix32( "; - Matrix32 m3 = p_variant; + String s="Transform2D( "; + Transform2D m3 = p_variant; for (int i=0;i<3;i++) { for (int j=0;j<2;j++) { @@ -1926,10 +1926,10 @@ Error VariantWriter::write(const Variant& p_variant, StoreStringFunc p_store_str p_store_string_func(p_store_string_ud,s+" )"); } break; - case Variant::MATRIX3: { + case Variant::BASIS: { - String s="Matrix3( "; - Matrix3 m3 = p_variant; + String s="Basis( "; + Basis m3 = p_variant; for (int i=0;i<3;i++) { for (int j=0;j<3;j++) { @@ -1946,7 +1946,7 @@ Error VariantWriter::write(const Variant& p_variant, StoreStringFunc p_store_str String s="Transform( "; Transform t = p_variant; - Matrix3 &m3 = t.basis; + Basis &m3 = t.basis; for (int i=0;i<3;i++) { for (int j=0;j<3;j++) { @@ -2124,9 +2124,9 @@ Error VariantWriter::write(const Variant& p_variant, StoreStringFunc p_store_str } break; - case Variant::RAW_ARRAY: { + case Variant::POOL_BYTE_ARRAY: { - p_store_string_func(p_store_string_ud,"ByteArray( "); + p_store_string_func(p_store_string_ud,"PoolByteArray( "); String s; PoolVector<uint8_t> data = p_variant; int len = data.size(); @@ -2144,9 +2144,9 @@ Error VariantWriter::write(const Variant& p_variant, StoreStringFunc p_store_str p_store_string_func(p_store_string_ud," )"); } break; - case Variant::INT_ARRAY: { + case Variant::POOL_INT_ARRAY: { - p_store_string_func(p_store_string_ud,"IntArray( "); + p_store_string_func(p_store_string_ud,"PoolIntArray( "); PoolVector<int> data = p_variant; int len = data.size(); PoolVector<int>::Read r = data.read(); @@ -2164,9 +2164,9 @@ Error VariantWriter::write(const Variant& p_variant, StoreStringFunc p_store_str p_store_string_func(p_store_string_ud," )"); } break; - case Variant::REAL_ARRAY: { + case Variant::POOL_REAL_ARRAY: { - p_store_string_func(p_store_string_ud,"FloatArray( "); + p_store_string_func(p_store_string_ud,"PoolFloatArray( "); PoolVector<real_t> data = p_variant; int len = data.size(); PoolVector<real_t>::Read r = data.read(); @@ -2182,9 +2182,9 @@ Error VariantWriter::write(const Variant& p_variant, StoreStringFunc p_store_str p_store_string_func(p_store_string_ud," )"); } break; - case Variant::STRING_ARRAY: { + case Variant::POOL_STRING_ARRAY: { - p_store_string_func(p_store_string_ud,"StringArray( "); + p_store_string_func(p_store_string_ud,"PoolStringArray( "); PoolVector<String> data = p_variant; int len = data.size(); PoolVector<String>::Read r = data.read(); @@ -2205,9 +2205,9 @@ Error VariantWriter::write(const Variant& p_variant, StoreStringFunc p_store_str p_store_string_func(p_store_string_ud," )"); } break; - case Variant::VECTOR2_ARRAY: { + case Variant::POOL_VECTOR2_ARRAY: { - p_store_string_func(p_store_string_ud,"Vector2Array( "); + p_store_string_func(p_store_string_ud,"PoolVector2Array( "); PoolVector<Vector2> data = p_variant; int len = data.size(); PoolVector<Vector2>::Read r = data.read(); @@ -2223,9 +2223,9 @@ Error VariantWriter::write(const Variant& p_variant, StoreStringFunc p_store_str p_store_string_func(p_store_string_ud," )"); } break; - case Variant::VECTOR3_ARRAY: { + case Variant::POOL_VECTOR3_ARRAY: { - p_store_string_func(p_store_string_ud,"Vector3Array( "); + p_store_string_func(p_store_string_ud,"PoolVector3Array( "); PoolVector<Vector3> data = p_variant; int len = data.size(); PoolVector<Vector3>::Read r = data.read(); @@ -2241,9 +2241,9 @@ Error VariantWriter::write(const Variant& p_variant, StoreStringFunc p_store_str p_store_string_func(p_store_string_ud," )"); } break; - case Variant::COLOR_ARRAY: { + case Variant::POOL_COLOR_ARRAY: { - p_store_string_func(p_store_string_ud,"ColorArray( "); + p_store_string_func(p_store_string_ud,"PoolColorArray( "); PoolVector<Color> data = p_variant; int len = data.size(); |