fix setVertexAttribPointer luabinding

This commit is contained in:
fusijie 2015-08-18 11:46:45 +08:00
parent f671d36e31
commit a799c99b1a
1 changed files with 0 additions and 61 deletions

View File

@ -7213,67 +7213,6 @@ static int lua_cocos2dx_GLProgramState_setVertexAttribPointer(lua_State* tolua_S
lua_settop(tolua_S, 1);
return 1;
}
else if (argc == 7)
{
std::string arg0;
int arg1;
unsigned int arg2;
bool arg3;
int arg4;
GLfloat* arg5;
int arg6;
ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.GLProgramState:setVertexAttribPointer");
ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1, "cc.GLProgramState:setVertexAttribPointer");
ok &= luaval_to_uint32(tolua_S, 4,&arg2, "cc.GLProgramState:setVertexAttribPointer");
ok &= luaval_to_boolean(tolua_S, 5, &arg3, "cc.GLProgramState:setVertexAttribPointer");
ok &= luaval_to_int32(tolua_S, 6,(int *)&arg4, "cc.GLProgramState:setVertexAttribPointer");
ok &= luaval_to_int32(tolua_S, 8, (int *)&arg6, "cc.GLProgramState:setVertexAttribPointer");
size_t len = lua_objlen(tolua_S, 7);
if (len != arg6)
{
luaL_error(tolua_S, "table size is %zu,but input size is %d \n", len, arg6);
return 0;
}
arg5 = new (std::nothrow) GLfloat[len];
for (int i = 0; i < len; i++)
{
lua_pushnumber(tolua_S,i + 1);
lua_gettable(tolua_S,7);
bool isnum = true;
#if COCOS2D_DEBUG >= 1
if (!tolua_isnumber(tolua_S, -1, 0, &tolua_err))
{
isnum = false;
}
#endif
if (isnum)
{
arg5[i] = tolua_tonumber(tolua_S, -1, 0);
}
else
{
arg5[i] = 0;
}
lua_pop(tolua_S, 1);
}
cobj->setVertexAttribPointer(arg0, arg1, arg2, arg3, arg4, (void*)arg5);
CC_SAFE_DELETE(arg5);
lua_settop(tolua_S, 1);
return 1;
}
luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.GLProgramState:setVertexAttribPointer",argc, 6);
return 0;