From eba8696d654c0c7796b940da65aa736aef28bfb5 Mon Sep 17 00:00:00 2001 From: rh101 Date: Thu, 2 Sep 2021 17:46:22 +1000 Subject: [PATCH] Change %ld to %d for 32bit data types Regenerate LUA bindings --- cocos/base/CCProfiling.cpp | 2 +- cocos/base/CCProperties.cpp | 2 +- cocos/platform/CCGLView.cpp | 4 +- cocos/renderer/CCTextureCache.cpp | 2 +- cocos/ui/UIHelper.cpp | 2 +- .../lua-bindings/auto/lua_cocos2dx_auto.cpp | 4640 +++++++++-------- .../lua-bindings/auto/lua_cocos2dx_auto.hpp | 4 + .../Classes/ActionsTest/ActionsTest.cpp | 2 +- .../Classes/Camera3DTest/Camera3DTest.cpp | 4 +- .../TableViewTest/TableViewTestScene.cpp | 4 +- .../Classes/FileUtilsTest/FileUtilsTest.cpp | 4 +- .../HttpClientTest/HttpClientTest.cpp | 8 +- .../UIPageViewTest/UIPageViewTest.cpp | 6 +- .../UIRichTextTest/UIRichTextTest.cpp | 4 +- 14 files changed, 2445 insertions(+), 2243 deletions(-) diff --git a/cocos/base/CCProfiling.cpp b/cocos/base/CCProfiling.cpp index d3324790b3..de7e90fd8f 100644 --- a/cocos/base/CCProfiling.cpp +++ b/cocos/base/CCProfiling.cpp @@ -115,7 +115,7 @@ std::string ProfilingTimer::getDescription() const { static char s_description[512] = {0}; - sprintf(s_description, "%s ::\tavg1: %ldu,\tavg2: %ldu,\tmin: %ldu,\tmax: %ldu,\ttotal: %.2fs,\tnr calls: %ld", _nameStr.c_str(), _averageTime1, _averageTime2, minTime, maxTime, totalTime/1000000., numberOfCalls); + sprintf(s_description, "%s ::\tavg1: %du,\tavg2: %du,\tmin: %du,\tmax: %du,\ttotal: %.2fs,\tnr calls: %d", _nameStr.c_str(), _averageTime1, _averageTime2, minTime, maxTime, totalTime/1000000., numberOfCalls); return s_description; } diff --git a/cocos/base/CCProperties.cpp b/cocos/base/CCProperties.cpp index 8dbb70070e..6a5d8f4a26 100644 --- a/cocos/base/CCProperties.cpp +++ b/cocos/base/CCProperties.cpp @@ -902,7 +902,7 @@ int32_t Properties::getLong(const char* name) const { int32_t value; int scanned; - scanned = sscanf(valueString, "%ld", &value); + scanned = sscanf(valueString, "%d", &value); if (scanned != 1) { CCLOGERROR("Error attempting to parse property '%s' as a long integer.", name); diff --git a/cocos/platform/CCGLView.cpp b/cocos/platform/CCGLView.cpp index 95968bf261..dc447f640f 100644 --- a/cocos/platform/CCGLView.cpp +++ b/cocos/platform/CCGLView.cpp @@ -380,7 +380,7 @@ void GLView::handleTouchesMove(int num, intptr_t ids[], float xs[], float ys[], else { // It is error, should return. - CCLOG("Moving touches with id: %ld error", (int32_t)id); + CCLOG("Moving touches with id: %d error", static_cast(id)); return; } } @@ -433,7 +433,7 @@ void GLView::handleTouchesOfEndOrCancel(EventTouch::EventCode eventCode, int num } else { - CCLOG("Ending touches with id: %ld error", static_cast(id)); + CCLOG("Ending touches with id: %d error", static_cast(id)); return; } diff --git a/cocos/renderer/CCTextureCache.cpp b/cocos/renderer/CCTextureCache.cpp index ee58ae3e12..8ce35c4d25 100644 --- a/cocos/renderer/CCTextureCache.cpp +++ b/cocos/renderer/CCTextureCache.cpp @@ -652,7 +652,7 @@ std::string TextureCache::getCachedTextureInfo() const auto bytes = tex->getPixelsWide() * tex->getPixelsHigh() * bpp / 8; totalBytes += bytes; count++; - snprintf(buftmp, sizeof(buftmp) - 1, "\"%s\" rc=%lu id=%p %lu x %lu @ %ld bpp => %lu KB\n", + snprintf(buftmp, sizeof(buftmp) - 1, "\"%s\" rc=%lu id=%p %lu x %lu @ %d bpp => %lu KB\n", texture.first.c_str(), (int32_t)tex->getReferenceCount(), tex->getBackendTexture(), diff --git a/cocos/ui/UIHelper.cpp b/cocos/ui/UIHelper.cpp index 0e72f299d1..02e74c3b11 100644 --- a/cocos/ui/UIHelper.cpp +++ b/cocos/ui/UIHelper.cpp @@ -123,7 +123,7 @@ std::string Helper::getSubStringOfUTF8String(const std::string& str, std::string return ""; } if (utf32.size() < start) { - CCLOGERROR("'start' is out of range: %ld, %s", static_cast(start), str.c_str()); + CCLOGERROR("'start' is out of range: %d, %s", static_cast(start), str.c_str()); return ""; } std::string result; diff --git a/extensions/scripting/lua-bindings/auto/lua_cocos2dx_auto.cpp b/extensions/scripting/lua-bindings/auto/lua_cocos2dx_auto.cpp index 866e1ca34a..3a0b98fae5 100644 --- a/extensions/scripting/lua-bindings/auto/lua_cocos2dx_auto.cpp +++ b/extensions/scripting/lua-bindings/auto/lua_cocos2dx_auto.cpp @@ -29629,7 +29629,7 @@ int lua_cocos2dx_Properties_getLong(lua_State* tolua_S) tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Properties_getLong'", nullptr); return 0; } - long ret = cobj->getLong(); + int ret = cobj->getLong(); tolua_pushnumber(tolua_S,(lua_Number)ret); return 1; } @@ -29643,7 +29643,7 @@ int lua_cocos2dx_Properties_getLong(lua_State* tolua_S) tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Properties_getLong'", nullptr); return 0; } - long ret = cobj->getLong(arg0); + int ret = cobj->getLong(arg0); tolua_pushnumber(tolua_S,(lua_Number)ret); return 1; } @@ -57589,2207 +57589,6 @@ int lua_register_cocos2dx_LabelAtlas(lua_State* tolua_S) return 1; } -int lua_cocos2dx_Sprite_setSpriteFrame(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::Sprite* 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.Sprite",0,&tolua_err)) goto tolua_lerror; -#endif - cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_setSpriteFrame'", nullptr); - return 0; - } -#endif - argc = lua_gettop(tolua_S)-1; - do{ - if (argc == 1) { - cocos2d::SpriteFrame* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.SpriteFrame",&arg0, "cc.Sprite:setSpriteFrame"); - - if (!ok) { break; } - cobj->setSpriteFrame(arg0); - lua_settop(tolua_S, 1); - return 1; - } - }while(0); - ok = true; - do{ - if (argc == 1) { - std::string arg0; - ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.Sprite:setSpriteFrame"); - - if (!ok) { break; } - cobj->setSpriteFrame(arg0); - 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.Sprite:setSpriteFrame",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_setSpriteFrame'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_Sprite_setTexture(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::Sprite* 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.Sprite",0,&tolua_err)) goto tolua_lerror; -#endif - cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_setTexture'", nullptr); - return 0; - } -#endif - argc = lua_gettop(tolua_S)-1; - do{ - if (argc == 1) { - cocos2d::Texture2D* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Texture2D",&arg0, "cc.Sprite:setTexture"); - - if (!ok) { break; } - cobj->setTexture(arg0); - lua_settop(tolua_S, 1); - return 1; - } - }while(0); - ok = true; - do{ - if (argc == 1) { - std::string arg0; - ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.Sprite:setTexture"); - - if (!ok) { break; } - cobj->setTexture(arg0); - 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.Sprite:setTexture",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_setTexture'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_Sprite_getTexture(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::Sprite* 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.Sprite",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_getTexture'", 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_Sprite_getTexture'", nullptr); - return 0; - } - cocos2d::Texture2D* ret = cobj->getTexture(); - object_to_luaval(tolua_S, "cc.Texture2D",(cocos2d::Texture2D*)ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite:getTexture",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_getTexture'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_Sprite_setFlippedY(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::Sprite* 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.Sprite",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_setFlippedY'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 1) - { - bool arg0; - - ok &= luaval_to_boolean(tolua_S, 2,&arg0, "cc.Sprite:setFlippedY"); - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Sprite_setFlippedY'", nullptr); - return 0; - } - cobj->setFlippedY(arg0); - lua_settop(tolua_S, 1); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite:setFlippedY",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_setFlippedY'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_Sprite_setFlippedX(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::Sprite* 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.Sprite",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_setFlippedX'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 1) - { - bool arg0; - - ok &= luaval_to_boolean(tolua_S, 2,&arg0, "cc.Sprite:setFlippedX"); - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Sprite_setFlippedX'", nullptr); - return 0; - } - cobj->setFlippedX(arg0); - lua_settop(tolua_S, 1); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite:setFlippedX",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_setFlippedX'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_Sprite_getResourceType(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::Sprite* 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.Sprite",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_getResourceType'", 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_Sprite_getResourceType'", nullptr); - return 0; - } - int ret = cobj->getResourceType(); - 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.Sprite:getResourceType",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_getResourceType'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_Sprite_setDisplayFrameWithAnimationName(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::Sprite* 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.Sprite",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_setDisplayFrameWithAnimationName'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 2) - { - std::string arg0; - unsigned int arg1; - - ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.Sprite:setDisplayFrameWithAnimationName"); - - ok &= luaval_to_uint32(tolua_S, 3,&arg1, "cc.Sprite:setDisplayFrameWithAnimationName"); - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Sprite_setDisplayFrameWithAnimationName'", nullptr); - return 0; - } - cobj->setDisplayFrameWithAnimationName(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.Sprite:setDisplayFrameWithAnimationName",argc, 2); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_setDisplayFrameWithAnimationName'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_Sprite_getBatchNode(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::Sprite* 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.Sprite",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_getBatchNode'", 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_Sprite_getBatchNode'", nullptr); - return 0; - } - cocos2d::SpriteBatchNode* ret = cobj->getBatchNode(); - object_to_luaval(tolua_S, "cc.SpriteBatchNode",(cocos2d::SpriteBatchNode*)ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite:getBatchNode",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_getBatchNode'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_Sprite_getOffsetPosition(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::Sprite* 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.Sprite",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_getOffsetPosition'", 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_Sprite_getOffsetPosition'", nullptr); - return 0; - } - const cocos2d::Vec2& ret = cobj->getOffsetPosition(); - vec2_to_luaval(tolua_S, ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite:getOffsetPosition",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_getOffsetPosition'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_Sprite_getCenterRect(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::Sprite* 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.Sprite",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_getCenterRect'", 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_Sprite_getCenterRect'", nullptr); - return 0; - } - cocos2d::Rect ret = cobj->getCenterRect(); - rect_to_luaval(tolua_S, ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite:getCenterRect",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_getCenterRect'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_Sprite_setCenterRectNormalized(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::Sprite* 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.Sprite",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_setCenterRectNormalized'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 1) - { - cocos2d::Rect arg0; - - ok &= luaval_to_rect(tolua_S, 2, &arg0, "cc.Sprite:setCenterRectNormalized"); - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Sprite_setCenterRectNormalized'", nullptr); - return 0; - } - cobj->setCenterRectNormalized(arg0); - lua_settop(tolua_S, 1); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite:setCenterRectNormalized",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_setCenterRectNormalized'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_Sprite_isStretchEnabled(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::Sprite* 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.Sprite",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_isStretchEnabled'", 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_Sprite_isStretchEnabled'", nullptr); - return 0; - } - bool ret = cobj->isStretchEnabled(); - tolua_pushboolean(tolua_S,(bool)ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite:isStretchEnabled",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_isStretchEnabled'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_Sprite_setTextureRect(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::Sprite* 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.Sprite",0,&tolua_err)) goto tolua_lerror; -#endif - cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_setTextureRect'", nullptr); - return 0; - } -#endif - argc = lua_gettop(tolua_S)-1; - do{ - if (argc == 3) { - cocos2d::Rect arg0; - ok &= luaval_to_rect(tolua_S, 2, &arg0, "cc.Sprite:setTextureRect"); - - if (!ok) { break; } - bool arg1; - ok &= luaval_to_boolean(tolua_S, 3,&arg1, "cc.Sprite:setTextureRect"); - - if (!ok) { break; } - cocos2d::Size arg2; - ok &= luaval_to_size(tolua_S, 4, &arg2, "cc.Sprite:setTextureRect"); - - if (!ok) { break; } - cobj->setTextureRect(arg0, arg1, arg2); - lua_settop(tolua_S, 1); - return 1; - } - }while(0); - ok = true; - do{ - if (argc == 1) { - cocos2d::Rect arg0; - ok &= luaval_to_rect(tolua_S, 2, &arg0, "cc.Sprite:setTextureRect"); - - if (!ok) { break; } - cobj->setTextureRect(arg0); - 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.Sprite:setTextureRect",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_setTextureRect'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_Sprite_initWithSpriteFrameName(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::Sprite* 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.Sprite",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_initWithSpriteFrameName'", 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.Sprite:initWithSpriteFrameName"); - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Sprite_initWithSpriteFrameName'", nullptr); - return 0; - } - bool ret = cobj->initWithSpriteFrameName(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.Sprite:initWithSpriteFrameName",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_initWithSpriteFrameName'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_Sprite_setStretchEnabled(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::Sprite* 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.Sprite",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_setStretchEnabled'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 1) - { - bool arg0; - - ok &= luaval_to_boolean(tolua_S, 2,&arg0, "cc.Sprite:setStretchEnabled"); - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Sprite_setStretchEnabled'", nullptr); - return 0; - } - cobj->setStretchEnabled(arg0); - lua_settop(tolua_S, 1); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite:setStretchEnabled",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_setStretchEnabled'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_Sprite_isFrameDisplayed(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::Sprite* 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.Sprite",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_isFrameDisplayed'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 1) - { - cocos2d::SpriteFrame* arg0; - - ok &= luaval_to_object(tolua_S, 2, "cc.SpriteFrame",&arg0, "cc.Sprite:isFrameDisplayed"); - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Sprite_isFrameDisplayed'", nullptr); - return 0; - } - bool ret = cobj->isFrameDisplayed(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.Sprite:isFrameDisplayed",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_isFrameDisplayed'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_Sprite_getAtlasIndex(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::Sprite* 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.Sprite",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_getAtlasIndex'", 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_Sprite_getAtlasIndex'", nullptr); - return 0; - } - unsigned int ret = cobj->getAtlasIndex(); - 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.Sprite:getAtlasIndex",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_getAtlasIndex'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_Sprite_setTextureAtlas(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::Sprite* 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.Sprite",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_setTextureAtlas'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 1) - { - cocos2d::TextureAtlas* arg0; - - ok &= luaval_to_object(tolua_S, 2, "cc.TextureAtlas",&arg0, "cc.Sprite:setTextureAtlas"); - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Sprite_setTextureAtlas'", nullptr); - return 0; - } - cobj->setTextureAtlas(arg0); - lua_settop(tolua_S, 1); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite:setTextureAtlas",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_setTextureAtlas'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_Sprite_setBatchNode(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::Sprite* 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.Sprite",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_setBatchNode'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 1) - { - cocos2d::SpriteBatchNode* arg0; - - ok &= luaval_to_object(tolua_S, 2, "cc.SpriteBatchNode",&arg0, "cc.Sprite:setBatchNode"); - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Sprite_setBatchNode'", nullptr); - return 0; - } - cobj->setBatchNode(arg0); - lua_settop(tolua_S, 1); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite:setBatchNode",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_setBatchNode'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_Sprite_getBlendFunc(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::Sprite* 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.Sprite",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_getBlendFunc'", 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_Sprite_getBlendFunc'", nullptr); - return 0; - } - const cocos2d::BlendFunc& ret = cobj->getBlendFunc(); - blendfunc_to_luaval(tolua_S, ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite:getBlendFunc",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_getBlendFunc'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_Sprite_setCenterRect(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::Sprite* 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.Sprite",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_setCenterRect'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 1) - { - cocos2d::Rect arg0; - - ok &= luaval_to_rect(tolua_S, 2, &arg0, "cc.Sprite:setCenterRect"); - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Sprite_setCenterRect'", nullptr); - return 0; - } - cobj->setCenterRect(arg0); - lua_settop(tolua_S, 1); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite:setCenterRect",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_setCenterRect'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_Sprite_getSpriteFrame(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::Sprite* 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.Sprite",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_getSpriteFrame'", 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_Sprite_getSpriteFrame'", nullptr); - return 0; - } - cocos2d::SpriteFrame* ret = cobj->getSpriteFrame(); - object_to_luaval(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.Sprite:getSpriteFrame",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_getSpriteFrame'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_Sprite_setVertexLayout(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::Sprite* 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.Sprite",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_setVertexLayout'", 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_Sprite_setVertexLayout'", nullptr); - return 0; - } - cobj->setVertexLayout(); - lua_settop(tolua_S, 1); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite:setVertexLayout",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_setVertexLayout'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_Sprite_removeAllChildrenWithCleanup(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::Sprite* 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.Sprite",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_removeAllChildrenWithCleanup'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 1) - { - bool arg0; - - ok &= luaval_to_boolean(tolua_S, 2,&arg0, "cc.Sprite:removeAllChildrenWithCleanup"); - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Sprite_removeAllChildrenWithCleanup'", nullptr); - return 0; - } - cobj->removeAllChildrenWithCleanup(arg0); - lua_settop(tolua_S, 1); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite:removeAllChildrenWithCleanup",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_removeAllChildrenWithCleanup'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_Sprite_getResourceName(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::Sprite* 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.Sprite",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_getResourceName'", 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_Sprite_getResourceName'", nullptr); - return 0; - } - const std::string& ret = cobj->getResourceName(); - 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.Sprite:getResourceName",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_getResourceName'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_Sprite_isDirty(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::Sprite* 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.Sprite",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_isDirty'", 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_Sprite_isDirty'", nullptr); - return 0; - } - bool ret = cobj->isDirty(); - tolua_pushboolean(tolua_S,(bool)ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite:isDirty",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_isDirty'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_Sprite_getCenterRectNormalized(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::Sprite* 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.Sprite",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_getCenterRectNormalized'", 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_Sprite_getCenterRectNormalized'", nullptr); - return 0; - } - cocos2d::Rect ret = cobj->getCenterRectNormalized(); - rect_to_luaval(tolua_S, ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite:getCenterRectNormalized",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_getCenterRectNormalized'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_Sprite_setAtlasIndex(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::Sprite* 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.Sprite",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_setAtlasIndex'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 1) - { - unsigned int arg0; - - ok &= luaval_to_uint32(tolua_S, 2,&arg0, "cc.Sprite:setAtlasIndex"); - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Sprite_setAtlasIndex'", nullptr); - return 0; - } - cobj->setAtlasIndex(arg0); - lua_settop(tolua_S, 1); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite:setAtlasIndex",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_setAtlasIndex'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_Sprite_initWithTexture(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::Sprite* 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.Sprite",0,&tolua_err)) goto tolua_lerror; -#endif - cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_initWithTexture'", nullptr); - return 0; - } -#endif - argc = lua_gettop(tolua_S)-1; - do{ - if (argc == 2) { - cocos2d::Texture2D* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Texture2D",&arg0, "cc.Sprite:initWithTexture"); - - if (!ok) { break; } - cocos2d::Rect arg1; - ok &= luaval_to_rect(tolua_S, 3, &arg1, "cc.Sprite:initWithTexture"); - - if (!ok) { break; } - bool ret = cobj->initWithTexture(arg0, arg1); - tolua_pushboolean(tolua_S,(bool)ret); - return 1; - } - }while(0); - ok = true; - do{ - if (argc == 1) { - cocos2d::Texture2D* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Texture2D",&arg0, "cc.Sprite:initWithTexture"); - - if (!ok) { break; } - bool ret = cobj->initWithTexture(arg0); - tolua_pushboolean(tolua_S,(bool)ret); - return 1; - } - }while(0); - ok = true; - do{ - if (argc == 3) { - cocos2d::Texture2D* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Texture2D",&arg0, "cc.Sprite:initWithTexture"); - - if (!ok) { break; } - cocos2d::Rect arg1; - ok &= luaval_to_rect(tolua_S, 3, &arg1, "cc.Sprite:initWithTexture"); - - if (!ok) { break; } - bool arg2; - ok &= luaval_to_boolean(tolua_S, 4,&arg2, "cc.Sprite:initWithTexture"); - - if (!ok) { break; } - bool ret = cobj->initWithTexture(arg0, arg1, arg2); - tolua_pushboolean(tolua_S,(bool)ret); - return 1; - } - }while(0); - ok = true; - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite:initWithTexture",argc, 3); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_initWithTexture'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_Sprite_setDirty(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::Sprite* 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.Sprite",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_setDirty'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 1) - { - bool arg0; - - ok &= luaval_to_boolean(tolua_S, 2,&arg0, "cc.Sprite:setDirty"); - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Sprite_setDirty'", nullptr); - return 0; - } - cobj->setDirty(arg0); - lua_settop(tolua_S, 1); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite:setDirty",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_setDirty'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_Sprite_isTextureRectRotated(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::Sprite* 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.Sprite",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_isTextureRectRotated'", 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_Sprite_isTextureRectRotated'", nullptr); - return 0; - } - bool ret = cobj->isTextureRectRotated(); - tolua_pushboolean(tolua_S,(bool)ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite:isTextureRectRotated",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_isTextureRectRotated'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_Sprite_getTextureRect(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::Sprite* 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.Sprite",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_getTextureRect'", 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_Sprite_getTextureRect'", nullptr); - return 0; - } - const cocos2d::Rect& ret = cobj->getTextureRect(); - rect_to_luaval(tolua_S, ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite:getTextureRect",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_getTextureRect'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_Sprite_initWithFile(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::Sprite* 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.Sprite",0,&tolua_err)) goto tolua_lerror; -#endif - cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_initWithFile'", nullptr); - return 0; - } -#endif - argc = lua_gettop(tolua_S)-1; - do{ - if (argc == 2) { - std::string arg0; - ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.Sprite:initWithFile"); - - if (!ok) { break; } - cocos2d::Rect arg1; - ok &= luaval_to_rect(tolua_S, 3, &arg1, "cc.Sprite:initWithFile"); - - if (!ok) { break; } - bool ret = cobj->initWithFile(arg0, arg1); - tolua_pushboolean(tolua_S,(bool)ret); - return 1; - } - }while(0); - ok = true; - do{ - if (argc == 1) { - std::string arg0; - ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.Sprite:initWithFile"); - - if (!ok) { break; } - bool ret = cobj->initWithFile(arg0); - tolua_pushboolean(tolua_S,(bool)ret); - return 1; - } - }while(0); - ok = true; - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite:initWithFile",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_initWithFile'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_Sprite_setBlendFunc(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::Sprite* 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.Sprite",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_setBlendFunc'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 1) - { - cocos2d::BlendFunc arg0; - - ok &= luaval_to_blendfunc(tolua_S, 2, &arg0, "cc.Sprite:setBlendFunc"); - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Sprite_setBlendFunc'", nullptr); - return 0; - } - cobj->setBlendFunc(arg0); - lua_settop(tolua_S, 1); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite:setBlendFunc",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_setBlendFunc'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_Sprite_getTextureAtlas(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::Sprite* 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.Sprite",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_getTextureAtlas'", 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_Sprite_getTextureAtlas'", nullptr); - return 0; - } - cocos2d::TextureAtlas* ret = cobj->getTextureAtlas(); - object_to_luaval(tolua_S, "cc.TextureAtlas",(cocos2d::TextureAtlas*)ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite:getTextureAtlas",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_getTextureAtlas'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_Sprite_initWithSpriteFrame(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::Sprite* 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.Sprite",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_initWithSpriteFrame'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 1) - { - cocos2d::SpriteFrame* arg0; - - ok &= luaval_to_object(tolua_S, 2, "cc.SpriteFrame",&arg0, "cc.Sprite:initWithSpriteFrame"); - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Sprite_initWithSpriteFrame'", nullptr); - return 0; - } - bool ret = cobj->initWithSpriteFrame(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.Sprite:initWithSpriteFrame",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_initWithSpriteFrame'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_Sprite_isFlippedX(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::Sprite* 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.Sprite",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_isFlippedX'", 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_Sprite_isFlippedX'", nullptr); - return 0; - } - bool ret = cobj->isFlippedX(); - tolua_pushboolean(tolua_S,(bool)ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite:isFlippedX",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_isFlippedX'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_Sprite_isFlippedY(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::Sprite* 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.Sprite",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_isFlippedY'", 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_Sprite_isFlippedY'", nullptr); - return 0; - } - bool ret = cobj->isFlippedY(); - tolua_pushboolean(tolua_S,(bool)ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite:isFlippedY",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_isFlippedY'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_Sprite_setVertexRect(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::Sprite* 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.Sprite",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_setVertexRect'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 1) - { - cocos2d::Rect arg0; - - ok &= luaval_to_rect(tolua_S, 2, &arg0, "cc.Sprite:setVertexRect"); - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Sprite_setVertexRect'", nullptr); - return 0; - } - cobj->setVertexRect(arg0); - lua_settop(tolua_S, 1); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite:setVertexRect",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_setVertexRect'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_Sprite_createWithTexture(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.Sprite",0,&tolua_err)) goto tolua_lerror; -#endif - - argc = lua_gettop(tolua_S)-1; - - do - { - if (argc == 2) - { - cocos2d::Texture2D* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Texture2D",&arg0, "cc.Sprite:createWithTexture"); - if (!ok) { break; } - cocos2d::Rect arg1; - ok &= luaval_to_rect(tolua_S, 3, &arg1, "cc.Sprite:createWithTexture"); - if (!ok) { break; } - cocos2d::Sprite* ret = cocos2d::Sprite::createWithTexture(arg0, arg1); - object_to_luaval(tolua_S, "cc.Sprite",(cocos2d::Sprite*)ret); - return 1; - } - } while (0); - ok = true; - do - { - if (argc == 3) - { - cocos2d::Texture2D* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Texture2D",&arg0, "cc.Sprite:createWithTexture"); - if (!ok) { break; } - cocos2d::Rect arg1; - ok &= luaval_to_rect(tolua_S, 3, &arg1, "cc.Sprite:createWithTexture"); - if (!ok) { break; } - bool arg2; - ok &= luaval_to_boolean(tolua_S, 4,&arg2, "cc.Sprite:createWithTexture"); - if (!ok) { break; } - cocos2d::Sprite* ret = cocos2d::Sprite::createWithTexture(arg0, arg1, arg2); - object_to_luaval(tolua_S, "cc.Sprite",(cocos2d::Sprite*)ret); - return 1; - } - } while (0); - ok = true; - do - { - if (argc == 1) - { - cocos2d::Texture2D* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Texture2D",&arg0, "cc.Sprite:createWithTexture"); - if (!ok) { break; } - cocos2d::Sprite* ret = cocos2d::Sprite::createWithTexture(arg0); - object_to_luaval(tolua_S, "cc.Sprite",(cocos2d::Sprite*)ret); - return 1; - } - } while (0); - ok = true; - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d", "cc.Sprite:createWithTexture",argc, 1); - return 0; -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_createWithTexture'.",&tolua_err); -#endif - return 0; -} -int lua_cocos2dx_Sprite_createWithSpriteFrameName(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.Sprite",0,&tolua_err)) goto tolua_lerror; -#endif - - argc = lua_gettop(tolua_S) - 1; - - if (argc == 1) - { - std::string arg0; - ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.Sprite:createWithSpriteFrameName"); - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Sprite_createWithSpriteFrameName'", nullptr); - return 0; - } - cocos2d::Sprite* ret = cocos2d::Sprite::createWithSpriteFrameName(arg0); - object_to_luaval(tolua_S, "cc.Sprite",(cocos2d::Sprite*)ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d\n ", "cc.Sprite:createWithSpriteFrameName",argc, 1); - return 0; -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_createWithSpriteFrameName'.",&tolua_err); -#endif - return 0; -} -int lua_cocos2dx_Sprite_createWithSpriteFrame(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.Sprite",0,&tolua_err)) goto tolua_lerror; -#endif - - argc = lua_gettop(tolua_S) - 1; - - if (argc == 1) - { - cocos2d::SpriteFrame* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.SpriteFrame",&arg0, "cc.Sprite:createWithSpriteFrame"); - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Sprite_createWithSpriteFrame'", nullptr); - return 0; - } - cocos2d::Sprite* ret = cocos2d::Sprite::createWithSpriteFrame(arg0); - object_to_luaval(tolua_S, "cc.Sprite",(cocos2d::Sprite*)ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d\n ", "cc.Sprite:createWithSpriteFrame",argc, 1); - return 0; -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_createWithSpriteFrame'.",&tolua_err); -#endif - return 0; -} -int lua_cocos2dx_Sprite_constructor(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::Sprite* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - - - argc = lua_gettop(tolua_S)-1; - if (argc == 0) - { - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Sprite_constructor'", nullptr); - return 0; - } - cobj = new cocos2d::Sprite(); - cobj->autorelease(); - int ID = (int)cobj->_ID ; - int* luaID = &cobj->_luaID ; - toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)cobj,"cc.Sprite"); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite:Sprite",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_constructor'.",&tolua_err); -#endif - - return 0; -} - -static int lua_cocos2dx_Sprite_finalize(lua_State* tolua_S) -{ - printf("luabindings: finalizing LUA object (Sprite)"); - return 0; -} - -int lua_register_cocos2dx_Sprite(lua_State* tolua_S) -{ - tolua_usertype(tolua_S,"cc.Sprite"); - tolua_cclass(tolua_S,"Sprite","cc.Sprite","cc.Node",nullptr); - - tolua_beginmodule(tolua_S,"Sprite"); - tolua_function(tolua_S,"new",lua_cocos2dx_Sprite_constructor); - tolua_function(tolua_S,"setSpriteFrame",lua_cocos2dx_Sprite_setSpriteFrame); - tolua_function(tolua_S,"setTexture",lua_cocos2dx_Sprite_setTexture); - tolua_function(tolua_S,"getTexture",lua_cocos2dx_Sprite_getTexture); - tolua_function(tolua_S,"setFlippedY",lua_cocos2dx_Sprite_setFlippedY); - tolua_function(tolua_S,"setFlippedX",lua_cocos2dx_Sprite_setFlippedX); - tolua_function(tolua_S,"getResourceType",lua_cocos2dx_Sprite_getResourceType); - tolua_function(tolua_S,"setDisplayFrameWithAnimationName",lua_cocos2dx_Sprite_setDisplayFrameWithAnimationName); - tolua_function(tolua_S,"getBatchNode",lua_cocos2dx_Sprite_getBatchNode); - tolua_function(tolua_S,"getOffsetPosition",lua_cocos2dx_Sprite_getOffsetPosition); - tolua_function(tolua_S,"getCenterRect",lua_cocos2dx_Sprite_getCenterRect); - tolua_function(tolua_S,"setCenterRectNormalized",lua_cocos2dx_Sprite_setCenterRectNormalized); - tolua_function(tolua_S,"isStretchEnabled",lua_cocos2dx_Sprite_isStretchEnabled); - tolua_function(tolua_S,"setTextureRect",lua_cocos2dx_Sprite_setTextureRect); - tolua_function(tolua_S,"initWithSpriteFrameName",lua_cocos2dx_Sprite_initWithSpriteFrameName); - tolua_function(tolua_S,"setStretchEnabled",lua_cocos2dx_Sprite_setStretchEnabled); - tolua_function(tolua_S,"isFrameDisplayed",lua_cocos2dx_Sprite_isFrameDisplayed); - tolua_function(tolua_S,"getAtlasIndex",lua_cocos2dx_Sprite_getAtlasIndex); - tolua_function(tolua_S,"setTextureAtlas",lua_cocos2dx_Sprite_setTextureAtlas); - tolua_function(tolua_S,"setBatchNode",lua_cocos2dx_Sprite_setBatchNode); - tolua_function(tolua_S,"getBlendFunc",lua_cocos2dx_Sprite_getBlendFunc); - tolua_function(tolua_S,"setCenterRect",lua_cocos2dx_Sprite_setCenterRect); - tolua_function(tolua_S,"getSpriteFrame",lua_cocos2dx_Sprite_getSpriteFrame); - tolua_function(tolua_S,"setVertexLayout",lua_cocos2dx_Sprite_setVertexLayout); - tolua_function(tolua_S,"removeAllChildrenWithCleanup",lua_cocos2dx_Sprite_removeAllChildrenWithCleanup); - tolua_function(tolua_S,"getResourceName",lua_cocos2dx_Sprite_getResourceName); - tolua_function(tolua_S,"isDirty",lua_cocos2dx_Sprite_isDirty); - tolua_function(tolua_S,"getCenterRectNormalized",lua_cocos2dx_Sprite_getCenterRectNormalized); - tolua_function(tolua_S,"setAtlasIndex",lua_cocos2dx_Sprite_setAtlasIndex); - tolua_function(tolua_S,"initWithTexture",lua_cocos2dx_Sprite_initWithTexture); - tolua_function(tolua_S,"setDirty",lua_cocos2dx_Sprite_setDirty); - tolua_function(tolua_S,"isTextureRectRotated",lua_cocos2dx_Sprite_isTextureRectRotated); - tolua_function(tolua_S,"getTextureRect",lua_cocos2dx_Sprite_getTextureRect); - tolua_function(tolua_S,"initWithFile",lua_cocos2dx_Sprite_initWithFile); - tolua_function(tolua_S,"setBlendFunc",lua_cocos2dx_Sprite_setBlendFunc); - tolua_function(tolua_S,"getTextureAtlas",lua_cocos2dx_Sprite_getTextureAtlas); - tolua_function(tolua_S,"initWithSpriteFrame",lua_cocos2dx_Sprite_initWithSpriteFrame); - tolua_function(tolua_S,"isFlippedX",lua_cocos2dx_Sprite_isFlippedX); - tolua_function(tolua_S,"isFlippedY",lua_cocos2dx_Sprite_isFlippedY); - tolua_function(tolua_S,"setVertexRect",lua_cocos2dx_Sprite_setVertexRect); - tolua_function(tolua_S,"createWithTexture", lua_cocos2dx_Sprite_createWithTexture); - tolua_function(tolua_S,"createWithSpriteFrameName", lua_cocos2dx_Sprite_createWithSpriteFrameName); - tolua_function(tolua_S,"createWithSpriteFrame", lua_cocos2dx_Sprite_createWithSpriteFrame); - tolua_endmodule(tolua_S); - auto typeName = typeid(cocos2d::Sprite).name(); // rtti is literal storage - g_luaType[reinterpret_cast(typeName)] = "cc.Sprite"; - g_typeCast[typeName] = "cc.Sprite"; - return 1; -} - int lua_cocos2dx_Layer_create(lua_State* tolua_S) { int argc = 0; @@ -59870,7 +57669,7 @@ static int lua_cocos2dx_Layer_finalize(lua_State* tolua_S) int lua_register_cocos2dx_Layer(lua_State* tolua_S) { tolua_usertype(tolua_S,"cc.Layer"); - tolua_cclass(tolua_S,"Layer","cc.Layer","cc.Sprite",nullptr); + tolua_cclass(tolua_S,"Layer","cc.Layer","cc.Node",nullptr); tolua_beginmodule(tolua_S,"Layer"); tolua_function(tolua_S,"new",lua_cocos2dx_Layer_constructor); @@ -59935,7 +57734,7 @@ int lua_cocos2dx_LayerColor_changeWidthAndHeight(lua_State* tolua_S) return 0; } -int lua_cocos2dx_LayerColor_changeHeight(lua_State* tolua_S) +int lua_cocos2dx_LayerColor_getBlendFunc(lua_State* tolua_S) { int argc = 0; cocos2d::LayerColor* cobj = nullptr; @@ -59955,7 +57754,104 @@ int lua_cocos2dx_LayerColor_changeHeight(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_LayerColor_changeHeight'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_LayerColor_getBlendFunc'", 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_LayerColor_getBlendFunc'", nullptr); + return 0; + } + const cocos2d::BlendFunc& ret = cobj->getBlendFunc(); + blendfunc_to_luaval(tolua_S, ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.LayerColor:getBlendFunc",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_LayerColor_getBlendFunc'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_LayerColor_setBlendFunc(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::LayerColor* 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.LayerColor",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::LayerColor*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_LayerColor_setBlendFunc'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + cocos2d::BlendFunc arg0; + + ok &= luaval_to_blendfunc(tolua_S, 2, &arg0, "cc.LayerColor:setBlendFunc"); + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_LayerColor_setBlendFunc'", nullptr); + return 0; + } + cobj->setBlendFunc(arg0); + lua_settop(tolua_S, 1); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.LayerColor:setBlendFunc",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_LayerColor_setBlendFunc'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_LayerColor_changeWidth(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::LayerColor* 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.LayerColor",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::LayerColor*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_LayerColor_changeWidth'", nullptr); return 0; } #endif @@ -59965,22 +57861,22 @@ int lua_cocos2dx_LayerColor_changeHeight(lua_State* tolua_S) { double arg0; - ok &= luaval_to_number(tolua_S, 2,&arg0, "cc.LayerColor:changeHeight"); + ok &= luaval_to_number(tolua_S, 2,&arg0, "cc.LayerColor:changeWidth"); if(!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_LayerColor_changeHeight'", nullptr); + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_LayerColor_changeWidth'", nullptr); return 0; } - cobj->changeHeight(arg0); + cobj->changeWidth(arg0); lua_settop(tolua_S, 1); return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.LayerColor:changeHeight",argc, 1); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.LayerColor:changeWidth",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_LayerColor_changeHeight'.",&tolua_err); + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_LayerColor_changeWidth'.",&tolua_err); #endif return 0; @@ -60048,7 +57944,7 @@ int lua_cocos2dx_LayerColor_initWithColor(lua_State* tolua_S) return 0; } -int lua_cocos2dx_LayerColor_changeWidth(lua_State* tolua_S) +int lua_cocos2dx_LayerColor_changeHeight(lua_State* tolua_S) { int argc = 0; cocos2d::LayerColor* cobj = nullptr; @@ -60068,7 +57964,7 @@ int lua_cocos2dx_LayerColor_changeWidth(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_LayerColor_changeWidth'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_LayerColor_changeHeight'", nullptr); return 0; } #endif @@ -60078,22 +57974,22 @@ int lua_cocos2dx_LayerColor_changeWidth(lua_State* tolua_S) { double arg0; - ok &= luaval_to_number(tolua_S, 2,&arg0, "cc.LayerColor:changeWidth"); + ok &= luaval_to_number(tolua_S, 2,&arg0, "cc.LayerColor:changeHeight"); if(!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_LayerColor_changeWidth'", nullptr); + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_LayerColor_changeHeight'", nullptr); return 0; } - cobj->changeWidth(arg0); + cobj->changeHeight(arg0); lua_settop(tolua_S, 1); return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.LayerColor:changeWidth",argc, 1); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.LayerColor:changeHeight",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_LayerColor_changeWidth'.",&tolua_err); + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_LayerColor_changeHeight'.",&tolua_err); #endif return 0; @@ -60213,9 +58109,11 @@ int lua_register_cocos2dx_LayerColor(lua_State* tolua_S) tolua_beginmodule(tolua_S,"LayerColor"); tolua_function(tolua_S,"new",lua_cocos2dx_LayerColor_constructor); tolua_function(tolua_S,"changeWidthAndHeight",lua_cocos2dx_LayerColor_changeWidthAndHeight); - tolua_function(tolua_S,"changeHeight",lua_cocos2dx_LayerColor_changeHeight); - tolua_function(tolua_S,"initWithColor",lua_cocos2dx_LayerColor_initWithColor); + tolua_function(tolua_S,"getBlendFunc",lua_cocos2dx_LayerColor_getBlendFunc); + tolua_function(tolua_S,"setBlendFunc",lua_cocos2dx_LayerColor_setBlendFunc); tolua_function(tolua_S,"changeWidth",lua_cocos2dx_LayerColor_changeWidth); + tolua_function(tolua_S,"initWithColor",lua_cocos2dx_LayerColor_initWithColor); + tolua_function(tolua_S,"changeHeight",lua_cocos2dx_LayerColor_changeHeight); tolua_function(tolua_S,"create", lua_cocos2dx_LayerColor_create); tolua_endmodule(tolua_S); auto typeName = typeid(cocos2d::LayerColor).name(); // rtti is literal storage @@ -61058,6 +58956,53 @@ int lua_cocos2dx_LayerRadialGradient_getStartColor(lua_State* tolua_S) return 0; } +int lua_cocos2dx_LayerRadialGradient_getBlendFunc(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::LayerRadialGradient* 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.LayerRadialGradient",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::LayerRadialGradient*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_LayerRadialGradient_getBlendFunc'", 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_LayerRadialGradient_getBlendFunc'", nullptr); + return 0; + } + cocos2d::BlendFunc ret = cobj->getBlendFunc(); + blendfunc_to_luaval(tolua_S, ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.LayerRadialGradient:getBlendFunc",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_LayerRadialGradient_getBlendFunc'.",&tolua_err); +#endif + + return 0; +} int lua_cocos2dx_LayerRadialGradient_getStartColor3B(lua_State* tolua_S) { int argc = 0; @@ -61809,6 +59754,56 @@ int lua_cocos2dx_LayerRadialGradient_getExpand(lua_State* tolua_S) return 0; } +int lua_cocos2dx_LayerRadialGradient_setBlendFunc(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::LayerRadialGradient* 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.LayerRadialGradient",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::LayerRadialGradient*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_LayerRadialGradient_setBlendFunc'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + cocos2d::BlendFunc arg0; + + ok &= luaval_to_blendfunc(tolua_S, 2, &arg0, "cc.LayerRadialGradient:setBlendFunc"); + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_LayerRadialGradient_setBlendFunc'", nullptr); + return 0; + } + cobj->setBlendFunc(arg0); + lua_settop(tolua_S, 1); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.LayerRadialGradient:setBlendFunc",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_LayerRadialGradient_setBlendFunc'.",&tolua_err); +#endif + + return 0; +} int lua_cocos2dx_LayerRadialGradient_getRadius(lua_State* tolua_S) { int argc = 0; @@ -61964,6 +59959,7 @@ int lua_register_cocos2dx_LayerRadialGradient(lua_State* tolua_S) tolua_beginmodule(tolua_S,"LayerRadialGradient"); tolua_function(tolua_S,"new",lua_cocos2dx_LayerRadialGradient_constructor); tolua_function(tolua_S,"getStartColor",lua_cocos2dx_LayerRadialGradient_getStartColor); + tolua_function(tolua_S,"getBlendFunc",lua_cocos2dx_LayerRadialGradient_getBlendFunc); tolua_function(tolua_S,"getStartColor3B",lua_cocos2dx_LayerRadialGradient_getStartColor3B); tolua_function(tolua_S,"getStartOpacity",lua_cocos2dx_LayerRadialGradient_getStartOpacity); tolua_function(tolua_S,"setCenter",lua_cocos2dx_LayerRadialGradient_setCenter); @@ -61979,6 +59975,7 @@ int lua_register_cocos2dx_LayerRadialGradient(lua_State* tolua_S) tolua_function(tolua_S,"setRadius",lua_cocos2dx_LayerRadialGradient_setRadius); tolua_function(tolua_S,"setStartColor",lua_cocos2dx_LayerRadialGradient_setStartColor); tolua_function(tolua_S,"getExpand",lua_cocos2dx_LayerRadialGradient_getExpand); + tolua_function(tolua_S,"setBlendFunc",lua_cocos2dx_LayerRadialGradient_setBlendFunc); tolua_function(tolua_S,"getRadius",lua_cocos2dx_LayerRadialGradient_getRadius); tolua_function(tolua_S,"create", lua_cocos2dx_LayerRadialGradient_create); tolua_endmodule(tolua_S); @@ -77015,6 +75012,2207 @@ int lua_register_cocos2dx_ProtectedNode(lua_State* tolua_S) return 1; } +int lua_cocos2dx_Sprite_setSpriteFrame(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Sprite* 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.Sprite",0,&tolua_err)) goto tolua_lerror; +#endif + cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_setSpriteFrame'", nullptr); + return 0; + } +#endif + argc = lua_gettop(tolua_S)-1; + do{ + if (argc == 1) { + cocos2d::SpriteFrame* arg0; + ok &= luaval_to_object(tolua_S, 2, "cc.SpriteFrame",&arg0, "cc.Sprite:setSpriteFrame"); + + if (!ok) { break; } + cobj->setSpriteFrame(arg0); + lua_settop(tolua_S, 1); + return 1; + } + }while(0); + ok = true; + do{ + if (argc == 1) { + std::string arg0; + ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.Sprite:setSpriteFrame"); + + if (!ok) { break; } + cobj->setSpriteFrame(arg0); + 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.Sprite:setSpriteFrame",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_setSpriteFrame'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_Sprite_setTexture(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Sprite* 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.Sprite",0,&tolua_err)) goto tolua_lerror; +#endif + cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_setTexture'", nullptr); + return 0; + } +#endif + argc = lua_gettop(tolua_S)-1; + do{ + if (argc == 1) { + cocos2d::Texture2D* arg0; + ok &= luaval_to_object(tolua_S, 2, "cc.Texture2D",&arg0, "cc.Sprite:setTexture"); + + if (!ok) { break; } + cobj->setTexture(arg0); + lua_settop(tolua_S, 1); + return 1; + } + }while(0); + ok = true; + do{ + if (argc == 1) { + std::string arg0; + ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.Sprite:setTexture"); + + if (!ok) { break; } + cobj->setTexture(arg0); + 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.Sprite:setTexture",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_setTexture'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_Sprite_getTexture(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Sprite* 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.Sprite",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_getTexture'", 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_Sprite_getTexture'", nullptr); + return 0; + } + cocos2d::Texture2D* ret = cobj->getTexture(); + object_to_luaval(tolua_S, "cc.Texture2D",(cocos2d::Texture2D*)ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite:getTexture",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_getTexture'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_Sprite_setFlippedY(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Sprite* 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.Sprite",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_setFlippedY'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + bool arg0; + + ok &= luaval_to_boolean(tolua_S, 2,&arg0, "cc.Sprite:setFlippedY"); + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Sprite_setFlippedY'", nullptr); + return 0; + } + cobj->setFlippedY(arg0); + lua_settop(tolua_S, 1); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite:setFlippedY",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_setFlippedY'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_Sprite_setFlippedX(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Sprite* 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.Sprite",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_setFlippedX'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + bool arg0; + + ok &= luaval_to_boolean(tolua_S, 2,&arg0, "cc.Sprite:setFlippedX"); + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Sprite_setFlippedX'", nullptr); + return 0; + } + cobj->setFlippedX(arg0); + lua_settop(tolua_S, 1); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite:setFlippedX",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_setFlippedX'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_Sprite_getResourceType(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Sprite* 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.Sprite",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_getResourceType'", 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_Sprite_getResourceType'", nullptr); + return 0; + } + int ret = cobj->getResourceType(); + 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.Sprite:getResourceType",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_getResourceType'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_Sprite_setDisplayFrameWithAnimationName(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Sprite* 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.Sprite",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_setDisplayFrameWithAnimationName'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 2) + { + std::string arg0; + unsigned int arg1; + + ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.Sprite:setDisplayFrameWithAnimationName"); + + ok &= luaval_to_uint32(tolua_S, 3,&arg1, "cc.Sprite:setDisplayFrameWithAnimationName"); + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Sprite_setDisplayFrameWithAnimationName'", nullptr); + return 0; + } + cobj->setDisplayFrameWithAnimationName(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.Sprite:setDisplayFrameWithAnimationName",argc, 2); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_setDisplayFrameWithAnimationName'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_Sprite_getBatchNode(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Sprite* 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.Sprite",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_getBatchNode'", 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_Sprite_getBatchNode'", nullptr); + return 0; + } + cocos2d::SpriteBatchNode* ret = cobj->getBatchNode(); + object_to_luaval(tolua_S, "cc.SpriteBatchNode",(cocos2d::SpriteBatchNode*)ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite:getBatchNode",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_getBatchNode'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_Sprite_getOffsetPosition(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Sprite* 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.Sprite",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_getOffsetPosition'", 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_Sprite_getOffsetPosition'", nullptr); + return 0; + } + const cocos2d::Vec2& ret = cobj->getOffsetPosition(); + vec2_to_luaval(tolua_S, ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite:getOffsetPosition",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_getOffsetPosition'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_Sprite_getCenterRect(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Sprite* 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.Sprite",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_getCenterRect'", 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_Sprite_getCenterRect'", nullptr); + return 0; + } + cocos2d::Rect ret = cobj->getCenterRect(); + rect_to_luaval(tolua_S, ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite:getCenterRect",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_getCenterRect'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_Sprite_setCenterRectNormalized(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Sprite* 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.Sprite",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_setCenterRectNormalized'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + cocos2d::Rect arg0; + + ok &= luaval_to_rect(tolua_S, 2, &arg0, "cc.Sprite:setCenterRectNormalized"); + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Sprite_setCenterRectNormalized'", nullptr); + return 0; + } + cobj->setCenterRectNormalized(arg0); + lua_settop(tolua_S, 1); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite:setCenterRectNormalized",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_setCenterRectNormalized'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_Sprite_isStretchEnabled(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Sprite* 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.Sprite",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_isStretchEnabled'", 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_Sprite_isStretchEnabled'", nullptr); + return 0; + } + bool ret = cobj->isStretchEnabled(); + tolua_pushboolean(tolua_S,(bool)ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite:isStretchEnabled",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_isStretchEnabled'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_Sprite_setTextureRect(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Sprite* 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.Sprite",0,&tolua_err)) goto tolua_lerror; +#endif + cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_setTextureRect'", nullptr); + return 0; + } +#endif + argc = lua_gettop(tolua_S)-1; + do{ + if (argc == 3) { + cocos2d::Rect arg0; + ok &= luaval_to_rect(tolua_S, 2, &arg0, "cc.Sprite:setTextureRect"); + + if (!ok) { break; } + bool arg1; + ok &= luaval_to_boolean(tolua_S, 3,&arg1, "cc.Sprite:setTextureRect"); + + if (!ok) { break; } + cocos2d::Size arg2; + ok &= luaval_to_size(tolua_S, 4, &arg2, "cc.Sprite:setTextureRect"); + + if (!ok) { break; } + cobj->setTextureRect(arg0, arg1, arg2); + lua_settop(tolua_S, 1); + return 1; + } + }while(0); + ok = true; + do{ + if (argc == 1) { + cocos2d::Rect arg0; + ok &= luaval_to_rect(tolua_S, 2, &arg0, "cc.Sprite:setTextureRect"); + + if (!ok) { break; } + cobj->setTextureRect(arg0); + 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.Sprite:setTextureRect",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_setTextureRect'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_Sprite_initWithSpriteFrameName(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Sprite* 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.Sprite",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_initWithSpriteFrameName'", 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.Sprite:initWithSpriteFrameName"); + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Sprite_initWithSpriteFrameName'", nullptr); + return 0; + } + bool ret = cobj->initWithSpriteFrameName(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.Sprite:initWithSpriteFrameName",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_initWithSpriteFrameName'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_Sprite_setStretchEnabled(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Sprite* 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.Sprite",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_setStretchEnabled'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + bool arg0; + + ok &= luaval_to_boolean(tolua_S, 2,&arg0, "cc.Sprite:setStretchEnabled"); + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Sprite_setStretchEnabled'", nullptr); + return 0; + } + cobj->setStretchEnabled(arg0); + lua_settop(tolua_S, 1); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite:setStretchEnabled",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_setStretchEnabled'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_Sprite_isFrameDisplayed(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Sprite* 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.Sprite",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_isFrameDisplayed'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + cocos2d::SpriteFrame* arg0; + + ok &= luaval_to_object(tolua_S, 2, "cc.SpriteFrame",&arg0, "cc.Sprite:isFrameDisplayed"); + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Sprite_isFrameDisplayed'", nullptr); + return 0; + } + bool ret = cobj->isFrameDisplayed(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.Sprite:isFrameDisplayed",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_isFrameDisplayed'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_Sprite_getAtlasIndex(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Sprite* 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.Sprite",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_getAtlasIndex'", 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_Sprite_getAtlasIndex'", nullptr); + return 0; + } + unsigned int ret = cobj->getAtlasIndex(); + 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.Sprite:getAtlasIndex",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_getAtlasIndex'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_Sprite_setTextureAtlas(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Sprite* 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.Sprite",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_setTextureAtlas'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + cocos2d::TextureAtlas* arg0; + + ok &= luaval_to_object(tolua_S, 2, "cc.TextureAtlas",&arg0, "cc.Sprite:setTextureAtlas"); + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Sprite_setTextureAtlas'", nullptr); + return 0; + } + cobj->setTextureAtlas(arg0); + lua_settop(tolua_S, 1); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite:setTextureAtlas",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_setTextureAtlas'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_Sprite_setBatchNode(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Sprite* 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.Sprite",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_setBatchNode'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + cocos2d::SpriteBatchNode* arg0; + + ok &= luaval_to_object(tolua_S, 2, "cc.SpriteBatchNode",&arg0, "cc.Sprite:setBatchNode"); + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Sprite_setBatchNode'", nullptr); + return 0; + } + cobj->setBatchNode(arg0); + lua_settop(tolua_S, 1); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite:setBatchNode",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_setBatchNode'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_Sprite_getBlendFunc(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Sprite* 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.Sprite",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_getBlendFunc'", 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_Sprite_getBlendFunc'", nullptr); + return 0; + } + const cocos2d::BlendFunc& ret = cobj->getBlendFunc(); + blendfunc_to_luaval(tolua_S, ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite:getBlendFunc",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_getBlendFunc'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_Sprite_setCenterRect(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Sprite* 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.Sprite",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_setCenterRect'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + cocos2d::Rect arg0; + + ok &= luaval_to_rect(tolua_S, 2, &arg0, "cc.Sprite:setCenterRect"); + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Sprite_setCenterRect'", nullptr); + return 0; + } + cobj->setCenterRect(arg0); + lua_settop(tolua_S, 1); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite:setCenterRect",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_setCenterRect'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_Sprite_getSpriteFrame(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Sprite* 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.Sprite",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_getSpriteFrame'", 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_Sprite_getSpriteFrame'", nullptr); + return 0; + } + cocos2d::SpriteFrame* ret = cobj->getSpriteFrame(); + object_to_luaval(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.Sprite:getSpriteFrame",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_getSpriteFrame'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_Sprite_setVertexLayout(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Sprite* 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.Sprite",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_setVertexLayout'", 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_Sprite_setVertexLayout'", nullptr); + return 0; + } + cobj->setVertexLayout(); + lua_settop(tolua_S, 1); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite:setVertexLayout",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_setVertexLayout'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_Sprite_removeAllChildrenWithCleanup(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Sprite* 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.Sprite",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_removeAllChildrenWithCleanup'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + bool arg0; + + ok &= luaval_to_boolean(tolua_S, 2,&arg0, "cc.Sprite:removeAllChildrenWithCleanup"); + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Sprite_removeAllChildrenWithCleanup'", nullptr); + return 0; + } + cobj->removeAllChildrenWithCleanup(arg0); + lua_settop(tolua_S, 1); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite:removeAllChildrenWithCleanup",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_removeAllChildrenWithCleanup'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_Sprite_getResourceName(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Sprite* 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.Sprite",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_getResourceName'", 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_Sprite_getResourceName'", nullptr); + return 0; + } + const std::string& ret = cobj->getResourceName(); + 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.Sprite:getResourceName",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_getResourceName'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_Sprite_isDirty(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Sprite* 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.Sprite",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_isDirty'", 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_Sprite_isDirty'", nullptr); + return 0; + } + bool ret = cobj->isDirty(); + tolua_pushboolean(tolua_S,(bool)ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite:isDirty",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_isDirty'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_Sprite_getCenterRectNormalized(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Sprite* 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.Sprite",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_getCenterRectNormalized'", 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_Sprite_getCenterRectNormalized'", nullptr); + return 0; + } + cocos2d::Rect ret = cobj->getCenterRectNormalized(); + rect_to_luaval(tolua_S, ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite:getCenterRectNormalized",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_getCenterRectNormalized'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_Sprite_setAtlasIndex(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Sprite* 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.Sprite",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_setAtlasIndex'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + unsigned int arg0; + + ok &= luaval_to_uint32(tolua_S, 2,&arg0, "cc.Sprite:setAtlasIndex"); + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Sprite_setAtlasIndex'", nullptr); + return 0; + } + cobj->setAtlasIndex(arg0); + lua_settop(tolua_S, 1); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite:setAtlasIndex",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_setAtlasIndex'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_Sprite_initWithTexture(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Sprite* 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.Sprite",0,&tolua_err)) goto tolua_lerror; +#endif + cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_initWithTexture'", nullptr); + return 0; + } +#endif + argc = lua_gettop(tolua_S)-1; + do{ + if (argc == 2) { + cocos2d::Texture2D* arg0; + ok &= luaval_to_object(tolua_S, 2, "cc.Texture2D",&arg0, "cc.Sprite:initWithTexture"); + + if (!ok) { break; } + cocos2d::Rect arg1; + ok &= luaval_to_rect(tolua_S, 3, &arg1, "cc.Sprite:initWithTexture"); + + if (!ok) { break; } + bool ret = cobj->initWithTexture(arg0, arg1); + tolua_pushboolean(tolua_S,(bool)ret); + return 1; + } + }while(0); + ok = true; + do{ + if (argc == 1) { + cocos2d::Texture2D* arg0; + ok &= luaval_to_object(tolua_S, 2, "cc.Texture2D",&arg0, "cc.Sprite:initWithTexture"); + + if (!ok) { break; } + bool ret = cobj->initWithTexture(arg0); + tolua_pushboolean(tolua_S,(bool)ret); + return 1; + } + }while(0); + ok = true; + do{ + if (argc == 3) { + cocos2d::Texture2D* arg0; + ok &= luaval_to_object(tolua_S, 2, "cc.Texture2D",&arg0, "cc.Sprite:initWithTexture"); + + if (!ok) { break; } + cocos2d::Rect arg1; + ok &= luaval_to_rect(tolua_S, 3, &arg1, "cc.Sprite:initWithTexture"); + + if (!ok) { break; } + bool arg2; + ok &= luaval_to_boolean(tolua_S, 4,&arg2, "cc.Sprite:initWithTexture"); + + if (!ok) { break; } + bool ret = cobj->initWithTexture(arg0, arg1, arg2); + tolua_pushboolean(tolua_S,(bool)ret); + return 1; + } + }while(0); + ok = true; + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite:initWithTexture",argc, 3); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_initWithTexture'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_Sprite_setDirty(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Sprite* 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.Sprite",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_setDirty'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + bool arg0; + + ok &= luaval_to_boolean(tolua_S, 2,&arg0, "cc.Sprite:setDirty"); + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Sprite_setDirty'", nullptr); + return 0; + } + cobj->setDirty(arg0); + lua_settop(tolua_S, 1); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite:setDirty",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_setDirty'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_Sprite_isTextureRectRotated(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Sprite* 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.Sprite",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_isTextureRectRotated'", 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_Sprite_isTextureRectRotated'", nullptr); + return 0; + } + bool ret = cobj->isTextureRectRotated(); + tolua_pushboolean(tolua_S,(bool)ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite:isTextureRectRotated",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_isTextureRectRotated'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_Sprite_getTextureRect(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Sprite* 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.Sprite",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_getTextureRect'", 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_Sprite_getTextureRect'", nullptr); + return 0; + } + const cocos2d::Rect& ret = cobj->getTextureRect(); + rect_to_luaval(tolua_S, ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite:getTextureRect",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_getTextureRect'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_Sprite_initWithFile(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Sprite* 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.Sprite",0,&tolua_err)) goto tolua_lerror; +#endif + cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_initWithFile'", nullptr); + return 0; + } +#endif + argc = lua_gettop(tolua_S)-1; + do{ + if (argc == 2) { + std::string arg0; + ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.Sprite:initWithFile"); + + if (!ok) { break; } + cocos2d::Rect arg1; + ok &= luaval_to_rect(tolua_S, 3, &arg1, "cc.Sprite:initWithFile"); + + if (!ok) { break; } + bool ret = cobj->initWithFile(arg0, arg1); + tolua_pushboolean(tolua_S,(bool)ret); + return 1; + } + }while(0); + ok = true; + do{ + if (argc == 1) { + std::string arg0; + ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.Sprite:initWithFile"); + + if (!ok) { break; } + bool ret = cobj->initWithFile(arg0); + tolua_pushboolean(tolua_S,(bool)ret); + return 1; + } + }while(0); + ok = true; + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite:initWithFile",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_initWithFile'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_Sprite_setBlendFunc(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Sprite* 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.Sprite",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_setBlendFunc'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + cocos2d::BlendFunc arg0; + + ok &= luaval_to_blendfunc(tolua_S, 2, &arg0, "cc.Sprite:setBlendFunc"); + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Sprite_setBlendFunc'", nullptr); + return 0; + } + cobj->setBlendFunc(arg0); + lua_settop(tolua_S, 1); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite:setBlendFunc",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_setBlendFunc'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_Sprite_getTextureAtlas(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Sprite* 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.Sprite",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_getTextureAtlas'", 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_Sprite_getTextureAtlas'", nullptr); + return 0; + } + cocos2d::TextureAtlas* ret = cobj->getTextureAtlas(); + object_to_luaval(tolua_S, "cc.TextureAtlas",(cocos2d::TextureAtlas*)ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite:getTextureAtlas",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_getTextureAtlas'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_Sprite_initWithSpriteFrame(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Sprite* 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.Sprite",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_initWithSpriteFrame'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + cocos2d::SpriteFrame* arg0; + + ok &= luaval_to_object(tolua_S, 2, "cc.SpriteFrame",&arg0, "cc.Sprite:initWithSpriteFrame"); + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Sprite_initWithSpriteFrame'", nullptr); + return 0; + } + bool ret = cobj->initWithSpriteFrame(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.Sprite:initWithSpriteFrame",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_initWithSpriteFrame'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_Sprite_isFlippedX(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Sprite* 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.Sprite",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_isFlippedX'", 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_Sprite_isFlippedX'", nullptr); + return 0; + } + bool ret = cobj->isFlippedX(); + tolua_pushboolean(tolua_S,(bool)ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite:isFlippedX",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_isFlippedX'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_Sprite_isFlippedY(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Sprite* 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.Sprite",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_isFlippedY'", 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_Sprite_isFlippedY'", nullptr); + return 0; + } + bool ret = cobj->isFlippedY(); + tolua_pushboolean(tolua_S,(bool)ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite:isFlippedY",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_isFlippedY'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_Sprite_setVertexRect(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Sprite* 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.Sprite",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_setVertexRect'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + cocos2d::Rect arg0; + + ok &= luaval_to_rect(tolua_S, 2, &arg0, "cc.Sprite:setVertexRect"); + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Sprite_setVertexRect'", nullptr); + return 0; + } + cobj->setVertexRect(arg0); + lua_settop(tolua_S, 1); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite:setVertexRect",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_setVertexRect'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_Sprite_createWithTexture(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.Sprite",0,&tolua_err)) goto tolua_lerror; +#endif + + argc = lua_gettop(tolua_S)-1; + + do + { + if (argc == 2) + { + cocos2d::Texture2D* arg0; + ok &= luaval_to_object(tolua_S, 2, "cc.Texture2D",&arg0, "cc.Sprite:createWithTexture"); + if (!ok) { break; } + cocos2d::Rect arg1; + ok &= luaval_to_rect(tolua_S, 3, &arg1, "cc.Sprite:createWithTexture"); + if (!ok) { break; } + cocos2d::Sprite* ret = cocos2d::Sprite::createWithTexture(arg0, arg1); + object_to_luaval(tolua_S, "cc.Sprite",(cocos2d::Sprite*)ret); + return 1; + } + } while (0); + ok = true; + do + { + if (argc == 3) + { + cocos2d::Texture2D* arg0; + ok &= luaval_to_object(tolua_S, 2, "cc.Texture2D",&arg0, "cc.Sprite:createWithTexture"); + if (!ok) { break; } + cocos2d::Rect arg1; + ok &= luaval_to_rect(tolua_S, 3, &arg1, "cc.Sprite:createWithTexture"); + if (!ok) { break; } + bool arg2; + ok &= luaval_to_boolean(tolua_S, 4,&arg2, "cc.Sprite:createWithTexture"); + if (!ok) { break; } + cocos2d::Sprite* ret = cocos2d::Sprite::createWithTexture(arg0, arg1, arg2); + object_to_luaval(tolua_S, "cc.Sprite",(cocos2d::Sprite*)ret); + return 1; + } + } while (0); + ok = true; + do + { + if (argc == 1) + { + cocos2d::Texture2D* arg0; + ok &= luaval_to_object(tolua_S, 2, "cc.Texture2D",&arg0, "cc.Sprite:createWithTexture"); + if (!ok) { break; } + cocos2d::Sprite* ret = cocos2d::Sprite::createWithTexture(arg0); + object_to_luaval(tolua_S, "cc.Sprite",(cocos2d::Sprite*)ret); + return 1; + } + } while (0); + ok = true; + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d", "cc.Sprite:createWithTexture",argc, 1); + return 0; +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_createWithTexture'.",&tolua_err); +#endif + return 0; +} +int lua_cocos2dx_Sprite_createWithSpriteFrameName(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.Sprite",0,&tolua_err)) goto tolua_lerror; +#endif + + argc = lua_gettop(tolua_S) - 1; + + if (argc == 1) + { + std::string arg0; + ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.Sprite:createWithSpriteFrameName"); + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Sprite_createWithSpriteFrameName'", nullptr); + return 0; + } + cocos2d::Sprite* ret = cocos2d::Sprite::createWithSpriteFrameName(arg0); + object_to_luaval(tolua_S, "cc.Sprite",(cocos2d::Sprite*)ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d\n ", "cc.Sprite:createWithSpriteFrameName",argc, 1); + return 0; +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_createWithSpriteFrameName'.",&tolua_err); +#endif + return 0; +} +int lua_cocos2dx_Sprite_createWithSpriteFrame(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.Sprite",0,&tolua_err)) goto tolua_lerror; +#endif + + argc = lua_gettop(tolua_S) - 1; + + if (argc == 1) + { + cocos2d::SpriteFrame* arg0; + ok &= luaval_to_object(tolua_S, 2, "cc.SpriteFrame",&arg0, "cc.Sprite:createWithSpriteFrame"); + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Sprite_createWithSpriteFrame'", nullptr); + return 0; + } + cocos2d::Sprite* ret = cocos2d::Sprite::createWithSpriteFrame(arg0); + object_to_luaval(tolua_S, "cc.Sprite",(cocos2d::Sprite*)ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d\n ", "cc.Sprite:createWithSpriteFrame",argc, 1); + return 0; +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_createWithSpriteFrame'.",&tolua_err); +#endif + return 0; +} +int lua_cocos2dx_Sprite_constructor(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Sprite* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Sprite_constructor'", nullptr); + return 0; + } + cobj = new cocos2d::Sprite(); + cobj->autorelease(); + int ID = (int)cobj->_ID ; + int* luaID = &cobj->_luaID ; + toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)cobj,"cc.Sprite"); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite:Sprite",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_constructor'.",&tolua_err); +#endif + + return 0; +} + +static int lua_cocos2dx_Sprite_finalize(lua_State* tolua_S) +{ + printf("luabindings: finalizing LUA object (Sprite)"); + return 0; +} + +int lua_register_cocos2dx_Sprite(lua_State* tolua_S) +{ + tolua_usertype(tolua_S,"cc.Sprite"); + tolua_cclass(tolua_S,"Sprite","cc.Sprite","cc.Node",nullptr); + + tolua_beginmodule(tolua_S,"Sprite"); + tolua_function(tolua_S,"new",lua_cocos2dx_Sprite_constructor); + tolua_function(tolua_S,"setSpriteFrame",lua_cocos2dx_Sprite_setSpriteFrame); + tolua_function(tolua_S,"setTexture",lua_cocos2dx_Sprite_setTexture); + tolua_function(tolua_S,"getTexture",lua_cocos2dx_Sprite_getTexture); + tolua_function(tolua_S,"setFlippedY",lua_cocos2dx_Sprite_setFlippedY); + tolua_function(tolua_S,"setFlippedX",lua_cocos2dx_Sprite_setFlippedX); + tolua_function(tolua_S,"getResourceType",lua_cocos2dx_Sprite_getResourceType); + tolua_function(tolua_S,"setDisplayFrameWithAnimationName",lua_cocos2dx_Sprite_setDisplayFrameWithAnimationName); + tolua_function(tolua_S,"getBatchNode",lua_cocos2dx_Sprite_getBatchNode); + tolua_function(tolua_S,"getOffsetPosition",lua_cocos2dx_Sprite_getOffsetPosition); + tolua_function(tolua_S,"getCenterRect",lua_cocos2dx_Sprite_getCenterRect); + tolua_function(tolua_S,"setCenterRectNormalized",lua_cocos2dx_Sprite_setCenterRectNormalized); + tolua_function(tolua_S,"isStretchEnabled",lua_cocos2dx_Sprite_isStretchEnabled); + tolua_function(tolua_S,"setTextureRect",lua_cocos2dx_Sprite_setTextureRect); + tolua_function(tolua_S,"initWithSpriteFrameName",lua_cocos2dx_Sprite_initWithSpriteFrameName); + tolua_function(tolua_S,"setStretchEnabled",lua_cocos2dx_Sprite_setStretchEnabled); + tolua_function(tolua_S,"isFrameDisplayed",lua_cocos2dx_Sprite_isFrameDisplayed); + tolua_function(tolua_S,"getAtlasIndex",lua_cocos2dx_Sprite_getAtlasIndex); + tolua_function(tolua_S,"setTextureAtlas",lua_cocos2dx_Sprite_setTextureAtlas); + tolua_function(tolua_S,"setBatchNode",lua_cocos2dx_Sprite_setBatchNode); + tolua_function(tolua_S,"getBlendFunc",lua_cocos2dx_Sprite_getBlendFunc); + tolua_function(tolua_S,"setCenterRect",lua_cocos2dx_Sprite_setCenterRect); + tolua_function(tolua_S,"getSpriteFrame",lua_cocos2dx_Sprite_getSpriteFrame); + tolua_function(tolua_S,"setVertexLayout",lua_cocos2dx_Sprite_setVertexLayout); + tolua_function(tolua_S,"removeAllChildrenWithCleanup",lua_cocos2dx_Sprite_removeAllChildrenWithCleanup); + tolua_function(tolua_S,"getResourceName",lua_cocos2dx_Sprite_getResourceName); + tolua_function(tolua_S,"isDirty",lua_cocos2dx_Sprite_isDirty); + tolua_function(tolua_S,"getCenterRectNormalized",lua_cocos2dx_Sprite_getCenterRectNormalized); + tolua_function(tolua_S,"setAtlasIndex",lua_cocos2dx_Sprite_setAtlasIndex); + tolua_function(tolua_S,"initWithTexture",lua_cocos2dx_Sprite_initWithTexture); + tolua_function(tolua_S,"setDirty",lua_cocos2dx_Sprite_setDirty); + tolua_function(tolua_S,"isTextureRectRotated",lua_cocos2dx_Sprite_isTextureRectRotated); + tolua_function(tolua_S,"getTextureRect",lua_cocos2dx_Sprite_getTextureRect); + tolua_function(tolua_S,"initWithFile",lua_cocos2dx_Sprite_initWithFile); + tolua_function(tolua_S,"setBlendFunc",lua_cocos2dx_Sprite_setBlendFunc); + tolua_function(tolua_S,"getTextureAtlas",lua_cocos2dx_Sprite_getTextureAtlas); + tolua_function(tolua_S,"initWithSpriteFrame",lua_cocos2dx_Sprite_initWithSpriteFrame); + tolua_function(tolua_S,"isFlippedX",lua_cocos2dx_Sprite_isFlippedX); + tolua_function(tolua_S,"isFlippedY",lua_cocos2dx_Sprite_isFlippedY); + tolua_function(tolua_S,"setVertexRect",lua_cocos2dx_Sprite_setVertexRect); + tolua_function(tolua_S,"createWithTexture", lua_cocos2dx_Sprite_createWithTexture); + tolua_function(tolua_S,"createWithSpriteFrameName", lua_cocos2dx_Sprite_createWithSpriteFrameName); + tolua_function(tolua_S,"createWithSpriteFrame", lua_cocos2dx_Sprite_createWithSpriteFrame); + tolua_endmodule(tolua_S); + auto typeName = typeid(cocos2d::Sprite).name(); // rtti is literal storage + g_luaType[reinterpret_cast(typeName)] = "cc.Sprite"; + g_typeCast[typeName] = "cc.Sprite"; + return 1; +} + int lua_cocos2dx_RenderTexture_setVirtualViewport(lua_State* tolua_S) { int argc = 0; @@ -106225,7 +106423,6 @@ TOLUA_API int register_all_cocos2dx(lua_State* tolua_S) lua_register_cocos2dx_EaseQuadraticActionOut(tolua_S); lua_register_cocos2dx_TransitionProgress(tolua_S); lua_register_cocos2dx_TransitionProgressVertical(tolua_S); - lua_register_cocos2dx_Sprite(tolua_S); lua_register_cocos2dx_Layer(tolua_S); lua_register_cocos2dx_Grid3DAction(tolua_S); lua_register_cocos2dx_BaseLight(tolua_S); @@ -106419,6 +106616,7 @@ TOLUA_API int register_all_cocos2dx(lua_State* tolua_S) lua_register_cocos2dx_MotionStreak(tolua_S); lua_register_cocos2dx_RotateBy(tolua_S); lua_register_cocos2dx_FileUtils(tolua_S); + lua_register_cocos2dx_Sprite(tolua_S); lua_register_cocos2dx_TransitionSlideInT(tolua_S); lua_register_cocos2dx_ProgressTo(tolua_S); lua_register_cocos2dx_TransitionProgressOutIn(tolua_S); diff --git a/extensions/scripting/lua-bindings/auto/lua_cocos2dx_auto.hpp b/extensions/scripting/lua-bindings/auto/lua_cocos2dx_auto.hpp index facd9cb94e..2bcb64b12d 100644 --- a/extensions/scripting/lua-bindings/auto/lua_cocos2dx_auto.hpp +++ b/extensions/scripting/lua-bindings/auto/lua_cocos2dx_auto.hpp @@ -2325,6 +2325,10 @@ int register_all_cocos2dx(lua_State* tolua_S); + + + + diff --git a/tests/cpp-tests/Classes/ActionsTest/ActionsTest.cpp b/tests/cpp-tests/Classes/ActionsTest/ActionsTest.cpp index 1b86e03172..03a32b70be 100644 --- a/tests/cpp-tests/Classes/ActionsTest/ActionsTest.cpp +++ b/tests/cpp-tests/Classes/ActionsTest/ActionsTest.cpp @@ -957,7 +957,7 @@ void ActionCallFunction::callback3(Node* sender, int32_t data) label->setPosition(s.width/4*3,s.height/2); addChild(label); - CCLOG("target is: %p, data is: %ld", sender, data); + CCLOG("target is: %p, data is: %d", sender, data); } std::string ActionCallFunction::subtitle() const diff --git a/tests/cpp-tests/Classes/Camera3DTest/Camera3DTest.cpp b/tests/cpp-tests/Classes/Camera3DTest/Camera3DTest.cpp index 9f03e2456d..a833ad3fb8 100644 --- a/tests/cpp-tests/Classes/Camera3DTest/Camera3DTest.cpp +++ b/tests/cpp-tests/Classes/Camera3DTest/Camera3DTest.cpp @@ -900,7 +900,7 @@ void CameraCullingDemo::addSpriteCallback(Ref* sender) // update sprite number char szText[16]; - sprintf(szText,"%ld sprits", static_cast(_layer3D->getChildrenCount())); + sprintf(szText,"%d sprits", static_cast(_layer3D->getChildrenCount())); _labelSprite3DCount->setString(szText); } @@ -928,7 +928,7 @@ void CameraCullingDemo::delSpriteCallback(Ref* sender) // update sprite number char szText[16]; - sprintf(szText,"%ld sprits", static_cast(_layer3D->getChildrenCount())); + sprintf(szText,"%l sprits", static_cast(_layer3D->getChildrenCount())); _labelSprite3DCount->setString(szText); } diff --git a/tests/cpp-tests/Classes/ExtensionsTest/TableViewTest/TableViewTestScene.cpp b/tests/cpp-tests/Classes/ExtensionsTest/TableViewTest/TableViewTestScene.cpp index 6db8a02f3c..ced3c807ae 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/TableViewTest/TableViewTestScene.cpp +++ b/tests/cpp-tests/Classes/ExtensionsTest/TableViewTest/TableViewTestScene.cpp @@ -71,7 +71,7 @@ bool TableViewTest::init() void TableViewTest::tableCellTouched(TableView* table, TableViewCell* cell) { - CCLOG("cell touched at index: %ld", static_cast(cell->getIdx())); + CCLOG("cell touched at index: %d", static_cast(cell->getIdx())); } Size TableViewTest::tableCellSizeForIndex(TableView *table, ssize_t idx) @@ -84,7 +84,7 @@ Size TableViewTest::tableCellSizeForIndex(TableView *table, ssize_t idx) TableViewCell* TableViewTest::tableCellAtIndex(TableView *table, ssize_t idx) { - auto string = StringUtils::format("%ld", static_cast(idx)); + auto string = StringUtils::format("%d", static_cast(idx)); TableViewCell *cell = table->dequeueCell(); if (!cell) { cell = new (std::nothrow) CustomTableViewCell(); diff --git a/tests/cpp-tests/Classes/FileUtilsTest/FileUtilsTest.cpp b/tests/cpp-tests/Classes/FileUtilsTest/FileUtilsTest.cpp index a16ff5af97..831a1e2cdc 100644 --- a/tests/cpp-tests/Classes/FileUtilsTest/FileUtilsTest.cpp +++ b/tests/cpp-tests/Classes/FileUtilsTest/FileUtilsTest.cpp @@ -374,7 +374,7 @@ void TestFileFuncs::onEnter() // getFileSize Test int32_t size = sharedFileUtils->getFileSize(filepath); - msg = StringUtils::format("getFileSize: Test file size equals %ld", size); + msg = StringUtils::format("getFileSize: Test file size equals %d", size); label = Label::createWithSystemFont(msg, "", 20); label->setPosition(x, y * 3); this->addChild(label); @@ -1161,7 +1161,7 @@ void TestFileFuncsAsync::onEnter() this->addChild(label); sharedFileUtils->getFileSize(filepath, [=](int32_t size) { - auto msg = StringUtils::format("getFileSize: Test file size equals %ld", size); + auto msg = StringUtils::format("getFileSize: Test file size equals %d", size); auto label = Label::createWithSystemFont(msg, "", 20); label->setPosition(x, y * 3); this->addChild(label); diff --git a/tests/cpp-tests/Classes/NetworkTest/HttpClientTest/HttpClientTest.cpp b/tests/cpp-tests/Classes/NetworkTest/HttpClientTest/HttpClientTest.cpp index 0494cf5281..9891b415c1 100644 --- a/tests/cpp-tests/Classes/NetworkTest/HttpClientTest/HttpClientTest.cpp +++ b/tests/cpp-tests/Classes/NetworkTest/HttpClientTest/HttpClientTest.cpp @@ -313,9 +313,9 @@ void HttpClientTest::onHttpRequestCompleted(HttpClient *sender, HttpResponse *re int32_t statusCode = response->getResponseCode(); char statusString[64] = {}; - sprintf(statusString, "HTTP Status Code: %ld, tag = %s", statusCode, response->getHttpRequest()->getTag()); + sprintf(statusString, "HTTP Status Code: %d, tag = %s", statusCode, response->getHttpRequest()->getTag()); _labelStatusCode->setString(statusString); - log("response code: %ld", statusCode); + log("response code: %d", statusCode); if (response->getResponseCode() != 200) { @@ -462,9 +462,9 @@ void HttpClientClearRequestsTest::onHttpRequestCompleted(HttpClient *sender, Htt int32_t statusCode = response->getResponseCode(); char statusString[64] = {}; - sprintf(statusString, "HTTP Status Code: %ld, tag = %s", statusCode, response->getHttpRequest()->getTag()); + sprintf(statusString, "HTTP Status Code: %d, tag = %s", statusCode, response->getHttpRequest()->getTag()); _labelStatusCode->setString(statusString); - log("response code: %ld", statusCode); + log("response code: %d", statusCode); _totalProcessedRequests++; sprintf(statusString, "Got %d of %d expected http requests", _totalProcessedRequests, _totalExpectedRequests); diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIPageViewTest/UIPageViewTest.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIPageViewTest/UIPageViewTest.cpp index 18e62bb436..d0657f013c 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIPageViewTest/UIPageViewTest.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIPageViewTest/UIPageViewTest.cpp @@ -129,7 +129,7 @@ void UIPageViewTest::pageViewEvent(Ref *pSender, PageView::EventType type) { PageView* pageView = dynamic_cast(pSender); - _displayValueLabel->setString(StringUtils::format("page = %ld", static_cast(pageView->getCurrentPageIndex() + 1))); + _displayValueLabel->setString(StringUtils::format("page = %d", static_cast(pageView->getCurrentPageIndex() + 1))); } break; @@ -241,7 +241,7 @@ void UIPageViewButtonTest::pageViewEvent(Ref *pSender, PageView::EventType type) { PageView* pageView = dynamic_cast(pSender); - _displayValueLabel->setString(StringUtils::format("page = %ld", static_cast(pageView->getCurrentPageIndex() + 1))); + _displayValueLabel->setString(StringUtils::format("page = %d", static_cast(pageView->getCurrentPageIndex() + 1))); } break; @@ -438,7 +438,7 @@ void UIPageViewTouchPropagationTest::pageViewEvent(Ref *pSender, PageView::Event { PageView* pageView = dynamic_cast(pSender); - _displayValueLabel->setString(StringUtils::format("page = %ld", static_cast(pageView->getCurrentPageIndex() + 1))); + _displayValueLabel->setString(StringUtils::format("page = %d", static_cast(pageView->getCurrentPageIndex() + 1))); } break; diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIRichTextTest/UIRichTextTest.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIRichTextTest/UIRichTextTest.cpp index 2def10a868..e30ad08900 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIRichTextTest/UIRichTextTest.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIRichTextTest/UIRichTextTest.cpp @@ -67,12 +67,12 @@ bool UIRichTextTest::init() std::string str1 = config->getValue("Chinese").asString(); std::string str2 = config->getValue("Japanese").asString(); - CCLOG("str1:%s ascii length = %ld, utf8 length = %ld, substr = %s", + CCLOG("str1:%s ascii length = %d, utf8 length = %d, substr = %s", str1.c_str(), static_cast(str1.length()), StringUtils::getCharacterCountInUTF8String(str1), Helper::getSubStringOfUTF8String(str1, 0, 5).c_str()); - CCLOG("str2:%s ascii length = %ld, utf8 length = %ld, substr = %s", + CCLOG("str2:%s ascii length = %d, utf8 length = %d, substr = %s", str2.c_str(), static_cast(str2.length()), StringUtils::getCharacterCountInUTF8String(str2),