Merge pull request #4152 from samuele3hu/developCheck

Add conversion functions to support bindings-generator
This commit is contained in:
James Chen 2013-11-09 19:24:03 -08:00
commit 9ed0bd0689
3 changed files with 26 additions and 1 deletions

View File

@ -283,6 +283,30 @@ bool luaval_to_point(lua_State* L,int lo,Point* outValue)
return ok;
}
bool luaval_to_long(lua_State* L,int lo, long* outValue)
{
if (NULL == L || NULL == outValue)
return false;
bool ok = true;
tolua_Error tolua_err;
if (!tolua_isnumber(L,lo,0,&tolua_err))
{
#if COCOS2D_DEBUG >=1
luaval_to_native_err(L,"#ferror:",&tolua_err);
#endif
ok = false;
}
if (ok)
{
*outValue = (long)tolua_tonumber(L, lo, 0);
}
return ok;
}
bool luaval_to_size(lua_State* L,int lo,Size* outValue)
{
if (NULL == L || NULL == outValue)

View File

@ -30,6 +30,7 @@ extern bool luaval_to_boolean(lua_State* L,int lo,bool* outValue);
extern bool luaval_to_number(lua_State* L,int lo,double* outValue);
extern bool luaval_to_long_long(lua_State* L,int lo,long long* outValue);
extern bool luaval_to_std_string(lua_State* L, int lo, std::string* outValue);
extern bool luaval_to_long(lua_State* L,int lo, long* outValue);
extern bool luaval_to_point(lua_State* L,int lo,Point* outValue);
extern bool luaval_to_size(lua_State* L,int lo,Size* outValue);

@ -1 +1 @@
Subproject commit d41959ab0b15c20aa0802ab5c9ef92be7b742bd4
Subproject commit 7ccbabbaa677607048c511b33cb6d83b2081220e