diff options
Diffstat (limited to 'core/variant.cpp')
-rw-r--r-- | core/variant.cpp | 340 |
1 files changed, 170 insertions, 170 deletions
diff --git a/core/variant.cpp b/core/variant.cpp index 69160fffa7..4ab46edf75 100644 --- a/core/variant.cpp +++ b/core/variant.cpp @@ -74,9 +74,9 @@ String Variant::get_type_name(Variant::Type p_type) { return "Rect2"; } break; - case MATRIX32: { + case TRANSFORM2D: { - return "Matrix32"; + return "Transform2D"; } break; case VECTOR3: { @@ -92,18 +92,18 @@ String Variant::get_type_name(Variant::Type p_type) { } break;*/ - case _AABB: { + case RECT3: { - return "AABB"; + return "Rect3"; } break; case QUAT: { return "Quat"; } break; - case MATRIX3: { + case BASIS: { - return "Matrix3"; + return "Basis"; } break; case TRANSFORM: { @@ -153,38 +153,38 @@ String Variant::get_type_name(Variant::Type p_type) { } break; // arrays - case RAW_ARRAY: { + case POOL_BYTE_ARRAY: { - return "RawArray"; + return "PoolByteArray"; } break; - case INT_ARRAY: { + case POOL_INT_ARRAY: { - return "IntArray"; + return "PoolIntArray"; } break; - case REAL_ARRAY: { + case POOL_REAL_ARRAY: { - return "RealArray"; + return "PoolFloatArray"; } break; - case STRING_ARRAY: { + case POOL_STRING_ARRAY: { - return "StringArray"; + return "PoolStringArray"; } break; - case VECTOR2_ARRAY: { + case POOL_VECTOR2_ARRAY: { - return "Vector2Array"; + return "PoolVector2Array"; } break; - case VECTOR3_ARRAY: { + case POOL_VECTOR3_ARRAY: { - return "Vector3Array"; + return "PoolVector3Array"; } break; - case COLOR_ARRAY: { + case POOL_COLOR_ARRAY: { - return "ColorArray"; + return "PoolColorArray"; } break; default: {} @@ -255,7 +255,7 @@ bool Variant::can_convert(Variant::Type p_type_from,Variant::Type p_type_to) { invalid_types=invalid; } break; - case MATRIX32: { + case TRANSFORM2D: { static const Type valid[]={ @@ -268,14 +268,14 @@ bool Variant::can_convert(Variant::Type p_type_from,Variant::Type p_type_to) { case QUAT: { static const Type valid[]={ - MATRIX3, + BASIS, NIL }; valid_types=valid; } break; - case MATRIX3: { + case BASIS: { static const Type valid[]={ QUAT, @@ -289,9 +289,9 @@ bool Variant::can_convert(Variant::Type p_type_from,Variant::Type p_type_to) { case TRANSFORM: { static const Type valid[]={ - MATRIX32, + TRANSFORM2D, QUAT, - MATRIX3, + BASIS, NIL }; @@ -341,20 +341,20 @@ bool Variant::can_convert(Variant::Type p_type_from,Variant::Type p_type_to) { static const Type valid[]={ - RAW_ARRAY, - INT_ARRAY, - STRING_ARRAY, - REAL_ARRAY, - COLOR_ARRAY, - VECTOR2_ARRAY, - VECTOR3_ARRAY, + POOL_BYTE_ARRAY, + POOL_INT_ARRAY, + POOL_STRING_ARRAY, + POOL_REAL_ARRAY, + POOL_COLOR_ARRAY, + POOL_VECTOR2_ARRAY, + POOL_VECTOR3_ARRAY, NIL }; valid_types=valid; } break; // arrays - case RAW_ARRAY: { + case POOL_BYTE_ARRAY: { static const Type valid[]={ ARRAY, @@ -363,7 +363,7 @@ bool Variant::can_convert(Variant::Type p_type_from,Variant::Type p_type_to) { valid_types=valid; } break; - case INT_ARRAY: { + case POOL_INT_ARRAY: { static const Type valid[]={ ARRAY, @@ -371,7 +371,7 @@ bool Variant::can_convert(Variant::Type p_type_from,Variant::Type p_type_to) { }; valid_types=valid; } break; - case REAL_ARRAY: { + case POOL_REAL_ARRAY: { static const Type valid[]={ ARRAY, @@ -380,7 +380,7 @@ bool Variant::can_convert(Variant::Type p_type_from,Variant::Type p_type_to) { valid_types=valid; } break; - case STRING_ARRAY: { + case POOL_STRING_ARRAY: { static const Type valid[]={ ARRAY, @@ -388,7 +388,7 @@ bool Variant::can_convert(Variant::Type p_type_from,Variant::Type p_type_to) { }; valid_types=valid; } break; - case VECTOR2_ARRAY: { + case POOL_VECTOR2_ARRAY: { static const Type valid[]={ ARRAY, @@ -397,7 +397,7 @@ bool Variant::can_convert(Variant::Type p_type_from,Variant::Type p_type_to) { valid_types=valid; } break; - case VECTOR3_ARRAY: { + case POOL_VECTOR3_ARRAY: { static const Type valid[]={ ARRAY, @@ -406,7 +406,7 @@ bool Variant::can_convert(Variant::Type p_type_from,Variant::Type p_type_to) { valid_types=valid; } break; - case COLOR_ARRAY: { + case POOL_COLOR_ARRAY: { static const Type valid[]={ ARRAY, @@ -507,7 +507,7 @@ bool Variant::can_convert_strict(Variant::Type p_type_from,Variant::Type p_type_ valid_types=valid; } break; - case MATRIX32: { + case TRANSFORM2D: { static const Type valid[]={ @@ -520,14 +520,14 @@ bool Variant::can_convert_strict(Variant::Type p_type_from,Variant::Type p_type_ case QUAT: { static const Type valid[]={ - MATRIX3, + BASIS, NIL }; valid_types=valid; } break; - case MATRIX3: { + case BASIS: { static const Type valid[]={ QUAT, @@ -541,9 +541,9 @@ bool Variant::can_convert_strict(Variant::Type p_type_from,Variant::Type p_type_ case TRANSFORM: { static const Type valid[]={ - MATRIX32, + TRANSFORM2D, QUAT, - MATRIX3, + BASIS, NIL }; @@ -593,20 +593,20 @@ bool Variant::can_convert_strict(Variant::Type p_type_from,Variant::Type p_type_ static const Type valid[]={ - RAW_ARRAY, - INT_ARRAY, - STRING_ARRAY, - REAL_ARRAY, - COLOR_ARRAY, - VECTOR2_ARRAY, - VECTOR3_ARRAY, + POOL_BYTE_ARRAY, + POOL_INT_ARRAY, + POOL_STRING_ARRAY, + POOL_REAL_ARRAY, + POOL_COLOR_ARRAY, + POOL_VECTOR2_ARRAY, + POOL_VECTOR3_ARRAY, NIL }; valid_types=valid; } break; // arrays - case RAW_ARRAY: { + case POOL_BYTE_ARRAY: { static const Type valid[]={ ARRAY, @@ -615,7 +615,7 @@ bool Variant::can_convert_strict(Variant::Type p_type_from,Variant::Type p_type_ valid_types=valid; } break; - case INT_ARRAY: { + case POOL_INT_ARRAY: { static const Type valid[]={ ARRAY, @@ -623,7 +623,7 @@ bool Variant::can_convert_strict(Variant::Type p_type_from,Variant::Type p_type_ }; valid_types=valid; } break; - case REAL_ARRAY: { + case POOL_REAL_ARRAY: { static const Type valid[]={ ARRAY, @@ -632,7 +632,7 @@ bool Variant::can_convert_strict(Variant::Type p_type_from,Variant::Type p_type_ valid_types=valid; } break; - case STRING_ARRAY: { + case POOL_STRING_ARRAY: { static const Type valid[]={ ARRAY, @@ -640,7 +640,7 @@ bool Variant::can_convert_strict(Variant::Type p_type_from,Variant::Type p_type_ }; valid_types=valid; } break; - case VECTOR2_ARRAY: { + case POOL_VECTOR2_ARRAY: { static const Type valid[]={ ARRAY, @@ -649,7 +649,7 @@ bool Variant::can_convert_strict(Variant::Type p_type_from,Variant::Type p_type_ valid_types=valid; } break; - case VECTOR3_ARRAY: { + case POOL_VECTOR3_ARRAY: { static const Type valid[]={ ARRAY, @@ -658,7 +658,7 @@ bool Variant::can_convert_strict(Variant::Type p_type_from,Variant::Type p_type_ valid_types=valid; } break; - case COLOR_ARRAY: { + case POOL_COLOR_ARRAY: { static const Type valid[]={ ARRAY, @@ -759,9 +759,9 @@ bool Variant::is_zero() const { return *reinterpret_cast<const Rect2*>(_data._mem)==Rect2(); } break; - case MATRIX32: { + case TRANSFORM2D: { - return *_data._matrix32==Matrix32(); + return *_data._transform2d==Transform2D(); } break; case VECTOR3: { @@ -779,18 +779,18 @@ bool Variant::is_zero() const { } break;*/ - case _AABB: { + case RECT3: { - return *_data._aabb==AABB(); + return *_data._rect3==Rect3(); } break; case QUAT: { return *reinterpret_cast<const Quat*>(_data._mem)==Quat(); } break; - case MATRIX3: { + case BASIS: { - return *_data._matrix3==Matrix3(); + return *_data._basis==Basis(); } break; case TRANSFORM: { @@ -840,37 +840,37 @@ bool Variant::is_zero() const { } break; // arrays - case RAW_ARRAY: { + case POOL_BYTE_ARRAY: { return reinterpret_cast<const PoolVector<uint8_t>*>(_data._mem)->size()==0; } break; - case INT_ARRAY: { + case POOL_INT_ARRAY: { return reinterpret_cast<const PoolVector<int>*>(_data._mem)->size()==0; } break; - case REAL_ARRAY: { + case POOL_REAL_ARRAY: { return reinterpret_cast<const PoolVector<real_t>*>(_data._mem)->size()==0; } break; - case STRING_ARRAY: { + case POOL_STRING_ARRAY: { return reinterpret_cast<const PoolVector<String>*>(_data._mem)->size()==0; } break; - case VECTOR2_ARRAY: { + case POOL_VECTOR2_ARRAY: { return reinterpret_cast<const PoolVector<Vector2>*>(_data._mem)->size()==0; } break; - case VECTOR3_ARRAY: { + case POOL_VECTOR3_ARRAY: { return reinterpret_cast<const PoolVector<Vector3>*>(_data._mem)->size()==0; } break; - case COLOR_ARRAY: { + case POOL_COLOR_ARRAY: { return reinterpret_cast<const PoolVector<Color>*>(_data._mem)->size()==0; @@ -987,9 +987,9 @@ void Variant::reference(const Variant& p_variant) { memnew_placement( _data._mem, Rect2( *reinterpret_cast<const Rect2*>(p_variant._data._mem) ) ); } break; - case MATRIX32: { + case TRANSFORM2D: { - _data._matrix32 = memnew( Matrix32( *p_variant._data._matrix32 ) ); + _data._transform2d = memnew( Transform2D( *p_variant._data._transform2d ) ); } break; case VECTOR3: { @@ -1007,18 +1007,18 @@ void Variant::reference(const Variant& p_variant) { } break;*/ - case _AABB: { + case RECT3: { - _data._aabb = memnew( AABB( *p_variant._data._aabb ) ); + _data._rect3 = memnew( Rect3( *p_variant._data._rect3 ) ); } break; case QUAT: { memnew_placement( _data._mem, Quat( *reinterpret_cast<const Quat*>(p_variant._data._mem) ) ); } break; - case MATRIX3: { + case BASIS: { - _data._matrix3 = memnew( Matrix3( *p_variant._data._matrix3 ) ); + _data._basis = memnew( Basis( *p_variant._data._basis ) ); } break; case TRANSFORM: { @@ -1068,37 +1068,37 @@ void Variant::reference(const Variant& p_variant) { } break; // arrays - case RAW_ARRAY: { + case POOL_BYTE_ARRAY: { memnew_placement( _data._mem, PoolVector<uint8_t> ( *reinterpret_cast<const PoolVector<uint8_t>*>(p_variant._data._mem) ) ); } break; - case INT_ARRAY: { + case POOL_INT_ARRAY: { memnew_placement( _data._mem, PoolVector<int> ( *reinterpret_cast<const PoolVector<int>*>(p_variant._data._mem) ) ); } break; - case REAL_ARRAY: { + case POOL_REAL_ARRAY: { memnew_placement( _data._mem, PoolVector<real_t> ( *reinterpret_cast<const PoolVector<real_t>*>(p_variant._data._mem) ) ); } break; - case STRING_ARRAY: { + case POOL_STRING_ARRAY: { memnew_placement( _data._mem, PoolVector<String> ( *reinterpret_cast<const PoolVector<String>*>(p_variant._data._mem) ) ); } break; - case VECTOR2_ARRAY: { + case POOL_VECTOR2_ARRAY: { memnew_placement( _data._mem, PoolVector<Vector2> ( *reinterpret_cast<const PoolVector<Vector2>*>(p_variant._data._mem) ) ); } break; - case VECTOR3_ARRAY: { + case POOL_VECTOR3_ARRAY: { memnew_placement( _data._mem, PoolVector<Vector3> ( *reinterpret_cast<const PoolVector<Vector3>*>(p_variant._data._mem) ) ); } break; - case COLOR_ARRAY: { + case POOL_COLOR_ARRAY: { memnew_placement( _data._mem, PoolVector<Color> ( *reinterpret_cast<const PoolVector<Color>*>(p_variant._data._mem) ) ); @@ -1139,19 +1139,19 @@ void Variant::clear() { VECTOR2, RECT2 */ - case MATRIX32: { + case TRANSFORM2D: { - memdelete( _data._matrix32 ); + memdelete( _data._transform2d ); } break; - case _AABB: { + case RECT3: { - memdelete( _data._aabb ); + memdelete( _data._rect3 ); } break; - case MATRIX3: { + case BASIS: { - memdelete( _data._matrix3 ); + memdelete( _data._basis ); } break; case TRANSFORM: { @@ -1196,37 +1196,37 @@ void Variant::clear() { } break; // arrays - case RAW_ARRAY: { + case POOL_BYTE_ARRAY: { reinterpret_cast< PoolVector<uint8_t>* >(_data._mem)->~PoolVector<uint8_t>(); } break; - case INT_ARRAY: { + case POOL_INT_ARRAY: { reinterpret_cast< PoolVector<int>* >(_data._mem)->~PoolVector<int>(); } break; - case REAL_ARRAY: { + case POOL_REAL_ARRAY: { reinterpret_cast< PoolVector<real_t>* >(_data._mem)->~PoolVector<real_t>(); } break; - case STRING_ARRAY: { + case POOL_STRING_ARRAY: { reinterpret_cast< PoolVector<String>* >(_data._mem)->~PoolVector<String>(); } break; - case VECTOR2_ARRAY: { + case POOL_VECTOR2_ARRAY: { reinterpret_cast< PoolVector<Vector2>* >(_data._mem)->~PoolVector<Vector2>(); } break; - case VECTOR3_ARRAY: { + case POOL_VECTOR3_ARRAY: { reinterpret_cast< PoolVector<Vector3>* >(_data._mem)->~PoolVector<Vector3>(); } break; - case COLOR_ARRAY: { + case POOL_COLOR_ARRAY: { reinterpret_cast< PoolVector<Color>* >(_data._mem)->~PoolVector<Color>(); @@ -1509,19 +1509,19 @@ Variant::operator String() const { case STRING: return *reinterpret_cast<const String*>(_data._mem); case VECTOR2: return "("+operator Vector2()+")"; case RECT2: return "("+operator Rect2()+")"; - case MATRIX32: { + case TRANSFORM2D: { - Matrix32 mat32 = operator Matrix32(); + Transform2D mat32 = operator Transform2D(); return "("+Variant(mat32.elements[0]).operator String()+", "+Variant(mat32.elements[1]).operator String()+", "+Variant(mat32.elements[2]).operator String()+")"; } break; case VECTOR3: return "("+operator Vector3()+")"; case PLANE: return operator Plane(); //case QUAT: - case _AABB: return operator AABB(); + case RECT3: return operator Rect3(); case QUAT: return "("+operator Quat()+")"; - case MATRIX3: { + case BASIS: { - Matrix3 mat3 = operator Matrix3(); + Basis mat3 = operator Basis(); String mtx("("); for (int i=0;i<3;i++) { @@ -1576,7 +1576,7 @@ Variant::operator String() const { return str; } break; - case VECTOR2_ARRAY: { + case POOL_VECTOR2_ARRAY: { PoolVector<Vector2> vec = operator PoolVector<Vector2>(); String str("["); @@ -1589,7 +1589,7 @@ Variant::operator String() const { str += "]"; return str; } break; - case VECTOR3_ARRAY: { + case POOL_VECTOR3_ARRAY: { PoolVector<Vector3> vec = operator PoolVector<Vector3>(); String str("["); @@ -1602,7 +1602,7 @@ Variant::operator String() const { str += "]"; return str; } break; - case STRING_ARRAY: { + case POOL_STRING_ARRAY: { PoolVector<String> vec = operator PoolVector<String>(); String str("["); @@ -1615,7 +1615,7 @@ Variant::operator String() const { str += "]"; return str; } break; - case INT_ARRAY: { + case POOL_INT_ARRAY: { PoolVector<int> vec = operator PoolVector<int>(); String str("["); @@ -1628,7 +1628,7 @@ Variant::operator String() const { str += "]"; return str; } break; - case REAL_ARRAY: { + case POOL_REAL_ARRAY: { PoolVector<real_t> vec = operator PoolVector<real_t>(); String str("["); @@ -1713,32 +1713,32 @@ Variant::operator Plane() const { return Plane(); } -Variant::operator AABB() const { +Variant::operator Rect3() const { - if (type==_AABB) - return *_data._aabb; + if (type==RECT3) + return *_data._rect3; else - return AABB(); + return Rect3(); } -Variant::operator Matrix3() const { +Variant::operator Basis() const { - if (type==MATRIX3) - return *_data._matrix3; + if (type==BASIS) + return *_data._basis; else if (type==QUAT) return *reinterpret_cast<const Quat*>(_data._mem); else if (type==TRANSFORM) return _data._transform->basis; else - return Matrix3(); + return Basis(); } Variant::operator Quat() const { if (type==QUAT) return *reinterpret_cast<const Quat*>(_data._mem); - else if (type==MATRIX3) - return *_data._matrix3; + else if (type==BASIS) + return *_data._basis; else if (type==TRANSFORM) return _data._transform->basis; else @@ -1751,21 +1751,21 @@ Variant::operator Transform() const { if (type==TRANSFORM) return *_data._transform; - else if (type==MATRIX3) - return Transform(*_data._matrix3,Vector3()); + else if (type==BASIS) + return Transform(*_data._basis,Vector3()); else if (type==QUAT) - return Transform(Matrix3(*reinterpret_cast<const Quat*>(_data._mem)),Vector3()); + return Transform(Basis(*reinterpret_cast<const Quat*>(_data._mem)),Vector3()); else return Transform(); } - Variant::operator Matrix32() const { + Variant::operator Transform2D() const { - if (type==MATRIX32) { - return *_data._matrix32; + if (type==TRANSFORM2D) { + return *_data._transform2d; } else if (type==TRANSFORM) { const Transform& t = *_data._transform;; - Matrix32 m; + Transform2D m; m.elements[0][0]=t.basis.elements[0][0]; m.elements[0][1]=t.basis.elements[1][0]; m.elements[1][0]=t.basis.elements[0][1]; @@ -1774,7 +1774,7 @@ Variant::operator Transform() const { m.elements[2][1]=t.origin[1]; return m; } else - return Matrix32(); + return Transform2D(); } @@ -1893,13 +1893,13 @@ inline DA _convert_array_from_variant(const Variant& p_variant) { case Variant::ARRAY: { return _convert_array<DA,Array >( p_variant.operator Array () ); } - case Variant::RAW_ARRAY: { return _convert_array<DA,PoolVector<uint8_t> >( p_variant.operator PoolVector<uint8_t> () ); } - case Variant::INT_ARRAY: { return _convert_array<DA,PoolVector<int> >( p_variant.operator PoolVector<int> () ); } - case Variant::REAL_ARRAY: { return _convert_array<DA,PoolVector<real_t> >( p_variant.operator PoolVector<real_t> () ); } - case Variant::STRING_ARRAY: { return _convert_array<DA,PoolVector<String> >( p_variant.operator PoolVector<String> () ); } - case Variant::VECTOR2_ARRAY: { return _convert_array<DA,PoolVector<Vector2> >( p_variant.operator PoolVector<Vector2> () ); } - case Variant::VECTOR3_ARRAY: { return _convert_array<DA,PoolVector<Vector3> >( p_variant.operator PoolVector<Vector3> () ); } - case Variant::COLOR_ARRAY: { return _convert_array<DA,PoolVector<Color> >( p_variant.operator PoolVector<Color>() ); } + case Variant::POOL_BYTE_ARRAY: { return _convert_array<DA,PoolVector<uint8_t> >( p_variant.operator PoolVector<uint8_t> () ); } + case Variant::POOL_INT_ARRAY: { return _convert_array<DA,PoolVector<int> >( p_variant.operator PoolVector<int> () ); } + case Variant::POOL_REAL_ARRAY: { return _convert_array<DA,PoolVector<real_t> >( p_variant.operator PoolVector<real_t> () ); } + case Variant::POOL_STRING_ARRAY: { return _convert_array<DA,PoolVector<String> >( p_variant.operator PoolVector<String> () ); } + case Variant::POOL_VECTOR2_ARRAY: { return _convert_array<DA,PoolVector<Vector2> >( p_variant.operator PoolVector<Vector2> () ); } + case Variant::POOL_VECTOR3_ARRAY: { return _convert_array<DA,PoolVector<Vector3> >( p_variant.operator PoolVector<Vector3> () ); } + case Variant::POOL_COLOR_ARRAY: { return _convert_array<DA,PoolVector<Color> >( p_variant.operator PoolVector<Color>() ); } default: { return DA(); } } @@ -1916,14 +1916,14 @@ Variant::operator Array() const { Variant::operator PoolVector<uint8_t>() const { - if (type==RAW_ARRAY) + if (type==POOL_BYTE_ARRAY) return *reinterpret_cast<const PoolVector<uint8_t>* >(_data._mem); else return _convert_array_from_variant<PoolVector<uint8_t> >(*this); } Variant::operator PoolVector<int>() const { - if (type==INT_ARRAY) + if (type==POOL_INT_ARRAY) return *reinterpret_cast<const PoolVector<int>* >(_data._mem); else return _convert_array_from_variant<PoolVector<int> >(*this); @@ -1931,7 +1931,7 @@ Variant::operator PoolVector<int>() const { } Variant::operator PoolVector<real_t>() const { - if (type==REAL_ARRAY) + if (type==POOL_REAL_ARRAY) return *reinterpret_cast<const PoolVector<real_t>* >(_data._mem); else return _convert_array_from_variant<PoolVector<real_t> >(*this); @@ -1940,7 +1940,7 @@ Variant::operator PoolVector<real_t>() const { Variant::operator PoolVector<String>() const { - if (type==STRING_ARRAY) + if (type==POOL_STRING_ARRAY) return *reinterpret_cast<const PoolVector<String>* >(_data._mem); else return _convert_array_from_variant<PoolVector<String> >(*this); @@ -1949,7 +1949,7 @@ Variant::operator PoolVector<String>() const { } Variant::operator PoolVector<Vector3>() const { - if (type==VECTOR3_ARRAY) + if (type==POOL_VECTOR3_ARRAY) return *reinterpret_cast<const PoolVector<Vector3>* >(_data._mem); else return _convert_array_from_variant<PoolVector<Vector3> >(*this); @@ -1958,7 +1958,7 @@ Variant::operator PoolVector<Vector3>() const { } Variant::operator PoolVector<Vector2>() const { - if (type==VECTOR2_ARRAY) + if (type==POOL_VECTOR2_ARRAY) return *reinterpret_cast<const PoolVector<Vector2>* >(_data._mem); else return _convert_array_from_variant<PoolVector<Vector2> >(*this); @@ -1968,7 +1968,7 @@ Variant::operator PoolVector<Vector2>() const { Variant::operator PoolVector<Color>() const { - if (type==COLOR_ARRAY) + if (type==POOL_COLOR_ARRAY) return *reinterpret_cast<const PoolVector<Color>* >(_data._mem); else return _convert_array_from_variant<PoolVector<Color> >(*this); @@ -2165,7 +2165,7 @@ Variant::operator Orientation() const { Variant::operator IP_Address() const { - if (type==REAL_ARRAY || type==INT_ARRAY || type==RAW_ARRAY) { + if (type==POOL_REAL_ARRAY || type==POOL_INT_ARRAY || type==POOL_BYTE_ARRAY) { PoolVector<int> addr=operator PoolVector<int>(); if (addr.size()==4) { @@ -2320,16 +2320,16 @@ Variant::Variant(const Plane& p_plane) { memnew_placement( _data._mem, Plane( p_plane ) ); } -Variant::Variant(const AABB& p_aabb) { +Variant::Variant(const Rect3& p_aabb) { - type=_AABB; - _data._aabb = memnew( AABB( p_aabb ) ); + type=RECT3; + _data._rect3 = memnew( Rect3( p_aabb ) ); } -Variant::Variant(const Matrix3& p_matrix) { +Variant::Variant(const Basis& p_matrix) { - type=MATRIX3; - _data._matrix3= memnew( Matrix3( p_matrix ) ); + type=BASIS; + _data._basis= memnew( Basis( p_matrix ) ); } @@ -2346,10 +2346,10 @@ Variant::Variant(const Transform& p_transform) { } -Variant::Variant(const Matrix32& p_transform) { +Variant::Variant(const Transform2D& p_transform) { - type=MATRIX32; - _data._matrix32 = memnew( Matrix32( p_transform ) ); + type=TRANSFORM2D; + _data._transform2d = memnew( Transform2D( p_transform ) ); } Variant::Variant(const Color& p_color) { @@ -2483,44 +2483,44 @@ Variant::Variant(const Vector<Vector2>& p_array) { Variant::Variant(const PoolVector<uint8_t>& p_raw_array) { - type=RAW_ARRAY; + type=POOL_BYTE_ARRAY; memnew_placement( _data._mem, PoolVector<uint8_t>(p_raw_array) ); } Variant::Variant(const PoolVector<int>& p_int_array) { - type=INT_ARRAY; + type=POOL_INT_ARRAY; memnew_placement( _data._mem, PoolVector<int>(p_int_array) ); } Variant::Variant(const PoolVector<real_t>& p_real_array) { - type=REAL_ARRAY; + type=POOL_REAL_ARRAY; memnew_placement( _data._mem, PoolVector<real_t>(p_real_array) ); } Variant::Variant(const PoolVector<String>& p_string_array) { - type=STRING_ARRAY; + type=POOL_STRING_ARRAY; memnew_placement( _data._mem, PoolVector<String>(p_string_array) ); } Variant::Variant(const PoolVector<Vector3>& p_vector3_array) { - type=VECTOR3_ARRAY; + type=POOL_VECTOR3_ARRAY; memnew_placement( _data._mem, PoolVector<Vector3>(p_vector3_array) ); } Variant::Variant(const PoolVector<Vector2>& p_vector2_array) { - type=VECTOR2_ARRAY; + type=POOL_VECTOR2_ARRAY; memnew_placement( _data._mem, PoolVector<Vector2>(p_vector2_array) ); } Variant::Variant(const PoolVector<Color>& p_color_array) { - type=COLOR_ARRAY; + type=POOL_COLOR_ARRAY; memnew_placement( _data._mem, PoolVector<Color>(p_color_array) ); } @@ -2700,13 +2700,13 @@ uint32_t Variant::hash() const { hash = hash_djb2_one_float(reinterpret_cast<const Rect2*>(_data._mem)->size.x,hash); return hash_djb2_one_float(reinterpret_cast<const Rect2*>(_data._mem)->size.y,hash); } break; - case MATRIX32: { + case TRANSFORM2D: { uint32_t hash = 5831; for(int i=0;i<3;i++) { for(int j=0;j<2;j++) { - hash = hash_djb2_one_float(_data._matrix32->elements[i][j],hash); + hash = hash_djb2_one_float(_data._transform2d->elements[i][j],hash); } } @@ -2731,13 +2731,13 @@ uint32_t Variant::hash() const { } break;*/ - case _AABB: { + case RECT3: { uint32_t hash = 5831; for(int i=0;i<3;i++) { - hash = hash_djb2_one_float(_data._aabb->pos[i],hash); - hash = hash_djb2_one_float(_data._aabb->size[i],hash); + hash = hash_djb2_one_float(_data._rect3->pos[i],hash); + hash = hash_djb2_one_float(_data._rect3->size[i],hash); } @@ -2752,13 +2752,13 @@ uint32_t Variant::hash() const { return hash_djb2_one_float(reinterpret_cast<const Quat*>(_data._mem)->w,hash); } break; - case MATRIX3: { + case BASIS: { uint32_t hash = 5831; for(int i=0;i<3;i++) { for(int j=0;j<3;j++) { - hash = hash_djb2_one_float(_data._matrix3->elements[i][j],hash); + hash = hash_djb2_one_float(_data._basis->elements[i][j],hash); } } @@ -2824,7 +2824,7 @@ uint32_t Variant::hash() const { return arr.hash(); } break; - case RAW_ARRAY: { + case POOL_BYTE_ARRAY: { const PoolVector<uint8_t>& arr = *reinterpret_cast<const PoolVector<uint8_t>* >(_data._mem); int len = arr.size(); @@ -2833,7 +2833,7 @@ uint32_t Variant::hash() const { return hash_djb2_buffer((uint8_t*)&r[0],len); } break; - case INT_ARRAY: { + case POOL_INT_ARRAY: { const PoolVector<int>& arr = *reinterpret_cast<const PoolVector<int>* >(_data._mem); int len = arr.size(); @@ -2842,7 +2842,7 @@ uint32_t Variant::hash() const { return hash_djb2_buffer((uint8_t*)&r[0],len*sizeof(int)); } break; - case REAL_ARRAY: { + case POOL_REAL_ARRAY: { const PoolVector<real_t>& arr = *reinterpret_cast<const PoolVector<real_t>* >(_data._mem); int len = arr.size(); @@ -2851,7 +2851,7 @@ uint32_t Variant::hash() const { return hash_djb2_buffer((uint8_t*)&r[0],len*sizeof(real_t)); } break; - case STRING_ARRAY: { + case POOL_STRING_ARRAY: { uint32_t hash=5831; const PoolVector<String>& arr = *reinterpret_cast<const PoolVector<String>* >(_data._mem); @@ -2864,7 +2864,7 @@ uint32_t Variant::hash() const { return hash; } break; - case VECTOR2_ARRAY: { + case POOL_VECTOR2_ARRAY: { uint32_t hash=5831; const PoolVector<Vector2>& arr = *reinterpret_cast<const PoolVector<Vector2>* >(_data._mem); @@ -2879,7 +2879,7 @@ uint32_t Variant::hash() const { return hash; } break; - case VECTOR3_ARRAY: { + case POOL_VECTOR3_ARRAY: { uint32_t hash=5831; const PoolVector<Vector3>& arr = *reinterpret_cast<const PoolVector<Vector3>* >(_data._mem); @@ -2895,7 +2895,7 @@ uint32_t Variant::hash() const { return hash; } break; - case COLOR_ARRAY: { + case POOL_COLOR_ARRAY: { uint32_t hash=5831; const PoolVector<Color>& arr = *reinterpret_cast<const PoolVector<Color>* >(_data._mem); |