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 /modules/gdscript | |
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 'modules/gdscript')
-rw-r--r-- | modules/gdscript/gd_editor.cpp | 4 | ||||
-rw-r--r-- | modules/gdscript/gd_functions.cpp | 18 | ||||
-rw-r--r-- | modules/gdscript/gd_script.h | 2 | ||||
-rw-r--r-- | modules/gdscript/gd_tokenizer.cpp | 21 |
4 files changed, 22 insertions, 23 deletions
diff --git a/modules/gdscript/gd_editor.cpp b/modules/gdscript/gd_editor.cpp index d3c3dac1fd..00b080190f 100644 --- a/modules/gdscript/gd_editor.cpp +++ b/modules/gdscript/gd_editor.cpp @@ -325,7 +325,7 @@ void GDScriptLanguage::get_public_constants(List<Pair<String,Variant> > *p_const p_constants->push_back(pi); } -String GDScriptLanguage::make_function(const String& p_class,const String& p_name,const StringArray& p_args) const { +String GDScriptLanguage::make_function(const String& p_class,const String& p_name,const PoolStringArray& p_args) const { String s="func "+p_name+"("; if (p_args.size()) { @@ -1393,7 +1393,7 @@ static void _find_identifiers(GDCompletionContext& context,int p_line,bool p_onl } static const char*_type_names[Variant::VARIANT_MAX]={ - "null","bool","int","float","String","Vector2","Rect2","Vector3","Matrix32","Plane","Quat","AABB","Matrix3","Transform", + "null","bool","int","float","String","Vector2","Rect2","Vector3","Transform2D","Plane","Quat","AABB","Basis","Transform", "Color","Image","NodePath","RID","Object","InputEvent","Dictionary","Array","RawArray","IntArray","FloatArray","StringArray", "Vector2Array","Vector3Array","ColorArray"}; diff --git a/modules/gdscript/gd_functions.cpp b/modules/gdscript/gd_functions.cpp index 64578e5f5c..bf73b14066 100644 --- a/modules/gdscript/gd_functions.cpp +++ b/modules/gdscript/gd_functions.cpp @@ -672,7 +672,7 @@ void GDFunctions::call(Function p_func,const Variant **p_args,int p_arg_count,Va case VAR_TO_BYTES: { VALIDATE_ARG_COUNT(1); - ByteArray barr; + PoolByteArray barr; int len; Error err = encode_variant(*p_args[0],NULL,len); if (err) { @@ -685,7 +685,7 @@ void GDFunctions::call(Function p_func,const Variant **p_args,int p_arg_count,Va barr.resize(len); { - ByteArray::Write w = barr.write(); + PoolByteArray::Write w = barr.write(); encode_variant(*p_args[0],w.ptr(),len); } @@ -693,24 +693,24 @@ void GDFunctions::call(Function p_func,const Variant **p_args,int p_arg_count,Va } break; case BYTES_TO_VAR: { VALIDATE_ARG_COUNT(1); - if (p_args[0]->get_type()!=Variant::RAW_ARRAY) { + if (p_args[0]->get_type()!=Variant::POOL_BYTE_ARRAY) { r_error.error=Variant::CallError::CALL_ERROR_INVALID_ARGUMENT; r_error.argument=0; - r_error.expected=Variant::RAW_ARRAY; + r_error.expected=Variant::POOL_BYTE_ARRAY; r_ret=Variant(); return; } - ByteArray varr=*p_args[0]; + PoolByteArray varr=*p_args[0]; Variant ret; { - ByteArray::Read r=varr.read(); + PoolByteArray::Read r=varr.read(); Error err = decode_variant(ret,r.ptr(),varr.size(),NULL); if (err!=OK) { r_ret=RTR("Not enough bytes for decoding bytes, or invalid format."); r_error.error=Variant::CallError::CALL_ERROR_INVALID_ARGUMENT; r_error.argument=0; - r_error.expected=Variant::RAW_ARRAY; + r_error.expected=Variant::POOL_BYTE_ARRAY; return; } @@ -1531,13 +1531,13 @@ MethodInfo GDFunctions::get_info(Function p_func) { } break; case VAR_TO_BYTES: { MethodInfo mi("var2bytes",PropertyInfo(Variant::NIL,"var")); - mi.return_val.type=Variant::RAW_ARRAY; + mi.return_val.type=Variant::POOL_BYTE_ARRAY; return mi; } break; case BYTES_TO_VAR: { - MethodInfo mi("bytes2var:Variant",PropertyInfo(Variant::RAW_ARRAY,"bytes")); + MethodInfo mi("bytes2var:Variant",PropertyInfo(Variant::POOL_BYTE_ARRAY,"bytes")); mi.return_val.type=Variant::NIL; return mi; } break; diff --git a/modules/gdscript/gd_script.h b/modules/gdscript/gd_script.h index dec191c01e..960b06f3ff 100644 --- a/modules/gdscript/gd_script.h +++ b/modules/gdscript/gd_script.h @@ -408,7 +408,7 @@ public: virtual Script *create_script() const; virtual bool has_named_classes() const; virtual int find_function(const String& p_function,const String& p_code) const; - virtual String make_function(const String& p_class,const String& p_name,const StringArray& p_args) const; + virtual String make_function(const String& p_class,const String& p_name,const PoolStringArray& p_args) const; virtual Error complete_code(const String& p_code, const String& p_base_path, Object*p_owner,List<String>* r_options,String& r_call_hint); #ifdef TOOLS_ENABLED virtual Error lookup_code(const String& p_code, const String& p_symbol, const String& p_base_path, Object*p_owner, LookupResult& r_result); diff --git a/modules/gdscript/gd_tokenizer.cpp b/modules/gdscript/gd_tokenizer.cpp index 2b306a92fc..30ac988295 100644 --- a/modules/gdscript/gd_tokenizer.cpp +++ b/modules/gdscript/gd_tokenizer.cpp @@ -788,13 +788,12 @@ void GDTokenizerText::_advance() { {Variant::STRING,"String"}, {Variant::VECTOR2,"Vector2"}, {Variant::RECT2,"Rect2"}, - {Variant::MATRIX32,"Matrix32"}, + {Variant::TRANSFORM2D,"Transform2D"}, {Variant::VECTOR3,"Vector3"}, - {Variant::_AABB,"AABB"}, - {Variant::_AABB,"Rect3"}, + {Variant::RECT3,"Rect3"}, {Variant::PLANE,"Plane"}, {Variant::QUAT,"Quat"}, - {Variant::MATRIX3,"Matrix3"}, + {Variant::BASIS,"Basis"}, {Variant::TRANSFORM,"Transform"}, {Variant::COLOR,"Color"}, {Variant::IMAGE,"Image"}, @@ -804,13 +803,13 @@ void GDTokenizerText::_advance() { {Variant::NODE_PATH,"NodePath"}, {Variant::DICTIONARY,"Dictionary"}, {Variant::ARRAY,"Array"}, - {Variant::RAW_ARRAY,"RawArray"}, - {Variant::INT_ARRAY,"IntArray"}, - {Variant::REAL_ARRAY,"FloatArray"}, - {Variant::STRING_ARRAY,"StringArray"}, - {Variant::VECTOR2_ARRAY,"Vector2Array"}, - {Variant::VECTOR3_ARRAY,"Vector3Array"}, - {Variant::COLOR_ARRAY,"ColorArray"}, + {Variant::POOL_BYTE_ARRAY,"PoolByteArray"}, + {Variant::POOL_INT_ARRAY,"PoolIntArray"}, + {Variant::POOL_REAL_ARRAY,"PoolFloatArray"}, + {Variant::POOL_STRING_ARRAY,"PoolStringArray"}, + {Variant::POOL_VECTOR2_ARRAY,"PoolVector2Array"}, + {Variant::POOL_VECTOR3_ARRAY,"PoolVector3Array"}, + {Variant::POOL_COLOR_ARRAY,"PoolColorArray"}, {Variant::VARIANT_MAX,NULL}, }; |