issue #3708:Performance Test: data structure conversion in lua binding

This commit is contained in:
samuele3hu 2014-02-12 18:19:06 +08:00
parent e90e0b0c23
commit 3d0fabe08c
5 changed files with 1668 additions and 1196 deletions

View File

@ -105,7 +105,7 @@ int lua_print(lua_State * luastate)
if (i!=nargs)
t += "\t";
}
CCLOG("[LUA-print] %s", t.c_str());
log("[LUA-print] %s", t.c_str());
return 0;
}
@ -157,6 +157,7 @@ bool LuaStack::init(void)
register_all_cocos2dx_extension(_state);
register_all_cocos2dx_deprecated(_state);
register_cocos2dx_extension_CCBProxy(_state);
register_cocos2dx_PerformanceStuctAndTable(_state);
tolua_opengl_open(_state);
register_all_cocos2dx_gui(_state);
register_all_cocos2dx_studio(_state);

View File

@ -106,7 +106,7 @@ bool array_to_valuevector_deprecated(Array& array,ValueVector& valueVec)
#define deprecatedFunctionTip(oldFun,newFun) CCLOG("%s was deprecated please use %s instead ",oldFun, newFun)
static int tolua_Cocos2d_CCPoint_new00(lua_State* tolua_S)
{
deprecatedClassTip("CCPoint");
// deprecatedClassTip("CCPoint");
#ifndef TOLUA_RELEASE
tolua_Error tolua_err;
@ -132,7 +132,7 @@ tolua_lerror:
static int tolua_Cocos2d_CCPoint_new00_local(lua_State* tolua_S)
{
deprecatedClassTip("CCPoint");
// deprecatedClassTip("CCPoint");
#ifndef TOLUA_RELEASE
tolua_Error tolua_err;
@ -183,7 +183,7 @@ tolua_lerror:
static int tolua_Cocos2d_CCPoint_new01_local(lua_State* tolua_S)
{
deprecatedClassTip("CCPoint");
// deprecatedClassTip("CCPoint");
tolua_Error tolua_err;
if (
@ -197,8 +197,10 @@ static int tolua_Cocos2d_CCPoint_new01_local(lua_State* tolua_S)
{
float x = ((float) tolua_tonumber(tolua_S,2,0));
float y = ((float) tolua_tonumber(tolua_S,3,0));
Point tolua_ret(x,y);
point_to_luaval(tolua_S, tolua_ret);
Point* tolua_ret = (Point*) Mtolua_new((Point)(x,y));
tolua_pushusertype(tolua_S,(void*)tolua_ret,"CCPoint");
tolua_register_gc(tolua_S,lua_gettop(tolua_S));
//point_to_luaval(tolua_S, tolua_ret);
}
return 1;
tolua_lerror:

View File

@ -1 +1 @@
c5f8d4a3ea721a2ecb36fe381430b7ac6fad1740
8102f7376c603c7a65f754d9d1f981c6a5c1ce2f

View File

@ -55,6 +55,8 @@ TOLUA_API int register_all_cocos2dx_manual(lua_State* tolua_S);
TOLUA_API int register_cocos2dx_event_releated(lua_State* tolua_S);
TOLUA_API int register_cocos2dx_PerformanceStuctAndTable(lua_State* tolua_S);
struct LuaEventAccelerationData
{
void* acc;