Merge pull request #16240 from CocosRobot/update_lua_bindings_1469651785

[ci skip][AUTO]: updating luabinding & jsbinding automatically
This commit is contained in:
minggo 2016-07-28 08:24:00 +08:00 committed by GitHub
commit b8f530afd0
6 changed files with 150 additions and 64 deletions

View File

@ -2058,6 +2058,14 @@ getScale : function (
return 0;
},
/**
* @method updateOrderOfArrival
*/
updateOrderOfArrival : function (
)
{
},
/**
* @method getNormalizedPosition
* @return {vec2_object}

View File

@ -5019,6 +5019,22 @@ bool js_cocos2dx_Node_getScale(JSContext *cx, uint32_t argc, jsval *vp)
JS_ReportError(cx, "js_cocos2dx_Node_getScale : wrong number of arguments: %d, was expecting %d", argc, 0);
return false;
}
bool js_cocos2dx_Node_updateOrderOfArrival(JSContext *cx, uint32_t argc, jsval *vp)
{
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
JS::RootedObject obj(cx, args.thisv().toObjectOrNull());
js_proxy_t *proxy = jsb_get_js_proxy(obj);
cocos2d::Node* cobj = (cocos2d::Node *)(proxy ? proxy->ptr : NULL);
JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Node_updateOrderOfArrival : Invalid Native Object");
if (argc == 0) {
cobj->updateOrderOfArrival();
args.rval().setUndefined();
return true;
}
JS_ReportError(cx, "js_cocos2dx_Node_updateOrderOfArrival : wrong number of arguments: %d, was expecting %d", argc, 0);
return false;
}
bool js_cocos2dx_Node_getNormalizedPosition(JSContext *cx, uint32_t argc, jsval *vp)
{
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
@ -5394,6 +5410,7 @@ void js_register_cocos2dx_Node(JSContext *cx, JS::HandleObject global) {
JS_FN("sortAllChildren", js_cocos2dx_Node_sortAllChildren, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),
JS_FN("getWorldToNodeTransform", js_cocos2dx_Node_getWorldToNodeAffineTransform, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),
JS_FN("getScale", js_cocos2dx_Node_getScale, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),
JS_FN("updateOrderOfArrival", js_cocos2dx_Node_updateOrderOfArrival, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),
JS_FN("getNormalizedPosition", js_cocos2dx_Node_getNormalizedPosition, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),
JS_FN("getParentToNodeTransform3D", js_cocos2dx_Node_getParentToNodeTransform, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),
JS_FN("convertToNodeSpace", js_cocos2dx_Node_convertToNodeSpace, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),

View File

@ -253,6 +253,7 @@ bool js_cocos2dx_Node_update(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_Node_sortAllChildren(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_Node_getWorldToNodeAffineTransform(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_Node_getScale(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_Node_updateOrderOfArrival(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_Node_getNormalizedPosition(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_Node_getParentToNodeTransform(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_Node_convertToNodeSpace(JSContext *cx, uint32_t argc, jsval *vp);

View File

@ -559,6 +559,19 @@
-- @param self
-- @return Node#Node self (return value: cc.Node)
--------------------------------
-- Sets the shader program for this node<br>
-- Since v2.0, each rendering node must set its shader program.<br>
-- It should be set in initialize phase.<br>
-- code<br>
-- node->setGLrProgram(GLProgramCache::getInstance()->getProgram(GLProgram::SHADER_NAME_POSITION_TEXTURE_COLOR));<br>
-- endcode<br>
-- param glprogram The shader program.
-- @function [parent=#Node] setGLProgram
-- @param self
-- @param #cc.GLProgram glprogram
-- @return Node#Node self (return value: cc.Node)
--------------------------------
-- Determines if the node is visible.<br>
-- see `setVisible(bool)`<br>
@ -1088,19 +1101,6 @@
-- @param self
-- @return mat4_table#mat4_table ret (return value: mat4_table)
--------------------------------
-- Sets the shader program for this node<br>
-- Since v2.0, each rendering node must set its shader program.<br>
-- It should be set in initialize phase.<br>
-- code<br>
-- node->setGLrProgram(GLProgramCache::getInstance()->getProgram(GLProgram::SHADER_NAME_POSITION_TEXTURE_COLOR));<br>
-- endcode<br>
-- param glprogram The shader program.
-- @function [parent=#Node] setGLProgram
-- @param self
-- @param #cc.GLProgram glprogram
-- @return Node#Node self (return value: cc.Node)
--------------------------------
-- Gets the scale factor of the node, when X and Y have the same scale factor.<br>
-- warning Assert when `_scaleX != _scaleY`<br>
@ -1110,6 +1110,17 @@
-- @param self
-- @return float#float ret (return value: float)
--------------------------------
-- !!! ONLY FOR INTERNAL USE<br>
-- Sets the arrival order when this node has a same ZOrder with other children.<br>
-- A node which called addChild subsequently will take a larger arrival order,<br>
-- If two children have the same Z order, the child with larger arrival order will be drawn later.<br>
-- warning This method is used internally for localZOrder sorting, don't change this manually<br>
-- param orderOfArrival The arrival order.
-- @function [parent=#Node] updateOrderOfArrival
-- @param self
-- @return Node#Node self (return value: cc.Node)
--------------------------------
-- Returns the normalized position.<br>
-- return The normalized position.

View File

@ -7213,6 +7213,56 @@ int lua_cocos2dx_Node_updateTransform(lua_State* tolua_S)
return 0;
}
int lua_cocos2dx_Node_setGLProgram(lua_State* tolua_S)
{
int argc = 0;
cocos2d::Node* 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.Node",0,&tolua_err)) goto tolua_lerror;
#endif
cobj = (cocos2d::Node*)tolua_tousertype(tolua_S,1,0);
#if COCOS2D_DEBUG >= 1
if (!cobj)
{
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Node_setGLProgram'", nullptr);
return 0;
}
#endif
argc = lua_gettop(tolua_S)-1;
if (argc == 1)
{
cocos2d::GLProgram* arg0;
ok &= luaval_to_object<cocos2d::GLProgram>(tolua_S, 2, "cc.GLProgram",&arg0, "cc.Node:setGLProgram");
if(!ok)
{
tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Node_setGLProgram'", nullptr);
return 0;
}
cobj->setGLProgram(arg0);
lua_settop(tolua_S, 1);
return 1;
}
luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Node:setGLProgram",argc, 1);
return 0;
#if COCOS2D_DEBUG >= 1
tolua_lerror:
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Node_setGLProgram'.",&tolua_err);
#endif
return 0;
}
int lua_cocos2dx_Node_isVisible(lua_State* tolua_S)
{
int argc = 0;
@ -10279,56 +10329,6 @@ int lua_cocos2dx_Node_getWorldToNodeTransform(lua_State* tolua_S)
return 0;
}
int lua_cocos2dx_Node_setGLProgram(lua_State* tolua_S)
{
int argc = 0;
cocos2d::Node* 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.Node",0,&tolua_err)) goto tolua_lerror;
#endif
cobj = (cocos2d::Node*)tolua_tousertype(tolua_S,1,0);
#if COCOS2D_DEBUG >= 1
if (!cobj)
{
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Node_setGLProgram'", nullptr);
return 0;
}
#endif
argc = lua_gettop(tolua_S)-1;
if (argc == 1)
{
cocos2d::GLProgram* arg0;
ok &= luaval_to_object<cocos2d::GLProgram>(tolua_S, 2, "cc.GLProgram",&arg0, "cc.Node:setGLProgram");
if(!ok)
{
tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Node_setGLProgram'", nullptr);
return 0;
}
cobj->setGLProgram(arg0);
lua_settop(tolua_S, 1);
return 1;
}
luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Node:setGLProgram",argc, 1);
return 0;
#if COCOS2D_DEBUG >= 1
tolua_lerror:
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Node_setGLProgram'.",&tolua_err);
#endif
return 0;
}
int lua_cocos2dx_Node_getScale(lua_State* tolua_S)
{
int argc = 0;
@ -10376,6 +10376,53 @@ int lua_cocos2dx_Node_getScale(lua_State* tolua_S)
return 0;
}
int lua_cocos2dx_Node_updateOrderOfArrival(lua_State* tolua_S)
{
int argc = 0;
cocos2d::Node* 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.Node",0,&tolua_err)) goto tolua_lerror;
#endif
cobj = (cocos2d::Node*)tolua_tousertype(tolua_S,1,0);
#if COCOS2D_DEBUG >= 1
if (!cobj)
{
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Node_updateOrderOfArrival'", 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_Node_updateOrderOfArrival'", nullptr);
return 0;
}
cobj->updateOrderOfArrival();
lua_settop(tolua_S, 1);
return 1;
}
luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Node:updateOrderOfArrival",argc, 0);
return 0;
#if COCOS2D_DEBUG >= 1
tolua_lerror:
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Node_updateOrderOfArrival'.",&tolua_err);
#endif
return 0;
}
int lua_cocos2dx_Node_getNormalizedPosition(lua_State* tolua_S)
{
int argc = 0;
@ -10857,6 +10904,7 @@ int lua_register_cocos2dx_Node(lua_State* tolua_S)
tolua_function(tolua_S,"getAnchorPoint",lua_cocos2dx_Node_getAnchorPoint);
tolua_function(tolua_S,"getNumberOfRunningActions",lua_cocos2dx_Node_getNumberOfRunningActions);
tolua_function(tolua_S,"updateTransform",lua_cocos2dx_Node_updateTransform);
tolua_function(tolua_S,"setGLProgram",lua_cocos2dx_Node_setGLProgram);
tolua_function(tolua_S,"isVisible",lua_cocos2dx_Node_isVisible);
tolua_function(tolua_S,"getChildrenCount",lua_cocos2dx_Node_getChildrenCount);
tolua_function(tolua_S,"convertToNodeSpaceAR",lua_cocos2dx_Node_convertToNodeSpaceAR);
@ -10919,8 +10967,8 @@ int lua_register_cocos2dx_Node(lua_State* tolua_S)
tolua_function(tolua_S,"update",lua_cocos2dx_Node_update);
tolua_function(tolua_S,"sortAllChildren",lua_cocos2dx_Node_sortAllChildren);
tolua_function(tolua_S,"getWorldToNodeTransform",lua_cocos2dx_Node_getWorldToNodeTransform);
tolua_function(tolua_S,"setGLProgram",lua_cocos2dx_Node_setGLProgram);
tolua_function(tolua_S,"getScale",lua_cocos2dx_Node_getScale);
tolua_function(tolua_S,"updateOrderOfArrival",lua_cocos2dx_Node_updateOrderOfArrival);
tolua_function(tolua_S,"getNormalizedPosition",lua_cocos2dx_Node_getNormalizedPosition);
tolua_function(tolua_S,"getRotationSkewX",lua_cocos2dx_Node_getRotationSkewX);
tolua_function(tolua_S,"getRotationSkewY",lua_cocos2dx_Node_getRotationSkewY);

View File

@ -2211,6 +2211,7 @@ int register_all_cocos2dx(lua_State* tolua_S);
#endif // __cocos2dx_h__