Skip to content

[ci skip][AUTO]: updating luabinding & jsbinding & cocos_file.json automatically #17857

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 23, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions cocos/scripting/js-bindings/auto/api/jsb_cocos2dx_auto_api.js
Original file line number Diff line number Diff line change
Expand Up @@ -2899,8 +2899,10 @@ getVisibleOrigin : function (

/**
* @method mainLoop
*/
mainLoop : function (
* @param {float} float
*/
mainLoop : function(
float
)
{
},
Expand Down
33 changes: 25 additions & 8 deletions cocos/scripting/js-bindings/auto/jsb_cocos2dx_auto.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7105,18 +7105,35 @@ bool js_cocos2dx_Director_getVisibleOrigin(JSContext *cx, uint32_t argc, jsval *
}
bool js_cocos2dx_Director_mainLoop(JSContext *cx, uint32_t argc, jsval *vp)
{
bool ok = true;
cocos2d::Director* cobj = nullptr;

JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
JS::RootedObject obj(cx, args.thisv().toObjectOrNull());
JS::RootedObject obj(cx);
obj.set(args.thisv().toObjectOrNull());
js_proxy_t *proxy = jsb_get_js_proxy(obj);
cocos2d::Director* cobj = (cocos2d::Director *)(proxy ? proxy->ptr : NULL);
cobj = (cocos2d::Director *)(proxy ? proxy->ptr : nullptr);
JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Director_mainLoop : Invalid Native Object");
if (argc == 0) {
cobj->mainLoop();
args.rval().setUndefined();
return true;
}
do {
if (argc == 1) {
double arg0 = 0;
ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0);
if (!ok) { ok = true; break; }
cobj->mainLoop(arg0);
args.rval().setUndefined();
return true;
}
} while(0);

do {
if (argc == 0) {
cobj->mainLoop();
args.rval().setUndefined();
return true;
}
} while(0);

JS_ReportError(cx, "js_cocos2dx_Director_mainLoop : wrong number of arguments: %d, was expecting %d", argc, 0);
JS_ReportError(cx, "js_cocos2dx_Director_mainLoop : wrong number of arguments");
return false;
}
bool js_cocos2dx_Director_setDepthTest(JSContext *cx, uint32_t argc, jsval *vp)
Expand Down
8 changes: 5 additions & 3 deletions cocos/scripting/lua-bindings/auto/api/Director.lua
Original file line number Diff line number Diff line change
Expand Up @@ -155,11 +155,13 @@
-- @return vec2_table#vec2_table ret (return value: vec2_table)

--------------------------------
--
-- @function [parent=#Director] mainLoop
-- @overload self, float
-- @overload self
-- @function [parent=#Director] mainLoop
-- @param self
-- @param #float dt
-- @return Director#Director self (return value: cc.Director)

--------------------------------
-- Enables/disables OpenGL depth test.
-- @function [parent=#Director] setDepthTest
Expand Down
38 changes: 21 additions & 17 deletions cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14546,39 +14546,43 @@ int lua_cocos2dx_Director_mainLoop(lua_State* tolua_S)
int argc = 0;
cocos2d::Director* 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.Director",0,&tolua_err)) goto tolua_lerror;
#endif

cobj = (cocos2d::Director*)tolua_tousertype(tolua_S,1,0);

#if COCOS2D_DEBUG >= 1
if (!cobj)
if (!cobj)
{
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Director_mainLoop'", nullptr);
return 0;
}
#endif

argc = lua_gettop(tolua_S)-1;
if (argc == 0)
{
if(!ok)
{
tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Director_mainLoop'", nullptr);
return 0;
do{
if (argc == 1) {
double arg0;
ok &= luaval_to_number(tolua_S, 2,&arg0, "cc.Director:mainLoop");

if (!ok) { break; }
cobj->mainLoop(arg0);
lua_settop(tolua_S, 1);
return 1;
}
cobj->mainLoop();
lua_settop(tolua_S, 1);
return 1;
}
luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Director:mainLoop",argc, 0);
}while(0);
ok = true;
do{
if (argc == 0) {
cobj->mainLoop();
lua_settop(tolua_S, 1);
return 1;
}
}while(0);
ok = true;
luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Director:mainLoop",argc, 0);
return 0;

#if COCOS2D_DEBUG >= 1
Expand Down