diff options
Diffstat (limited to 'core/variant_call.cpp')
-rw-r--r-- | core/variant_call.cpp | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/core/variant_call.cpp b/core/variant_call.cpp index da6e602ccb..f66cce85c9 100644 --- a/core/variant_call.cpp +++ b/core/variant_call.cpp @@ -130,9 +130,9 @@ struct _VariantCall { StringName name; Variant::Type type; Arg() { type = Variant::NIL; } - Arg(Variant::Type p_type, const StringName &p_name) - : name(p_name), - type(p_type) { + Arg(Variant::Type p_type, const StringName &p_name) : + name(p_name), + type(p_type) { } }; @@ -360,6 +360,7 @@ struct _VariantCall { VCALL_LOCALMEM2R(Rect2, grow_margin); VCALL_LOCALMEM4R(Rect2, grow_individual); VCALL_LOCALMEM1R(Rect2, expand); + VCALL_LOCALMEM0R(Rect2, abs); VCALL_LOCALMEM0R(Vector3, min_axis); VCALL_LOCALMEM0R(Vector3, max_axis); @@ -437,6 +438,8 @@ struct _VariantCall { VCALL_LOCALMEM0R(Color, contrasted); VCALL_LOCALMEM2R(Color, linear_interpolate); VCALL_LOCALMEM1R(Color, blend); + VCALL_LOCALMEM1R(Color, lightened); + VCALL_LOCALMEM1R(Color, darkened); VCALL_LOCALMEM1R(Color, to_html); VCALL_LOCALMEM0R(RID, get_id); @@ -446,7 +449,8 @@ struct _VariantCall { VCALL_LOCALMEM1R(NodePath, get_name); VCALL_LOCALMEM0R(NodePath, get_subname_count); VCALL_LOCALMEM1R(NodePath, get_subname); - VCALL_LOCALMEM0R(NodePath, get_property); + VCALL_LOCALMEM0R(NodePath, get_concatenated_subnames); + VCALL_LOCALMEM0R(NodePath, get_as_property_path); VCALL_LOCALMEM0R(NodePath, is_empty); VCALL_LOCALMEM0R(Dictionary, size); @@ -496,7 +500,7 @@ struct _VariantCall { PoolByteArray::Read r = ba->read(); CharString cs; cs.resize(ba->size() + 1); - copymem(cs.ptr(), r.ptr(), ba->size()); + copymem(cs.ptrw(), r.ptr(), ba->size()); cs[ba->size()] = 0; s = cs.get_data(); @@ -899,11 +903,6 @@ struct _VariantCall { r_ret = Basis(p_args[0]->operator Vector3(), p_args[1]->operator real_t()); } - static void Basis_init3(Variant &r_ret, const Variant **p_args) { - - r_ret = Basis(p_args[0]->operator Vector3()); - } - static void Transform_init1(Variant &r_ret, const Variant **p_args) { Transform t; @@ -1528,6 +1527,7 @@ void register_variant_methods() { ADDFUNC2R(RECT2, RECT2, Rect2, grow_margin, INT, "margin", REAL, "by", varray()); ADDFUNC4R(RECT2, RECT2, Rect2, grow_individual, REAL, "left", REAL, "top", REAL, "right", REAL, " bottom", varray()); ADDFUNC1R(RECT2, RECT2, Rect2, expand, VECTOR2, "to", varray()); + ADDFUNC0R(RECT2, RECT2, Rect2, abs, varray()); ADDFUNC0R(VECTOR3, INT, Vector3, min_axis, varray()); ADDFUNC0R(VECTOR3, INT, Vector3, max_axis, varray()); @@ -1583,6 +1583,8 @@ void register_variant_methods() { ADDFUNC0R(COLOR, COLOR, Color, contrasted, varray()); ADDFUNC2R(COLOR, COLOR, Color, linear_interpolate, COLOR, "b", REAL, "t", varray()); ADDFUNC1R(COLOR, COLOR, Color, blend, COLOR, "over", varray()); + ADDFUNC1R(COLOR, COLOR, Color, lightened, REAL, "amount", varray()); + ADDFUNC1R(COLOR, COLOR, Color, darkened, REAL, "amount", varray()); ADDFUNC1R(COLOR, STRING, Color, to_html, BOOL, "with_alpha", varray(true)); ADDFUNC0R(_RID, INT, RID, get_id, varray()); @@ -1592,7 +1594,8 @@ void register_variant_methods() { ADDFUNC1R(NODE_PATH, STRING, NodePath, get_name, INT, "idx", varray()); ADDFUNC0R(NODE_PATH, INT, NodePath, get_subname_count, varray()); ADDFUNC1R(NODE_PATH, STRING, NodePath, get_subname, INT, "idx", varray()); - ADDFUNC0R(NODE_PATH, STRING, NodePath, get_property, varray()); + ADDFUNC0R(NODE_PATH, STRING, NodePath, get_concatenated_subnames, varray()); + ADDFUNC0R(NODE_PATH, NODE_PATH, NodePath, get_as_property_path, varray()); ADDFUNC0R(NODE_PATH, BOOL, NodePath, is_empty, varray()); ADDFUNC0R(DICTIONARY, INT, Dictionary, size, varray()); @@ -1799,7 +1802,6 @@ void register_variant_methods() { _VariantCall::add_constructor(_VariantCall::Basis_init1, Variant::BASIS, "x_axis", Variant::VECTOR3, "y_axis", Variant::VECTOR3, "z_axis", Variant::VECTOR3); _VariantCall::add_constructor(_VariantCall::Basis_init2, Variant::BASIS, "axis", Variant::VECTOR3, "phi", Variant::REAL); - _VariantCall::add_constructor(_VariantCall::Basis_init3, Variant::BASIS, "euler", Variant::VECTOR3); _VariantCall::add_constructor(_VariantCall::Transform_init1, Variant::TRANSFORM, "x_axis", Variant::VECTOR3, "y_axis", Variant::VECTOR3, "z_axis", Variant::VECTOR3, "origin", Variant::VECTOR3); _VariantCall::add_constructor(_VariantCall::Transform_init2, Variant::TRANSFORM, "basis", Variant::BASIS, "origin", Variant::VECTOR3); |