Skip to content

Commit

Permalink
fixed cocos2d#1369: Invoking CCLabelTTF:setPosition(x,y) in lua scrip…
Browse files Browse the repository at this point in the history
…t causes crash.
  • Loading branch information
James Chen committed Jun 27, 2012
1 parent 03afa55 commit d147bcf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 37 deletions.
43 changes: 7 additions & 36 deletions lua/cocos2dx_support/LuaCocos2d.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
** Lua binding: Cocos2d
** Generated automatically by tolua++-1.0.92 on 06/27/12 13:55:52.
** Generated automatically by tolua++-1.0.92 on 06/28/12 00:04:38.
*/

#include <vector>
Expand Down Expand Up @@ -16849,38 +16849,6 @@ static int tolua_Cocos2d_CCNode_getPositionY00(lua_State* tolua_S)
static int tolua_Cocos2d_CCNode_setPosition00(lua_State* tolua_S)
{
#ifndef TOLUA_RELEASE
tolua_Error tolua_err;
if (
!tolua_isusertype(tolua_S,1,"CCNode",0,&tolua_err) ||
(tolua_isvaluenil(tolua_S,2,&tolua_err) || !tolua_isusertype(tolua_S,2,"CCPoint",0,&tolua_err)) ||
!tolua_isnoobj(tolua_S,3,&tolua_err)
)
goto tolua_lerror;
else
#endif
{
CCNode* self = (CCNode*) tolua_tousertype(tolua_S,1,0);
CCPoint newPosition = *((CCPoint*) tolua_tousertype(tolua_S,2,0));
#ifndef TOLUA_RELEASE
if (!self) tolua_error(tolua_S,"invalid 'self' in function 'setPosition'", NULL);
#endif
{
self->setPosition(newPosition);
}
}
return 0;
#ifndef TOLUA_RELEASE
tolua_lerror:
tolua_error(tolua_S,"#ferror in function 'setPosition'.",&tolua_err);
return 0;
#endif
}
#endif //#ifndef TOLUA_DISABLE

/* method: setPosition of class CCNode */
#ifndef TOLUA_DISABLE_tolua_Cocos2d_CCNode_setPosition01
static int tolua_Cocos2d_CCNode_setPosition01(lua_State* tolua_S)
{
tolua_Error tolua_err;
if (
!tolua_isusertype(tolua_S,1,"CCNode",0,&tolua_err) ||
Expand All @@ -16890,6 +16858,7 @@ static int tolua_Cocos2d_CCNode_setPosition01(lua_State* tolua_S)
)
goto tolua_lerror;
else
#endif
{
CCNode* self = (CCNode*) tolua_tousertype(tolua_S,1,0);
float x = ((float) tolua_tonumber(tolua_S,2,0));
Expand All @@ -16902,8 +16871,11 @@ static int tolua_Cocos2d_CCNode_setPosition01(lua_State* tolua_S)
}
}
return 0;
tolua_lerror:
return tolua_Cocos2d_CCNode_setPosition00(tolua_S);
#ifndef TOLUA_RELEASE
tolua_lerror:
tolua_error(tolua_S,"#ferror in function 'setPosition'.",&tolua_err);
return 0;
#endif
}
#endif //#ifndef TOLUA_DISABLE

Expand Down Expand Up @@ -38237,7 +38209,6 @@ TOLUA_API int tolua_Cocos2d_open (lua_State* tolua_S)
tolua_function(tolua_S,"getPositionX",tolua_Cocos2d_CCNode_getPositionX00);
tolua_function(tolua_S,"getPositionY",tolua_Cocos2d_CCNode_getPositionY00);
tolua_function(tolua_S,"setPosition",tolua_Cocos2d_CCNode_setPosition00);
tolua_function(tolua_S,"setPosition",tolua_Cocos2d_CCNode_setPosition01);
tolua_function(tolua_S,"setPositionX",tolua_Cocos2d_CCNode_setPositionX00);
tolua_function(tolua_S,"setPositionY",tolua_Cocos2d_CCNode_setPositionY00);
tolua_function(tolua_S,"getSkewX",tolua_Cocos2d_CCNode_getSkewX00);
Expand Down
1 change: 0 additions & 1 deletion tools/tolua++/CCNode.pkg
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ class CCNode : public CCObject
void getPosition(float* x = 0, float* y = 0);
float getPositionX();
float getPositionY();
void setPosition(CCPoint newPosition);
void setPosition(float x, float y);
void setPositionX(float x);
void setPositionY(float y);
Expand Down

0 comments on commit d147bcf

Please sign in to comment.