Add CC_DEPRECATED_ATTRIBUTE flag

This commit is contained in:
samuele3hu 2015-01-14 15:09:37 +08:00
parent 951324a230
commit c026aa82f9
4 changed files with 55 additions and 25 deletions

View File

@ -28,7 +28,7 @@
extern int lua_cocos2dx_3d_Sprite3D_setBlendFunc(lua_State* L);
int lua_cocos2dx_3d_Sprite3D_setBlendFunc01(lua_State* L)
CC_DEPRECATED_ATTRIBUTE int lua_cocos2dx_3d_Sprite3D_setBlendFunc01(lua_State* L)
{
int argc = 0;
cocos2d::Sprite3D* cobj = nullptr;

View File

@ -3413,7 +3413,7 @@ tolua_lerror:
}
extern int lua_cocos2dx_Sprite_setBlendFunc(lua_State* tolua_S);
static int tolua_cocos2dx_Sprite_setBlendFunc01(lua_State* tolua_S)
CC_DEPRECATED_ATTRIBUTE static int tolua_cocos2dx_Sprite_setBlendFunc01(lua_State* tolua_S)
{
int argc = lua_gettop(tolua_S) - 1;
if (argc == 2)
@ -3426,7 +3426,7 @@ static int tolua_cocos2dx_Sprite_setBlendFunc01(lua_State* tolua_S)
extern int lua_cocos2dx_SpriteBatchNode_setBlendFunc(lua_State* tolua_S);
static int tolua_cocos2dx_SpriteBatchNode_setBlendFunc01(lua_State* tolua_S)
CC_DEPRECATED_ATTRIBUTE static int tolua_cocos2dx_SpriteBatchNode_setBlendFunc01(lua_State* tolua_S)
{
int argc = lua_gettop(tolua_S) - 1;
if (argc == 2)
@ -3439,7 +3439,7 @@ static int tolua_cocos2dx_SpriteBatchNode_setBlendFunc01(lua_State* tolua_S)
extern int lua_cocos2dx_MotionStreak_setBlendFunc(lua_State* tolua_S);
static int tolua_cocos2dx_MotionStreak_setBlendFunc01(lua_State* tolua_S)
CC_DEPRECATED_ATTRIBUTE static int tolua_cocos2dx_MotionStreak_setBlendFunc01(lua_State* tolua_S)
{
int argc = lua_gettop(tolua_S) - 1;
if (argc == 2)
@ -3452,7 +3452,7 @@ static int tolua_cocos2dx_MotionStreak_setBlendFunc01(lua_State* tolua_S)
extern int lua_cocos2dx_AtlasNode_setBlendFunc(lua_State* tolua_S);
static int tolua_cocos2dx_AtlasNode_setBlendFunc01(lua_State* tolua_S)
CC_DEPRECATED_ATTRIBUTE static int tolua_cocos2dx_AtlasNode_setBlendFunc01(lua_State* tolua_S)
{
int argc = lua_gettop(tolua_S) - 1;
if (argc == 2)
@ -3465,7 +3465,7 @@ static int tolua_cocos2dx_AtlasNode_setBlendFunc01(lua_State* tolua_S)
extern int lua_cocos2dx_ParticleBatchNode_setBlendFunc(lua_State* tolua_S);
static int tolua_cocos2dx_ParticleBatchNode_setBlendFunc01(lua_State* tolua_S)
CC_DEPRECATED_ATTRIBUTE static int tolua_cocos2dx_ParticleBatchNode_setBlendFunc01(lua_State* tolua_S)
{
int argc = lua_gettop(tolua_S) - 1;
if (argc == 2)
@ -3478,7 +3478,7 @@ static int tolua_cocos2dx_ParticleBatchNode_setBlendFunc01(lua_State* tolua_S)
extern int lua_cocos2dx_LayerColor_setBlendFunc(lua_State* tolua_S);
static int tolua_cocos2dx_LayerColor_setBlendFunc01(lua_State* tolua_S)
CC_DEPRECATED_ATTRIBUTE static int tolua_cocos2dx_LayerColor_setBlendFunc01(lua_State* tolua_S)
{
int argc = lua_gettop(tolua_S) - 1;
if (argc == 2)
@ -3491,7 +3491,7 @@ static int tolua_cocos2dx_LayerColor_setBlendFunc01(lua_State* tolua_S)
extern int lua_cocos2dx_ParticleSystem_setBlendFunc(lua_State* tolua_S);
static int tolua_cocos2dx_ParticleSystem_setBlendFunc01(lua_State* tolua_S)
CC_DEPRECATED_ATTRIBUTE static int tolua_cocos2dx_ParticleSystem_setBlendFunc01(lua_State* tolua_S)
{
int argc = lua_gettop(tolua_S) - 1;
if (argc == 2)
@ -3504,7 +3504,7 @@ static int tolua_cocos2dx_ParticleSystem_setBlendFunc01(lua_State* tolua_S)
extern int lua_cocos2dx_DrawNode_setBlendFunc(lua_State* tolua_S);
static int tolua_cocos2dx_DrawNode_setBlendFunc01(lua_State* tolua_S)
CC_DEPRECATED_ATTRIBUTE static int tolua_cocos2dx_DrawNode_setBlendFunc01(lua_State* tolua_S)
{
int argc = lua_gettop(tolua_S) - 1;
if (argc == 2)

View File

@ -322,7 +322,7 @@ tolua_lerror:
extern int lua_cocos2dx_spine_SkeletonRenderer_setBlendFunc(lua_State* tolua_S);
static int tolua_spine_SkeletoneAnimation_setBlendFunc(lua_State* tolua_S)
CC_DEPRECATED_ATTRIBUTE static int tolua_spine_SkeletoneAnimation_setBlendFunc(lua_State* tolua_S)
{
int argc = lua_gettop(tolua_S) - 1;
if (argc == 2)

View File

@ -417,20 +417,6 @@ int lua_cocos2dx_DrawNode3D_setBlendFunc(lua_State* L)
cobj->setBlendFunc(arg0);
return 0;
}
else if (argc == 2)
{
CCLOG("setBlendFunc of cc.DrawNode3D will deprecate two int parameter form,please pass a table like {src = xx, dst = xx} as a parameter");
GLenum src, dst;
if (!luaval_to_int32(L, 2, (int32_t*)&src, "cc.DrawNode3D:setBlendFunc"))
return 0;
if (!luaval_to_int32(L, 3, (int32_t*)&dst, "cc.DrawNode3D:setBlendFunc"))
return 0;
BlendFunc blendFunc = {src, dst};
cobj->setBlendFunc(blendFunc);
return 0;
}
CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.DrawNode3D:setBlendFunc",argc, 1);
return 0;
@ -443,6 +429,50 @@ tolua_lerror:
return 0;
}
CC_DEPRECATED_ATTRIBUTE int lua_cocos2dx_DrawNode3D_setBlendFunc01(lua_State* L)
{
int argc = 0;
cocos2d::DrawNode3D* cobj = nullptr;
tolua_Error tolua_err;
if (!tolua_isusertype(L,1,"cc.DrawNode3D",0,&tolua_err)) goto tolua_lerror;
cobj = (cocos2d::DrawNode3D*)tolua_tousertype(L,1,0);
#if COCOS2D_DEBUG >= 1
if (!cobj)
{
tolua_error(L,"invalid 'cobj' in function 'lua_cocos2dx_DrawNode3D_setBlendFunc'", nullptr);
return 0;
}
#endif
argc = lua_gettop(L)-1;
if (argc != 2)
{
goto tolua_lerror;
}
else
{
CCLOG("setBlendFunc of cc.DrawNode3D will deprecate two int parameter form,please pass a table like {src = xx, dst = xx} as a parameter");
GLenum src, dst;
if (!luaval_to_int32(L, 2, (int32_t*)&src, "cc.DrawNode3D:setBlendFunc"))
return 0;
if (!luaval_to_int32(L, 3, (int32_t*)&dst, "cc.DrawNode3D:setBlendFunc"))
return 0;
BlendFunc blendFunc = {src, dst};
cobj->setBlendFunc(blendFunc);
lua_settop(L, 1);
return 1;
}
tolua_lerror:
return lua_cocos2dx_DrawNode3D_setBlendFunc(L);
}
int lua_cocos2dx_DrawNode3D_drawLine(lua_State* L)
{
int argc = 0;
@ -657,7 +687,7 @@ int lua_register_cocos2dx_DrawNode3D(lua_State* L)
tolua_beginmodule(L,"DrawNode3D");
tolua_function(L,"getBlendFunc",lua_cocos2dx_DrawNode3D_getBlendFunc);
tolua_function(L,"setBlendFunc",lua_cocos2dx_DrawNode3D_setBlendFunc);
tolua_function(L,"setBlendFunc",lua_cocos2dx_DrawNode3D_setBlendFunc01);
tolua_function(L,"drawLine",lua_cocos2dx_DrawNode3D_drawLine);
tolua_function(L,"clear",lua_cocos2dx_DrawNode3D_clear);
tolua_function(L,"drawCube",lua_cocos2dx_DrawNode3D_drawCube);