Skip to content

Commit dd880ee

Browse files
CocosRobotminggo
authored and
minggo
committed
[ci skip][AUTO]: updating luabinding & jsbinding & cocos_file.json automatically (#17857)
1 parent 69da862 commit dd880ee

File tree

4 files changed

+55
-30
lines changed

4 files changed

+55
-30
lines changed

cocos/scripting/js-bindings/auto/api/jsb_cocos2dx_auto_api.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -2899,8 +2899,10 @@ getVisibleOrigin : function (
28992899

29002900
/**
29012901
* @method mainLoop
2902-
*/
2903-
mainLoop : function (
2902+
* @param {float} float
2903+
*/
2904+
mainLoop : function(
2905+
float
29042906
)
29052907
{
29062908
},

cocos/scripting/js-bindings/auto/jsb_cocos2dx_auto.cpp

+25-8
Original file line numberDiff line numberDiff line change
@@ -7105,18 +7105,35 @@ bool js_cocos2dx_Director_getVisibleOrigin(JSContext *cx, uint32_t argc, jsval *
71057105
}
71067106
bool js_cocos2dx_Director_mainLoop(JSContext *cx, uint32_t argc, jsval *vp)
71077107
{
7108+
bool ok = true;
7109+
cocos2d::Director* cobj = nullptr;
7110+
71087111
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
7109-
JS::RootedObject obj(cx, args.thisv().toObjectOrNull());
7112+
JS::RootedObject obj(cx);
7113+
obj.set(args.thisv().toObjectOrNull());
71107114
js_proxy_t *proxy = jsb_get_js_proxy(obj);
7111-
cocos2d::Director* cobj = (cocos2d::Director *)(proxy ? proxy->ptr : NULL);
7115+
cobj = (cocos2d::Director *)(proxy ? proxy->ptr : nullptr);
71127116
JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Director_mainLoop : Invalid Native Object");
7113-
if (argc == 0) {
7114-
cobj->mainLoop();
7115-
args.rval().setUndefined();
7116-
return true;
7117-
}
7117+
do {
7118+
if (argc == 1) {
7119+
double arg0 = 0;
7120+
ok &= JS::ToNumber( cx, args.get(0), &arg0) && !std::isnan(arg0);
7121+
if (!ok) { ok = true; break; }
7122+
cobj->mainLoop(arg0);
7123+
args.rval().setUndefined();
7124+
return true;
7125+
}
7126+
} while(0);
7127+
7128+
do {
7129+
if (argc == 0) {
7130+
cobj->mainLoop();
7131+
args.rval().setUndefined();
7132+
return true;
7133+
}
7134+
} while(0);
71187135

7119-
JS_ReportError(cx, "js_cocos2dx_Director_mainLoop : wrong number of arguments: %d, was expecting %d", argc, 0);
7136+
JS_ReportError(cx, "js_cocos2dx_Director_mainLoop : wrong number of arguments");
71207137
return false;
71217138
}
71227139
bool js_cocos2dx_Director_setDepthTest(JSContext *cx, uint32_t argc, jsval *vp)

cocos/scripting/lua-bindings/auto/api/Director.lua

+5-3
Original file line numberDiff line numberDiff line change
@@ -155,11 +155,13 @@
155155
-- @return vec2_table#vec2_table ret (return value: vec2_table)
156156

157157
--------------------------------
158-
--
159-
-- @function [parent=#Director] mainLoop
158+
-- @overload self, float
159+
-- @overload self
160+
-- @function [parent=#Director] mainLoop
160161
-- @param self
162+
-- @param #float dt
161163
-- @return Director#Director self (return value: cc.Director)
162-
164+
163165
--------------------------------
164166
-- Enables/disables OpenGL depth test.
165167
-- @function [parent=#Director] setDepthTest

cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.cpp

+21-17
Original file line numberDiff line numberDiff line change
@@ -14546,39 +14546,43 @@ int lua_cocos2dx_Director_mainLoop(lua_State* tolua_S)
1454614546
int argc = 0;
1454714547
cocos2d::Director* cobj = nullptr;
1454814548
bool ok = true;
14549-
1455014549
#if COCOS2D_DEBUG >= 1
1455114550
tolua_Error tolua_err;
1455214551
#endif
1455314552

14554-
1455514553
#if COCOS2D_DEBUG >= 1
1455614554
if (!tolua_isusertype(tolua_S,1,"cc.Director",0,&tolua_err)) goto tolua_lerror;
1455714555
#endif
14558-
1455914556
cobj = (cocos2d::Director*)tolua_tousertype(tolua_S,1,0);
14560-
1456114557
#if COCOS2D_DEBUG >= 1
14562-
if (!cobj)
14558+
if (!cobj)
1456314559
{
1456414560
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Director_mainLoop'", nullptr);
1456514561
return 0;
1456614562
}
1456714563
#endif
14568-
1456914564
argc = lua_gettop(tolua_S)-1;
14570-
if (argc == 0)
14571-
{
14572-
if(!ok)
14573-
{
14574-
tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Director_mainLoop'", nullptr);
14575-
return 0;
14565+
do{
14566+
if (argc == 1) {
14567+
double arg0;
14568+
ok &= luaval_to_number(tolua_S, 2,&arg0, "cc.Director:mainLoop");
14569+
14570+
if (!ok) { break; }
14571+
cobj->mainLoop(arg0);
14572+
lua_settop(tolua_S, 1);
14573+
return 1;
1457614574
}
14577-
cobj->mainLoop();
14578-
lua_settop(tolua_S, 1);
14579-
return 1;
14580-
}
14581-
luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Director:mainLoop",argc, 0);
14575+
}while(0);
14576+
ok = true;
14577+
do{
14578+
if (argc == 0) {
14579+
cobj->mainLoop();
14580+
lua_settop(tolua_S, 1);
14581+
return 1;
14582+
}
14583+
}while(0);
14584+
ok = true;
14585+
luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Director:mainLoop",argc, 0);
1458214586
return 0;
1458314587

1458414588
#if COCOS2D_DEBUG >= 1

0 commit comments

Comments
 (0)