Skip to content

Commit 33110eb

Browse files
CocosRobothuangwei1024
authored andcommitted
[ci skip][AUTO]: updating luabinding & jsbinding & cocos_file.json automatically (cocos2d#19796)
1 parent eaf1162 commit 33110eb

File tree

4 files changed

+247
-0
lines changed

4 files changed

+247
-0
lines changed

cocos/scripting/js-bindings/auto/jsb_cocos2dx_auto.cpp

+34
Original file line numberDiff line numberDiff line change
@@ -9819,6 +9819,22 @@ bool js_cocos2dx_Image_hasPremultipliedAlpha(JSContext *cx, uint32_t argc, jsval
98199819
JS_ReportError(cx, "js_cocos2dx_Image_hasPremultipliedAlpha : wrong number of arguments: %d, was expecting %d", argc, 0);
98209820
return false;
98219821
}
9822+
bool js_cocos2dx_Image_reversePremultipliedAlpha(JSContext *cx, uint32_t argc, jsval *vp)
9823+
{
9824+
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
9825+
JS::RootedObject obj(cx, args.thisv().toObjectOrNull());
9826+
js_proxy_t *proxy = jsb_get_js_proxy(obj);
9827+
cocos2d::Image* cobj = (cocos2d::Image *)(proxy ? proxy->ptr : NULL);
9828+
JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Image_reversePremultipliedAlpha : Invalid Native Object");
9829+
if (argc == 0) {
9830+
cobj->reversePremultipliedAlpha();
9831+
args.rval().setUndefined();
9832+
return true;
9833+
}
9834+
9835+
JS_ReportError(cx, "js_cocos2dx_Image_reversePremultipliedAlpha : wrong number of arguments: %d, was expecting %d", argc, 0);
9836+
return false;
9837+
}
98229838
bool js_cocos2dx_Image_getDataLen(JSContext *cx, uint32_t argc, jsval *vp)
98239839
{
98249840
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
@@ -9925,6 +9941,22 @@ bool js_cocos2dx_Image_getHeight(JSContext *cx, uint32_t argc, jsval *vp)
99259941
JS_ReportError(cx, "js_cocos2dx_Image_getHeight : wrong number of arguments: %d, was expecting %d", argc, 0);
99269942
return false;
99279943
}
9944+
bool js_cocos2dx_Image_premultiplyAlpha(JSContext *cx, uint32_t argc, jsval *vp)
9945+
{
9946+
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
9947+
JS::RootedObject obj(cx, args.thisv().toObjectOrNull());
9948+
js_proxy_t *proxy = jsb_get_js_proxy(obj);
9949+
cocos2d::Image* cobj = (cocos2d::Image *)(proxy ? proxy->ptr : NULL);
9950+
JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Image_premultiplyAlpha : Invalid Native Object");
9951+
if (argc == 0) {
9952+
cobj->premultiplyAlpha();
9953+
args.rval().setUndefined();
9954+
return true;
9955+
}
9956+
9957+
JS_ReportError(cx, "js_cocos2dx_Image_premultiplyAlpha : wrong number of arguments: %d, was expecting %d", argc, 0);
9958+
return false;
9959+
}
99289960
bool js_cocos2dx_Image_initWithImageFile(JSContext *cx, uint32_t argc, jsval *vp)
99299961
{
99309962
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
@@ -10210,11 +10242,13 @@ void js_register_cocos2dx_Image(JSContext *cx, JS::HandleObject global) {
1021010242

1021110243
static JSFunctionSpec funcs[] = {
1021210244
JS_FN("hasPremultipliedAlpha", js_cocos2dx_Image_hasPremultipliedAlpha, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),
10245+
JS_FN("reversePremultipliedAlpha", js_cocos2dx_Image_reversePremultipliedAlpha, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),
1021310246
JS_FN("getDataLen", js_cocos2dx_Image_getDataLen, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),
1021410247
JS_FN("saveToFile", js_cocos2dx_Image_saveToFile, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),
1021510248
JS_FN("hasAlpha", js_cocos2dx_Image_hasAlpha, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),
1021610249
JS_FN("isCompressed", js_cocos2dx_Image_isCompressed, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),
1021710250
JS_FN("getHeight", js_cocos2dx_Image_getHeight, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),
10251+
JS_FN("premultiplyAlpha", js_cocos2dx_Image_premultiplyAlpha, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),
1021810252
JS_FN("initWithImageFile", js_cocos2dx_Image_initWithImageFile, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),
1021910253
JS_FN("getWidth", js_cocos2dx_Image_getWidth, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),
1022010254
JS_FN("getBitPerPixel", js_cocos2dx_Image_getBitPerPixel, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),

cocos/scripting/js-bindings/auto/jsb_cocos2dx_auto.hpp

+2
Original file line numberDiff line numberDiff line change
@@ -523,11 +523,13 @@ void js_cocos2dx_Image_finalize(JSContext *cx, JSObject *obj);
523523
void js_register_cocos2dx_Image(JSContext *cx, JS::HandleObject global);
524524
void register_all_cocos2dx(JSContext* cx, JS::HandleObject obj);
525525
bool js_cocos2dx_Image_hasPremultipliedAlpha(JSContext *cx, uint32_t argc, jsval *vp);
526+
bool js_cocos2dx_Image_reversePremultipliedAlpha(JSContext *cx, uint32_t argc, jsval *vp);
526527
bool js_cocos2dx_Image_getDataLen(JSContext *cx, uint32_t argc, jsval *vp);
527528
bool js_cocos2dx_Image_saveToFile(JSContext *cx, uint32_t argc, jsval *vp);
528529
bool js_cocos2dx_Image_hasAlpha(JSContext *cx, uint32_t argc, jsval *vp);
529530
bool js_cocos2dx_Image_isCompressed(JSContext *cx, uint32_t argc, jsval *vp);
530531
bool js_cocos2dx_Image_getHeight(JSContext *cx, uint32_t argc, jsval *vp);
532+
bool js_cocos2dx_Image_premultiplyAlpha(JSContext *cx, uint32_t argc, jsval *vp);
531533
bool js_cocos2dx_Image_initWithImageFile(JSContext *cx, uint32_t argc, jsval *vp);
532534
bool js_cocos2dx_Image_getWidth(JSContext *cx, uint32_t argc, jsval *vp);
533535
bool js_cocos2dx_Image_getBitPerPixel(JSContext *cx, uint32_t argc, jsval *vp);

cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.cpp

+208
Original file line numberDiff line numberDiff line change
@@ -19918,6 +19918,53 @@ int lua_cocos2dx_Image_hasPremultipliedAlpha(lua_State* tolua_S)
1991819918

1991919919
return 0;
1992019920
}
19921+
int lua_cocos2dx_Image_reversePremultipliedAlpha(lua_State* tolua_S)
19922+
{
19923+
int argc = 0;
19924+
cocos2d::Image* cobj = nullptr;
19925+
bool ok = true;
19926+
19927+
#if COCOS2D_DEBUG >= 1
19928+
tolua_Error tolua_err;
19929+
#endif
19930+
19931+
19932+
#if COCOS2D_DEBUG >= 1
19933+
if (!tolua_isusertype(tolua_S,1,"cc.Image",0,&tolua_err)) goto tolua_lerror;
19934+
#endif
19935+
19936+
cobj = (cocos2d::Image*)tolua_tousertype(tolua_S,1,0);
19937+
19938+
#if COCOS2D_DEBUG >= 1
19939+
if (!cobj)
19940+
{
19941+
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Image_reversePremultipliedAlpha'", nullptr);
19942+
return 0;
19943+
}
19944+
#endif
19945+
19946+
argc = lua_gettop(tolua_S)-1;
19947+
if (argc == 0)
19948+
{
19949+
if(!ok)
19950+
{
19951+
tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Image_reversePremultipliedAlpha'", nullptr);
19952+
return 0;
19953+
}
19954+
cobj->reversePremultipliedAlpha();
19955+
lua_settop(tolua_S, 1);
19956+
return 1;
19957+
}
19958+
luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Image:reversePremultipliedAlpha",argc, 0);
19959+
return 0;
19960+
19961+
#if COCOS2D_DEBUG >= 1
19962+
tolua_lerror:
19963+
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Image_reversePremultipliedAlpha'.",&tolua_err);
19964+
#endif
19965+
19966+
return 0;
19967+
}
1992119968
int lua_cocos2dx_Image_saveToFile(lua_State* tolua_S)
1992219969
{
1992319970
int argc = 0;
@@ -20126,6 +20173,53 @@ int lua_cocos2dx_Image_getHeight(lua_State* tolua_S)
2012620173

2012720174
return 0;
2012820175
}
20176+
int lua_cocos2dx_Image_premultiplyAlpha(lua_State* tolua_S)
20177+
{
20178+
int argc = 0;
20179+
cocos2d::Image* cobj = nullptr;
20180+
bool ok = true;
20181+
20182+
#if COCOS2D_DEBUG >= 1
20183+
tolua_Error tolua_err;
20184+
#endif
20185+
20186+
20187+
#if COCOS2D_DEBUG >= 1
20188+
if (!tolua_isusertype(tolua_S,1,"cc.Image",0,&tolua_err)) goto tolua_lerror;
20189+
#endif
20190+
20191+
cobj = (cocos2d::Image*)tolua_tousertype(tolua_S,1,0);
20192+
20193+
#if COCOS2D_DEBUG >= 1
20194+
if (!cobj)
20195+
{
20196+
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Image_premultiplyAlpha'", nullptr);
20197+
return 0;
20198+
}
20199+
#endif
20200+
20201+
argc = lua_gettop(tolua_S)-1;
20202+
if (argc == 0)
20203+
{
20204+
if(!ok)
20205+
{
20206+
tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Image_premultiplyAlpha'", nullptr);
20207+
return 0;
20208+
}
20209+
cobj->premultiplyAlpha();
20210+
lua_settop(tolua_S, 1);
20211+
return 1;
20212+
}
20213+
luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Image:premultiplyAlpha",argc, 0);
20214+
return 0;
20215+
20216+
#if COCOS2D_DEBUG >= 1
20217+
tolua_lerror:
20218+
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Image_premultiplyAlpha'.",&tolua_err);
20219+
#endif
20220+
20221+
return 0;
20222+
}
2012920223
int lua_cocos2dx_Image_initWithImageFile(lua_State* tolua_S)
2013020224
{
2013120225
int argc = 0;
@@ -20581,10 +20675,12 @@ int lua_register_cocos2dx_Image(lua_State* tolua_S)
2058120675
tolua_beginmodule(tolua_S,"Image");
2058220676
tolua_function(tolua_S,"new",lua_cocos2dx_Image_constructor);
2058320677
tolua_function(tolua_S,"hasPremultipliedAlpha",lua_cocos2dx_Image_hasPremultipliedAlpha);
20678+
tolua_function(tolua_S,"reversePremultipliedAlpha",lua_cocos2dx_Image_reversePremultipliedAlpha);
2058420679
tolua_function(tolua_S,"saveToFile",lua_cocos2dx_Image_saveToFile);
2058520680
tolua_function(tolua_S,"hasAlpha",lua_cocos2dx_Image_hasAlpha);
2058620681
tolua_function(tolua_S,"isCompressed",lua_cocos2dx_Image_isCompressed);
2058720682
tolua_function(tolua_S,"getHeight",lua_cocos2dx_Image_getHeight);
20683+
tolua_function(tolua_S,"premultiplyAlpha",lua_cocos2dx_Image_premultiplyAlpha);
2058820684
tolua_function(tolua_S,"initWithImageFile",lua_cocos2dx_Image_initWithImageFile);
2058920685
tolua_function(tolua_S,"getWidth",lua_cocos2dx_Image_getWidth);
2059020686
tolua_function(tolua_S,"getBitPerPixel",lua_cocos2dx_Image_getBitPerPixel);
@@ -78809,6 +78905,117 @@ int lua_cocos2dx_RenderTexture_isAutoDraw(lua_State* tolua_S)
7880978905

7881078906
return 0;
7881178907
}
78908+
int lua_cocos2dx_RenderTexture_saveToFileAsNonPMA(lua_State* tolua_S)
78909+
{
78910+
int argc = 0;
78911+
cocos2d::RenderTexture* cobj = nullptr;
78912+
bool ok = true;
78913+
#if COCOS2D_DEBUG >= 1
78914+
tolua_Error tolua_err;
78915+
#endif
78916+
78917+
#if COCOS2D_DEBUG >= 1
78918+
if (!tolua_isusertype(tolua_S,1,"cc.RenderTexture",0,&tolua_err)) goto tolua_lerror;
78919+
#endif
78920+
cobj = (cocos2d::RenderTexture*)tolua_tousertype(tolua_S,1,0);
78921+
#if COCOS2D_DEBUG >= 1
78922+
if (!cobj)
78923+
{
78924+
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_RenderTexture_saveToFileAsNonPMA'", nullptr);
78925+
return 0;
78926+
}
78927+
#endif
78928+
argc = lua_gettop(tolua_S)-1;
78929+
do{
78930+
if (argc == 4) {
78931+
std::string arg0;
78932+
ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.RenderTexture:saveToFileAsNonPMA");
78933+
78934+
if (!ok) { break; }
78935+
cocos2d::Image::Format arg1;
78936+
ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1, "cc.RenderTexture:saveToFileAsNonPMA");
78937+
78938+
if (!ok) { break; }
78939+
bool arg2;
78940+
ok &= luaval_to_boolean(tolua_S, 4,&arg2, "cc.RenderTexture:saveToFileAsNonPMA");
78941+
78942+
if (!ok) { break; }
78943+
std::function<void (cocos2d::RenderTexture *, const std::string&)> arg3;
78944+
do {
78945+
// Lambda binding for lua is not supported.
78946+
assert(false);
78947+
} while(0)
78948+
;
78949+
78950+
if (!ok) { break; }
78951+
bool ret = cobj->saveToFileAsNonPMA(arg0, arg1, arg2, arg3);
78952+
tolua_pushboolean(tolua_S,(bool)ret);
78953+
return 1;
78954+
}
78955+
}while(0);
78956+
ok = true;
78957+
do{
78958+
if (argc == 1) {
78959+
std::string arg0;
78960+
ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.RenderTexture:saveToFileAsNonPMA");
78961+
78962+
if (!ok) { break; }
78963+
bool ret = cobj->saveToFileAsNonPMA(arg0);
78964+
tolua_pushboolean(tolua_S,(bool)ret);
78965+
return 1;
78966+
}
78967+
}while(0);
78968+
ok = true;
78969+
do{
78970+
if (argc == 2) {
78971+
std::string arg0;
78972+
ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.RenderTexture:saveToFileAsNonPMA");
78973+
78974+
if (!ok) { break; }
78975+
bool arg1;
78976+
ok &= luaval_to_boolean(tolua_S, 3,&arg1, "cc.RenderTexture:saveToFileAsNonPMA");
78977+
78978+
if (!ok) { break; }
78979+
bool ret = cobj->saveToFileAsNonPMA(arg0, arg1);
78980+
tolua_pushboolean(tolua_S,(bool)ret);
78981+
return 1;
78982+
}
78983+
}while(0);
78984+
ok = true;
78985+
do{
78986+
if (argc == 3) {
78987+
std::string arg0;
78988+
ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.RenderTexture:saveToFileAsNonPMA");
78989+
78990+
if (!ok) { break; }
78991+
bool arg1;
78992+
ok &= luaval_to_boolean(tolua_S, 3,&arg1, "cc.RenderTexture:saveToFileAsNonPMA");
78993+
78994+
if (!ok) { break; }
78995+
std::function<void (cocos2d::RenderTexture *, const std::string&)> arg2;
78996+
do {
78997+
// Lambda binding for lua is not supported.
78998+
assert(false);
78999+
} while(0)
79000+
;
79001+
79002+
if (!ok) { break; }
79003+
bool ret = cobj->saveToFileAsNonPMA(arg0, arg1, arg2);
79004+
tolua_pushboolean(tolua_S,(bool)ret);
79005+
return 1;
79006+
}
79007+
}while(0);
79008+
ok = true;
79009+
luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.RenderTexture:saveToFileAsNonPMA",argc, 1);
79010+
return 0;
79011+
79012+
#if COCOS2D_DEBUG >= 1
79013+
tolua_lerror:
79014+
tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_RenderTexture_saveToFileAsNonPMA'.",&tolua_err);
79015+
#endif
79016+
79017+
return 0;
79018+
}
7881279019
int lua_cocos2dx_RenderTexture_setKeepMatrix(lua_State* tolua_S)
7881379020
{
7881479021
int argc = 0;
@@ -79891,6 +80098,7 @@ int lua_register_cocos2dx_RenderTexture(lua_State* tolua_S)
7989180098
tolua_function(tolua_S,"setSprite",lua_cocos2dx_RenderTexture_setSprite);
7989280099
tolua_function(tolua_S,"getSprite",lua_cocos2dx_RenderTexture_getSprite);
7989380100
tolua_function(tolua_S,"isAutoDraw",lua_cocos2dx_RenderTexture_isAutoDraw);
80101+
tolua_function(tolua_S,"saveToFileAsNonPMA",lua_cocos2dx_RenderTexture_saveToFileAsNonPMA);
7989480102
tolua_function(tolua_S,"setKeepMatrix",lua_cocos2dx_RenderTexture_setKeepMatrix);
7989580103
tolua_function(tolua_S,"setClearFlags",lua_cocos2dx_RenderTexture_setClearFlags);
7989680104
tolua_function(tolua_S,"begin",lua_cocos2dx_RenderTexture_begin);

cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.hpp

+3
Original file line numberDiff line numberDiff line change
@@ -2294,6 +2294,9 @@ int register_all_cocos2dx(lua_State* tolua_S);
22942294

22952295

22962296

2297+
2298+
2299+
22972300

22982301

22992302

0 commit comments

Comments
 (0)