tolua_cocos2dx_GLProgram_setUniformLocationF32 function does’t work.
right code is here:
static int tolua_cocos2dx_GLProgram_setUniformLocationF32(lua_State* tolua_S)
{
if (nullptr == tolua_S)
return 0;
int argc = 0;
GLProgram* self = nullptr;
int location = 0;
double f1 = 0.0;
double f2 = 0.0;
double f3 = 0.0;
double f4 = 0.0;
#if COCOS2D_DEBUG >= 1
tolua_Error tolua_err;
if (!tolua_isusertype(tolua_S,1,“cc.GLProgram”,0,&tolua_err)) goto tolua_lerror;
#endif
self = (GLProgram*) tolua_tousertype(tolua_S,1,0);
#if COCOS2D_DEBUG >= 1
if (nullptr == self)
{
tolua_error(tolua_S,“invalid ‘self’ in function ‘tolua_cocos2d_GLProgram_getProgram’\n”, nullptr);
return 0;
}
#endif
argc = lua_gettop(tolua_S) - 1;
if (argc >= 2 && argc <= 5)
{
#if COCOS2D_DEBUG >= 1
if (!tolua_isnumber(tolua_S,2,0,&tolua_err) ||
!tolua_isnumber(tolua_S,3,0,&tolua_err))
{
goto tolua_lerror;
}
#endif
location = (int) tolua_tonumber(tolua_S,2,0);
f1 = (float) tolua_tonumber(tolua_S,3,0);
if (2 == argc)
{
self->setUniformLocationWith1f(location,f1);
return 0;
}
if (argc >= 3)
{
#if COCOS2D_DEBUG >= 1
if (!tolua_isnumber(tolua_S,4,0,&tolua_err))
goto tolua_lerror;
#endif
f2 = (float) tolua_tonumber(tolua_S,4,0);
if (3 == argc)
{
self->setUniformLocationWith2f(location, f1, f2);
return 0;
}
}
if (argc >= 4)
{
#if COCOS2D_DEBUG >= 1
if (!tolua_isnumber(tolua_S,5,0,&tolua_err))
goto tolua_lerror;
#endif
f3 = (float) tolua_tonumber(tolua_S,5,0);
if (4 == argc)
{
self->setUniformLocationWith3f(location, f1, f2, f3);
return 0;
}
}
if (argc == 5)
{
#if COCOS2D_DEBUG >= 1
if (!tolua_isnumber(tolua_S,6,0,&tolua_err))
goto tolua_lerror;
#endif
f4 = (float) tolua_tonumber(tolua_S,6,0);
if (5 == argc)
{
self->setUniformLocationWith4f(location, f1, f2, f3, f4);
return 0;
}
}
}
CCLOG("'setUniformLocationF32' function of GLProgram wrong number of arguments: %d, was expecting %d\n", argc, 2);
return 0;
#if COCOS2D_DEBUG >= 1
tolua_lerror:
tolua_error(tolua_S,"#ferror in function ‘setUniformLocationF32’.",&tolua_err);
return 0;
#endif
}