Update lua bindings

This commit is contained in:
halx99 2021-08-13 20:36:10 +08:00
parent 5af2f0d77e
commit fd9422d36d
5 changed files with 1242 additions and 56 deletions

View File

@ -2477,6 +2477,53 @@ int lua_cocos2dx_Texture2D_getContentSizeInPixels(lua_State* tolua_S)
return 0;
}
int lua_cocos2dx_Texture2D_getSamplerFlags(lua_State* tolua_S)
{
int argc = 0;
cocos2d::Texture2D* 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.Texture2D",0,&tolua_err)) goto tolua_lerror;
#endif
cobj = (cocos2d::Texture2D*)tolua_tousertype(tolua_S,1,0);
#if COCOS2D_DEBUG >= 1
if (!cobj)
{
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Texture2D_getSamplerFlags'", 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_Texture2D_getSamplerFlags'", nullptr);
return 0;
}
int ret = cobj->getSamplerFlags();
tolua_pushnumber(tolua_S,(lua_Number)ret);
return 1;
}
luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Texture2D:getSamplerFlags",argc, 0);
return 0;
#if COCOS2D_DEBUG >= 1
tolua_lerror:
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Texture2D_getSamplerFlags'.",&tolua_err);
#endif
return 0;
}
int lua_cocos2dx_Texture2D_getPixelsWide(lua_State* tolua_S)
{
int argc = 0;
@ -2747,53 +2794,6 @@ int lua_cocos2dx_Texture2D_updateWithImage(lua_State* tolua_S)
return 0;
}
int lua_cocos2dx_Texture2D_getSamplerFlags(lua_State* tolua_S)
{
int argc = 0;
cocos2d::Texture2D* 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.Texture2D",0,&tolua_err)) goto tolua_lerror;
#endif
cobj = (cocos2d::Texture2D*)tolua_tousertype(tolua_S,1,0);
#if COCOS2D_DEBUG >= 1
if (!cobj)
{
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Texture2D_getTextureFormatEXT'", 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_Texture2D_getTextureFormatEXT'", nullptr);
return 0;
}
int ret = cobj->getSamplerFlags();
tolua_pushnumber(tolua_S,(lua_Number)ret);
return 1;
}
luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Texture2D:getTextureFormatEXT",argc, 0);
return 0;
#if COCOS2D_DEBUG >= 1
tolua_lerror:
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Texture2D_getTextureFormatEXT'.",&tolua_err);
#endif
return 0;
}
int lua_cocos2dx_Texture2D_updateWithSubData(lua_State* tolua_S)
{
int argc = 0;
@ -3030,12 +3030,12 @@ int lua_register_cocos2dx_Texture2D(lua_State* tolua_S)
tolua_function(tolua_S,"setPremultipliedAlpha",lua_cocos2dx_Texture2D_setPremultipliedAlpha);
tolua_function(tolua_S,"getBackendTexture",lua_cocos2dx_Texture2D_getBackendTexture);
tolua_function(tolua_S,"getContentSizeInPixels",lua_cocos2dx_Texture2D_getContentSizeInPixels);
tolua_function(tolua_S,"getSamplerFlags",lua_cocos2dx_Texture2D_getSamplerFlags);
tolua_function(tolua_S,"getPixelsWide",lua_cocos2dx_Texture2D_getPixelsWide);
tolua_function(tolua_S,"drawAtPoint",lua_cocos2dx_Texture2D_drawAtPoint);
tolua_function(tolua_S,"hasMipmaps",lua_cocos2dx_Texture2D_hasMipmaps);
tolua_function(tolua_S,"setRenderTarget",lua_cocos2dx_Texture2D_setRenderTarget);
tolua_function(tolua_S,"updateWithImage",lua_cocos2dx_Texture2D_updateWithImage);
tolua_function(tolua_S, "getSamplerFlags", lua_cocos2dx_Texture2D_getSamplerFlags);
tolua_function(tolua_S,"updateWithSubData",lua_cocos2dx_Texture2D_updateWithSubData);
tolua_function(tolua_S,"setDefaultAlphaPixelFormat", lua_cocos2dx_Texture2D_setDefaultAlphaPixelFormat);
tolua_function(tolua_S,"getDefaultAlphaPixelFormat", lua_cocos2dx_Texture2D_getDefaultAlphaPixelFormat);
@ -9586,6 +9586,56 @@ int lua_cocos2dx_Node_removeChildByTag(lua_State* tolua_S)
return 0;
}
int lua_cocos2dx_Node_hitTest(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_hitTest'", nullptr);
return 0;
}
#endif
argc = lua_gettop(tolua_S)-1;
if (argc == 1)
{
cocos2d::Vec2 arg0;
ok &= luaval_to_vec2(tolua_S, 2, &arg0, "cc.Node:hitTest");
if(!ok)
{
tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Node_hitTest'", nullptr);
return 0;
}
bool ret = cobj->hitTest(arg0);
tolua_pushboolean(tolua_S,(bool)ret);
return 1;
}
luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Node:hitTest",argc, 1);
return 0;
#if COCOS2D_DEBUG >= 1
tolua_lerror:
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Node_hitTest'.",&tolua_err);
#endif
return 0;
}
int lua_cocos2dx_Node_setPositionY(lua_State* tolua_S)
{
int argc = 0;
@ -11911,6 +11961,7 @@ int lua_register_cocos2dx_Node(lua_State* tolua_S)
tolua_function(tolua_S,"getPositionY",lua_cocos2dx_Node_getPositionY);
tolua_function(tolua_S,"getPositionX",lua_cocos2dx_Node_getPositionX);
tolua_function(tolua_S,"removeChildByTag",lua_cocos2dx_Node_removeChildByTag);
tolua_function(tolua_S,"hitTest",lua_cocos2dx_Node_hitTest);
tolua_function(tolua_S,"setPositionY",lua_cocos2dx_Node_setPositionY);
tolua_function(tolua_S,"updateDisplayedColor",lua_cocos2dx_Node_updateDisplayedColor);
tolua_function(tolua_S,"setVisible",lua_cocos2dx_Node_setVisible);
@ -12277,6 +12328,53 @@ int lua_cocos2dx_Scene_getPhysicsWorld(lua_State* tolua_S)
return 0;
}
int lua_cocos2dx_Scene_initPhysicsWorld(lua_State* tolua_S)
{
int argc = 0;
cocos2d::Scene* 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.Scene",0,&tolua_err)) goto tolua_lerror;
#endif
cobj = (cocos2d::Scene*)tolua_tousertype(tolua_S,1,0);
#if COCOS2D_DEBUG >= 1
if (!cobj)
{
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Scene_initPhysicsWorld'", 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_Scene_initPhysicsWorld'", nullptr);
return 0;
}
bool ret = cobj->initPhysicsWorld();
tolua_pushboolean(tolua_S,(bool)ret);
return 1;
}
luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Scene:initPhysicsWorld",argc, 0);
return 0;
#if COCOS2D_DEBUG >= 1
tolua_lerror:
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Scene_initPhysicsWorld'.",&tolua_err);
#endif
return 0;
}
int lua_cocos2dx_Scene_initWithSize(lua_State* tolua_S)
{
int argc = 0;
@ -12534,6 +12632,7 @@ int lua_register_cocos2dx_Scene(lua_State* tolua_S)
tolua_function(tolua_S,"stepPhysicsAndNavigation",lua_cocos2dx_Scene_stepPhysicsAndNavigation);
tolua_function(tolua_S,"onProjectionChanged",lua_cocos2dx_Scene_onProjectionChanged);
tolua_function(tolua_S,"getPhysicsWorld",lua_cocos2dx_Scene_getPhysicsWorld);
tolua_function(tolua_S,"initPhysicsWorld",lua_cocos2dx_Scene_initPhysicsWorld);
tolua_function(tolua_S,"initWithSize",lua_cocos2dx_Scene_initWithSize);
tolua_function(tolua_S,"getDefaultCamera",lua_cocos2dx_Scene_getDefaultCamera);
tolua_function(tolua_S,"createWithSize", lua_cocos2dx_Scene_createWithSize);
@ -97896,6 +97995,166 @@ int lua_register_cocos2dx_SpriteBatchNode(lua_State* tolua_S)
return 1;
}
static int lua_cocos2dx_SpriteSheet_finalize(lua_State* tolua_S)
{
printf("luabindings: finalizing LUA object (SpriteSheet)");
return 0;
}
int lua_register_cocos2dx_SpriteSheet(lua_State* tolua_S)
{
tolua_usertype(tolua_S,"cc.SpriteSheet");
tolua_cclass(tolua_S,"SpriteSheet","cc.SpriteSheet","",nullptr);
tolua_beginmodule(tolua_S,"SpriteSheet");
tolua_endmodule(tolua_S);
auto typeName = typeid(cocos2d::SpriteSheet).name(); // rtti is literal storage
g_luaType[reinterpret_cast<uintptr_t>(typeName)] = "cc.SpriteSheet";
g_typeCast[typeName] = "cc.SpriteSheet";
return 1;
}
int lua_cocos2dx_SpriteSheetLoader_initializePolygonInfo(lua_State* tolua_S)
{
int argc = 0;
cocos2d::SpriteSheetLoader* 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.SpriteSheetLoader",0,&tolua_err)) goto tolua_lerror;
#endif
cobj = (cocos2d::SpriteSheetLoader*)tolua_tousertype(tolua_S,1,0);
#if COCOS2D_DEBUG >= 1
if (!cobj)
{
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_SpriteSheetLoader_initializePolygonInfo'", nullptr);
return 0;
}
#endif
argc = lua_gettop(tolua_S)-1;
if (argc == 6)
{
cocos2d::Size arg0;
cocos2d::Size arg1;
std::vector<int> arg2;
std::vector<int> arg3;
std::vector<int> arg4;
cocos2d::PolygonInfo arg5;
ok &= luaval_to_size(tolua_S, 2, &arg0, "cc.SpriteSheetLoader:initializePolygonInfo");
ok &= luaval_to_size(tolua_S, 3, &arg1, "cc.SpriteSheetLoader:initializePolygonInfo");
ok &= luaval_to_std_vector_int(tolua_S, 4, &arg2, "cc.SpriteSheetLoader:initializePolygonInfo");
ok &= luaval_to_std_vector_int(tolua_S, 5, &arg3, "cc.SpriteSheetLoader:initializePolygonInfo");
ok &= luaval_to_std_vector_int(tolua_S, 6, &arg4, "cc.SpriteSheetLoader:initializePolygonInfo");
ok &= luaval_to_object<cocos2d::PolygonInfo>(tolua_S, 7, "cc.PolygonInfo",&arg5, "cc.SpriteSheetLoader:initializePolygonInfo");
if(!ok)
{
tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_SpriteSheetLoader_initializePolygonInfo'", nullptr);
return 0;
}
cobj->initializePolygonInfo(arg0, arg1, arg2, arg3, arg4, arg5);
lua_settop(tolua_S, 1);
return 1;
}
luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.SpriteSheetLoader:initializePolygonInfo",argc, 6);
return 0;
#if COCOS2D_DEBUG >= 1
tolua_lerror:
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_SpriteSheetLoader_initializePolygonInfo'.",&tolua_err);
#endif
return 0;
}
static int lua_cocos2dx_SpriteSheetLoader_finalize(lua_State* tolua_S)
{
printf("luabindings: finalizing LUA object (SpriteSheetLoader)");
return 0;
}
int lua_register_cocos2dx_SpriteSheetLoader(lua_State* tolua_S)
{
tolua_usertype(tolua_S,"cc.SpriteSheetLoader");
tolua_cclass(tolua_S,"SpriteSheetLoader","cc.SpriteSheetLoader","cc.ISpriteSheetLoader",nullptr);
tolua_beginmodule(tolua_S,"SpriteSheetLoader");
tolua_function(tolua_S,"initializePolygonInfo",lua_cocos2dx_SpriteSheetLoader_initializePolygonInfo);
tolua_endmodule(tolua_S);
auto typeName = typeid(cocos2d::SpriteSheetLoader).name(); // rtti is literal storage
g_luaType[reinterpret_cast<uintptr_t>(typeName)] = "cc.SpriteSheetLoader";
g_typeCast[typeName] = "cc.SpriteSheetLoader";
return 1;
}
int lua_cocos2dx_SpriteFrameCache_insertFrame(lua_State* tolua_S)
{
int argc = 0;
cocos2d::SpriteFrameCache* 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.SpriteFrameCache",0,&tolua_err)) goto tolua_lerror;
#endif
cobj = (cocos2d::SpriteFrameCache*)tolua_tousertype(tolua_S,1,0);
#if COCOS2D_DEBUG >= 1
if (!cobj)
{
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_SpriteFrameCache_insertFrame'", nullptr);
return 0;
}
#endif
argc = lua_gettop(tolua_S)-1;
if (argc == 3)
{
std::shared_ptr<cocos2d::SpriteSheet> arg0;
std::string arg1;
cocos2d::SpriteFrame* arg2;
ok &= luaval_to_object<std::shared_ptr<cocos2d::SpriteSheet>>(tolua_S, 2, "std::shared_ptr<cocos2d::SpriteSheet>",&arg0, "cc.SpriteFrameCache:insertFrame");
ok &= luaval_to_std_string(tolua_S, 3,&arg1, "cc.SpriteFrameCache:insertFrame");
ok &= luaval_to_object<cocos2d::SpriteFrame>(tolua_S, 4, "cc.SpriteFrame",&arg2, "cc.SpriteFrameCache:insertFrame");
if(!ok)
{
tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_SpriteFrameCache_insertFrame'", nullptr);
return 0;
}
cobj->insertFrame(arg0, arg1, arg2);
lua_settop(tolua_S, 1);
return 1;
}
luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.SpriteFrameCache:insertFrame",argc, 3);
return 0;
#if COCOS2D_DEBUG >= 1
tolua_lerror:
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_SpriteFrameCache_insertFrame'.",&tolua_err);
#endif
return 0;
}
int lua_cocos2dx_SpriteFrameCache_reloadTexture(lua_State* tolua_S)
{
int argc = 0;
@ -97974,10 +98233,10 @@ int lua_cocos2dx_SpriteFrameCache_addSpriteFramesWithFileContent(lua_State* tolu
argc = lua_gettop(tolua_S)-1;
if (argc == 2)
{
std::string arg0;
cocos2d::Data arg0;
cocos2d::Texture2D* arg1;
ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.SpriteFrameCache:addSpriteFramesWithFileContent");
ok &= luaval_to_object<cocos2d::Data>(tolua_S, 2, "cc.Data",&arg0, "cc.SpriteFrameCache:addSpriteFramesWithFileContent");
ok &= luaval_to_object<cocos2d::Texture2D>(tolua_S, 3, "cc.Texture2D",&arg1, "cc.SpriteFrameCache:addSpriteFramesWithFileContent");
if(!ok)
@ -97989,6 +98248,26 @@ int lua_cocos2dx_SpriteFrameCache_addSpriteFramesWithFileContent(lua_State* tolu
lua_settop(tolua_S, 1);
return 1;
}
if (argc == 3)
{
cocos2d::Data arg0;
cocos2d::Texture2D* arg1;
std::string arg2;
ok &= luaval_to_object<cocos2d::Data>(tolua_S, 2, "cc.Data",&arg0, "cc.SpriteFrameCache:addSpriteFramesWithFileContent");
ok &= luaval_to_object<cocos2d::Texture2D>(tolua_S, 3, "cc.Texture2D",&arg1, "cc.SpriteFrameCache:addSpriteFramesWithFileContent");
ok &= luaval_to_std_string(tolua_S, 4,&arg2, "cc.SpriteFrameCache:addSpriteFramesWithFileContent");
if(!ok)
{
tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_SpriteFrameCache_addSpriteFramesWithFileContent'", nullptr);
return 0;
}
cobj->addSpriteFramesWithFileContent(arg0, arg1, arg2);
lua_settop(tolua_S, 1);
return 1;
}
luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.SpriteFrameCache:addSpriteFramesWithFileContent",argc, 2);
return 0;
@ -97999,6 +98278,56 @@ int lua_cocos2dx_SpriteFrameCache_addSpriteFramesWithFileContent(lua_State* tolu
return 0;
}
int lua_cocos2dx_SpriteFrameCache_getSpriteSheetLoader(lua_State* tolua_S)
{
int argc = 0;
cocos2d::SpriteFrameCache* 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.SpriteFrameCache",0,&tolua_err)) goto tolua_lerror;
#endif
cobj = (cocos2d::SpriteFrameCache*)tolua_tousertype(tolua_S,1,0);
#if COCOS2D_DEBUG >= 1
if (!cobj)
{
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_SpriteFrameCache_getSpriteSheetLoader'", nullptr);
return 0;
}
#endif
argc = lua_gettop(tolua_S)-1;
if (argc == 1)
{
std::string arg0;
ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.SpriteFrameCache:getSpriteSheetLoader");
if(!ok)
{
tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_SpriteFrameCache_getSpriteSheetLoader'", nullptr);
return 0;
}
cocos2d::ISpriteSheetLoader* ret = cobj->getSpriteSheetLoader(arg0);
object_to_luaval<cocos2d::ISpriteSheetLoader>(tolua_S, "cc.ISpriteSheetLoader",(cocos2d::ISpriteSheetLoader*)ret);
return 1;
}
luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.SpriteFrameCache:getSpriteSheetLoader",argc, 1);
return 0;
#if COCOS2D_DEBUG >= 1
tolua_lerror:
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_SpriteFrameCache_getSpriteSheetLoader'.",&tolua_err);
#endif
return 0;
}
int lua_cocos2dx_SpriteFrameCache_addSpriteFrame(lua_State* tolua_S)
{
int argc = 0;
@ -98052,6 +98381,56 @@ int lua_cocos2dx_SpriteFrameCache_addSpriteFrame(lua_State* tolua_S)
return 0;
}
int lua_cocos2dx_SpriteFrameCache_findFrame(lua_State* tolua_S)
{
int argc = 0;
cocos2d::SpriteFrameCache* 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.SpriteFrameCache",0,&tolua_err)) goto tolua_lerror;
#endif
cobj = (cocos2d::SpriteFrameCache*)tolua_tousertype(tolua_S,1,0);
#if COCOS2D_DEBUG >= 1
if (!cobj)
{
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_SpriteFrameCache_findFrame'", nullptr);
return 0;
}
#endif
argc = lua_gettop(tolua_S)-1;
if (argc == 1)
{
std::string arg0;
ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.SpriteFrameCache:findFrame");
if(!ok)
{
tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_SpriteFrameCache_findFrame'", nullptr);
return 0;
}
cocos2d::SpriteFrame* ret = cobj->findFrame(arg0);
object_to_luaval<cocos2d::SpriteFrame>(tolua_S, "cc.SpriteFrame",(cocos2d::SpriteFrame*)ret);
return 1;
}
luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.SpriteFrameCache:findFrame",argc, 1);
return 0;
#if COCOS2D_DEBUG >= 1
tolua_lerror:
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_SpriteFrameCache_findFrame'.",&tolua_err);
#endif
return 0;
}
int lua_cocos2dx_SpriteFrameCache_addSpriteFramesWithFile(lua_State* tolua_S)
{
int argc = 0;
@ -98079,8 +98458,8 @@ int lua_cocos2dx_SpriteFrameCache_addSpriteFramesWithFile(lua_State* tolua_S)
ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.SpriteFrameCache:addSpriteFramesWithFile");
if (!ok) { break; }
std::string arg1;
ok &= luaval_to_std_string(tolua_S, 3,&arg1, "cc.SpriteFrameCache:addSpriteFramesWithFile");
cocos2d::Texture2D* arg1;
ok &= luaval_to_object<cocos2d::Texture2D>(tolua_S, 3, "cc.Texture2D",&arg1, "cc.SpriteFrameCache:addSpriteFramesWithFile");
if (!ok) { break; }
cobj->addSpriteFramesWithFile(arg0, arg1);
@ -98089,6 +98468,26 @@ int lua_cocos2dx_SpriteFrameCache_addSpriteFramesWithFile(lua_State* tolua_S)
}
}while(0);
ok = true;
do{
if (argc == 3) {
std::string arg0;
ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.SpriteFrameCache:addSpriteFramesWithFile");
if (!ok) { break; }
cocos2d::Texture2D* arg1;
ok &= luaval_to_object<cocos2d::Texture2D>(tolua_S, 3, "cc.Texture2D",&arg1, "cc.SpriteFrameCache:addSpriteFramesWithFile");
if (!ok) { break; }
std::string arg2;
ok &= luaval_to_std_string(tolua_S, 4,&arg2, "cc.SpriteFrameCache:addSpriteFramesWithFile");
if (!ok) { break; }
cobj->addSpriteFramesWithFile(arg0, arg1, arg2);
lua_settop(tolua_S, 1);
return 1;
}
}while(0);
ok = true;
do{
if (argc == 1) {
std::string arg0;
@ -98107,8 +98506,8 @@ int lua_cocos2dx_SpriteFrameCache_addSpriteFramesWithFile(lua_State* tolua_S)
ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.SpriteFrameCache:addSpriteFramesWithFile");
if (!ok) { break; }
cocos2d::Texture2D* arg1;
ok &= luaval_to_object<cocos2d::Texture2D>(tolua_S, 3, "cc.Texture2D",&arg1, "cc.SpriteFrameCache:addSpriteFramesWithFile");
std::string arg1;
ok &= luaval_to_std_string(tolua_S, 3,&arg1, "cc.SpriteFrameCache:addSpriteFramesWithFile");
if (!ok) { break; }
cobj->addSpriteFramesWithFile(arg0, arg1);
@ -98117,7 +98516,7 @@ int lua_cocos2dx_SpriteFrameCache_addSpriteFramesWithFile(lua_State* tolua_S)
}
}while(0);
ok = true;
luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.SpriteFrameCache:addSpriteFramesWithFile",argc, 2);
luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.SpriteFrameCache:addSpriteFramesWithFile",argc, 1);
return 0;
#if COCOS2D_DEBUG >= 1
@ -98177,6 +98576,62 @@ int lua_cocos2dx_SpriteFrameCache_getSpriteFrameByName(lua_State* tolua_S)
return 0;
}
int lua_cocos2dx_SpriteFrameCache_addSpriteFrameCapInset(lua_State* tolua_S)
{
int argc = 0;
cocos2d::SpriteFrameCache* 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.SpriteFrameCache",0,&tolua_err)) goto tolua_lerror;
#endif
cobj = (cocos2d::SpriteFrameCache*)tolua_tousertype(tolua_S,1,0);
#if COCOS2D_DEBUG >= 1
if (!cobj)
{
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_SpriteFrameCache_addSpriteFrameCapInset'", nullptr);
return 0;
}
#endif
argc = lua_gettop(tolua_S)-1;
if (argc == 3)
{
cocos2d::SpriteFrame* arg0;
cocos2d::Rect arg1;
cocos2d::Texture2D* arg2;
ok &= luaval_to_object<cocos2d::SpriteFrame>(tolua_S, 2, "cc.SpriteFrame",&arg0, "cc.SpriteFrameCache:addSpriteFrameCapInset");
ok &= luaval_to_rect(tolua_S, 3, &arg1, "cc.SpriteFrameCache:addSpriteFrameCapInset");
ok &= luaval_to_object<cocos2d::Texture2D>(tolua_S, 4, "cc.Texture2D",&arg2, "cc.SpriteFrameCache:addSpriteFrameCapInset");
if(!ok)
{
tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_SpriteFrameCache_addSpriteFrameCapInset'", nullptr);
return 0;
}
cobj->addSpriteFrameCapInset(arg0, arg1, arg2);
lua_settop(tolua_S, 1);
return 1;
}
luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.SpriteFrameCache:addSpriteFrameCapInset",argc, 3);
return 0;
#if COCOS2D_DEBUG >= 1
tolua_lerror:
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_SpriteFrameCache_addSpriteFrameCapInset'.",&tolua_err);
#endif
return 0;
}
int lua_cocos2dx_SpriteFrameCache_removeSpriteFramesFromFile(lua_State* tolua_S)
{
int argc = 0;
@ -98321,6 +98776,56 @@ int lua_cocos2dx_SpriteFrameCache_removeSpriteFrames(lua_State* tolua_S)
return 0;
}
int lua_cocos2dx_SpriteFrameCache_deregisterSpriteSheetLoader(lua_State* tolua_S)
{
int argc = 0;
cocos2d::SpriteFrameCache* 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.SpriteFrameCache",0,&tolua_err)) goto tolua_lerror;
#endif
cobj = (cocos2d::SpriteFrameCache*)tolua_tousertype(tolua_S,1,0);
#if COCOS2D_DEBUG >= 1
if (!cobj)
{
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_SpriteFrameCache_deregisterSpriteSheetLoader'", nullptr);
return 0;
}
#endif
argc = lua_gettop(tolua_S)-1;
if (argc == 1)
{
std::string arg0;
ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.SpriteFrameCache:deregisterSpriteSheetLoader");
if(!ok)
{
tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_SpriteFrameCache_deregisterSpriteSheetLoader'", nullptr);
return 0;
}
cobj->deregisterSpriteSheetLoader(arg0);
lua_settop(tolua_S, 1);
return 1;
}
luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.SpriteFrameCache:deregisterSpriteSheetLoader",argc, 1);
return 0;
#if COCOS2D_DEBUG >= 1
tolua_lerror:
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_SpriteFrameCache_deregisterSpriteSheetLoader'.",&tolua_err);
#endif
return 0;
}
int lua_cocos2dx_SpriteFrameCache_removeUnusedSpriteFrames(lua_State* tolua_S)
{
int argc = 0;
@ -98468,6 +98973,106 @@ int lua_cocos2dx_SpriteFrameCache_removeSpriteFrameByName(lua_State* tolua_S)
return 0;
}
int lua_cocos2dx_SpriteFrameCache_registerSpriteSheetLoader(lua_State* tolua_S)
{
int argc = 0;
cocos2d::SpriteFrameCache* 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.SpriteFrameCache",0,&tolua_err)) goto tolua_lerror;
#endif
cobj = (cocos2d::SpriteFrameCache*)tolua_tousertype(tolua_S,1,0);
#if COCOS2D_DEBUG >= 1
if (!cobj)
{
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_SpriteFrameCache_registerSpriteSheetLoader'", nullptr);
return 0;
}
#endif
argc = lua_gettop(tolua_S)-1;
if (argc == 1)
{
std::unique_ptr<cocos2d::ISpriteSheetLoader, std::default_delete<cocos2d::ISpriteSheetLoader>> arg0;
ok &= luaval_to_object<std::unique_ptr<cocos2d::ISpriteSheetLoader, std::default_delete<cocos2d::ISpriteSheetLoader>>>(tolua_S, 2, "std::unique_ptr<cocos2d::ISpriteSheetLoader, std::default_delete<cocos2d::ISpriteSheetLoader>>",&arg0, "cc.SpriteFrameCache:registerSpriteSheetLoader");
if(!ok)
{
tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_SpriteFrameCache_registerSpriteSheetLoader'", nullptr);
return 0;
}
cobj->registerSpriteSheetLoader(arg0);
lua_settop(tolua_S, 1);
return 1;
}
luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.SpriteFrameCache:registerSpriteSheetLoader",argc, 1);
return 0;
#if COCOS2D_DEBUG >= 1
tolua_lerror:
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_SpriteFrameCache_registerSpriteSheetLoader'.",&tolua_err);
#endif
return 0;
}
int lua_cocos2dx_SpriteFrameCache_eraseFrame(lua_State* tolua_S)
{
int argc = 0;
cocos2d::SpriteFrameCache* 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.SpriteFrameCache",0,&tolua_err)) goto tolua_lerror;
#endif
cobj = (cocos2d::SpriteFrameCache*)tolua_tousertype(tolua_S,1,0);
#if COCOS2D_DEBUG >= 1
if (!cobj)
{
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_SpriteFrameCache_eraseFrame'", nullptr);
return 0;
}
#endif
argc = lua_gettop(tolua_S)-1;
if (argc == 1)
{
std::string arg0;
ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.SpriteFrameCache:eraseFrame");
if(!ok)
{
tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_SpriteFrameCache_eraseFrame'", nullptr);
return 0;
}
bool ret = cobj->eraseFrame(arg0);
tolua_pushboolean(tolua_S,(bool)ret);
return 1;
}
luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.SpriteFrameCache:eraseFrame",argc, 1);
return 0;
#if COCOS2D_DEBUG >= 1
tolua_lerror:
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_SpriteFrameCache_eraseFrame'.",&tolua_err);
#endif
return 0;
}
int lua_cocos2dx_SpriteFrameCache_isSpriteFramesWithFileLoaded(lua_State* tolua_S)
{
int argc = 0;
@ -98648,17 +99253,24 @@ int lua_register_cocos2dx_SpriteFrameCache(lua_State* tolua_S)
tolua_cclass(tolua_S,"SpriteFrameCache","cc.SpriteFrameCache","cc.Ref",nullptr);
tolua_beginmodule(tolua_S,"SpriteFrameCache");
tolua_function(tolua_S,"insertFrame",lua_cocos2dx_SpriteFrameCache_insertFrame);
tolua_function(tolua_S,"reloadTexture",lua_cocos2dx_SpriteFrameCache_reloadTexture);
tolua_function(tolua_S,"addSpriteFramesWithFileContent",lua_cocos2dx_SpriteFrameCache_addSpriteFramesWithFileContent);
tolua_function(tolua_S,"getSpriteSheetLoader",lua_cocos2dx_SpriteFrameCache_getSpriteSheetLoader);
tolua_function(tolua_S,"addSpriteFrame",lua_cocos2dx_SpriteFrameCache_addSpriteFrame);
tolua_function(tolua_S,"findFrame",lua_cocos2dx_SpriteFrameCache_findFrame);
tolua_function(tolua_S,"addSpriteFrames",lua_cocos2dx_SpriteFrameCache_addSpriteFramesWithFile);
tolua_function(tolua_S,"getSpriteFrame",lua_cocos2dx_SpriteFrameCache_getSpriteFrameByName);
tolua_function(tolua_S,"addSpriteFrameCapInset",lua_cocos2dx_SpriteFrameCache_addSpriteFrameCapInset);
tolua_function(tolua_S,"removeSpriteFramesFromFile",lua_cocos2dx_SpriteFrameCache_removeSpriteFramesFromFile);
tolua_function(tolua_S,"init",lua_cocos2dx_SpriteFrameCache_init);
tolua_function(tolua_S,"removeSpriteFrames",lua_cocos2dx_SpriteFrameCache_removeSpriteFrames);
tolua_function(tolua_S,"deregisterSpriteSheetLoader",lua_cocos2dx_SpriteFrameCache_deregisterSpriteSheetLoader);
tolua_function(tolua_S,"removeUnusedSpriteFrames",lua_cocos2dx_SpriteFrameCache_removeUnusedSpriteFrames);
tolua_function(tolua_S,"removeSpriteFramesFromFileContent",lua_cocos2dx_SpriteFrameCache_removeSpriteFramesFromFileContent);
tolua_function(tolua_S,"removeSpriteFrameByName",lua_cocos2dx_SpriteFrameCache_removeSpriteFrameByName);
tolua_function(tolua_S,"registerSpriteSheetLoader",lua_cocos2dx_SpriteFrameCache_registerSpriteSheetLoader);
tolua_function(tolua_S,"eraseFrame",lua_cocos2dx_SpriteFrameCache_eraseFrame);
tolua_function(tolua_S,"isSpriteFramesWithFileLoaded",lua_cocos2dx_SpriteFrameCache_isSpriteFramesWithFileLoaded);
tolua_function(tolua_S,"removeSpriteFramesFromTexture",lua_cocos2dx_SpriteFrameCache_removeSpriteFramesFromTexture);
tolua_function(tolua_S,"destroyInstance", lua_cocos2dx_SpriteFrameCache_destroyInstance);
@ -105967,6 +106579,7 @@ TOLUA_API int register_all_cocos2dx(lua_State* tolua_S)
lua_register_cocos2dx_MoveBy(tolua_S);
lua_register_cocos2dx_MoveTo(tolua_S);
lua_register_cocos2dx_JumpBy(tolua_S);
lua_register_cocos2dx_SpriteSheetLoader(tolua_S);
lua_register_cocos2dx_EventListener(tolua_S);
lua_register_cocos2dx_EventListenerKeyboard(tolua_S);
lua_register_cocos2dx_EventListenerMouse(tolua_S);
@ -106117,6 +106730,7 @@ TOLUA_API int register_all_cocos2dx(lua_State* tolua_S)
lua_register_cocos2dx_Properties(tolua_S);
lua_register_cocos2dx_BezierBy(tolua_S);
lua_register_cocos2dx_BezierTo(tolua_S);
lua_register_cocos2dx_SpriteSheet(tolua_S);
lua_register_cocos2dx_ParticleMeteor(tolua_S);
lua_register_cocos2dx_SpriteFrame(tolua_S);
lua_register_cocos2dx_Liquid(tolua_S);

View File

@ -2314,6 +2314,18 @@ int register_all_cocos2dx(lua_State* tolua_S);

View File

@ -3,6 +3,552 @@
#include "scripting/lua-bindings/manual/tolua_fix.h"
#include "scripting/lua-bindings/manual/LuaBasicConversions.h"
int lua_cocos2dx_extension_Controller_receiveExternalKeyEvent(lua_State* tolua_S)
{
int argc = 0;
cocos2d::Controller* 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.Controller",0,&tolua_err)) goto tolua_lerror;
#endif
cobj = (cocos2d::Controller*)tolua_tousertype(tolua_S,1,0);
#if COCOS2D_DEBUG >= 1
if (!cobj)
{
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_extension_Controller_receiveExternalKeyEvent'", nullptr);
return 0;
}
#endif
argc = lua_gettop(tolua_S)-1;
if (argc == 2)
{
int arg0;
bool arg1;
ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "cc.Controller:receiveExternalKeyEvent");
ok &= luaval_to_boolean(tolua_S, 3,&arg1, "cc.Controller:receiveExternalKeyEvent");
if(!ok)
{
tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_extension_Controller_receiveExternalKeyEvent'", nullptr);
return 0;
}
cobj->receiveExternalKeyEvent(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.Controller:receiveExternalKeyEvent",argc, 2);
return 0;
#if COCOS2D_DEBUG >= 1
tolua_lerror:
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_extension_Controller_receiveExternalKeyEvent'.",&tolua_err);
#endif
return 0;
}
int lua_cocos2dx_extension_Controller_getDeviceName(lua_State* tolua_S)
{
int argc = 0;
cocos2d::Controller* 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.Controller",0,&tolua_err)) goto tolua_lerror;
#endif
cobj = (cocos2d::Controller*)tolua_tousertype(tolua_S,1,0);
#if COCOS2D_DEBUG >= 1
if (!cobj)
{
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_extension_Controller_getDeviceName'", 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_extension_Controller_getDeviceName'", nullptr);
return 0;
}
const std::string& ret = cobj->getDeviceName();
lua_pushlstring(tolua_S,ret.c_str(),ret.length());
return 1;
}
luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Controller:getDeviceName",argc, 0);
return 0;
#if COCOS2D_DEBUG >= 1
tolua_lerror:
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_extension_Controller_getDeviceName'.",&tolua_err);
#endif
return 0;
}
int lua_cocos2dx_extension_Controller_isConnected(lua_State* tolua_S)
{
int argc = 0;
cocos2d::Controller* 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.Controller",0,&tolua_err)) goto tolua_lerror;
#endif
cobj = (cocos2d::Controller*)tolua_tousertype(tolua_S,1,0);
#if COCOS2D_DEBUG >= 1
if (!cobj)
{
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_extension_Controller_isConnected'", 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_extension_Controller_isConnected'", nullptr);
return 0;
}
bool ret = cobj->isConnected();
tolua_pushboolean(tolua_S,(bool)ret);
return 1;
}
luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Controller:isConnected",argc, 0);
return 0;
#if COCOS2D_DEBUG >= 1
tolua_lerror:
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_extension_Controller_isConnected'.",&tolua_err);
#endif
return 0;
}
int lua_cocos2dx_extension_Controller_getDeviceId(lua_State* tolua_S)
{
int argc = 0;
cocos2d::Controller* 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.Controller",0,&tolua_err)) goto tolua_lerror;
#endif
cobj = (cocos2d::Controller*)tolua_tousertype(tolua_S,1,0);
#if COCOS2D_DEBUG >= 1
if (!cobj)
{
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_extension_Controller_getDeviceId'", 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_extension_Controller_getDeviceId'", nullptr);
return 0;
}
int ret = cobj->getDeviceId();
tolua_pushnumber(tolua_S,(lua_Number)ret);
return 1;
}
luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Controller:getDeviceId",argc, 0);
return 0;
#if COCOS2D_DEBUG >= 1
tolua_lerror:
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_extension_Controller_getDeviceId'.",&tolua_err);
#endif
return 0;
}
int lua_cocos2dx_extension_Controller_getKeyStatus(lua_State* tolua_S)
{
int argc = 0;
cocos2d::Controller* 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.Controller",0,&tolua_err)) goto tolua_lerror;
#endif
cobj = (cocos2d::Controller*)tolua_tousertype(tolua_S,1,0);
#if COCOS2D_DEBUG >= 1
if (!cobj)
{
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_extension_Controller_getKeyStatus'", nullptr);
return 0;
}
#endif
argc = lua_gettop(tolua_S)-1;
if (argc == 1)
{
int arg0;
ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "cc.Controller:getKeyStatus");
if(!ok)
{
tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_extension_Controller_getKeyStatus'", nullptr);
return 0;
}
const cocos2d::Controller::_keyStatus& ret = cobj->getKeyStatus(arg0);
#pragma warning NO CONVERSION FROM NATIVE FOR _keyStatus;
return 1;
}
luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Controller:getKeyStatus",argc, 1);
return 0;
#if COCOS2D_DEBUG >= 1
tolua_lerror:
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_extension_Controller_getKeyStatus'.",&tolua_err);
#endif
return 0;
}
int lua_cocos2dx_extension_Controller_setTag(lua_State* tolua_S)
{
int argc = 0;
cocos2d::Controller* 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.Controller",0,&tolua_err)) goto tolua_lerror;
#endif
cobj = (cocos2d::Controller*)tolua_tousertype(tolua_S,1,0);
#if COCOS2D_DEBUG >= 1
if (!cobj)
{
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_extension_Controller_setTag'", nullptr);
return 0;
}
#endif
argc = lua_gettop(tolua_S)-1;
if (argc == 1)
{
int arg0;
ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "cc.Controller:setTag");
if(!ok)
{
tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_extension_Controller_setTag'", nullptr);
return 0;
}
cobj->setTag(arg0);
lua_settop(tolua_S, 1);
return 1;
}
luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Controller:setTag",argc, 1);
return 0;
#if COCOS2D_DEBUG >= 1
tolua_lerror:
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_extension_Controller_setTag'.",&tolua_err);
#endif
return 0;
}
int lua_cocos2dx_extension_Controller_getTag(lua_State* tolua_S)
{
int argc = 0;
cocos2d::Controller* 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.Controller",0,&tolua_err)) goto tolua_lerror;
#endif
cobj = (cocos2d::Controller*)tolua_tousertype(tolua_S,1,0);
#if COCOS2D_DEBUG >= 1
if (!cobj)
{
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_extension_Controller_getTag'", 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_extension_Controller_getTag'", nullptr);
return 0;
}
int ret = cobj->getTag();
tolua_pushnumber(tolua_S,(lua_Number)ret);
return 1;
}
luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Controller:getTag",argc, 0);
return 0;
#if COCOS2D_DEBUG >= 1
tolua_lerror:
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_extension_Controller_getTag'.",&tolua_err);
#endif
return 0;
}
int lua_cocos2dx_extension_Controller_getAllController(lua_State* tolua_S)
{
int argc = 0;
bool ok = true;
#if COCOS2D_DEBUG >= 1
tolua_Error tolua_err;
#endif
#if COCOS2D_DEBUG >= 1
if (!tolua_isusertable(tolua_S,1,"cc.Controller",0,&tolua_err)) goto tolua_lerror;
#endif
argc = lua_gettop(tolua_S) - 1;
if (argc == 0)
{
if(!ok)
{
tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_extension_Controller_getAllController'", nullptr);
return 0;
}
const std::vector<cocos2d::Controller *>& ret = cocos2d::Controller::getAllController();
object_to_luaval<std::vector<cocos2d::Controller >&>(tolua_S, "std::vector<cocos2d::Controller *>",(std::vector<cocos2d::Controller *>&)ret);
return 1;
}
luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d\n ", "cc.Controller:getAllController",argc, 0);
return 0;
#if COCOS2D_DEBUG >= 1
tolua_lerror:
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_extension_Controller_getAllController'.",&tolua_err);
#endif
return 0;
}
int lua_cocos2dx_extension_Controller_startDiscoveryController(lua_State* tolua_S)
{
int argc = 0;
bool ok = true;
#if COCOS2D_DEBUG >= 1
tolua_Error tolua_err;
#endif
#if COCOS2D_DEBUG >= 1
if (!tolua_isusertable(tolua_S,1,"cc.Controller",0,&tolua_err)) goto tolua_lerror;
#endif
argc = lua_gettop(tolua_S) - 1;
if (argc == 0)
{
if(!ok)
{
tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_extension_Controller_startDiscoveryController'", nullptr);
return 0;
}
cocos2d::Controller::startDiscoveryController();
lua_settop(tolua_S, 1);
return 1;
}
luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d\n ", "cc.Controller:startDiscoveryController",argc, 0);
return 0;
#if COCOS2D_DEBUG >= 1
tolua_lerror:
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_extension_Controller_startDiscoveryController'.",&tolua_err);
#endif
return 0;
}
int lua_cocos2dx_extension_Controller_stopDiscoveryController(lua_State* tolua_S)
{
int argc = 0;
bool ok = true;
#if COCOS2D_DEBUG >= 1
tolua_Error tolua_err;
#endif
#if COCOS2D_DEBUG >= 1
if (!tolua_isusertable(tolua_S,1,"cc.Controller",0,&tolua_err)) goto tolua_lerror;
#endif
argc = lua_gettop(tolua_S) - 1;
if (argc == 0)
{
if(!ok)
{
tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_extension_Controller_stopDiscoveryController'", nullptr);
return 0;
}
cocos2d::Controller::stopDiscoveryController();
lua_settop(tolua_S, 1);
return 1;
}
luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d\n ", "cc.Controller:stopDiscoveryController",argc, 0);
return 0;
#if COCOS2D_DEBUG >= 1
tolua_lerror:
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_extension_Controller_stopDiscoveryController'.",&tolua_err);
#endif
return 0;
}
int lua_cocos2dx_extension_Controller_getControllerByDeviceId(lua_State* tolua_S)
{
int argc = 0;
bool ok = true;
#if COCOS2D_DEBUG >= 1
tolua_Error tolua_err;
#endif
#if COCOS2D_DEBUG >= 1
if (!tolua_isusertable(tolua_S,1,"cc.Controller",0,&tolua_err)) goto tolua_lerror;
#endif
argc = lua_gettop(tolua_S) - 1;
if (argc == 1)
{
int arg0;
ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "cc.Controller:getControllerByDeviceId");
if(!ok)
{
tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_extension_Controller_getControllerByDeviceId'", nullptr);
return 0;
}
cocos2d::Controller* ret = cocos2d::Controller::getControllerByDeviceId(arg0);
object_to_luaval<cocos2d::Controller>(tolua_S, "cc.Controller",(cocos2d::Controller*)ret);
return 1;
}
luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d\n ", "cc.Controller:getControllerByDeviceId",argc, 1);
return 0;
#if COCOS2D_DEBUG >= 1
tolua_lerror:
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_extension_Controller_getControllerByDeviceId'.",&tolua_err);
#endif
return 0;
}
int lua_cocos2dx_extension_Controller_getControllerByTag(lua_State* tolua_S)
{
int argc = 0;
bool ok = true;
#if COCOS2D_DEBUG >= 1
tolua_Error tolua_err;
#endif
#if COCOS2D_DEBUG >= 1
if (!tolua_isusertable(tolua_S,1,"cc.Controller",0,&tolua_err)) goto tolua_lerror;
#endif
argc = lua_gettop(tolua_S) - 1;
if (argc == 1)
{
int arg0;
ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "cc.Controller:getControllerByTag");
if(!ok)
{
tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_extension_Controller_getControllerByTag'", nullptr);
return 0;
}
cocos2d::Controller* ret = cocos2d::Controller::getControllerByTag(arg0);
object_to_luaval<cocos2d::Controller>(tolua_S, "cc.Controller",(cocos2d::Controller*)ret);
return 1;
}
luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d\n ", "cc.Controller:getControllerByTag",argc, 1);
return 0;
#if COCOS2D_DEBUG >= 1
tolua_lerror:
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_extension_Controller_getControllerByTag'.",&tolua_err);
#endif
return 0;
}
static int lua_cocos2dx_extension_Controller_finalize(lua_State* tolua_S)
{
printf("luabindings: finalizing LUA object (Controller)");
return 0;
}
int lua_register_cocos2dx_extension_Controller(lua_State* tolua_S)
{
tolua_usertype(tolua_S,"cc.Controller");
tolua_cclass(tolua_S,"Controller","cc.Controller","",nullptr);
tolua_beginmodule(tolua_S,"Controller");
tolua_function(tolua_S,"receiveExternalKeyEvent",lua_cocos2dx_extension_Controller_receiveExternalKeyEvent);
tolua_function(tolua_S,"getDeviceName",lua_cocos2dx_extension_Controller_getDeviceName);
tolua_function(tolua_S,"isConnected",lua_cocos2dx_extension_Controller_isConnected);
tolua_function(tolua_S,"getDeviceId",lua_cocos2dx_extension_Controller_getDeviceId);
tolua_function(tolua_S,"getKeyStatus",lua_cocos2dx_extension_Controller_getKeyStatus);
tolua_function(tolua_S,"setTag",lua_cocos2dx_extension_Controller_setTag);
tolua_function(tolua_S,"getTag",lua_cocos2dx_extension_Controller_getTag);
tolua_function(tolua_S,"getAllController", lua_cocos2dx_extension_Controller_getAllController);
tolua_function(tolua_S,"startDiscoveryController", lua_cocos2dx_extension_Controller_startDiscoveryController);
tolua_function(tolua_S,"stopDiscoveryController", lua_cocos2dx_extension_Controller_stopDiscoveryController);
tolua_function(tolua_S,"getControllerByDeviceId", lua_cocos2dx_extension_Controller_getControllerByDeviceId);
tolua_function(tolua_S,"getControllerByTag", lua_cocos2dx_extension_Controller_getControllerByTag);
tolua_endmodule(tolua_S);
auto typeName = typeid(cocos2d::Controller).name(); // rtti is literal storage
g_luaType[reinterpret_cast<uintptr_t>(typeName)] = "cc.Controller";
g_typeCast[typeName] = "cc.Controller";
return 1;
}
int lua_cocos2dx_extension_AssetsManager_setStoragePath(lua_State* tolua_S)
{
int argc = 0;
@ -5794,6 +6340,7 @@ TOLUA_API int register_all_cocos2dx_extension(lua_State* tolua_S)
lua_register_cocos2dx_extension_EventListenerAssetsManagerEx(tolua_S);
lua_register_cocos2dx_extension_AssetsManager(tolua_S);
lua_register_cocos2dx_extension_Manifest(tolua_S);
lua_register_cocos2dx_extension_Controller(tolua_S);
lua_register_cocos2dx_extension_EventAssetsManagerEx(tolua_S);
lua_register_cocos2dx_extension_ParticleSystem3D(tolua_S);
lua_register_cocos2dx_extension_PUParticleSystem3D(tolua_S);

View File

@ -115,6 +115,19 @@ int register_all_cocos2dx_extension(lua_State* tolua_S);

View File

@ -14,7 +14,7 @@ android_flags = -target armv7-none-linux-androideabi -D_LIBCPP_DISABLE_VISIBILIT
clang_headers =
clang_flags = -nostdinc -x c++ -std=c++11 -fsigned-char -U__SSE__
cocos_headers = -I%(cocosdir)s -I%(cocosdir)s/extensions -I%(cocosdir)s/extensions/cocostudio -I%(cocosdir)s/cocos -I%(cocosdir)s/cocos/platform/android -I%(cocosdir)s/thirdparty -I%(cocosdir)s/thirdparty/rapidjson
cocos_headers = -I%(cocosdir)s -I%(cocosdir)s/extensions -I%(cocosdir)s/extensions/cocostudio -I%(cocosdir)s/cocos -I%(cocosdir)s/cocos/platform/android -I%(cocosdir)s/thirdparty -I%(cocosdir)s/thirdparty/rapidjson -I%(cocosdir)s/thirdparty/box2d/include
cocos_flags = -DANDROID