Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions cocos/scripting/js-bindings/auto/jsb_cocos2dx_auto.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9819,6 +9819,22 @@ bool js_cocos2dx_Image_hasPremultipliedAlpha(JSContext *cx, uint32_t argc, jsval
JS_ReportError(cx, "js_cocos2dx_Image_hasPremultipliedAlpha : wrong number of arguments: %d, was expecting %d", argc, 0);
return false;
}
bool js_cocos2dx_Image_reversePremultipliedAlpha(JSContext *cx, uint32_t argc, jsval *vp)
{
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
JS::RootedObject obj(cx, args.thisv().toObjectOrNull());
js_proxy_t *proxy = jsb_get_js_proxy(obj);
cocos2d::Image* cobj = (cocos2d::Image *)(proxy ? proxy->ptr : NULL);
JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Image_reversePremultipliedAlpha : Invalid Native Object");
if (argc == 0) {
cobj->reversePremultipliedAlpha();
args.rval().setUndefined();
return true;
}

JS_ReportError(cx, "js_cocos2dx_Image_reversePremultipliedAlpha : wrong number of arguments: %d, was expecting %d", argc, 0);
return false;
}
bool js_cocos2dx_Image_getDataLen(JSContext *cx, uint32_t argc, jsval *vp)
{
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
Expand Down Expand Up @@ -9925,6 +9941,22 @@ bool js_cocos2dx_Image_getHeight(JSContext *cx, uint32_t argc, jsval *vp)
JS_ReportError(cx, "js_cocos2dx_Image_getHeight : wrong number of arguments: %d, was expecting %d", argc, 0);
return false;
}
bool js_cocos2dx_Image_premultiplyAlpha(JSContext *cx, uint32_t argc, jsval *vp)
{
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
JS::RootedObject obj(cx, args.thisv().toObjectOrNull());
js_proxy_t *proxy = jsb_get_js_proxy(obj);
cocos2d::Image* cobj = (cocos2d::Image *)(proxy ? proxy->ptr : NULL);
JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Image_premultiplyAlpha : Invalid Native Object");
if (argc == 0) {
cobj->premultiplyAlpha();
args.rval().setUndefined();
return true;
}

JS_ReportError(cx, "js_cocos2dx_Image_premultiplyAlpha : wrong number of arguments: %d, was expecting %d", argc, 0);
return false;
}
bool js_cocos2dx_Image_initWithImageFile(JSContext *cx, uint32_t argc, jsval *vp)
{
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
Expand Down Expand Up @@ -10210,11 +10242,13 @@ void js_register_cocos2dx_Image(JSContext *cx, JS::HandleObject global) {

static JSFunctionSpec funcs[] = {
JS_FN("hasPremultipliedAlpha", js_cocos2dx_Image_hasPremultipliedAlpha, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),
JS_FN("reversePremultipliedAlpha", js_cocos2dx_Image_reversePremultipliedAlpha, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),
JS_FN("getDataLen", js_cocos2dx_Image_getDataLen, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),
JS_FN("saveToFile", js_cocos2dx_Image_saveToFile, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),
JS_FN("hasAlpha", js_cocos2dx_Image_hasAlpha, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),
JS_FN("isCompressed", js_cocos2dx_Image_isCompressed, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),
JS_FN("getHeight", js_cocos2dx_Image_getHeight, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),
JS_FN("premultiplyAlpha", js_cocos2dx_Image_premultiplyAlpha, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),
JS_FN("initWithImageFile", js_cocos2dx_Image_initWithImageFile, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),
JS_FN("getWidth", js_cocos2dx_Image_getWidth, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),
JS_FN("getBitPerPixel", js_cocos2dx_Image_getBitPerPixel, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),
Expand Down
2 changes: 2 additions & 0 deletions cocos/scripting/js-bindings/auto/jsb_cocos2dx_auto.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -523,11 +523,13 @@ void js_cocos2dx_Image_finalize(JSContext *cx, JSObject *obj);
void js_register_cocos2dx_Image(JSContext *cx, JS::HandleObject global);
void register_all_cocos2dx(JSContext* cx, JS::HandleObject obj);
bool js_cocos2dx_Image_hasPremultipliedAlpha(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_Image_reversePremultipliedAlpha(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_Image_getDataLen(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_Image_saveToFile(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_Image_hasAlpha(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_Image_isCompressed(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_Image_getHeight(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_Image_premultiplyAlpha(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_Image_initWithImageFile(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_Image_getWidth(JSContext *cx, uint32_t argc, jsval *vp);
bool js_cocos2dx_Image_getBitPerPixel(JSContext *cx, uint32_t argc, jsval *vp);
Expand Down
208 changes: 208 additions & 0 deletions cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19918,6 +19918,53 @@ int lua_cocos2dx_Image_hasPremultipliedAlpha(lua_State* tolua_S)

return 0;
}
int lua_cocos2dx_Image_reversePremultipliedAlpha(lua_State* tolua_S)
{
int argc = 0;
cocos2d::Image* cobj = nullptr;
bool ok = true;

#if COCOS2D_DEBUG >= 1
tolua_Error tolua_err;
#endif


#if COCOS2D_DEBUG >= 1
if (!tolua_isusertype(tolua_S,1,"cc.Image",0,&tolua_err)) goto tolua_lerror;
#endif

cobj = (cocos2d::Image*)tolua_tousertype(tolua_S,1,0);

#if COCOS2D_DEBUG >= 1
if (!cobj)
{
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Image_reversePremultipliedAlpha'", nullptr);
return 0;
}
#endif

argc = lua_gettop(tolua_S)-1;
if (argc == 0)
{
if(!ok)
{
tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Image_reversePremultipliedAlpha'", nullptr);
return 0;
}
cobj->reversePremultipliedAlpha();
lua_settop(tolua_S, 1);
return 1;
}
luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Image:reversePremultipliedAlpha",argc, 0);
return 0;

#if COCOS2D_DEBUG >= 1
tolua_lerror:
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Image_reversePremultipliedAlpha'.",&tolua_err);
#endif

return 0;
}
int lua_cocos2dx_Image_saveToFile(lua_State* tolua_S)
{
int argc = 0;
Expand Down Expand Up @@ -20126,6 +20173,53 @@ int lua_cocos2dx_Image_getHeight(lua_State* tolua_S)

return 0;
}
int lua_cocos2dx_Image_premultiplyAlpha(lua_State* tolua_S)
{
int argc = 0;
cocos2d::Image* cobj = nullptr;
bool ok = true;

#if COCOS2D_DEBUG >= 1
tolua_Error tolua_err;
#endif


#if COCOS2D_DEBUG >= 1
if (!tolua_isusertype(tolua_S,1,"cc.Image",0,&tolua_err)) goto tolua_lerror;
#endif

cobj = (cocos2d::Image*)tolua_tousertype(tolua_S,1,0);

#if COCOS2D_DEBUG >= 1
if (!cobj)
{
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Image_premultiplyAlpha'", nullptr);
return 0;
}
#endif

argc = lua_gettop(tolua_S)-1;
if (argc == 0)
{
if(!ok)
{
tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Image_premultiplyAlpha'", nullptr);
return 0;
}
cobj->premultiplyAlpha();
lua_settop(tolua_S, 1);
return 1;
}
luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Image:premultiplyAlpha",argc, 0);
return 0;

#if COCOS2D_DEBUG >= 1
tolua_lerror:
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Image_premultiplyAlpha'.",&tolua_err);
#endif

return 0;
}
int lua_cocos2dx_Image_initWithImageFile(lua_State* tolua_S)
{
int argc = 0;
Expand Down Expand Up @@ -20581,10 +20675,12 @@ int lua_register_cocos2dx_Image(lua_State* tolua_S)
tolua_beginmodule(tolua_S,"Image");
tolua_function(tolua_S,"new",lua_cocos2dx_Image_constructor);
tolua_function(tolua_S,"hasPremultipliedAlpha",lua_cocos2dx_Image_hasPremultipliedAlpha);
tolua_function(tolua_S,"reversePremultipliedAlpha",lua_cocos2dx_Image_reversePremultipliedAlpha);
tolua_function(tolua_S,"saveToFile",lua_cocos2dx_Image_saveToFile);
tolua_function(tolua_S,"hasAlpha",lua_cocos2dx_Image_hasAlpha);
tolua_function(tolua_S,"isCompressed",lua_cocos2dx_Image_isCompressed);
tolua_function(tolua_S,"getHeight",lua_cocos2dx_Image_getHeight);
tolua_function(tolua_S,"premultiplyAlpha",lua_cocos2dx_Image_premultiplyAlpha);
tolua_function(tolua_S,"initWithImageFile",lua_cocos2dx_Image_initWithImageFile);
tolua_function(tolua_S,"getWidth",lua_cocos2dx_Image_getWidth);
tolua_function(tolua_S,"getBitPerPixel",lua_cocos2dx_Image_getBitPerPixel);
Expand Down Expand Up @@ -78809,6 +78905,117 @@ int lua_cocos2dx_RenderTexture_isAutoDraw(lua_State* tolua_S)

return 0;
}
int lua_cocos2dx_RenderTexture_saveToFileAsNonPMA(lua_State* tolua_S)
{
int argc = 0;
cocos2d::RenderTexture* cobj = nullptr;
bool ok = true;
#if COCOS2D_DEBUG >= 1
tolua_Error tolua_err;
#endif

#if COCOS2D_DEBUG >= 1
if (!tolua_isusertype(tolua_S,1,"cc.RenderTexture",0,&tolua_err)) goto tolua_lerror;
#endif
cobj = (cocos2d::RenderTexture*)tolua_tousertype(tolua_S,1,0);
#if COCOS2D_DEBUG >= 1
if (!cobj)
{
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_RenderTexture_saveToFileAsNonPMA'", nullptr);
return 0;
}
#endif
argc = lua_gettop(tolua_S)-1;
do{
if (argc == 4) {
std::string arg0;
ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.RenderTexture:saveToFileAsNonPMA");

if (!ok) { break; }
cocos2d::Image::Format arg1;
ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1, "cc.RenderTexture:saveToFileAsNonPMA");

if (!ok) { break; }
bool arg2;
ok &= luaval_to_boolean(tolua_S, 4,&arg2, "cc.RenderTexture:saveToFileAsNonPMA");

if (!ok) { break; }
std::function<void (cocos2d::RenderTexture *, const std::string&)> arg3;
do {
// Lambda binding for lua is not supported.
assert(false);
} while(0)
;

if (!ok) { break; }
bool ret = cobj->saveToFileAsNonPMA(arg0, arg1, arg2, arg3);
tolua_pushboolean(tolua_S,(bool)ret);
return 1;
}
}while(0);
ok = true;
do{
if (argc == 1) {
std::string arg0;
ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.RenderTexture:saveToFileAsNonPMA");

if (!ok) { break; }
bool ret = cobj->saveToFileAsNonPMA(arg0);
tolua_pushboolean(tolua_S,(bool)ret);
return 1;
}
}while(0);
ok = true;
do{
if (argc == 2) {
std::string arg0;
ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.RenderTexture:saveToFileAsNonPMA");

if (!ok) { break; }
bool arg1;
ok &= luaval_to_boolean(tolua_S, 3,&arg1, "cc.RenderTexture:saveToFileAsNonPMA");

if (!ok) { break; }
bool ret = cobj->saveToFileAsNonPMA(arg0, arg1);
tolua_pushboolean(tolua_S,(bool)ret);
return 1;
}
}while(0);
ok = true;
do{
if (argc == 3) {
std::string arg0;
ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.RenderTexture:saveToFileAsNonPMA");

if (!ok) { break; }
bool arg1;
ok &= luaval_to_boolean(tolua_S, 3,&arg1, "cc.RenderTexture:saveToFileAsNonPMA");

if (!ok) { break; }
std::function<void (cocos2d::RenderTexture *, const std::string&)> arg2;
do {
// Lambda binding for lua is not supported.
assert(false);
} while(0)
;

if (!ok) { break; }
bool ret = cobj->saveToFileAsNonPMA(arg0, arg1, arg2);
tolua_pushboolean(tolua_S,(bool)ret);
return 1;
}
}while(0);
ok = true;
luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.RenderTexture:saveToFileAsNonPMA",argc, 1);
return 0;

#if COCOS2D_DEBUG >= 1
tolua_lerror:
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_RenderTexture_saveToFileAsNonPMA'.",&tolua_err);
#endif

return 0;
}
int lua_cocos2dx_RenderTexture_setKeepMatrix(lua_State* tolua_S)
{
int argc = 0;
Expand Down Expand Up @@ -79891,6 +80098,7 @@ int lua_register_cocos2dx_RenderTexture(lua_State* tolua_S)
tolua_function(tolua_S,"setSprite",lua_cocos2dx_RenderTexture_setSprite);
tolua_function(tolua_S,"getSprite",lua_cocos2dx_RenderTexture_getSprite);
tolua_function(tolua_S,"isAutoDraw",lua_cocos2dx_RenderTexture_isAutoDraw);
tolua_function(tolua_S,"saveToFileAsNonPMA",lua_cocos2dx_RenderTexture_saveToFileAsNonPMA);
tolua_function(tolua_S,"setKeepMatrix",lua_cocos2dx_RenderTexture_setKeepMatrix);
tolua_function(tolua_S,"setClearFlags",lua_cocos2dx_RenderTexture_setClearFlags);
tolua_function(tolua_S,"begin",lua_cocos2dx_RenderTexture_begin);
Expand Down
3 changes: 3 additions & 0 deletions cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2294,6 +2294,9 @@ int register_all_cocos2dx(lua_State* tolua_S);









Expand Down