Merge pull request #13153 from CocosRobot/update_lua_bindings_1438424818

[ci skip][AUTO]: updating luabinding & jsbinding automatically
This commit is contained in:
pandamicro 2015-08-02 09:25:47 +08:00
commit 6cdde3e434
6 changed files with 99 additions and 0 deletions

View File

@ -86,6 +86,18 @@ Animation3D : function (
*/
jsb.Animate3D = {
/**
* @method setKeyFrameUserInfo
* @param {int} arg0
* @param {map_object} arg1
*/
setKeyFrameUserInfo : function (
int,
map
)
{
},
/**
* @method getSpeed
* @return {float}

View File

@ -278,6 +278,28 @@ void js_register_cocos2dx_3d_Animation3D(JSContext *cx, JS::HandleObject global)
JSClass *jsb_cocos2d_Animate3D_class;
JSObject *jsb_cocos2d_Animate3D_prototype;
bool js_cocos2dx_3d_Animate3D_setKeyFrameUserInfo(JSContext *cx, uint32_t argc, jsval *vp)
{
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
bool ok = true;
JS::RootedObject obj(cx, args.thisv().toObjectOrNull());
js_proxy_t *proxy = jsb_get_js_proxy(obj);
cocos2d::Animate3D* cobj = (cocos2d::Animate3D *)(proxy ? proxy->ptr : NULL);
JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_3d_Animate3D_setKeyFrameUserInfo : Invalid Native Object");
if (argc == 2) {
int arg0;
cocos2d::ValueMap arg1;
ok &= jsval_to_int32(cx, args.get(0), (int32_t *)&arg0);
ok &= jsval_to_ccvaluemap(cx, args.get(1), &arg1);
JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_3d_Animate3D_setKeyFrameUserInfo : Error processing arguments");
cobj->setKeyFrameUserInfo(arg0, arg1);
args.rval().setUndefined();
return true;
}
JS_ReportError(cx, "js_cocos2dx_3d_Animate3D_setKeyFrameUserInfo : wrong number of arguments: %d, was expecting %d", argc, 2);
return false;
}
bool js_cocos2dx_3d_Animate3D_getSpeed(JSContext *cx, uint32_t argc, jsval *vp)
{
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
@ -764,6 +786,7 @@ void js_register_cocos2dx_3d_Animate3D(JSContext *cx, JS::HandleObject global) {
};
static JSFunctionSpec funcs[] = {
JS_FN("setKeyFrameUserInfo", js_cocos2dx_3d_Animate3D_setKeyFrameUserInfo, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),
JS_FN("getSpeed", js_cocos2dx_3d_Animate3D_getSpeed, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),
JS_FN("setQuality", js_cocos2dx_3d_Animate3D_setQuality, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),
JS_FN("setWeight", js_cocos2dx_3d_Animate3D_setWeight, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),

View File

@ -26,6 +26,7 @@ bool js_cocos2dx_3d_Animate3D_constructor(JSContext *cx, uint32_t argc, jsval *v
void js_cocos2dx_3d_Animate3D_finalize(JSContext *cx, JSObject *obj);
void js_register_cocos2dx_3d_Animate3D(JSContext *cx, JS::HandleObject global);
void register_all_cocos2dx_3d(JSContext* cx, JS::HandleObject obj);
bool js_cocos2dx_3d_Animate3D_setKeyFrameUserInfo(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_3d_Animate3D_getSpeed(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_3d_Animate3D_setQuality(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_3d_Animate3D_setWeight(JSContext *cx, uint32_t argc, jsval *vp);

View File

@ -4,6 +4,14 @@
-- @extend ActionInterval
-- @parent_module cc
--------------------------------
--
-- @function [parent=#Animate3D] setKeyFrameUserInfo
-- @param self
-- @param #int keyFrame
-- @param #map_table userInfo
-- @return Animate3D#Animate3D self (return value: cc.Animate3D)
--------------------------------
-- get & set speed, negative speed means playing reverse
-- @function [parent=#Animate3D] getSpeed

View File

@ -268,6 +268,59 @@ int lua_register_cocos2dx_3d_Animation3D(lua_State* tolua_S)
return 1;
}
int lua_cocos2dx_3d_Animate3D_setKeyFrameUserInfo(lua_State* tolua_S)
{
int argc = 0;
cocos2d::Animate3D* cobj = nullptr;
bool ok = true;
#if COCOS2D_DEBUG >= 1
tolua_Error tolua_err;
#endif
#if COCOS2D_DEBUG >= 1
if (!tolua_isusertype(tolua_S,1,"cc.Animate3D",0,&tolua_err)) goto tolua_lerror;
#endif
cobj = (cocos2d::Animate3D*)tolua_tousertype(tolua_S,1,0);
#if COCOS2D_DEBUG >= 1
if (!cobj)
{
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_3d_Animate3D_setKeyFrameUserInfo'", nullptr);
return 0;
}
#endif
argc = lua_gettop(tolua_S)-1;
if (argc == 2)
{
int arg0;
cocos2d::ValueMap arg1;
ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "cc.Animate3D:setKeyFrameUserInfo");
ok &= luaval_to_ccvaluemap(tolua_S, 3, &arg1, "cc.Animate3D:setKeyFrameUserInfo");
if(!ok)
{
tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_3d_Animate3D_setKeyFrameUserInfo'", nullptr);
return 0;
}
cobj->setKeyFrameUserInfo(arg0, arg1);
lua_settop(tolua_S, 1);
return 1;
}
luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Animate3D:setKeyFrameUserInfo",argc, 2);
return 0;
#if COCOS2D_DEBUG >= 1
tolua_lerror:
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_3d_Animate3D_setKeyFrameUserInfo'.",&tolua_err);
#endif
return 0;
}
int lua_cocos2dx_3d_Animate3D_getSpeed(lua_State* tolua_S)
{
int argc = 0;
@ -1058,6 +1111,7 @@ int lua_register_cocos2dx_3d_Animate3D(lua_State* tolua_S)
tolua_beginmodule(tolua_S,"Animate3D");
tolua_function(tolua_S,"new",lua_cocos2dx_3d_Animate3D_constructor);
tolua_function(tolua_S,"setKeyFrameUserInfo",lua_cocos2dx_3d_Animate3D_setKeyFrameUserInfo);
tolua_function(tolua_S,"getSpeed",lua_cocos2dx_3d_Animate3D_getSpeed);
tolua_function(tolua_S,"setQuality",lua_cocos2dx_3d_Animate3D_setQuality);
tolua_function(tolua_S,"setWeight",lua_cocos2dx_3d_Animate3D_setWeight);

View File

@ -145,6 +145,7 @@ int register_all_cocos2dx_3d(lua_State* tolua_S);
#endif // __cocos2dx_3d_h__