From bb659fa875c24c5f708c70438d8bbd371a825e8b Mon Sep 17 00:00:00 2001 From: James McLean Date: Tue, 9 Jun 2015 10:55:23 -0400 Subject: Added rot/pos constructor for Matrix32 variant. --- core/variant_call.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'core/variant_call.cpp') diff --git a/core/variant_call.cpp b/core/variant_call.cpp index 2f7e0205dc..7dd0eb8a0c 100644 --- a/core/variant_call.cpp +++ b/core/variant_call.cpp @@ -750,6 +750,12 @@ static void _call_##m_type##_##m_method(Variant& r_ret,Variant& p_self,const Var r_ret=Rect2(*p_args[0],*p_args[1],*p_args[2],*p_args[3]); } + static void Matrix32_init2(Variant& r_ret,const Variant** p_args) { + + Matrix32 m(*p_args[0], *p_args[1]); + r_ret=m; + } + static void Matrix32_init3(Variant& r_ret,const Variant** p_args) { Matrix32 m; @@ -1544,6 +1550,7 @@ _VariantCall::addfunc(Variant::m_vtype,Variant::m_ret,_SCS(#m_method),VCALL(m_cl _VariantCall::add_constructor(_VariantCall::Rect2_init1,Variant::RECT2,"pos",Variant::VECTOR2,"size",Variant::VECTOR2); _VariantCall::add_constructor(_VariantCall::Rect2_init2,Variant::RECT2,"x",Variant::REAL,"y",Variant::REAL,"width",Variant::REAL,"height",Variant::REAL); + _VariantCall::add_constructor(_VariantCall::Matrix32_init2,Variant::MATRIX32,"rot",Variant::REAL,"pos",Variant::VECTOR2); _VariantCall::add_constructor(_VariantCall::Matrix32_init3,Variant::MATRIX32,"x_axis",Variant::VECTOR2,"y_axis",Variant::VECTOR2,"origin",Variant::VECTOR2); _VariantCall::add_constructor(_VariantCall::Vector3_init1,Variant::VECTOR3,"x",Variant::REAL,"y",Variant::REAL,"z",Variant::REAL); -- cgit v1.2.3 From e6fb0cf970639d70d8207bf888eaf02681ac159a Mon Sep 17 00:00:00 2001 From: Jaguar Date: Tue, 23 Jun 2015 16:24:48 -0400 Subject: Added helper methods to InputEvent --- core/variant_call.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'core/variant_call.cpp') diff --git a/core/variant_call.cpp b/core/variant_call.cpp index 7dd0eb8a0c..4cca3420a1 100644 --- a/core/variant_call.cpp +++ b/core/variant_call.cpp @@ -715,6 +715,8 @@ static void _call_##m_type##_##m_method(Variant& r_ret,Variant& p_self,const Var VCALL_PTR0R( InputEvent, is_pressed ); VCALL_PTR1R( InputEvent, is_action ); + VCALL_PTR1R( InputEvent, is_action_pressed ); + VCALL_PTR1R( InputEvent, is_action_released ); VCALL_PTR0R( InputEvent, is_echo ); VCALL_PTR2( InputEvent, set_as_action ); @@ -1540,6 +1542,8 @@ _VariantCall::addfunc(Variant::m_vtype,Variant::m_ret,_SCS(#m_method),VCALL(m_cl ADDFUNC0(INPUT_EVENT,BOOL,InputEvent,is_pressed,varray()); ADDFUNC1(INPUT_EVENT,BOOL,InputEvent,is_action,STRING,"action",varray()); + ADDFUNC1(INPUT_EVENT,BOOL,InputEvent,is_action_pressed,STRING,"is_action_pressed",varray()); + ADDFUNC1(INPUT_EVENT,BOOL,InputEvent,is_action_released,STRING,"is_action_released",varray()); ADDFUNC0(INPUT_EVENT,BOOL,InputEvent,is_echo,varray()); ADDFUNC2(INPUT_EVENT,NIL,InputEvent,set_as_action,STRING,"action",BOOL,"pressed",varray()); -- cgit v1.2.3