diff --git a/cocos/scripting/js-bindings/auto/api/jsb_cocos2dx_auto_api.js b/cocos/scripting/js-bindings/auto/api/jsb_cocos2dx_auto_api.js index ce2c4f7fe3..9897478966 100644 --- a/cocos/scripting/js-bindings/auto/api/jsb_cocos2dx_auto_api.js +++ b/cocos/scripting/js-bindings/auto/api/jsb_cocos2dx_auto_api.js @@ -16255,6 +16255,200 @@ ProtectedNode : function ( }; +/** + * @class Image + */ +cc.Image = { + +/** + * @method hasPremultipliedAlpha + * @return {bool} + */ +hasPremultipliedAlpha : function ( +) +{ + return false; +}, + +/** + * @method getDataLen + * @return {long} + */ +getDataLen : function ( +) +{ + return 0; +}, + +/** + * @method saveToFile + * @param {String} arg0 + * @param {bool} arg1 + * @return {bool} + */ +saveToFile : function ( +str, +bool +) +{ + return false; +}, + +/** + * @method hasAlpha + * @return {bool} + */ +hasAlpha : function ( +) +{ + return false; +}, + +/** + * @method isCompressed + * @return {bool} + */ +isCompressed : function ( +) +{ + return false; +}, + +/** + * @method getHeight + * @return {int} + */ +getHeight : function ( +) +{ + return 0; +}, + +/** + * @method initWithImageFile + * @param {String} arg0 + * @return {bool} + */ +initWithImageFile : function ( +str +) +{ + return false; +}, + +/** + * @method getWidth + * @return {int} + */ +getWidth : function ( +) +{ + return 0; +}, + +/** + * @method getBitPerPixel + * @return {int} + */ +getBitPerPixel : function ( +) +{ + return 0; +}, + +/** + * @method getFileType + * @return {cc.Image::Format} + */ +getFileType : function ( +) +{ + return 0; +}, + +/** + * @method getNumberOfMipmaps + * @return {int} + */ +getNumberOfMipmaps : function ( +) +{ + return 0; +}, + +/** + * @method getRenderFormat + * @return {cc.Texture2D::PixelFormat} + */ +getRenderFormat : function ( +) +{ + return 0; +}, + +/** + * @method getData + * @return {unsigned char} + */ +getData : function ( +) +{ + return 0; +}, + +/** + * @method getMipmaps + * @return {cc._MipmapInfo} + */ +getMipmaps : function ( +) +{ + return cc._MipmapInfo; +}, + +/** + * @method initWithRawData + * @param {unsigned char} arg0 + * @param {long} arg1 + * @param {int} arg2 + * @param {int} arg3 + * @param {int} arg4 + * @param {bool} arg5 + * @return {bool} + */ +initWithRawData : function ( +char, +long, +int, +int, +int, +bool +) +{ + return false; +}, + +/** + * @method setPVRImagesHavePremultipliedAlpha + * @param {bool} arg0 + */ +setPVRImagesHavePremultipliedAlpha : function ( +bool +) +{ +}, + +/** + * @method Image + * @constructor + */ +Image : function ( +) +{ +}, + +}; + /** * @class Sprite */ @@ -16526,6 +16720,16 @@ getTextureRect : function ( return cc.Rect; }, +/** + * @method debugDraw + * @param {bool} arg0 + */ +debugDraw : function ( +bool +) +{ +}, + /** * @method initWithFile * @param {String|String} str @@ -16602,60 +16806,6 @@ rect { }, -/** - * @method create -* @param {String|String} str -* @param {rect_object} rect -* @return {cc.Sprite|cc.Sprite|cc.Sprite} -*/ -create : function( -str, -rect -) -{ - return cc.Sprite; -}, - -/** - * @method createWithTexture -* @param {cc.Texture2D|cc.Texture2D} texture2d -* @param {rect_object} rect -* @param {bool} bool -* @return {cc.Sprite|cc.Sprite} -*/ -createWithTexture : function( -texture2d, -rect, -bool -) -{ - return cc.Sprite; -}, - -/** - * @method createWithSpriteFrameName - * @param {String} arg0 - * @return {cc.Sprite} - */ -createWithSpriteFrameName : function ( -str -) -{ - return cc.Sprite; -}, - -/** - * @method createWithSpriteFrame - * @param {cc.SpriteFrame} arg0 - * @return {cc.Sprite} - */ -createWithSpriteFrame : function ( -spriteframe -) -{ - return cc.Sprite; -}, - /** * @method Sprite * @constructor @@ -16667,200 +16817,6 @@ Sprite : function ( }; -/** - * @class Image - */ -cc.Image = { - -/** - * @method hasPremultipliedAlpha - * @return {bool} - */ -hasPremultipliedAlpha : function ( -) -{ - return false; -}, - -/** - * @method getDataLen - * @return {long} - */ -getDataLen : function ( -) -{ - return 0; -}, - -/** - * @method saveToFile - * @param {String} arg0 - * @param {bool} arg1 - * @return {bool} - */ -saveToFile : function ( -str, -bool -) -{ - return false; -}, - -/** - * @method hasAlpha - * @return {bool} - */ -hasAlpha : function ( -) -{ - return false; -}, - -/** - * @method isCompressed - * @return {bool} - */ -isCompressed : function ( -) -{ - return false; -}, - -/** - * @method getHeight - * @return {int} - */ -getHeight : function ( -) -{ - return 0; -}, - -/** - * @method initWithImageFile - * @param {String} arg0 - * @return {bool} - */ -initWithImageFile : function ( -str -) -{ - return false; -}, - -/** - * @method getWidth - * @return {int} - */ -getWidth : function ( -) -{ - return 0; -}, - -/** - * @method getBitPerPixel - * @return {int} - */ -getBitPerPixel : function ( -) -{ - return 0; -}, - -/** - * @method getFileType - * @return {cc.Image::Format} - */ -getFileType : function ( -) -{ - return 0; -}, - -/** - * @method getNumberOfMipmaps - * @return {int} - */ -getNumberOfMipmaps : function ( -) -{ - return 0; -}, - -/** - * @method getRenderFormat - * @return {cc.Texture2D::PixelFormat} - */ -getRenderFormat : function ( -) -{ - return 0; -}, - -/** - * @method getData - * @return {unsigned char} - */ -getData : function ( -) -{ - return 0; -}, - -/** - * @method getMipmaps - * @return {cc._MipmapInfo} - */ -getMipmaps : function ( -) -{ - return cc._MipmapInfo; -}, - -/** - * @method initWithRawData - * @param {unsigned char} arg0 - * @param {long} arg1 - * @param {int} arg2 - * @param {int} arg3 - * @param {int} arg4 - * @param {bool} arg5 - * @return {bool} - */ -initWithRawData : function ( -char, -long, -int, -int, -int, -bool -) -{ - return false; -}, - -/** - * @method setPVRImagesHavePremultipliedAlpha - * @param {bool} arg0 - */ -setPVRImagesHavePremultipliedAlpha : function ( -bool -) -{ -}, - -/** - * @method Image - * @constructor - */ -Image : function ( -) -{ -}, - -}; - /** * @class RenderTexture */ @@ -22651,72 +22607,3 @@ getInstance : function ( }, }; - -/** - * @class SpritePolygonCache - */ -cc.SpritePolygonCache = { - -/** - * @method isSpritePolygonCachExist - * @param {String} arg0 - * @param {rect_object} arg1 - * @return {bool} - */ -isSpritePolygonCachExist : function ( -str, -rect -) -{ - return false; -}, - -/** - * @method removeAllSpritePolygonCache - */ -removeAllSpritePolygonCache : function ( -) -{ -}, - -/** - * @method removeSpritePolygonCache - * @param {String} arg0 - * @param {rect_object} arg1 - */ -removeSpritePolygonCache : function ( -str, -rect -) -{ -}, - -/** - * @method destroyInstance - */ -destroyInstance : function ( -) -{ -}, - -/** - * @method printInfo - * @param {cc._SpritePolygonInfo} arg0 - */ -printInfo : function ( -_spritepolygoninfo -) -{ -}, - -/** - * @method getInstance - * @return {cc.SpritePolygonCache} - */ -getInstance : function ( -) -{ - return cc.SpritePolygonCache; -}, - -}; diff --git a/cocos/scripting/js-bindings/auto/api/jsb_cocos2dx_experimental_api.js b/cocos/scripting/js-bindings/auto/api/jsb_cocos2dx_experimental_api.js deleted file mode 100644 index 5ea1dd93d7..0000000000 --- a/cocos/scripting/js-bindings/auto/api/jsb_cocos2dx_experimental_api.js +++ /dev/null @@ -1,99 +0,0 @@ -/** - * @module cocos2dx_experimental - */ -var ccexp = ccexp || {}; - -/** - * @class SpritePolygon - */ -ccexp.SpritePolygon = { - -/** - * @method setTexture -* @param {cc.Texture2D|String} texture2d -*/ -setTexture : function( -str -) -{ -}, - -/** - * @method initWithTexture - * @param {cc.Texture2D} arg0 - * @return {bool} - */ -initWithTexture : function ( -texture2d -) -{ - return false; -}, - -/** - * @method showDebug - * @param {bool} arg0 - */ -showDebug : function ( -bool -) -{ -}, - -/** - * @method getTexture - * @return {cc.Texture2D} - */ -getTexture : function ( -) -{ - return cc.Texture2D; -}, - -/** - * @method getArea - * @return {float} - */ -getArea : function ( -) -{ - return 0; -}, - -/** - * @method initWithMarching - * @param {String} arg0 - * @param {rect_object} arg1 - * @param {float} arg2 - * @return {bool} - */ -initWithMarching : function ( -str, -rect, -float -) -{ - return false; -}, - -/** - * @method getVertCount - * @return {long} - */ -getVertCount : function ( -) -{ - return 0; -}, - -/** - * @method getTrianglesCount - * @return {long} - */ -getTrianglesCount : function ( -) -{ - return 0; -}, - -}; diff --git a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_auto.cpp b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_auto.cpp index ac91701dc4..13ac0994ad 100644 --- a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_auto.cpp +++ b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_auto.cpp @@ -4,7 +4,6 @@ #include "SimpleAudioEngine.h" #include "CCProtectedNode.h" #include "CCAsyncTaskPool.h" -#include "SpritePolygonCache.h" template static bool dummy_constructor(JSContext *cx, uint32_t argc, jsval *vp) { @@ -49567,6 +49566,454 @@ void js_register_cocos2dx_ProtectedNode(JSContext *cx, JS::HandleObject global) } } +JSClass *jsb_cocos2d_Image_class; +JSObject *jsb_cocos2d_Image_prototype; + +bool js_cocos2dx_Image_hasPremultipliedAlpha(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_hasPremultipliedAlpha : Invalid Native Object"); + if (argc == 0) { + bool ret = cobj->hasPremultipliedAlpha(); + jsval jsret = JSVAL_NULL; + jsret = BOOLEAN_TO_JSVAL(ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_Image_hasPremultipliedAlpha : 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); + 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_getDataLen : Invalid Native Object"); + if (argc == 0) { + ssize_t ret = cobj->getDataLen(); + jsval jsret = JSVAL_NULL; + jsret = ssize_to_jsval(cx, ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_Image_getDataLen : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_Image_saveToFile(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + 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_saveToFile : Invalid Native Object"); + if (argc == 1) { + std::string arg0; + ok &= jsval_to_std_string(cx, args.get(0), &arg0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Image_saveToFile : Error processing arguments"); + bool ret = cobj->saveToFile(arg0); + jsval jsret = JSVAL_NULL; + jsret = BOOLEAN_TO_JSVAL(ret); + args.rval().set(jsret); + return true; + } + if (argc == 2) { + std::string arg0; + bool arg1; + ok &= jsval_to_std_string(cx, args.get(0), &arg0); + arg1 = JS::ToBoolean(args.get(1)); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Image_saveToFile : Error processing arguments"); + bool ret = cobj->saveToFile(arg0, arg1); + jsval jsret = JSVAL_NULL; + jsret = BOOLEAN_TO_JSVAL(ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_Image_saveToFile : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} +bool js_cocos2dx_Image_hasAlpha(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_hasAlpha : Invalid Native Object"); + if (argc == 0) { + bool ret = cobj->hasAlpha(); + jsval jsret = JSVAL_NULL; + jsret = BOOLEAN_TO_JSVAL(ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_Image_hasAlpha : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_Image_isCompressed(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_isCompressed : Invalid Native Object"); + if (argc == 0) { + bool ret = cobj->isCompressed(); + jsval jsret = JSVAL_NULL; + jsret = BOOLEAN_TO_JSVAL(ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_Image_isCompressed : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_Image_getHeight(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_getHeight : Invalid Native Object"); + if (argc == 0) { + int ret = cobj->getHeight(); + jsval jsret = JSVAL_NULL; + jsret = int32_to_jsval(cx, ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_Image_getHeight : 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); + bool ok = true; + 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_initWithImageFile : Invalid Native Object"); + if (argc == 1) { + std::string arg0; + ok &= jsval_to_std_string(cx, args.get(0), &arg0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Image_initWithImageFile : Error processing arguments"); + bool ret = cobj->initWithImageFile(arg0); + jsval jsret = JSVAL_NULL; + jsret = BOOLEAN_TO_JSVAL(ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_Image_initWithImageFile : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} +bool js_cocos2dx_Image_getWidth(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_getWidth : Invalid Native Object"); + if (argc == 0) { + int ret = cobj->getWidth(); + jsval jsret = JSVAL_NULL; + jsret = int32_to_jsval(cx, ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_Image_getWidth : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_Image_getBitPerPixel(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_getBitPerPixel : Invalid Native Object"); + if (argc == 0) { + int ret = cobj->getBitPerPixel(); + jsval jsret = JSVAL_NULL; + jsret = int32_to_jsval(cx, ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_Image_getBitPerPixel : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_Image_getFileType(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_getFileType : Invalid Native Object"); + if (argc == 0) { + int ret = (int)cobj->getFileType(); + jsval jsret = JSVAL_NULL; + jsret = int32_to_jsval(cx, ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_Image_getFileType : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_Image_getNumberOfMipmaps(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_getNumberOfMipmaps : Invalid Native Object"); + if (argc == 0) { + int ret = cobj->getNumberOfMipmaps(); + jsval jsret = JSVAL_NULL; + jsret = int32_to_jsval(cx, ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_Image_getNumberOfMipmaps : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_Image_getRenderFormat(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_getRenderFormat : Invalid Native Object"); + if (argc == 0) { + int ret = (int)cobj->getRenderFormat(); + jsval jsret = JSVAL_NULL; + jsret = int32_to_jsval(cx, ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_Image_getRenderFormat : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_Image_getData(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_getData : Invalid Native Object"); + if (argc == 0) { + unsigned char* ret = cobj->getData(); + jsval jsret = JSVAL_NULL; + #pragma warning NO CONVERSION FROM NATIVE FOR unsigned char*; + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_Image_getData : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_Image_getMipmaps(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_getMipmaps : Invalid Native Object"); + if (argc == 0) { + cocos2d::_MipmapInfo* ret = cobj->getMipmaps(); + jsval jsret = JSVAL_NULL; + #pragma warning NO CONVERSION FROM NATIVE FOR _MipmapInfo*; + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_Image_getMipmaps : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_Image_initWithRawData(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + 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_initWithRawData : Invalid Native Object"); + if (argc == 5) { + const unsigned char* arg0; + ssize_t arg1; + int arg2; + int arg3; + int arg4; + #pragma warning NO CONVERSION TO NATIVE FOR unsigned char* + ok = false; + ok &= jsval_to_ssize(cx, args.get(1), &arg1); + ok &= jsval_to_int32(cx, args.get(2), (int32_t *)&arg2); + ok &= jsval_to_int32(cx, args.get(3), (int32_t *)&arg3); + ok &= jsval_to_int32(cx, args.get(4), (int32_t *)&arg4); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Image_initWithRawData : Error processing arguments"); + bool ret = cobj->initWithRawData(arg0, arg1, arg2, arg3, arg4); + jsval jsret = JSVAL_NULL; + jsret = BOOLEAN_TO_JSVAL(ret); + args.rval().set(jsret); + return true; + } + if (argc == 6) { + const unsigned char* arg0; + ssize_t arg1; + int arg2; + int arg3; + int arg4; + bool arg5; + #pragma warning NO CONVERSION TO NATIVE FOR unsigned char* + ok = false; + ok &= jsval_to_ssize(cx, args.get(1), &arg1); + ok &= jsval_to_int32(cx, args.get(2), (int32_t *)&arg2); + ok &= jsval_to_int32(cx, args.get(3), (int32_t *)&arg3); + ok &= jsval_to_int32(cx, args.get(4), (int32_t *)&arg4); + arg5 = JS::ToBoolean(args.get(5)); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Image_initWithRawData : Error processing arguments"); + bool ret = cobj->initWithRawData(arg0, arg1, arg2, arg3, arg4, arg5); + jsval jsret = JSVAL_NULL; + jsret = BOOLEAN_TO_JSVAL(ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_Image_initWithRawData : wrong number of arguments: %d, was expecting %d", argc, 5); + return false; +} +bool js_cocos2dx_Image_setPVRImagesHavePremultipliedAlpha(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + if (argc == 1) { + bool arg0; + arg0 = JS::ToBoolean(args.get(0)); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Image_setPVRImagesHavePremultipliedAlpha : Error processing arguments"); + cocos2d::Image::setPVRImagesHavePremultipliedAlpha(arg0); + args.rval().setUndefined(); + return true; + } + JS_ReportError(cx, "js_cocos2dx_Image_setPVRImagesHavePremultipliedAlpha : wrong number of arguments"); + return false; +} + +bool js_cocos2dx_Image_constructor(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + cocos2d::Image* cobj = new (std::nothrow) cocos2d::Image(); + cocos2d::Ref *_ccobj = dynamic_cast(cobj); + if (_ccobj) { + _ccobj->autorelease(); + } + TypeTest t; + js_type_class_t *typeClass = nullptr; + std::string typeName = t.s_name(); + auto typeMapIter = _js_global_type_map.find(typeName); + CCASSERT(typeMapIter != _js_global_type_map.end(), "Can't find the class type!"); + typeClass = typeMapIter->second; + CCASSERT(typeClass, "The value is null."); + // JSObject *obj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto); + JS::RootedObject proto(cx, typeClass->proto.get()); + JS::RootedObject parent(cx, typeClass->parentProto.get()); + JS::RootedObject obj(cx, JS_NewObject(cx, typeClass->jsclass, proto, parent)); + args.rval().set(OBJECT_TO_JSVAL(obj)); + // link the native object with the javascript object + js_proxy_t* p = jsb_new_proxy(cobj, obj); + AddNamedObjectRoot(cx, &p->obj, "cocos2d::Image"); + if (JS_HasProperty(cx, obj, "_ctor", &ok) && ok) + ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(obj), "_ctor", args); + return true; +} + + + +void js_cocos2d_Image_finalize(JSFreeOp *fop, JSObject *obj) { + CCLOGINFO("jsbindings: finalizing JS object %p (Image)", obj); +} + +void js_register_cocos2dx_Image(JSContext *cx, JS::HandleObject global) { + jsb_cocos2d_Image_class = (JSClass *)calloc(1, sizeof(JSClass)); + jsb_cocos2d_Image_class->name = "Image"; + jsb_cocos2d_Image_class->addProperty = JS_PropertyStub; + jsb_cocos2d_Image_class->delProperty = JS_DeletePropertyStub; + jsb_cocos2d_Image_class->getProperty = JS_PropertyStub; + jsb_cocos2d_Image_class->setProperty = JS_StrictPropertyStub; + jsb_cocos2d_Image_class->enumerate = JS_EnumerateStub; + jsb_cocos2d_Image_class->resolve = JS_ResolveStub; + jsb_cocos2d_Image_class->convert = JS_ConvertStub; + jsb_cocos2d_Image_class->finalize = js_cocos2d_Image_finalize; + jsb_cocos2d_Image_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2); + + static JSPropertySpec properties[] = { + JS_PSG("__nativeObj", js_is_native_obj, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_PS_END + }; + + static JSFunctionSpec funcs[] = { + JS_FN("hasPremultipliedAlpha", js_cocos2dx_Image_hasPremultipliedAlpha, 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("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), + JS_FN("getFileType", js_cocos2dx_Image_getFileType, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getNumberOfMipmaps", js_cocos2dx_Image_getNumberOfMipmaps, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getRenderFormat", js_cocos2dx_Image_getRenderFormat, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getData", js_cocos2dx_Image_getData, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getMipmaps", js_cocos2dx_Image_getMipmaps, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("initWithRawData", js_cocos2dx_Image_initWithRawData, 5, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FS_END + }; + + static JSFunctionSpec st_funcs[] = { + JS_FN("setPVRImagesHavePremultipliedAlpha", js_cocos2dx_Image_setPVRImagesHavePremultipliedAlpha, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FS_END + }; + + jsb_cocos2d_Image_prototype = JS_InitClass( + cx, global, + JS::NullPtr(), // parent proto + jsb_cocos2d_Image_class, + js_cocos2dx_Image_constructor, 0, // constructor + properties, + funcs, + NULL, // no static properties + st_funcs); + // make the class enumerable in the registered namespace +// bool found; +//FIXME: Removed in Firefox v27 +// JS_SetPropertyAttributes(cx, global, "Image", JSPROP_ENUMERATE | JSPROP_READONLY, &found); + + // add the proto and JSClass to the type->js info hash table + TypeTest t; + js_type_class_t *p; + std::string typeName = t.s_name(); + if (_js_global_type_map.find(typeName) == _js_global_type_map.end()) + { + p = (js_type_class_t *)malloc(sizeof(js_type_class_t)); + p->jsclass = jsb_cocos2d_Image_class; + p->proto = jsb_cocos2d_Image_prototype; + p->parentProto = NULL; + _js_global_type_map.insert(std::make_pair(typeName, p)); + } +} + JSClass *jsb_cocos2d_Sprite_class; JSObject *jsb_cocos2d_Sprite_prototype; @@ -50237,6 +50684,26 @@ bool js_cocos2dx_Sprite_getTextureRect(JSContext *cx, uint32_t argc, jsval *vp) JS_ReportError(cx, "js_cocos2dx_Sprite_getTextureRect : wrong number of arguments: %d, was expecting %d", argc, 0); return false; } +bool js_cocos2dx_Sprite_debugDraw(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cocos2d::Sprite* cobj = (cocos2d::Sprite *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Sprite_debugDraw : Invalid Native Object"); + if (argc == 1) { + bool arg0; + arg0 = JS::ToBoolean(args.get(0)); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Sprite_debugDraw : Error processing arguments"); + cobj->debugDraw(arg0); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_Sprite_debugDraw : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} bool js_cocos2dx_Sprite_initWithFile(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); @@ -50411,230 +50878,6 @@ bool js_cocos2dx_Sprite_setVertexRect(JSContext *cx, uint32_t argc, jsval *vp) JS_ReportError(cx, "js_cocos2dx_Sprite_setVertexRect : wrong number of arguments: %d, was expecting %d", argc, 1); return false; } -bool js_cocos2dx_Sprite_create(JSContext *cx, uint32_t argc, jsval *vp) -{ - JS::CallArgs args = JS::CallArgsFromVp(argc, vp); - bool ok = true; - - do { - if (argc == 1) { - std::string arg0; - ok &= jsval_to_std_string(cx, args.get(0), &arg0); - if (!ok) { ok = true; break; } - cocos2d::Sprite* ret = cocos2d::Sprite::create(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Sprite*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); - return true; - } - } while (0); - - do { - if (argc == 0) { - cocos2d::Sprite* ret = cocos2d::Sprite::create(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Sprite*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); - return true; - } - } while (0); - - do { - if (argc == 2) { - std::string arg0; - ok &= jsval_to_std_string(cx, args.get(0), &arg0); - if (!ok) { ok = true; break; } - cocos2d::Rect arg1; - ok &= jsval_to_ccrect(cx, args.get(1), &arg1); - if (!ok) { ok = true; break; } - cocos2d::Sprite* ret = cocos2d::Sprite::create(arg0, arg1); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Sprite*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); - return true; - } - } while (0); - JS_ReportError(cx, "js_cocos2dx_Sprite_create : wrong number of arguments"); - return false; -} -bool js_cocos2dx_Sprite_createWithTexture(JSContext *cx, uint32_t argc, jsval *vp) -{ - JS::CallArgs args = JS::CallArgsFromVp(argc, vp); - bool ok = true; - - do { - if (argc == 2) { - cocos2d::Texture2D* arg0; - do { - if (args.get(0).isNull()) { arg0 = nullptr; break; } - if (!args.get(0).isObject()) { ok = false; break; } - js_proxy_t *jsProxy; - JSObject *tmpObj = args.get(0).toObjectOrNull(); - jsProxy = jsb_get_js_proxy(tmpObj); - arg0 = (cocos2d::Texture2D*)(jsProxy ? jsProxy->ptr : NULL); - JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); - } while (0); - if (!ok) { ok = true; break; } - cocos2d::Rect arg1; - ok &= jsval_to_ccrect(cx, args.get(1), &arg1); - if (!ok) { ok = true; break; } - cocos2d::Sprite* ret = cocos2d::Sprite::createWithTexture(arg0, arg1); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Sprite*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); - return true; - } - } while (0); - do { - if (argc == 3) { - cocos2d::Texture2D* arg0; - do { - if (args.get(0).isNull()) { arg0 = nullptr; break; } - if (!args.get(0).isObject()) { ok = false; break; } - js_proxy_t *jsProxy; - JSObject *tmpObj = args.get(0).toObjectOrNull(); - jsProxy = jsb_get_js_proxy(tmpObj); - arg0 = (cocos2d::Texture2D*)(jsProxy ? jsProxy->ptr : NULL); - JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); - } while (0); - if (!ok) { ok = true; break; } - cocos2d::Rect arg1; - ok &= jsval_to_ccrect(cx, args.get(1), &arg1); - if (!ok) { ok = true; break; } - bool arg2; - arg2 = JS::ToBoolean(args.get(2)); - if (!ok) { ok = true; break; } - cocos2d::Sprite* ret = cocos2d::Sprite::createWithTexture(arg0, arg1, arg2); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Sprite*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); - return true; - } - } while (0); - - do { - if (argc == 1) { - cocos2d::Texture2D* arg0; - do { - if (args.get(0).isNull()) { arg0 = nullptr; break; } - if (!args.get(0).isObject()) { ok = false; break; } - js_proxy_t *jsProxy; - JSObject *tmpObj = args.get(0).toObjectOrNull(); - jsProxy = jsb_get_js_proxy(tmpObj); - arg0 = (cocos2d::Texture2D*)(jsProxy ? jsProxy->ptr : NULL); - JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); - } while (0); - if (!ok) { ok = true; break; } - cocos2d::Sprite* ret = cocos2d::Sprite::createWithTexture(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Sprite*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); - return true; - } - } while (0); - JS_ReportError(cx, "js_cocos2dx_Sprite_createWithTexture : wrong number of arguments"); - return false; -} -bool js_cocos2dx_Sprite_createWithSpriteFrameName(JSContext *cx, uint32_t argc, jsval *vp) -{ - JS::CallArgs args = JS::CallArgsFromVp(argc, vp); - bool ok = true; - if (argc == 1) { - std::string arg0; - ok &= jsval_to_std_string(cx, args.get(0), &arg0); - JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Sprite_createWithSpriteFrameName : Error processing arguments"); - cocos2d::Sprite* ret = cocos2d::Sprite::createWithSpriteFrameName(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Sprite*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); - return true; - } - JS_ReportError(cx, "js_cocos2dx_Sprite_createWithSpriteFrameName : wrong number of arguments"); - return false; -} - -bool js_cocos2dx_Sprite_createWithSpriteFrame(JSContext *cx, uint32_t argc, jsval *vp) -{ - JS::CallArgs args = JS::CallArgsFromVp(argc, vp); - bool ok = true; - if (argc == 1) { - cocos2d::SpriteFrame* arg0; - do { - if (args.get(0).isNull()) { arg0 = nullptr; break; } - if (!args.get(0).isObject()) { ok = false; break; } - js_proxy_t *jsProxy; - JSObject *tmpObj = args.get(0).toObjectOrNull(); - jsProxy = jsb_get_js_proxy(tmpObj); - arg0 = (cocos2d::SpriteFrame*)(jsProxy ? jsProxy->ptr : NULL); - JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); - } while (0); - JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Sprite_createWithSpriteFrame : Error processing arguments"); - cocos2d::Sprite* ret = cocos2d::Sprite::createWithSpriteFrame(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Sprite*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); - return true; - } - JS_ReportError(cx, "js_cocos2dx_Sprite_createWithSpriteFrame : wrong number of arguments"); - return false; -} - bool js_cocos2dx_Sprite_constructor(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); @@ -50731,6 +50974,7 @@ void js_register_cocos2dx_Sprite(JSContext *cx, JS::HandleObject global) { JS_FN("setDirty", js_cocos2dx_Sprite_setDirty, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("isTextureRectRotated", js_cocos2dx_Sprite_isTextureRectRotated, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("getTextureRect", js_cocos2dx_Sprite_getTextureRect, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("debugDraw", js_cocos2dx_Sprite_debugDraw, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("initWithFile", js_cocos2dx_Sprite_initWithFile, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("setBlendFunc", js_cocos2dx_Sprite_setBlendFunc, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("getTextureAtlas", js_cocos2dx_Sprite_getTextureAtlas, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), @@ -50742,13 +50986,7 @@ void js_register_cocos2dx_Sprite(JSContext *cx, JS::HandleObject global) { JS_FS_END }; - static JSFunctionSpec st_funcs[] = { - JS_FN("create", js_cocos2dx_Sprite_create, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), - JS_FN("createWithTexture", js_cocos2dx_Sprite_createWithTexture, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), - JS_FN("createWithSpriteFrameName", js_cocos2dx_Sprite_createWithSpriteFrameName, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), - JS_FN("createWithSpriteFrame", js_cocos2dx_Sprite_createWithSpriteFrame, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), - JS_FS_END - }; + JSFunctionSpec *st_funcs = NULL; jsb_cocos2d_Sprite_prototype = JS_InitClass( cx, global, @@ -50778,454 +51016,6 @@ void js_register_cocos2dx_Sprite(JSContext *cx, JS::HandleObject global) { } } -JSClass *jsb_cocos2d_Image_class; -JSObject *jsb_cocos2d_Image_prototype; - -bool js_cocos2dx_Image_hasPremultipliedAlpha(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_hasPremultipliedAlpha : Invalid Native Object"); - if (argc == 0) { - bool ret = cobj->hasPremultipliedAlpha(); - jsval jsret = JSVAL_NULL; - jsret = BOOLEAN_TO_JSVAL(ret); - args.rval().set(jsret); - return true; - } - - JS_ReportError(cx, "js_cocos2dx_Image_hasPremultipliedAlpha : 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); - 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_getDataLen : Invalid Native Object"); - if (argc == 0) { - ssize_t ret = cobj->getDataLen(); - jsval jsret = JSVAL_NULL; - jsret = ssize_to_jsval(cx, ret); - args.rval().set(jsret); - return true; - } - - JS_ReportError(cx, "js_cocos2dx_Image_getDataLen : wrong number of arguments: %d, was expecting %d", argc, 0); - return false; -} -bool js_cocos2dx_Image_saveToFile(JSContext *cx, uint32_t argc, jsval *vp) -{ - JS::CallArgs args = JS::CallArgsFromVp(argc, vp); - bool ok = true; - 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_saveToFile : Invalid Native Object"); - if (argc == 1) { - std::string arg0; - ok &= jsval_to_std_string(cx, args.get(0), &arg0); - JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Image_saveToFile : Error processing arguments"); - bool ret = cobj->saveToFile(arg0); - jsval jsret = JSVAL_NULL; - jsret = BOOLEAN_TO_JSVAL(ret); - args.rval().set(jsret); - return true; - } - if (argc == 2) { - std::string arg0; - bool arg1; - ok &= jsval_to_std_string(cx, args.get(0), &arg0); - arg1 = JS::ToBoolean(args.get(1)); - JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Image_saveToFile : Error processing arguments"); - bool ret = cobj->saveToFile(arg0, arg1); - jsval jsret = JSVAL_NULL; - jsret = BOOLEAN_TO_JSVAL(ret); - args.rval().set(jsret); - return true; - } - - JS_ReportError(cx, "js_cocos2dx_Image_saveToFile : wrong number of arguments: %d, was expecting %d", argc, 1); - return false; -} -bool js_cocos2dx_Image_hasAlpha(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_hasAlpha : Invalid Native Object"); - if (argc == 0) { - bool ret = cobj->hasAlpha(); - jsval jsret = JSVAL_NULL; - jsret = BOOLEAN_TO_JSVAL(ret); - args.rval().set(jsret); - return true; - } - - JS_ReportError(cx, "js_cocos2dx_Image_hasAlpha : wrong number of arguments: %d, was expecting %d", argc, 0); - return false; -} -bool js_cocos2dx_Image_isCompressed(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_isCompressed : Invalid Native Object"); - if (argc == 0) { - bool ret = cobj->isCompressed(); - jsval jsret = JSVAL_NULL; - jsret = BOOLEAN_TO_JSVAL(ret); - args.rval().set(jsret); - return true; - } - - JS_ReportError(cx, "js_cocos2dx_Image_isCompressed : wrong number of arguments: %d, was expecting %d", argc, 0); - return false; -} -bool js_cocos2dx_Image_getHeight(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_getHeight : Invalid Native Object"); - if (argc == 0) { - int ret = cobj->getHeight(); - jsval jsret = JSVAL_NULL; - jsret = int32_to_jsval(cx, ret); - args.rval().set(jsret); - return true; - } - - JS_ReportError(cx, "js_cocos2dx_Image_getHeight : 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); - bool ok = true; - 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_initWithImageFile : Invalid Native Object"); - if (argc == 1) { - std::string arg0; - ok &= jsval_to_std_string(cx, args.get(0), &arg0); - JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Image_initWithImageFile : Error processing arguments"); - bool ret = cobj->initWithImageFile(arg0); - jsval jsret = JSVAL_NULL; - jsret = BOOLEAN_TO_JSVAL(ret); - args.rval().set(jsret); - return true; - } - - JS_ReportError(cx, "js_cocos2dx_Image_initWithImageFile : wrong number of arguments: %d, was expecting %d", argc, 1); - return false; -} -bool js_cocos2dx_Image_getWidth(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_getWidth : Invalid Native Object"); - if (argc == 0) { - int ret = cobj->getWidth(); - jsval jsret = JSVAL_NULL; - jsret = int32_to_jsval(cx, ret); - args.rval().set(jsret); - return true; - } - - JS_ReportError(cx, "js_cocos2dx_Image_getWidth : wrong number of arguments: %d, was expecting %d", argc, 0); - return false; -} -bool js_cocos2dx_Image_getBitPerPixel(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_getBitPerPixel : Invalid Native Object"); - if (argc == 0) { - int ret = cobj->getBitPerPixel(); - jsval jsret = JSVAL_NULL; - jsret = int32_to_jsval(cx, ret); - args.rval().set(jsret); - return true; - } - - JS_ReportError(cx, "js_cocos2dx_Image_getBitPerPixel : wrong number of arguments: %d, was expecting %d", argc, 0); - return false; -} -bool js_cocos2dx_Image_getFileType(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_getFileType : Invalid Native Object"); - if (argc == 0) { - int ret = (int)cobj->getFileType(); - jsval jsret = JSVAL_NULL; - jsret = int32_to_jsval(cx, ret); - args.rval().set(jsret); - return true; - } - - JS_ReportError(cx, "js_cocos2dx_Image_getFileType : wrong number of arguments: %d, was expecting %d", argc, 0); - return false; -} -bool js_cocos2dx_Image_getNumberOfMipmaps(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_getNumberOfMipmaps : Invalid Native Object"); - if (argc == 0) { - int ret = cobj->getNumberOfMipmaps(); - jsval jsret = JSVAL_NULL; - jsret = int32_to_jsval(cx, ret); - args.rval().set(jsret); - return true; - } - - JS_ReportError(cx, "js_cocos2dx_Image_getNumberOfMipmaps : wrong number of arguments: %d, was expecting %d", argc, 0); - return false; -} -bool js_cocos2dx_Image_getRenderFormat(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_getRenderFormat : Invalid Native Object"); - if (argc == 0) { - int ret = (int)cobj->getRenderFormat(); - jsval jsret = JSVAL_NULL; - jsret = int32_to_jsval(cx, ret); - args.rval().set(jsret); - return true; - } - - JS_ReportError(cx, "js_cocos2dx_Image_getRenderFormat : wrong number of arguments: %d, was expecting %d", argc, 0); - return false; -} -bool js_cocos2dx_Image_getData(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_getData : Invalid Native Object"); - if (argc == 0) { - unsigned char* ret = cobj->getData(); - jsval jsret = JSVAL_NULL; - #pragma warning NO CONVERSION FROM NATIVE FOR unsigned char*; - args.rval().set(jsret); - return true; - } - - JS_ReportError(cx, "js_cocos2dx_Image_getData : wrong number of arguments: %d, was expecting %d", argc, 0); - return false; -} -bool js_cocos2dx_Image_getMipmaps(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_getMipmaps : Invalid Native Object"); - if (argc == 0) { - cocos2d::_MipmapInfo* ret = cobj->getMipmaps(); - jsval jsret = JSVAL_NULL; - #pragma warning NO CONVERSION FROM NATIVE FOR _MipmapInfo*; - args.rval().set(jsret); - return true; - } - - JS_ReportError(cx, "js_cocos2dx_Image_getMipmaps : wrong number of arguments: %d, was expecting %d", argc, 0); - return false; -} -bool js_cocos2dx_Image_initWithRawData(JSContext *cx, uint32_t argc, jsval *vp) -{ - JS::CallArgs args = JS::CallArgsFromVp(argc, vp); - bool ok = true; - 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_initWithRawData : Invalid Native Object"); - if (argc == 5) { - const unsigned char* arg0; - ssize_t arg1; - int arg2; - int arg3; - int arg4; - #pragma warning NO CONVERSION TO NATIVE FOR unsigned char* - ok = false; - ok &= jsval_to_ssize(cx, args.get(1), &arg1); - ok &= jsval_to_int32(cx, args.get(2), (int32_t *)&arg2); - ok &= jsval_to_int32(cx, args.get(3), (int32_t *)&arg3); - ok &= jsval_to_int32(cx, args.get(4), (int32_t *)&arg4); - JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Image_initWithRawData : Error processing arguments"); - bool ret = cobj->initWithRawData(arg0, arg1, arg2, arg3, arg4); - jsval jsret = JSVAL_NULL; - jsret = BOOLEAN_TO_JSVAL(ret); - args.rval().set(jsret); - return true; - } - if (argc == 6) { - const unsigned char* arg0; - ssize_t arg1; - int arg2; - int arg3; - int arg4; - bool arg5; - #pragma warning NO CONVERSION TO NATIVE FOR unsigned char* - ok = false; - ok &= jsval_to_ssize(cx, args.get(1), &arg1); - ok &= jsval_to_int32(cx, args.get(2), (int32_t *)&arg2); - ok &= jsval_to_int32(cx, args.get(3), (int32_t *)&arg3); - ok &= jsval_to_int32(cx, args.get(4), (int32_t *)&arg4); - arg5 = JS::ToBoolean(args.get(5)); - JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Image_initWithRawData : Error processing arguments"); - bool ret = cobj->initWithRawData(arg0, arg1, arg2, arg3, arg4, arg5); - jsval jsret = JSVAL_NULL; - jsret = BOOLEAN_TO_JSVAL(ret); - args.rval().set(jsret); - return true; - } - - JS_ReportError(cx, "js_cocos2dx_Image_initWithRawData : wrong number of arguments: %d, was expecting %d", argc, 5); - return false; -} -bool js_cocos2dx_Image_setPVRImagesHavePremultipliedAlpha(JSContext *cx, uint32_t argc, jsval *vp) -{ - JS::CallArgs args = JS::CallArgsFromVp(argc, vp); - bool ok = true; - if (argc == 1) { - bool arg0; - arg0 = JS::ToBoolean(args.get(0)); - JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Image_setPVRImagesHavePremultipliedAlpha : Error processing arguments"); - cocos2d::Image::setPVRImagesHavePremultipliedAlpha(arg0); - args.rval().setUndefined(); - return true; - } - JS_ReportError(cx, "js_cocos2dx_Image_setPVRImagesHavePremultipliedAlpha : wrong number of arguments"); - return false; -} - -bool js_cocos2dx_Image_constructor(JSContext *cx, uint32_t argc, jsval *vp) -{ - JS::CallArgs args = JS::CallArgsFromVp(argc, vp); - bool ok = true; - cocos2d::Image* cobj = new (std::nothrow) cocos2d::Image(); - cocos2d::Ref *_ccobj = dynamic_cast(cobj); - if (_ccobj) { - _ccobj->autorelease(); - } - TypeTest t; - js_type_class_t *typeClass = nullptr; - std::string typeName = t.s_name(); - auto typeMapIter = _js_global_type_map.find(typeName); - CCASSERT(typeMapIter != _js_global_type_map.end(), "Can't find the class type!"); - typeClass = typeMapIter->second; - CCASSERT(typeClass, "The value is null."); - // JSObject *obj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto); - JS::RootedObject proto(cx, typeClass->proto.get()); - JS::RootedObject parent(cx, typeClass->parentProto.get()); - JS::RootedObject obj(cx, JS_NewObject(cx, typeClass->jsclass, proto, parent)); - args.rval().set(OBJECT_TO_JSVAL(obj)); - // link the native object with the javascript object - js_proxy_t* p = jsb_new_proxy(cobj, obj); - AddNamedObjectRoot(cx, &p->obj, "cocos2d::Image"); - if (JS_HasProperty(cx, obj, "_ctor", &ok) && ok) - ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(obj), "_ctor", args); - return true; -} - - - -void js_cocos2d_Image_finalize(JSFreeOp *fop, JSObject *obj) { - CCLOGINFO("jsbindings: finalizing JS object %p (Image)", obj); -} - -void js_register_cocos2dx_Image(JSContext *cx, JS::HandleObject global) { - jsb_cocos2d_Image_class = (JSClass *)calloc(1, sizeof(JSClass)); - jsb_cocos2d_Image_class->name = "Image"; - jsb_cocos2d_Image_class->addProperty = JS_PropertyStub; - jsb_cocos2d_Image_class->delProperty = JS_DeletePropertyStub; - jsb_cocos2d_Image_class->getProperty = JS_PropertyStub; - jsb_cocos2d_Image_class->setProperty = JS_StrictPropertyStub; - jsb_cocos2d_Image_class->enumerate = JS_EnumerateStub; - jsb_cocos2d_Image_class->resolve = JS_ResolveStub; - jsb_cocos2d_Image_class->convert = JS_ConvertStub; - jsb_cocos2d_Image_class->finalize = js_cocos2d_Image_finalize; - jsb_cocos2d_Image_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2); - - static JSPropertySpec properties[] = { - JS_PSG("__nativeObj", js_is_native_obj, JSPROP_PERMANENT | JSPROP_ENUMERATE), - JS_PS_END - }; - - static JSFunctionSpec funcs[] = { - JS_FN("hasPremultipliedAlpha", js_cocos2dx_Image_hasPremultipliedAlpha, 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("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), - JS_FN("getFileType", js_cocos2dx_Image_getFileType, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), - JS_FN("getNumberOfMipmaps", js_cocos2dx_Image_getNumberOfMipmaps, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), - JS_FN("getRenderFormat", js_cocos2dx_Image_getRenderFormat, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), - JS_FN("getData", js_cocos2dx_Image_getData, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), - JS_FN("getMipmaps", js_cocos2dx_Image_getMipmaps, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), - JS_FN("initWithRawData", js_cocos2dx_Image_initWithRawData, 5, JSPROP_PERMANENT | JSPROP_ENUMERATE), - JS_FS_END - }; - - static JSFunctionSpec st_funcs[] = { - JS_FN("setPVRImagesHavePremultipliedAlpha", js_cocos2dx_Image_setPVRImagesHavePremultipliedAlpha, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), - JS_FS_END - }; - - jsb_cocos2d_Image_prototype = JS_InitClass( - cx, global, - JS::NullPtr(), // parent proto - jsb_cocos2d_Image_class, - js_cocos2dx_Image_constructor, 0, // constructor - properties, - funcs, - NULL, // no static properties - st_funcs); - // make the class enumerable in the registered namespace -// bool found; -//FIXME: Removed in Firefox v27 -// JS_SetPropertyAttributes(cx, global, "Image", JSPROP_ENUMERATE | JSPROP_READONLY, &found); - - // add the proto and JSClass to the type->js info hash table - TypeTest t; - js_type_class_t *p; - std::string typeName = t.s_name(); - if (_js_global_type_map.find(typeName) == _js_global_type_map.end()) - { - p = (js_type_class_t *)malloc(sizeof(js_type_class_t)); - p->jsclass = jsb_cocos2d_Image_class; - p->proto = jsb_cocos2d_Image_prototype; - p->parentProto = NULL; - _js_global_type_map.insert(std::make_pair(typeName, p)); - } -} - JSClass *jsb_cocos2d_RenderTexture_class; JSObject *jsb_cocos2d_RenderTexture_prototype; @@ -69015,203 +68805,6 @@ void js_register_cocos2dx_SimpleAudioEngine(JSContext *cx, JS::HandleObject glob } } -JSClass *jsb_cocos2d_SpritePolygonCache_class; -JSObject *jsb_cocos2d_SpritePolygonCache_prototype; - -bool js_cocos2dx_SpritePolygonCache_isSpritePolygonCachExist(JSContext *cx, uint32_t argc, jsval *vp) -{ - JS::CallArgs args = JS::CallArgsFromVp(argc, vp); - bool ok = true; - JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); - js_proxy_t *proxy = jsb_get_js_proxy(obj); - cocos2d::SpritePolygonCache* cobj = (cocos2d::SpritePolygonCache *)(proxy ? proxy->ptr : NULL); - JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_SpritePolygonCache_isSpritePolygonCachExist : Invalid Native Object"); - if (argc == 2) { - std::string arg0; - cocos2d::Rect arg1; - ok &= jsval_to_std_string(cx, args.get(0), &arg0); - ok &= jsval_to_ccrect(cx, args.get(1), &arg1); - JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_SpritePolygonCache_isSpritePolygonCachExist : Error processing arguments"); - bool ret = cobj->isSpritePolygonCachExist(arg0, arg1); - jsval jsret = JSVAL_NULL; - jsret = BOOLEAN_TO_JSVAL(ret); - args.rval().set(jsret); - return true; - } - - JS_ReportError(cx, "js_cocos2dx_SpritePolygonCache_isSpritePolygonCachExist : wrong number of arguments: %d, was expecting %d", argc, 2); - return false; -} -bool js_cocos2dx_SpritePolygonCache_removeAllSpritePolygonCache(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::SpritePolygonCache* cobj = (cocos2d::SpritePolygonCache *)(proxy ? proxy->ptr : NULL); - JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_SpritePolygonCache_removeAllSpritePolygonCache : Invalid Native Object"); - if (argc == 0) { - cobj->removeAllSpritePolygonCache(); - args.rval().setUndefined(); - return true; - } - - JS_ReportError(cx, "js_cocos2dx_SpritePolygonCache_removeAllSpritePolygonCache : wrong number of arguments: %d, was expecting %d", argc, 0); - return false; -} -bool js_cocos2dx_SpritePolygonCache_removeSpritePolygonCache(JSContext *cx, uint32_t argc, jsval *vp) -{ - JS::CallArgs args = JS::CallArgsFromVp(argc, vp); - bool ok = true; - JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); - js_proxy_t *proxy = jsb_get_js_proxy(obj); - cocos2d::SpritePolygonCache* cobj = (cocos2d::SpritePolygonCache *)(proxy ? proxy->ptr : NULL); - JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_SpritePolygonCache_removeSpritePolygonCache : Invalid Native Object"); - if (argc == 1) { - std::string arg0; - ok &= jsval_to_std_string(cx, args.get(0), &arg0); - JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_SpritePolygonCache_removeSpritePolygonCache : Error processing arguments"); - cobj->removeSpritePolygonCache(arg0); - args.rval().setUndefined(); - return true; - } - if (argc == 2) { - std::string arg0; - const cocos2d::Rect* arg1; - ok &= jsval_to_std_string(cx, args.get(0), &arg0); - do { - if (args.get(1).isNull()) { arg1 = nullptr; break; } - if (!args.get(1).isObject()) { ok = false; break; } - js_proxy_t *jsProxy; - JSObject *tmpObj = args.get(1).toObjectOrNull(); - jsProxy = jsb_get_js_proxy(tmpObj); - arg1 = (const cocos2d::Rect*)(jsProxy ? jsProxy->ptr : NULL); - JSB_PRECONDITION2( arg1, cx, false, "Invalid Native Object"); - } while (0); - JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_SpritePolygonCache_removeSpritePolygonCache : Error processing arguments"); - cobj->removeSpritePolygonCache(arg0, arg1); - args.rval().setUndefined(); - return true; - } - - JS_ReportError(cx, "js_cocos2dx_SpritePolygonCache_removeSpritePolygonCache : wrong number of arguments: %d, was expecting %d", argc, 1); - return false; -} -bool js_cocos2dx_SpritePolygonCache_destroyInstance(JSContext *cx, uint32_t argc, jsval *vp) -{ - JS::CallArgs args = JS::CallArgsFromVp(argc, vp); - if (argc == 0) { - cocos2d::SpritePolygonCache::destroyInstance(); - args.rval().setUndefined(); - return true; - } - JS_ReportError(cx, "js_cocos2dx_SpritePolygonCache_destroyInstance : wrong number of arguments"); - return false; -} - -bool js_cocos2dx_SpritePolygonCache_printInfo(JSContext *cx, uint32_t argc, jsval *vp) -{ - JS::CallArgs args = JS::CallArgsFromVp(argc, vp); - bool ok = true; - if (argc == 1) { - cocos2d::_SpritePolygonInfo arg0; - #pragma warning NO CONVERSION TO NATIVE FOR _SpritePolygonInfo - ok = false; - JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_SpritePolygonCache_printInfo : Error processing arguments"); - cocos2d::SpritePolygonCache::printInfo(arg0); - args.rval().setUndefined(); - return true; - } - JS_ReportError(cx, "js_cocos2dx_SpritePolygonCache_printInfo : wrong number of arguments"); - return false; -} - -bool js_cocos2dx_SpritePolygonCache_getInstance(JSContext *cx, uint32_t argc, jsval *vp) -{ - JS::CallArgs args = JS::CallArgsFromVp(argc, vp); - if (argc == 0) { - cocos2d::SpritePolygonCache* ret = cocos2d::SpritePolygonCache::getInstance(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::SpritePolygonCache*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); - return true; - } - JS_ReportError(cx, "js_cocos2dx_SpritePolygonCache_getInstance : wrong number of arguments"); - return false; -} - - - -void js_cocos2d_SpritePolygonCache_finalize(JSFreeOp *fop, JSObject *obj) { - CCLOGINFO("jsbindings: finalizing JS object %p (SpritePolygonCache)", obj); -} - -void js_register_cocos2dx_SpritePolygonCache(JSContext *cx, JS::HandleObject global) { - jsb_cocos2d_SpritePolygonCache_class = (JSClass *)calloc(1, sizeof(JSClass)); - jsb_cocos2d_SpritePolygonCache_class->name = "SpritePolygonCache"; - jsb_cocos2d_SpritePolygonCache_class->addProperty = JS_PropertyStub; - jsb_cocos2d_SpritePolygonCache_class->delProperty = JS_DeletePropertyStub; - jsb_cocos2d_SpritePolygonCache_class->getProperty = JS_PropertyStub; - jsb_cocos2d_SpritePolygonCache_class->setProperty = JS_StrictPropertyStub; - jsb_cocos2d_SpritePolygonCache_class->enumerate = JS_EnumerateStub; - jsb_cocos2d_SpritePolygonCache_class->resolve = JS_ResolveStub; - jsb_cocos2d_SpritePolygonCache_class->convert = JS_ConvertStub; - jsb_cocos2d_SpritePolygonCache_class->finalize = js_cocos2d_SpritePolygonCache_finalize; - jsb_cocos2d_SpritePolygonCache_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2); - - static JSPropertySpec properties[] = { - JS_PSG("__nativeObj", js_is_native_obj, JSPROP_PERMANENT | JSPROP_ENUMERATE), - JS_PS_END - }; - - static JSFunctionSpec funcs[] = { - JS_FN("isSpritePolygonCachExist", js_cocos2dx_SpritePolygonCache_isSpritePolygonCachExist, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE), - JS_FN("removeAllSpritePolygonCache", js_cocos2dx_SpritePolygonCache_removeAllSpritePolygonCache, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), - JS_FN("removeSpritePolygonCache", js_cocos2dx_SpritePolygonCache_removeSpritePolygonCache, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), - JS_FS_END - }; - - static JSFunctionSpec st_funcs[] = { - JS_FN("destroyInstance", js_cocos2dx_SpritePolygonCache_destroyInstance, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), - JS_FN("printInfo", js_cocos2dx_SpritePolygonCache_printInfo, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), - JS_FN("getInstance", js_cocos2dx_SpritePolygonCache_getInstance, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), - JS_FS_END - }; - - jsb_cocos2d_SpritePolygonCache_prototype = JS_InitClass( - cx, global, - JS::NullPtr(), // parent proto - jsb_cocos2d_SpritePolygonCache_class, - empty_constructor, 0, - properties, - funcs, - NULL, // no static properties - st_funcs); - // make the class enumerable in the registered namespace -// bool found; -//FIXME: Removed in Firefox v27 -// JS_SetPropertyAttributes(cx, global, "SpritePolygonCache", JSPROP_ENUMERATE | JSPROP_READONLY, &found); - - // add the proto and JSClass to the type->js info hash table - TypeTest t; - js_type_class_t *p; - std::string typeName = t.s_name(); - if (_js_global_type_map.find(typeName) == _js_global_type_map.end()) - { - p = (js_type_class_t *)malloc(sizeof(js_type_class_t)); - p->jsclass = jsb_cocos2d_SpritePolygonCache_class; - p->proto = jsb_cocos2d_SpritePolygonCache_prototype; - p->parentProto = NULL; - _js_global_type_map.insert(std::make_pair(typeName, p)); - } -} - void register_all_cocos2dx(JSContext* cx, JS::HandleObject obj) { // Get the ns JS::RootedObject ns(cx); @@ -69414,7 +69007,6 @@ void register_all_cocos2dx(JSContext* cx, JS::HandleObject obj) { js_register_cocos2dx_TransitionSlideInL(cx, ns); js_register_cocos2dx_TransitionSlideInT(cx, ns); js_register_cocos2dx_Grid3D(cx, ns); - js_register_cocos2dx_SpritePolygonCache(cx, ns); js_register_cocos2dx_EaseCircleActionOut(cx, ns); js_register_cocos2dx_TransitionProgressInOut(cx, ns); js_register_cocos2dx_EaseCubicActionInOut(cx, ns); diff --git a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_auto.hpp b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_auto.hpp index d0ab4c9e94..dea55ec6d1 100644 --- a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_auto.hpp +++ b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_auto.hpp @@ -2861,6 +2861,31 @@ bool js_cocos2dx_ProtectedNode_removeAllProtectedChildren(JSContext *cx, uint32_ bool js_cocos2dx_ProtectedNode_create(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_ProtectedNode_ProtectedNode(JSContext *cx, uint32_t argc, jsval *vp); +extern JSClass *jsb_cocos2d_Image_class; +extern JSObject *jsb_cocos2d_Image_prototype; + +bool js_cocos2dx_Image_constructor(JSContext *cx, uint32_t argc, jsval *vp); +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_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_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); +bool js_cocos2dx_Image_getFileType(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_Image_getNumberOfMipmaps(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_Image_getRenderFormat(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_Image_getData(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_Image_getMipmaps(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_Image_initWithRawData(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_Image_setPVRImagesHavePremultipliedAlpha(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_Image_Image(JSContext *cx, uint32_t argc, jsval *vp); + extern JSClass *jsb_cocos2d_Sprite_class; extern JSObject *jsb_cocos2d_Sprite_prototype; @@ -2893,6 +2918,7 @@ bool js_cocos2dx_Sprite_setAtlasIndex(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_Sprite_setDirty(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_Sprite_isTextureRectRotated(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_Sprite_getTextureRect(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_Sprite_debugDraw(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_Sprite_initWithFile(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_Sprite_setBlendFunc(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_Sprite_getTextureAtlas(JSContext *cx, uint32_t argc, jsval *vp); @@ -2900,37 +2926,8 @@ bool js_cocos2dx_Sprite_initWithSpriteFrame(JSContext *cx, uint32_t argc, jsval bool js_cocos2dx_Sprite_isFlippedX(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_Sprite_isFlippedY(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_Sprite_setVertexRect(JSContext *cx, uint32_t argc, jsval *vp); -bool js_cocos2dx_Sprite_create(JSContext *cx, uint32_t argc, jsval *vp); -bool js_cocos2dx_Sprite_createWithTexture(JSContext *cx, uint32_t argc, jsval *vp); -bool js_cocos2dx_Sprite_createWithSpriteFrameName(JSContext *cx, uint32_t argc, jsval *vp); -bool js_cocos2dx_Sprite_createWithSpriteFrame(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_Sprite_Sprite(JSContext *cx, uint32_t argc, jsval *vp); -extern JSClass *jsb_cocos2d_Image_class; -extern JSObject *jsb_cocos2d_Image_prototype; - -bool js_cocos2dx_Image_constructor(JSContext *cx, uint32_t argc, jsval *vp); -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_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_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); -bool js_cocos2dx_Image_getFileType(JSContext *cx, uint32_t argc, jsval *vp); -bool js_cocos2dx_Image_getNumberOfMipmaps(JSContext *cx, uint32_t argc, jsval *vp); -bool js_cocos2dx_Image_getRenderFormat(JSContext *cx, uint32_t argc, jsval *vp); -bool js_cocos2dx_Image_getData(JSContext *cx, uint32_t argc, jsval *vp); -bool js_cocos2dx_Image_getMipmaps(JSContext *cx, uint32_t argc, jsval *vp); -bool js_cocos2dx_Image_initWithRawData(JSContext *cx, uint32_t argc, jsval *vp); -bool js_cocos2dx_Image_setPVRImagesHavePremultipliedAlpha(JSContext *cx, uint32_t argc, jsval *vp); -bool js_cocos2dx_Image_Image(JSContext *cx, uint32_t argc, jsval *vp); - extern JSClass *jsb_cocos2d_RenderTexture_class; extern JSObject *jsb_cocos2d_RenderTexture_prototype; @@ -3983,18 +3980,4 @@ bool js_cocos2dx_SimpleAudioEngine_resumeEffect(JSContext *cx, uint32_t argc, js bool js_cocos2dx_SimpleAudioEngine_end(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_SimpleAudioEngine_getInstance(JSContext *cx, uint32_t argc, jsval *vp); -extern JSClass *jsb_cocos2d_SpritePolygonCache_class; -extern JSObject *jsb_cocos2d_SpritePolygonCache_prototype; - -bool js_cocos2dx_SpritePolygonCache_constructor(JSContext *cx, uint32_t argc, jsval *vp); -void js_cocos2dx_SpritePolygonCache_finalize(JSContext *cx, JSObject *obj); -void js_register_cocos2dx_SpritePolygonCache(JSContext *cx, JS::HandleObject global); -void register_all_cocos2dx(JSContext* cx, JS::HandleObject obj); -bool js_cocos2dx_SpritePolygonCache_isSpritePolygonCachExist(JSContext *cx, uint32_t argc, jsval *vp); -bool js_cocos2dx_SpritePolygonCache_removeAllSpritePolygonCache(JSContext *cx, uint32_t argc, jsval *vp); -bool js_cocos2dx_SpritePolygonCache_removeSpritePolygonCache(JSContext *cx, uint32_t argc, jsval *vp); -bool js_cocos2dx_SpritePolygonCache_destroyInstance(JSContext *cx, uint32_t argc, jsval *vp); -bool js_cocos2dx_SpritePolygonCache_printInfo(JSContext *cx, uint32_t argc, jsval *vp); -bool js_cocos2dx_SpritePolygonCache_getInstance(JSContext *cx, uint32_t argc, jsval *vp); - #endif // __cocos2dx_h__ diff --git a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_experimental.cpp b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_experimental.cpp deleted file mode 100644 index 57802ed4b0..0000000000 --- a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_experimental.cpp +++ /dev/null @@ -1,320 +0,0 @@ -#include "jsb_cocos2dx_experimental.hpp" -#include "cocos2d_specifics.hpp" -#include "SpritePolygon.h" - -template -static bool dummy_constructor(JSContext *cx, uint32_t argc, jsval *vp) { - JS::CallArgs args = JS::CallArgsFromVp(argc, vp); - JS::RootedValue initializing(cx); - bool isNewValid = true; - JS::RootedObject global(cx, ScriptingCore::getInstance()->getGlobalObject()); - isNewValid = JS_GetProperty(cx, global, "initializing", &initializing) && initializing.toBoolean(); - if (isNewValid) - { - TypeTest t; - js_type_class_t *typeClass = nullptr; - std::string typeName = t.s_name(); - auto typeMapIter = _js_global_type_map.find(typeName); - CCASSERT(typeMapIter != _js_global_type_map.end(), "Can't find the class type!"); - typeClass = typeMapIter->second; - CCASSERT(typeClass, "The value is null."); - - JS::RootedObject proto(cx, typeClass->proto.get()); - JS::RootedObject parent(cx, typeClass->parentProto.get()); - JS::RootedObject _tmp(cx, JS_NewObject(cx, typeClass->jsclass, proto, parent)); - - args.rval().set(OBJECT_TO_JSVAL(_tmp)); - return true; - } - - JS_ReportError(cx, "Constructor for the requested class is not available, please refer to the API reference."); - return false; -} - -static bool empty_constructor(JSContext *cx, uint32_t argc, jsval *vp) { - return false; -} - -static bool js_is_native_obj(JSContext *cx, uint32_t argc, jsval *vp) -{ - JS::CallArgs args = JS::CallArgsFromVp(argc, vp); - args.rval().setBoolean(true); - return true; -} -JSClass *jsb_cocos2d_experimental_SpritePolygon_class; -JSObject *jsb_cocos2d_experimental_SpritePolygon_prototype; - -bool js_cocos2dx_experimental_SpritePolygon_setTexture(JSContext *cx, uint32_t argc, jsval *vp) -{ - JS::CallArgs args = JS::CallArgsFromVp(argc, vp); - bool ok = true; - - JS::RootedObject obj(cx); - cocos2d::experimental::SpritePolygon* cobj = NULL; - obj = args.thisv().toObjectOrNull(); - js_proxy_t *proxy = jsb_get_js_proxy(obj); - cobj = (cocos2d::experimental::SpritePolygon *)(proxy ? proxy->ptr : NULL); - JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_experimental_SpritePolygon_setTexture : Invalid Native Object"); - do { - if (argc == 1) { - cocos2d::Texture2D* arg0; - do { - if (args.get(0).isNull()) { arg0 = nullptr; break; } - if (!args.get(0).isObject()) { ok = false; break; } - js_proxy_t *jsProxy; - JSObject *tmpObj = args.get(0).toObjectOrNull(); - jsProxy = jsb_get_js_proxy(tmpObj); - arg0 = (cocos2d::Texture2D*)(jsProxy ? jsProxy->ptr : NULL); - JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); - } while (0); - if (!ok) { ok = true; break; } - cobj->setTexture(arg0); - args.rval().setUndefined(); - return true; - } - } while(0); - - do { - if (argc == 1) { - std::string arg0; - ok &= jsval_to_std_string(cx, args.get(0), &arg0); - if (!ok) { ok = true; break; } - cobj->setTexture(arg0); - args.rval().setUndefined(); - return true; - } - } while(0); - - JS_ReportError(cx, "js_cocos2dx_experimental_SpritePolygon_setTexture : wrong number of arguments"); - return false; -} -bool js_cocos2dx_experimental_SpritePolygon_initWithTexture(JSContext *cx, uint32_t argc, jsval *vp) -{ - JS::CallArgs args = JS::CallArgsFromVp(argc, vp); - bool ok = true; - JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); - js_proxy_t *proxy = jsb_get_js_proxy(obj); - cocos2d::experimental::SpritePolygon* cobj = (cocos2d::experimental::SpritePolygon *)(proxy ? proxy->ptr : NULL); - JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_experimental_SpritePolygon_initWithTexture : Invalid Native Object"); - if (argc == 1) { - cocos2d::Texture2D* arg0; - do { - if (args.get(0).isNull()) { arg0 = nullptr; break; } - if (!args.get(0).isObject()) { ok = false; break; } - js_proxy_t *jsProxy; - JSObject *tmpObj = args.get(0).toObjectOrNull(); - jsProxy = jsb_get_js_proxy(tmpObj); - arg0 = (cocos2d::Texture2D*)(jsProxy ? jsProxy->ptr : NULL); - JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); - } while (0); - JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_experimental_SpritePolygon_initWithTexture : Error processing arguments"); - bool ret = cobj->initWithTexture(arg0); - jsval jsret = JSVAL_NULL; - jsret = BOOLEAN_TO_JSVAL(ret); - args.rval().set(jsret); - return true; - } - - JS_ReportError(cx, "js_cocos2dx_experimental_SpritePolygon_initWithTexture : wrong number of arguments: %d, was expecting %d", argc, 1); - return false; -} -bool js_cocos2dx_experimental_SpritePolygon_showDebug(JSContext *cx, uint32_t argc, jsval *vp) -{ - JS::CallArgs args = JS::CallArgsFromVp(argc, vp); - bool ok = true; - JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); - js_proxy_t *proxy = jsb_get_js_proxy(obj); - cocos2d::experimental::SpritePolygon* cobj = (cocos2d::experimental::SpritePolygon *)(proxy ? proxy->ptr : NULL); - JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_experimental_SpritePolygon_showDebug : Invalid Native Object"); - if (argc == 1) { - bool arg0; - arg0 = JS::ToBoolean(args.get(0)); - JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_experimental_SpritePolygon_showDebug : Error processing arguments"); - cobj->showDebug(arg0); - args.rval().setUndefined(); - return true; - } - - JS_ReportError(cx, "js_cocos2dx_experimental_SpritePolygon_showDebug : wrong number of arguments: %d, was expecting %d", argc, 1); - return false; -} -bool js_cocos2dx_experimental_SpritePolygon_getTexture(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::experimental::SpritePolygon* cobj = (cocos2d::experimental::SpritePolygon *)(proxy ? proxy->ptr : NULL); - JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_experimental_SpritePolygon_getTexture : Invalid Native Object"); - if (argc == 0) { - cocos2d::Texture2D* ret = cobj->getTexture(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Texture2D*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); - return true; - } - - JS_ReportError(cx, "js_cocos2dx_experimental_SpritePolygon_getTexture : wrong number of arguments: %d, was expecting %d", argc, 0); - return false; -} -bool js_cocos2dx_experimental_SpritePolygon_getArea(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::experimental::SpritePolygon* cobj = (cocos2d::experimental::SpritePolygon *)(proxy ? proxy->ptr : NULL); - JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_experimental_SpritePolygon_getArea : Invalid Native Object"); - if (argc == 0) { - const float ret = cobj->getArea(); - jsval jsret = JSVAL_NULL; - jsret = DOUBLE_TO_JSVAL(ret); - args.rval().set(jsret); - return true; - } - - JS_ReportError(cx, "js_cocos2dx_experimental_SpritePolygon_getArea : wrong number of arguments: %d, was expecting %d", argc, 0); - return false; -} -bool js_cocos2dx_experimental_SpritePolygon_initWithMarching(JSContext *cx, uint32_t argc, jsval *vp) -{ - JS::CallArgs args = JS::CallArgsFromVp(argc, vp); - bool ok = true; - JS::RootedObject obj(cx, args.thisv().toObjectOrNull()); - js_proxy_t *proxy = jsb_get_js_proxy(obj); - cocos2d::experimental::SpritePolygon* cobj = (cocos2d::experimental::SpritePolygon *)(proxy ? proxy->ptr : NULL); - JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_experimental_SpritePolygon_initWithMarching : Invalid Native Object"); - if (argc == 3) { - std::string arg0; - cocos2d::Rect arg1; - double arg2; - ok &= jsval_to_std_string(cx, args.get(0), &arg0); - ok &= jsval_to_ccrect(cx, args.get(1), &arg1); - ok &= JS::ToNumber( cx, args.get(2), &arg2) && !isnan(arg2); - JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_experimental_SpritePolygon_initWithMarching : Error processing arguments"); - bool ret = cobj->initWithMarching(arg0, arg1, arg2); - jsval jsret = JSVAL_NULL; - jsret = BOOLEAN_TO_JSVAL(ret); - args.rval().set(jsret); - return true; - } - - JS_ReportError(cx, "js_cocos2dx_experimental_SpritePolygon_initWithMarching : wrong number of arguments: %d, was expecting %d", argc, 3); - return false; -} -bool js_cocos2dx_experimental_SpritePolygon_getVertCount(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::experimental::SpritePolygon* cobj = (cocos2d::experimental::SpritePolygon *)(proxy ? proxy->ptr : NULL); - JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_experimental_SpritePolygon_getVertCount : Invalid Native Object"); - if (argc == 0) { - const ssize_t ret = cobj->getVertCount(); - jsval jsret = JSVAL_NULL; - jsret = ssize_to_jsval(cx, ret); - args.rval().set(jsret); - return true; - } - - JS_ReportError(cx, "js_cocos2dx_experimental_SpritePolygon_getVertCount : wrong number of arguments: %d, was expecting %d", argc, 0); - return false; -} -bool js_cocos2dx_experimental_SpritePolygon_getTrianglesCount(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::experimental::SpritePolygon* cobj = (cocos2d::experimental::SpritePolygon *)(proxy ? proxy->ptr : NULL); - JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_experimental_SpritePolygon_getTrianglesCount : Invalid Native Object"); - if (argc == 0) { - const ssize_t ret = cobj->getTrianglesCount(); - jsval jsret = JSVAL_NULL; - jsret = ssize_to_jsval(cx, ret); - args.rval().set(jsret); - return true; - } - - JS_ReportError(cx, "js_cocos2dx_experimental_SpritePolygon_getTrianglesCount : wrong number of arguments: %d, was expecting %d", argc, 0); - return false; -} - -extern JSObject *jsb_cocos2d_Node_prototype; - -void js_cocos2d_experimental_SpritePolygon_finalize(JSFreeOp *fop, JSObject *obj) { - CCLOGINFO("jsbindings: finalizing JS object %p (SpritePolygon)", obj); -} - -void js_register_cocos2dx_experimental_SpritePolygon(JSContext *cx, JS::HandleObject global) { - jsb_cocos2d_experimental_SpritePolygon_class = (JSClass *)calloc(1, sizeof(JSClass)); - jsb_cocos2d_experimental_SpritePolygon_class->name = "SpritePolygon"; - jsb_cocos2d_experimental_SpritePolygon_class->addProperty = JS_PropertyStub; - jsb_cocos2d_experimental_SpritePolygon_class->delProperty = JS_DeletePropertyStub; - jsb_cocos2d_experimental_SpritePolygon_class->getProperty = JS_PropertyStub; - jsb_cocos2d_experimental_SpritePolygon_class->setProperty = JS_StrictPropertyStub; - jsb_cocos2d_experimental_SpritePolygon_class->enumerate = JS_EnumerateStub; - jsb_cocos2d_experimental_SpritePolygon_class->resolve = JS_ResolveStub; - jsb_cocos2d_experimental_SpritePolygon_class->convert = JS_ConvertStub; - jsb_cocos2d_experimental_SpritePolygon_class->finalize = js_cocos2d_experimental_SpritePolygon_finalize; - jsb_cocos2d_experimental_SpritePolygon_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2); - - static JSPropertySpec properties[] = { - JS_PSG("__nativeObj", js_is_native_obj, JSPROP_PERMANENT | JSPROP_ENUMERATE), - JS_PS_END - }; - - static JSFunctionSpec funcs[] = { - JS_FN("setTexture", js_cocos2dx_experimental_SpritePolygon_setTexture, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), - JS_FN("initWithTexture", js_cocos2dx_experimental_SpritePolygon_initWithTexture, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), - JS_FN("showDebug", js_cocos2dx_experimental_SpritePolygon_showDebug, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), - JS_FN("getTexture", js_cocos2dx_experimental_SpritePolygon_getTexture, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), - JS_FN("getArea", js_cocos2dx_experimental_SpritePolygon_getArea, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), - JS_FN("initWithMarching", js_cocos2dx_experimental_SpritePolygon_initWithMarching, 3, JSPROP_PERMANENT | JSPROP_ENUMERATE), - JS_FN("getVertCount", js_cocos2dx_experimental_SpritePolygon_getVertCount, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), - JS_FN("getTrianglesCount", js_cocos2dx_experimental_SpritePolygon_getTrianglesCount, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), - JS_FS_END - }; - - JSFunctionSpec *st_funcs = NULL; - - jsb_cocos2d_experimental_SpritePolygon_prototype = JS_InitClass( - cx, global, - JS::RootedObject(cx, jsb_cocos2d_Node_prototype), - jsb_cocos2d_experimental_SpritePolygon_class, - dummy_constructor, 0, // no constructor - properties, - funcs, - NULL, // no static properties - st_funcs); - // make the class enumerable in the registered namespace -// bool found; -//FIXME: Removed in Firefox v27 -// JS_SetPropertyAttributes(cx, global, "SpritePolygon", JSPROP_ENUMERATE | JSPROP_READONLY, &found); - - // add the proto and JSClass to the type->js info hash table - TypeTest t; - js_type_class_t *p; - std::string typeName = t.s_name(); - if (_js_global_type_map.find(typeName) == _js_global_type_map.end()) - { - p = (js_type_class_t *)malloc(sizeof(js_type_class_t)); - p->jsclass = jsb_cocos2d_experimental_SpritePolygon_class; - p->proto = jsb_cocos2d_experimental_SpritePolygon_prototype; - p->parentProto = jsb_cocos2d_Node_prototype; - _js_global_type_map.insert(std::make_pair(typeName, p)); - } -} - -void register_all_cocos2dx_experimental(JSContext* cx, JS::HandleObject obj) { - // Get the ns - JS::RootedObject ns(cx); - get_or_create_js_obj(cx, obj, "ccexp", &ns); - - js_register_cocos2dx_experimental_SpritePolygon(cx, ns); -} - diff --git a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_experimental.hpp b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_experimental.hpp deleted file mode 100644 index cc1fa9e695..0000000000 --- a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_experimental.hpp +++ /dev/null @@ -1,25 +0,0 @@ -#include "base/ccConfig.h" -#ifndef __cocos2dx_experimental_h__ -#define __cocos2dx_experimental_h__ - -#include "jsapi.h" -#include "jsfriendapi.h" - - -extern JSClass *jsb_cocos2d_experimental_SpritePolygon_class; -extern JSObject *jsb_cocos2d_experimental_SpritePolygon_prototype; - -bool js_cocos2dx_experimental_SpritePolygon_constructor(JSContext *cx, uint32_t argc, jsval *vp); -void js_cocos2dx_experimental_SpritePolygon_finalize(JSContext *cx, JSObject *obj); -void js_register_cocos2dx_experimental_SpritePolygon(JSContext *cx, JS::HandleObject global); -void register_all_cocos2dx_experimental(JSContext* cx, JS::HandleObject obj); -bool js_cocos2dx_experimental_SpritePolygon_setTexture(JSContext *cx, uint32_t argc, jsval *vp); -bool js_cocos2dx_experimental_SpritePolygon_initWithTexture(JSContext *cx, uint32_t argc, jsval *vp); -bool js_cocos2dx_experimental_SpritePolygon_showDebug(JSContext *cx, uint32_t argc, jsval *vp); -bool js_cocos2dx_experimental_SpritePolygon_getTexture(JSContext *cx, uint32_t argc, jsval *vp); -bool js_cocos2dx_experimental_SpritePolygon_getArea(JSContext *cx, uint32_t argc, jsval *vp); -bool js_cocos2dx_experimental_SpritePolygon_initWithMarching(JSContext *cx, uint32_t argc, jsval *vp); -bool js_cocos2dx_experimental_SpritePolygon_getVertCount(JSContext *cx, uint32_t argc, jsval *vp); -bool js_cocos2dx_experimental_SpritePolygon_getTrianglesCount(JSContext *cx, uint32_t argc, jsval *vp); - -#endif // __cocos2dx_experimental_h__ diff --git a/cocos/scripting/lua-bindings/auto/api/AutoPolygon.lua b/cocos/scripting/lua-bindings/auto/api/AutoPolygon.lua new file mode 100644 index 0000000000..c7750adf8a --- /dev/null +++ b/cocos/scripting/lua-bindings/auto/api/AutoPolygon.lua @@ -0,0 +1,16 @@ + +-------------------------------- +-- @module AutoPolygon +-- @parent_module cc + +-------------------------------- +-- create an AutoPolygon and initialize it with an image file
+-- the image must be a 32bit PNG for current version 3.7
+-- param filename a path to image file, e.g., "scene1/monster.png".
+-- return an AutoPolygon object; +-- @function [parent=#AutoPolygon] AutoPolygon +-- @param self +-- @param #string filename +-- @return AutoPolygon#AutoPolygon self (return value: cc.AutoPolygon) + +return nil diff --git a/cocos/scripting/lua-bindings/auto/api/PolygonInfo.lua b/cocos/scripting/lua-bindings/auto/api/PolygonInfo.lua new file mode 100644 index 0000000000..58a9a285fe --- /dev/null +++ b/cocos/scripting/lua-bindings/auto/api/PolygonInfo.lua @@ -0,0 +1,46 @@ + +-------------------------------- +-- @module PolygonInfo +-- @parent_module cc + +-------------------------------- +-- get sum of all triangle area size
+-- return sum of all triangle area size +-- @function [parent=#PolygonInfo] getArea +-- @param self +-- @return float#float ret (return value: float) + +-------------------------------- +-- get triangles count
+-- return number of triangles +-- @function [parent=#PolygonInfo] getTriaglesCount +-- @param self +-- @return unsigned int#unsigned int ret (return value: unsigned int) + +-------------------------------- +-- get vertex count
+-- return number of vertices +-- @function [parent=#PolygonInfo] getVertCount +-- @param self +-- @return unsigned int#unsigned int ret (return value: unsigned int) + +-------------------------------- +-- set the data to be a pointer to a quad
+-- the member verts will not be released when this PolygonInfo destructs
+-- as the verts memory are managed by other objects
+-- param quad a pointer to the V3F_C4B_T2F_Quad obje +-- @function [parent=#PolygonInfo] setQuad +-- @param self +-- @param #cc.V3F_C4B_T2F_Quad quad +-- @return PolygonInfo#PolygonInfo self (return value: cc.PolygonInfo) + +-------------------------------- +-- / @name Creators/ @{
+-- Creates an empty Polygon info
+-- memberof PolygonInfo
+-- return PolygonInfo object +-- @function [parent=#PolygonInfo] PolygonInfo +-- @param self +-- @return PolygonInfo#PolygonInfo self (return value: cc.PolygonInfo) + +return nil diff --git a/cocos/scripting/lua-bindings/auto/api/Sprite.lua b/cocos/scripting/lua-bindings/auto/api/Sprite.lua index 8bf0536e3d..92bab73b70 100644 --- a/cocos/scripting/lua-bindings/auto/api/Sprite.lua +++ b/cocos/scripting/lua-bindings/auto/api/Sprite.lua @@ -186,6 +186,13 @@ -- @param self -- @return rect_table#rect_table ret (return value: rect_table) +-------------------------------- +-- +-- @function [parent=#Sprite] debugDraw +-- @param self +-- @param #bool on +-- @return Sprite#Sprite self (return value: cc.Sprite) + -------------------------------- -- @overload self, string, rect_table -- @overload self, string @@ -254,46 +261,6 @@ -- @param #rect_table rect -- @return Sprite#Sprite self (return value: cc.Sprite) --------------------------------- --- @overload self, string --- @overload self --- @overload self, string, rect_table --- @function [parent=#Sprite] create --- @param self --- @param #string filename --- @param #rect_table rect --- @return Sprite#Sprite ret (return value: cc.Sprite) - --------------------------------- --- @overload self, cc.Texture2D, rect_table, bool --- @overload self, cc.Texture2D --- @function [parent=#Sprite] createWithTexture --- @param self --- @param #cc.Texture2D texture --- @param #rect_table rect --- @param #bool rotated --- @return Sprite#Sprite ret (return value: cc.Sprite) - --------------------------------- --- Creates a sprite with an sprite frame name.
--- A SpriteFrame will be fetched from the SpriteFrameCache by spriteFrameName param.
--- If the SpriteFrame doesn't exist it will raise an exception.
--- param spriteFrameName A null terminated string which indicates the sprite frame name.
--- return An autoreleased sprite object. --- @function [parent=#Sprite] createWithSpriteFrameName --- @param self --- @param #string spriteFrameName --- @return Sprite#Sprite ret (return value: cc.Sprite) - --------------------------------- --- Creates a sprite with an sprite frame.
--- param spriteFrame A sprite frame which involves a texture and a rect.
--- return An autoreleased sprite object. --- @function [parent=#Sprite] createWithSpriteFrame --- @param self --- @param #cc.SpriteFrame spriteFrame --- @return Sprite#Sprite ret (return value: cc.Sprite) - -------------------------------- -- @overload self, cc.Node, int, string -- @overload self, cc.Node, int, int diff --git a/cocos/scripting/lua-bindings/auto/api/SpritePolygon.lua b/cocos/scripting/lua-bindings/auto/api/SpritePolygon.lua deleted file mode 100644 index d932cae710..0000000000 --- a/cocos/scripting/lua-bindings/auto/api/SpritePolygon.lua +++ /dev/null @@ -1,61 +0,0 @@ - --------------------------------- --- @module SpritePolygon --- @extend Node --- @parent_module ccexp - --------------------------------- --- @overload self, cc.Texture2D --- @overload self, string --- @function [parent=#SpritePolygon] setTexture --- @param self --- @param #string filename --- @return experimental::SpritePolygon#experimental::SpritePolygon self (return value: cc.experimental::SpritePolygon) - --------------------------------- --- --- @function [parent=#SpritePolygon] initWithTexture --- @param self --- @param #cc.Texture2D texture --- @return bool#bool ret (return value: bool) - --------------------------------- --- --- @function [parent=#SpritePolygon] showDebug --- @param self --- @param #bool val --- @return experimental::SpritePolygon#experimental::SpritePolygon self (return value: cc.experimental::SpritePolygon) - --------------------------------- --- returns the Texture2D object used by the sprite --- @function [parent=#SpritePolygon] getTexture --- @param self --- @return Texture2D#Texture2D ret (return value: cc.Texture2D) - --------------------------------- --- --- @function [parent=#SpritePolygon] getArea --- @param self --- @return float#float ret (return value: float) - --------------------------------- --- --- @function [parent=#SpritePolygon] initWithCache --- @param self --- @param #string file --- @param #cc._SpritePolygonInfo info --- @return bool#bool ret (return value: bool) - --------------------------------- --- --- @function [parent=#SpritePolygon] getVertCount --- @param self --- @return long#long ret (return value: long) - --------------------------------- --- --- @function [parent=#SpritePolygon] getTrianglesCount --- @param self --- @return long#long ret (return value: long) - -return nil diff --git a/cocos/scripting/lua-bindings/auto/api/SpritePolygonCache.lua b/cocos/scripting/lua-bindings/auto/api/SpritePolygonCache.lua deleted file mode 100644 index ffd1851189..0000000000 --- a/cocos/scripting/lua-bindings/auto/api/SpritePolygonCache.lua +++ /dev/null @@ -1,48 +0,0 @@ - --------------------------------- --- @module SpritePolygonCache --- @extend Ref --- @parent_module cc - --------------------------------- --- --- @function [parent=#SpritePolygonCache] isSpritePolygonCachExist --- @param self --- @param #string filePath --- @param #rect_table rect --- @return bool#bool ret (return value: bool) - --------------------------------- --- --- @function [parent=#SpritePolygonCache] removeAllSpritePolygonCache --- @param self --- @return SpritePolygonCache#SpritePolygonCache self (return value: cc.SpritePolygonCache) - --------------------------------- --- --- @function [parent=#SpritePolygonCache] removeSpritePolygonCache --- @param self --- @param #string filePath --- @param #rect_table rect --- @return SpritePolygonCache#SpritePolygonCache self (return value: cc.SpritePolygonCache) - --------------------------------- --- --- @function [parent=#SpritePolygonCache] destroyInstance --- @param self --- @return SpritePolygonCache#SpritePolygonCache self (return value: cc.SpritePolygonCache) - --------------------------------- --- --- @function [parent=#SpritePolygonCache] printInfo --- @param self --- @param #cc._SpritePolygonInfo info --- @return SpritePolygonCache#SpritePolygonCache self (return value: cc.SpritePolygonCache) - --------------------------------- --- --- @function [parent=#SpritePolygonCache] getInstance --- @param self --- @return SpritePolygonCache#SpritePolygonCache ret (return value: cc.SpritePolygonCache) - -return nil diff --git a/cocos/scripting/lua-bindings/auto/api/lua_cocos2dx_auto_api.lua b/cocos/scripting/lua-bindings/auto/api/lua_cocos2dx_auto_api.lua index 892bf26e99..e59c3ca80f 100644 --- a/cocos/scripting/lua-bindings/auto/api/lua_cocos2dx_auto_api.lua +++ b/cocos/scripting/lua-bindings/auto/api/lua_cocos2dx_auto_api.lua @@ -932,13 +932,23 @@ -------------------------------------------------------- --- the cc Sprite --- @field [parent=#cc] Sprite#Sprite Sprite preloaded module +-- the cc Image +-- @field [parent=#cc] Image#Image Image preloaded module -------------------------------------------------------- --- the cc Image --- @field [parent=#cc] Image#Image Image preloaded module +-- the cc PolygonInfo +-- @field [parent=#cc] PolygonInfo#PolygonInfo PolygonInfo preloaded module + + +-------------------------------------------------------- +-- the cc AutoPolygon +-- @field [parent=#cc] AutoPolygon#AutoPolygon AutoPolygon preloaded module + + +-------------------------------------------------------- +-- the cc Sprite +-- @field [parent=#cc] Sprite#Sprite Sprite preloaded module -------------------------------------------------------- @@ -1281,9 +1291,4 @@ -- @field [parent=#cc] Component#Component Component preloaded module --------------------------------------------------------- --- the cc SpritePolygonCache --- @field [parent=#cc] SpritePolygonCache#SpritePolygonCache SpritePolygonCache preloaded module - - return nil diff --git a/cocos/scripting/lua-bindings/auto/api/lua_cocos2dx_experimental_auto_api.lua b/cocos/scripting/lua-bindings/auto/api/lua_cocos2dx_experimental_auto_api.lua index d78658478a..56a40c50ac 100644 --- a/cocos/scripting/lua-bindings/auto/api/lua_cocos2dx_experimental_auto_api.lua +++ b/cocos/scripting/lua-bindings/auto/api/lua_cocos2dx_experimental_auto_api.lua @@ -11,9 +11,4 @@ -- @field [parent=#ccexp] TMXTiledMap#TMXTiledMap TMXTiledMap preloaded module --------------------------------------------------------- --- the ccexp SpritePolygon --- @field [parent=#ccexp] SpritePolygon#SpritePolygon SpritePolygon preloaded module - - return nil diff --git a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.cpp b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.cpp index aeb7908cc3..54a1af7a02 100644 --- a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.cpp +++ b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.cpp @@ -2,7 +2,6 @@ #include "cocos2d.h" #include "CCProtectedNode.h" #include "CCAsyncTaskPool.h" -#include "SpritePolygonCache.h" #include "tolua_fix.h" #include "LuaBasicConversions.h" @@ -67675,6 +67674,960 @@ int lua_register_cocos2dx_ProtectedNode(lua_State* tolua_S) return 1; } +int lua_cocos2dx_Image_hasPremultipliedAlpha(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_hasPremultipliedAlpha'", 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_hasPremultipliedAlpha'", nullptr); + return 0; + } + bool ret = cobj->hasPremultipliedAlpha(); + tolua_pushboolean(tolua_S,(bool)ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Image:hasPremultipliedAlpha",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Image_hasPremultipliedAlpha'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_Image_saveToFile(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_saveToFile'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + std::string arg0; + + ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.Image:saveToFile"); + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Image_saveToFile'", nullptr); + return 0; + } + bool ret = cobj->saveToFile(arg0); + tolua_pushboolean(tolua_S,(bool)ret); + return 1; + } + if (argc == 2) + { + std::string arg0; + bool arg1; + + ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.Image:saveToFile"); + + ok &= luaval_to_boolean(tolua_S, 3,&arg1, "cc.Image:saveToFile"); + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Image_saveToFile'", nullptr); + return 0; + } + bool ret = cobj->saveToFile(arg0, arg1); + tolua_pushboolean(tolua_S,(bool)ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Image:saveToFile",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Image_saveToFile'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_Image_hasAlpha(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_hasAlpha'", 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_hasAlpha'", nullptr); + return 0; + } + bool ret = cobj->hasAlpha(); + tolua_pushboolean(tolua_S,(bool)ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Image:hasAlpha",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Image_hasAlpha'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_Image_isCompressed(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_isCompressed'", 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_isCompressed'", nullptr); + return 0; + } + bool ret = cobj->isCompressed(); + tolua_pushboolean(tolua_S,(bool)ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Image:isCompressed",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Image_isCompressed'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_Image_getHeight(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_getHeight'", 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_getHeight'", nullptr); + return 0; + } + int ret = cobj->getHeight(); + tolua_pushnumber(tolua_S,(lua_Number)ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Image:getHeight",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Image_getHeight'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_Image_initWithImageFile(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_initWithImageFile'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + std::string arg0; + + ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.Image:initWithImageFile"); + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Image_initWithImageFile'", nullptr); + return 0; + } + bool ret = cobj->initWithImageFile(arg0); + tolua_pushboolean(tolua_S,(bool)ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Image:initWithImageFile",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Image_initWithImageFile'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_Image_getWidth(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_getWidth'", 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_getWidth'", nullptr); + return 0; + } + int ret = cobj->getWidth(); + tolua_pushnumber(tolua_S,(lua_Number)ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Image:getWidth",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Image_getWidth'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_Image_getBitPerPixel(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_getBitPerPixel'", 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_getBitPerPixel'", nullptr); + return 0; + } + int ret = cobj->getBitPerPixel(); + tolua_pushnumber(tolua_S,(lua_Number)ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Image:getBitPerPixel",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Image_getBitPerPixel'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_Image_getFileType(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_getFileType'", 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_getFileType'", nullptr); + return 0; + } + int ret = (int)cobj->getFileType(); + tolua_pushnumber(tolua_S,(lua_Number)ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Image:getFileType",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Image_getFileType'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_Image_getNumberOfMipmaps(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_getNumberOfMipmaps'", 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_getNumberOfMipmaps'", nullptr); + return 0; + } + int ret = cobj->getNumberOfMipmaps(); + tolua_pushnumber(tolua_S,(lua_Number)ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Image:getNumberOfMipmaps",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Image_getNumberOfMipmaps'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_Image_getRenderFormat(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_getRenderFormat'", 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_getRenderFormat'", nullptr); + return 0; + } + int ret = (int)cobj->getRenderFormat(); + tolua_pushnumber(tolua_S,(lua_Number)ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Image:getRenderFormat",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Image_getRenderFormat'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_Image_setPVRImagesHavePremultipliedAlpha(lua_State* tolua_S) +{ + int argc = 0; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertable(tolua_S,1,"cc.Image",0,&tolua_err)) goto tolua_lerror; +#endif + + argc = lua_gettop(tolua_S) - 1; + + if (argc == 1) + { + bool arg0; + ok &= luaval_to_boolean(tolua_S, 2,&arg0, "cc.Image:setPVRImagesHavePremultipliedAlpha"); + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Image_setPVRImagesHavePremultipliedAlpha'", nullptr); + return 0; + } + cocos2d::Image::setPVRImagesHavePremultipliedAlpha(arg0); + lua_settop(tolua_S, 1); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d\n ", "cc.Image:setPVRImagesHavePremultipliedAlpha",argc, 1); + return 0; +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Image_setPVRImagesHavePremultipliedAlpha'.",&tolua_err); +#endif + return 0; +} +int lua_cocos2dx_Image_constructor(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Image* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Image_constructor'", nullptr); + return 0; + } + cobj = new cocos2d::Image(); + cobj->autorelease(); + int ID = (int)cobj->_ID ; + int* luaID = &cobj->_luaID ; + toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)cobj,"cc.Image"); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Image:Image",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Image_constructor'.",&tolua_err); +#endif + + return 0; +} + +static int lua_cocos2dx_Image_finalize(lua_State* tolua_S) +{ + printf("luabindings: finalizing LUA object (Image)"); + return 0; +} + +int lua_register_cocos2dx_Image(lua_State* tolua_S) +{ + tolua_usertype(tolua_S,"cc.Image"); + tolua_cclass(tolua_S,"Image","cc.Image","cc.Ref",nullptr); + + 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,"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,"initWithImageFile",lua_cocos2dx_Image_initWithImageFile); + tolua_function(tolua_S,"getWidth",lua_cocos2dx_Image_getWidth); + tolua_function(tolua_S,"getBitPerPixel",lua_cocos2dx_Image_getBitPerPixel); + tolua_function(tolua_S,"getFileType",lua_cocos2dx_Image_getFileType); + tolua_function(tolua_S,"getNumberOfMipmaps",lua_cocos2dx_Image_getNumberOfMipmaps); + tolua_function(tolua_S,"getRenderFormat",lua_cocos2dx_Image_getRenderFormat); + tolua_function(tolua_S,"setPVRImagesHavePremultipliedAlpha", lua_cocos2dx_Image_setPVRImagesHavePremultipliedAlpha); + tolua_endmodule(tolua_S); + std::string typeName = typeid(cocos2d::Image).name(); + g_luaType[typeName] = "cc.Image"; + g_typeCast["Image"] = "cc.Image"; + return 1; +} + +int lua_cocos2dx_PolygonInfo_getArea(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::PolygonInfo* 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.PolygonInfo",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::PolygonInfo*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_PolygonInfo_getArea'", 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_PolygonInfo_getArea'", nullptr); + return 0; + } + const float ret = cobj->getArea(); + tolua_pushnumber(tolua_S,(lua_Number)ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.PolygonInfo:getArea",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_PolygonInfo_getArea'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_PolygonInfo_getTriaglesCount(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::PolygonInfo* 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.PolygonInfo",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::PolygonInfo*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_PolygonInfo_getTriaglesCount'", 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_PolygonInfo_getTriaglesCount'", nullptr); + return 0; + } + const unsigned int ret = cobj->getTriaglesCount(); + tolua_pushnumber(tolua_S,(lua_Number)ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.PolygonInfo:getTriaglesCount",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_PolygonInfo_getTriaglesCount'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_PolygonInfo_getVertCount(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::PolygonInfo* 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.PolygonInfo",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::PolygonInfo*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_PolygonInfo_getVertCount'", 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_PolygonInfo_getVertCount'", nullptr); + return 0; + } + const unsigned int ret = cobj->getVertCount(); + tolua_pushnumber(tolua_S,(lua_Number)ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.PolygonInfo:getVertCount",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_PolygonInfo_getVertCount'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_PolygonInfo_setQuad(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::PolygonInfo* 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.PolygonInfo",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::PolygonInfo*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_PolygonInfo_setQuad'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + cocos2d::V3F_C4B_T2F_Quad* arg0; + + #pragma warning NO CONVERSION TO NATIVE FOR V3F_C4B_T2F_Quad* + ok = false; + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_PolygonInfo_setQuad'", nullptr); + return 0; + } + cobj->setQuad(arg0); + lua_settop(tolua_S, 1); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.PolygonInfo:setQuad",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_PolygonInfo_setQuad'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_PolygonInfo_constructor(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::PolygonInfo* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_PolygonInfo_constructor'", nullptr); + return 0; + } + cobj = new cocos2d::PolygonInfo(); + tolua_pushusertype(tolua_S,(void*)cobj,"cc.PolygonInfo"); + tolua_register_gc(tolua_S,lua_gettop(tolua_S)); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.PolygonInfo:PolygonInfo",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_PolygonInfo_constructor'.",&tolua_err); +#endif + + return 0; +} + +static int lua_cocos2dx_PolygonInfo_finalize(lua_State* tolua_S) +{ + printf("luabindings: finalizing LUA object (PolygonInfo)"); + return 0; +} + +int lua_register_cocos2dx_PolygonInfo(lua_State* tolua_S) +{ + tolua_usertype(tolua_S,"cc.PolygonInfo"); + tolua_cclass(tolua_S,"PolygonInfo","cc.PolygonInfo","",nullptr); + + tolua_beginmodule(tolua_S,"PolygonInfo"); + tolua_function(tolua_S,"new",lua_cocos2dx_PolygonInfo_constructor); + tolua_function(tolua_S,"getArea",lua_cocos2dx_PolygonInfo_getArea); + tolua_function(tolua_S,"getTriaglesCount",lua_cocos2dx_PolygonInfo_getTriaglesCount); + tolua_function(tolua_S,"getVertCount",lua_cocos2dx_PolygonInfo_getVertCount); + tolua_function(tolua_S,"setQuad",lua_cocos2dx_PolygonInfo_setQuad); + tolua_endmodule(tolua_S); + std::string typeName = typeid(cocos2d::PolygonInfo).name(); + g_luaType[typeName] = "cc.PolygonInfo"; + g_typeCast["PolygonInfo"] = "cc.PolygonInfo"; + return 1; +} + +int lua_cocos2dx_AutoPolygon_constructor(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::AutoPolygon* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + std::string arg0; + + ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.AutoPolygon:AutoPolygon"); + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_AutoPolygon_constructor'", nullptr); + return 0; + } + cobj = new cocos2d::AutoPolygon(arg0); + tolua_pushusertype(tolua_S,(void*)cobj,"cc.AutoPolygon"); + tolua_register_gc(tolua_S,lua_gettop(tolua_S)); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.AutoPolygon:AutoPolygon",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_AutoPolygon_constructor'.",&tolua_err); +#endif + + return 0; +} + +static int lua_cocos2dx_AutoPolygon_finalize(lua_State* tolua_S) +{ + printf("luabindings: finalizing LUA object (AutoPolygon)"); + return 0; +} + +int lua_register_cocos2dx_AutoPolygon(lua_State* tolua_S) +{ + tolua_usertype(tolua_S,"cc.AutoPolygon"); + tolua_cclass(tolua_S,"AutoPolygon","cc.AutoPolygon","",nullptr); + + tolua_beginmodule(tolua_S,"AutoPolygon"); + tolua_function(tolua_S,"new",lua_cocos2dx_AutoPolygon_constructor); + tolua_endmodule(tolua_S); + std::string typeName = typeid(cocos2d::AutoPolygon).name(); + g_luaType[typeName] = "cc.AutoPolygon"; + g_typeCast["AutoPolygon"] = "cc.AutoPolygon"; + return 1; +} + int lua_cocos2dx_Sprite_setSpriteFrame(lua_State* tolua_S) { int argc = 0; @@ -68853,6 +69806,56 @@ int lua_cocos2dx_Sprite_getTextureRect(lua_State* tolua_S) return 0; } +int lua_cocos2dx_Sprite_debugDraw(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Sprite* 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.Sprite",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_debugDraw'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + bool arg0; + + ok &= luaval_to_boolean(tolua_S, 2,&arg0, "cc.Sprite:debugDraw"); + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Sprite_debugDraw'", nullptr); + return 0; + } + cobj->debugDraw(arg0); + lua_settop(tolua_S, 1); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite:debugDraw",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_debugDraw'.",&tolua_err); +#endif + + return 0; +} int lua_cocos2dx_Sprite_initWithFile(lua_State* tolua_S) { int argc = 0; @@ -69203,209 +70206,6 @@ int lua_cocos2dx_Sprite_setVertexRect(lua_State* tolua_S) return 0; } -int lua_cocos2dx_Sprite_create(lua_State* tolua_S) -{ - int argc = 0; - bool ok = true; -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertable(tolua_S,1,"cc.Sprite",0,&tolua_err)) goto tolua_lerror; -#endif - - argc = lua_gettop(tolua_S)-1; - - do - { - if (argc == 1) - { - std::string arg0; - ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.Sprite:create"); - if (!ok) { break; } - cocos2d::Sprite* ret = cocos2d::Sprite::create(arg0); - object_to_luaval(tolua_S, "cc.Sprite",(cocos2d::Sprite*)ret); - return 1; - } - } while (0); - ok = true; - do - { - if (argc == 0) - { - cocos2d::Sprite* ret = cocos2d::Sprite::create(); - object_to_luaval(tolua_S, "cc.Sprite",(cocos2d::Sprite*)ret); - return 1; - } - } while (0); - ok = true; - do - { - if (argc == 2) - { - std::string arg0; - ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.Sprite:create"); - if (!ok) { break; } - cocos2d::Rect arg1; - ok &= luaval_to_rect(tolua_S, 3, &arg1, "cc.Sprite:create"); - if (!ok) { break; } - cocos2d::Sprite* ret = cocos2d::Sprite::create(arg0, arg1); - object_to_luaval(tolua_S, "cc.Sprite",(cocos2d::Sprite*)ret); - return 1; - } - } while (0); - ok = true; - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d", "cc.Sprite:create",argc, 2); - return 0; -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_create'.",&tolua_err); -#endif - return 0; -} -int lua_cocos2dx_Sprite_createWithTexture(lua_State* tolua_S) -{ - int argc = 0; - bool ok = true; -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertable(tolua_S,1,"cc.Sprite",0,&tolua_err)) goto tolua_lerror; -#endif - - argc = lua_gettop(tolua_S)-1; - - do - { - if (argc == 2) - { - cocos2d::Texture2D* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Texture2D",&arg0, "cc.Sprite:createWithTexture"); - if (!ok) { break; } - cocos2d::Rect arg1; - ok &= luaval_to_rect(tolua_S, 3, &arg1, "cc.Sprite:createWithTexture"); - if (!ok) { break; } - cocos2d::Sprite* ret = cocos2d::Sprite::createWithTexture(arg0, arg1); - object_to_luaval(tolua_S, "cc.Sprite",(cocos2d::Sprite*)ret); - return 1; - } - } while (0); - ok = true; - do - { - if (argc == 3) - { - cocos2d::Texture2D* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Texture2D",&arg0, "cc.Sprite:createWithTexture"); - if (!ok) { break; } - cocos2d::Rect arg1; - ok &= luaval_to_rect(tolua_S, 3, &arg1, "cc.Sprite:createWithTexture"); - if (!ok) { break; } - bool arg2; - ok &= luaval_to_boolean(tolua_S, 4,&arg2, "cc.Sprite:createWithTexture"); - if (!ok) { break; } - cocos2d::Sprite* ret = cocos2d::Sprite::createWithTexture(arg0, arg1, arg2); - object_to_luaval(tolua_S, "cc.Sprite",(cocos2d::Sprite*)ret); - return 1; - } - } while (0); - ok = true; - do - { - if (argc == 1) - { - cocos2d::Texture2D* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Texture2D",&arg0, "cc.Sprite:createWithTexture"); - if (!ok) { break; } - cocos2d::Sprite* ret = cocos2d::Sprite::createWithTexture(arg0); - object_to_luaval(tolua_S, "cc.Sprite",(cocos2d::Sprite*)ret); - return 1; - } - } while (0); - ok = true; - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d", "cc.Sprite:createWithTexture",argc, 1); - return 0; -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_createWithTexture'.",&tolua_err); -#endif - return 0; -} -int lua_cocos2dx_Sprite_createWithSpriteFrameName(lua_State* tolua_S) -{ - int argc = 0; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertable(tolua_S,1,"cc.Sprite",0,&tolua_err)) goto tolua_lerror; -#endif - - argc = lua_gettop(tolua_S) - 1; - - if (argc == 1) - { - std::string arg0; - ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.Sprite:createWithSpriteFrameName"); - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Sprite_createWithSpriteFrameName'", nullptr); - return 0; - } - cocos2d::Sprite* ret = cocos2d::Sprite::createWithSpriteFrameName(arg0); - object_to_luaval(tolua_S, "cc.Sprite",(cocos2d::Sprite*)ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d\n ", "cc.Sprite:createWithSpriteFrameName",argc, 1); - return 0; -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_createWithSpriteFrameName'.",&tolua_err); -#endif - return 0; -} -int lua_cocos2dx_Sprite_createWithSpriteFrame(lua_State* tolua_S) -{ - int argc = 0; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertable(tolua_S,1,"cc.Sprite",0,&tolua_err)) goto tolua_lerror; -#endif - - argc = lua_gettop(tolua_S) - 1; - - if (argc == 1) - { - cocos2d::SpriteFrame* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.SpriteFrame",&arg0, "cc.Sprite:createWithSpriteFrame"); - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Sprite_createWithSpriteFrame'", nullptr); - return 0; - } - cocos2d::Sprite* ret = cocos2d::Sprite::createWithSpriteFrame(arg0); - object_to_luaval(tolua_S, "cc.Sprite",(cocos2d::Sprite*)ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d\n ", "cc.Sprite:createWithSpriteFrame",argc, 1); - return 0; -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_createWithSpriteFrame'.",&tolua_err); -#endif - return 0; -} int lua_cocos2dx_Sprite_constructor(lua_State* tolua_S) { int argc = 0; @@ -69479,6 +70279,7 @@ int lua_register_cocos2dx_Sprite(lua_State* tolua_S) tolua_function(tolua_S,"setDirty",lua_cocos2dx_Sprite_setDirty); tolua_function(tolua_S,"isTextureRectRotated",lua_cocos2dx_Sprite_isTextureRectRotated); tolua_function(tolua_S,"getTextureRect",lua_cocos2dx_Sprite_getTextureRect); + tolua_function(tolua_S,"debugDraw",lua_cocos2dx_Sprite_debugDraw); tolua_function(tolua_S,"initWithFile",lua_cocos2dx_Sprite_initWithFile); tolua_function(tolua_S,"setBlendFunc",lua_cocos2dx_Sprite_setBlendFunc); tolua_function(tolua_S,"getTextureAtlas",lua_cocos2dx_Sprite_getTextureAtlas); @@ -69486,10 +70287,6 @@ int lua_register_cocos2dx_Sprite(lua_State* tolua_S) tolua_function(tolua_S,"isFlippedX",lua_cocos2dx_Sprite_isFlippedX); tolua_function(tolua_S,"isFlippedY",lua_cocos2dx_Sprite_isFlippedY); tolua_function(tolua_S,"setVertexRect",lua_cocos2dx_Sprite_setVertexRect); - tolua_function(tolua_S,"create", lua_cocos2dx_Sprite_create); - tolua_function(tolua_S,"createWithTexture", lua_cocos2dx_Sprite_createWithTexture); - tolua_function(tolua_S,"createWithSpriteFrameName", lua_cocos2dx_Sprite_createWithSpriteFrameName); - tolua_function(tolua_S,"createWithSpriteFrame", lua_cocos2dx_Sprite_createWithSpriteFrame); tolua_endmodule(tolua_S); std::string typeName = typeid(cocos2d::Sprite).name(); g_luaType[typeName] = "cc.Sprite"; @@ -69497,651 +70294,6 @@ int lua_register_cocos2dx_Sprite(lua_State* tolua_S) return 1; } -int lua_cocos2dx_Image_hasPremultipliedAlpha(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_hasPremultipliedAlpha'", 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_hasPremultipliedAlpha'", nullptr); - return 0; - } - bool ret = cobj->hasPremultipliedAlpha(); - tolua_pushboolean(tolua_S,(bool)ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Image:hasPremultipliedAlpha",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Image_hasPremultipliedAlpha'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_Image_saveToFile(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_saveToFile'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 1) - { - std::string arg0; - - ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.Image:saveToFile"); - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Image_saveToFile'", nullptr); - return 0; - } - bool ret = cobj->saveToFile(arg0); - tolua_pushboolean(tolua_S,(bool)ret); - return 1; - } - if (argc == 2) - { - std::string arg0; - bool arg1; - - ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.Image:saveToFile"); - - ok &= luaval_to_boolean(tolua_S, 3,&arg1, "cc.Image:saveToFile"); - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Image_saveToFile'", nullptr); - return 0; - } - bool ret = cobj->saveToFile(arg0, arg1); - tolua_pushboolean(tolua_S,(bool)ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Image:saveToFile",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Image_saveToFile'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_Image_hasAlpha(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_hasAlpha'", 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_hasAlpha'", nullptr); - return 0; - } - bool ret = cobj->hasAlpha(); - tolua_pushboolean(tolua_S,(bool)ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Image:hasAlpha",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Image_hasAlpha'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_Image_isCompressed(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_isCompressed'", 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_isCompressed'", nullptr); - return 0; - } - bool ret = cobj->isCompressed(); - tolua_pushboolean(tolua_S,(bool)ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Image:isCompressed",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Image_isCompressed'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_Image_getHeight(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_getHeight'", 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_getHeight'", nullptr); - return 0; - } - int ret = cobj->getHeight(); - tolua_pushnumber(tolua_S,(lua_Number)ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Image:getHeight",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Image_getHeight'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_Image_initWithImageFile(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_initWithImageFile'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 1) - { - std::string arg0; - - ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.Image:initWithImageFile"); - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Image_initWithImageFile'", nullptr); - return 0; - } - bool ret = cobj->initWithImageFile(arg0); - tolua_pushboolean(tolua_S,(bool)ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Image:initWithImageFile",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Image_initWithImageFile'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_Image_getWidth(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_getWidth'", 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_getWidth'", nullptr); - return 0; - } - int ret = cobj->getWidth(); - tolua_pushnumber(tolua_S,(lua_Number)ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Image:getWidth",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Image_getWidth'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_Image_getBitPerPixel(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_getBitPerPixel'", 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_getBitPerPixel'", nullptr); - return 0; - } - int ret = cobj->getBitPerPixel(); - tolua_pushnumber(tolua_S,(lua_Number)ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Image:getBitPerPixel",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Image_getBitPerPixel'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_Image_getFileType(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_getFileType'", 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_getFileType'", nullptr); - return 0; - } - int ret = (int)cobj->getFileType(); - tolua_pushnumber(tolua_S,(lua_Number)ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Image:getFileType",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Image_getFileType'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_Image_getNumberOfMipmaps(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_getNumberOfMipmaps'", 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_getNumberOfMipmaps'", nullptr); - return 0; - } - int ret = cobj->getNumberOfMipmaps(); - tolua_pushnumber(tolua_S,(lua_Number)ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Image:getNumberOfMipmaps",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Image_getNumberOfMipmaps'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_Image_getRenderFormat(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_getRenderFormat'", 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_getRenderFormat'", nullptr); - return 0; - } - int ret = (int)cobj->getRenderFormat(); - tolua_pushnumber(tolua_S,(lua_Number)ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Image:getRenderFormat",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Image_getRenderFormat'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_Image_setPVRImagesHavePremultipliedAlpha(lua_State* tolua_S) -{ - int argc = 0; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertable(tolua_S,1,"cc.Image",0,&tolua_err)) goto tolua_lerror; -#endif - - argc = lua_gettop(tolua_S) - 1; - - if (argc == 1) - { - bool arg0; - ok &= luaval_to_boolean(tolua_S, 2,&arg0, "cc.Image:setPVRImagesHavePremultipliedAlpha"); - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Image_setPVRImagesHavePremultipliedAlpha'", nullptr); - return 0; - } - cocos2d::Image::setPVRImagesHavePremultipliedAlpha(arg0); - lua_settop(tolua_S, 1); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d\n ", "cc.Image:setPVRImagesHavePremultipliedAlpha",argc, 1); - return 0; -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Image_setPVRImagesHavePremultipliedAlpha'.",&tolua_err); -#endif - return 0; -} -int lua_cocos2dx_Image_constructor(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::Image* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - - - argc = lua_gettop(tolua_S)-1; - if (argc == 0) - { - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Image_constructor'", nullptr); - return 0; - } - cobj = new cocos2d::Image(); - cobj->autorelease(); - int ID = (int)cobj->_ID ; - int* luaID = &cobj->_luaID ; - toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)cobj,"cc.Image"); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Image:Image",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Image_constructor'.",&tolua_err); -#endif - - return 0; -} - -static int lua_cocos2dx_Image_finalize(lua_State* tolua_S) -{ - printf("luabindings: finalizing LUA object (Image)"); - return 0; -} - -int lua_register_cocos2dx_Image(lua_State* tolua_S) -{ - tolua_usertype(tolua_S,"cc.Image"); - tolua_cclass(tolua_S,"Image","cc.Image","cc.Ref",nullptr); - - 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,"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,"initWithImageFile",lua_cocos2dx_Image_initWithImageFile); - tolua_function(tolua_S,"getWidth",lua_cocos2dx_Image_getWidth); - tolua_function(tolua_S,"getBitPerPixel",lua_cocos2dx_Image_getBitPerPixel); - tolua_function(tolua_S,"getFileType",lua_cocos2dx_Image_getFileType); - tolua_function(tolua_S,"getNumberOfMipmaps",lua_cocos2dx_Image_getNumberOfMipmaps); - tolua_function(tolua_S,"getRenderFormat",lua_cocos2dx_Image_getRenderFormat); - tolua_function(tolua_S,"setPVRImagesHavePremultipliedAlpha", lua_cocos2dx_Image_setPVRImagesHavePremultipliedAlpha); - tolua_endmodule(tolua_S); - std::string typeName = typeid(cocos2d::Image).name(); - g_luaType[typeName] = "cc.Image"; - g_typeCast["Image"] = "cc.Image"; - return 1; -} - int lua_cocos2dx_RenderTexture_setVirtualViewport(lua_State* tolua_S) { int argc = 0; @@ -91952,303 +92104,6 @@ int lua_register_cocos2dx_Component(lua_State* tolua_S) g_typeCast["Component"] = "cc.Component"; return 1; } - -int lua_cocos2dx_SpritePolygonCache_isSpritePolygonCachExist(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::SpritePolygonCache* 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.SpritePolygonCache",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::SpritePolygonCache*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_SpritePolygonCache_isSpritePolygonCachExist'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 2) - { - std::string arg0; - cocos2d::Rect arg1; - - ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.SpritePolygonCache:isSpritePolygonCachExist"); - - ok &= luaval_to_rect(tolua_S, 3, &arg1, "cc.SpritePolygonCache:isSpritePolygonCachExist"); - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_SpritePolygonCache_isSpritePolygonCachExist'", nullptr); - return 0; - } - bool ret = cobj->isSpritePolygonCachExist(arg0, arg1); - tolua_pushboolean(tolua_S,(bool)ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.SpritePolygonCache:isSpritePolygonCachExist",argc, 2); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_SpritePolygonCache_isSpritePolygonCachExist'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_SpritePolygonCache_removeAllSpritePolygonCache(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::SpritePolygonCache* 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.SpritePolygonCache",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::SpritePolygonCache*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_SpritePolygonCache_removeAllSpritePolygonCache'", 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_SpritePolygonCache_removeAllSpritePolygonCache'", nullptr); - return 0; - } - cobj->removeAllSpritePolygonCache(); - lua_settop(tolua_S, 1); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.SpritePolygonCache:removeAllSpritePolygonCache",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_SpritePolygonCache_removeAllSpritePolygonCache'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_SpritePolygonCache_removeSpritePolygonCache(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::SpritePolygonCache* 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.SpritePolygonCache",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::SpritePolygonCache*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_SpritePolygonCache_removeSpritePolygonCache'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 1) - { - std::string arg0; - - ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.SpritePolygonCache:removeSpritePolygonCache"); - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_SpritePolygonCache_removeSpritePolygonCache'", nullptr); - return 0; - } - cobj->removeSpritePolygonCache(arg0); - lua_settop(tolua_S, 1); - return 1; - } - if (argc == 2) - { - std::string arg0; - const cocos2d::Rect* arg1; - - ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.SpritePolygonCache:removeSpritePolygonCache"); - - ok &= luaval_to_object(tolua_S, 3, "cc.Rect",&arg1, "cc.SpritePolygonCache:removeSpritePolygonCache"); - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_SpritePolygonCache_removeSpritePolygonCache'", nullptr); - return 0; - } - cobj->removeSpritePolygonCache(arg0, arg1); - lua_settop(tolua_S, 1); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.SpritePolygonCache:removeSpritePolygonCache",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_SpritePolygonCache_removeSpritePolygonCache'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_SpritePolygonCache_destroyInstance(lua_State* tolua_S) -{ - int argc = 0; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertable(tolua_S,1,"cc.SpritePolygonCache",0,&tolua_err)) goto tolua_lerror; -#endif - - argc = lua_gettop(tolua_S) - 1; - - if (argc == 0) - { - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_SpritePolygonCache_destroyInstance'", nullptr); - return 0; - } - cocos2d::SpritePolygonCache::destroyInstance(); - lua_settop(tolua_S, 1); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d\n ", "cc.SpritePolygonCache:destroyInstance",argc, 0); - return 0; -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_SpritePolygonCache_destroyInstance'.",&tolua_err); -#endif - return 0; -} -int lua_cocos2dx_SpritePolygonCache_printInfo(lua_State* tolua_S) -{ - int argc = 0; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertable(tolua_S,1,"cc.SpritePolygonCache",0,&tolua_err)) goto tolua_lerror; -#endif - - argc = lua_gettop(tolua_S) - 1; - - if (argc == 1) - { - cocos2d::_SpritePolygonInfo arg0; - #pragma warning NO CONVERSION TO NATIVE FOR _SpritePolygonInfo - ok = false; - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_SpritePolygonCache_printInfo'", nullptr); - return 0; - } - cocos2d::SpritePolygonCache::printInfo(arg0); - lua_settop(tolua_S, 1); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d\n ", "cc.SpritePolygonCache:printInfo",argc, 1); - return 0; -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_SpritePolygonCache_printInfo'.",&tolua_err); -#endif - return 0; -} -int lua_cocos2dx_SpritePolygonCache_getInstance(lua_State* tolua_S) -{ - int argc = 0; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertable(tolua_S,1,"cc.SpritePolygonCache",0,&tolua_err)) goto tolua_lerror; -#endif - - argc = lua_gettop(tolua_S) - 1; - - if (argc == 0) - { - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_SpritePolygonCache_getInstance'", nullptr); - return 0; - } - cocos2d::SpritePolygonCache* ret = cocos2d::SpritePolygonCache::getInstance(); - object_to_luaval(tolua_S, "cc.SpritePolygonCache",(cocos2d::SpritePolygonCache*)ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d\n ", "cc.SpritePolygonCache:getInstance",argc, 0); - return 0; -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_SpritePolygonCache_getInstance'.",&tolua_err); -#endif - return 0; -} -static int lua_cocos2dx_SpritePolygonCache_finalize(lua_State* tolua_S) -{ - printf("luabindings: finalizing LUA object (SpritePolygonCache)"); - return 0; -} - -int lua_register_cocos2dx_SpritePolygonCache(lua_State* tolua_S) -{ - tolua_usertype(tolua_S,"cc.SpritePolygonCache"); - tolua_cclass(tolua_S,"SpritePolygonCache","cc.SpritePolygonCache","cc.Ref",nullptr); - - tolua_beginmodule(tolua_S,"SpritePolygonCache"); - tolua_function(tolua_S,"isSpritePolygonCachExist",lua_cocos2dx_SpritePolygonCache_isSpritePolygonCachExist); - tolua_function(tolua_S,"removeAllSpritePolygonCache",lua_cocos2dx_SpritePolygonCache_removeAllSpritePolygonCache); - tolua_function(tolua_S,"removeSpritePolygonCache",lua_cocos2dx_SpritePolygonCache_removeSpritePolygonCache); - tolua_function(tolua_S,"destroyInstance", lua_cocos2dx_SpritePolygonCache_destroyInstance); - tolua_function(tolua_S,"printInfo", lua_cocos2dx_SpritePolygonCache_printInfo); - tolua_function(tolua_S,"getInstance", lua_cocos2dx_SpritePolygonCache_getInstance); - tolua_endmodule(tolua_S); - std::string typeName = typeid(cocos2d::SpritePolygonCache).name(); - g_luaType[typeName] = "cc.SpritePolygonCache"; - g_typeCast["SpritePolygonCache"] = "cc.SpritePolygonCache"; - return 1; -} TOLUA_API int register_all_cocos2dx(lua_State* tolua_S) { tolua_open(tolua_S); @@ -92354,6 +92209,7 @@ TOLUA_API int register_all_cocos2dx(lua_State* tolua_S) lua_register_cocos2dx_Application(tolua_S); lua_register_cocos2dx_DelayTime(tolua_S); lua_register_cocos2dx_LabelAtlas(tolua_S); + lua_register_cocos2dx_TMXLayer(tolua_S); lua_register_cocos2dx_AsyncTaskPool(tolua_S); lua_register_cocos2dx_ParticleSnow(tolua_S); lua_register_cocos2dx_EaseElasticIn(tolua_S); @@ -92368,7 +92224,7 @@ TOLUA_API int register_all_cocos2dx(lua_State* tolua_S) lua_register_cocos2dx_ParticleSun(tolua_S); lua_register_cocos2dx_TransitionProgressHorizontal(tolua_S); lua_register_cocos2dx_TMXObjectGroup(tolua_S); - lua_register_cocos2dx_TMXLayer(tolua_S); + lua_register_cocos2dx_AutoPolygon(tolua_S); lua_register_cocos2dx_FlipX(tolua_S); lua_register_cocos2dx_FlipY(tolua_S); lua_register_cocos2dx_EventKeyboard(tolua_S); @@ -92448,10 +92304,10 @@ TOLUA_API int register_all_cocos2dx(lua_State* tolua_S) lua_register_cocos2dx_EaseQuarticActionInOut(tolua_S); lua_register_cocos2dx_ShakyTiles3D(tolua_S); lua_register_cocos2dx_PageTurn3D(tolua_S); + lua_register_cocos2dx_PolygonInfo(tolua_S); lua_register_cocos2dx_TransitionSlideInL(tolua_S); lua_register_cocos2dx_TransitionSlideInT(tolua_S); lua_register_cocos2dx_Grid3D(tolua_S); - lua_register_cocos2dx_SpritePolygonCache(tolua_S); lua_register_cocos2dx_EaseCircleActionOut(tolua_S); lua_register_cocos2dx_TransitionProgressInOut(tolua_S); lua_register_cocos2dx_EaseCubicActionInOut(tolua_S); diff --git a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.hpp b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.hpp index 1e4d4890e0..5bf82ddefb 100644 --- a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.hpp +++ b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.hpp @@ -2056,8 +2056,6 @@ int register_all_cocos2dx(lua_State* tolua_S); - - diff --git a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_experimental_auto.cpp b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_experimental_auto.cpp index 0a80669d0e..5645e1fef7 100644 --- a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_experimental_auto.cpp +++ b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_experimental_auto.cpp @@ -1,7 +1,6 @@ #include "lua_cocos2dx_experimental_auto.hpp" #include "CCFastTMXLayer.h" #include "CCFastTMXTiledMap.h" -#include "SpritePolygon.h" #include "tolua_fix.h" #include "LuaBasicConversions.h" @@ -1869,430 +1868,6 @@ int lua_register_cocos2dx_experimental_TMXTiledMap(lua_State* tolua_S) g_typeCast["TMXTiledMap"] = "ccexp.TMXTiledMap"; return 1; } - -int lua_cocos2dx_experimental_SpritePolygon_setTexture(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::experimental::SpritePolygon* cobj = nullptr; - bool ok = true; -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"ccexp.SpritePolygon",0,&tolua_err)) goto tolua_lerror; -#endif - cobj = (cocos2d::experimental::SpritePolygon*)tolua_tousertype(tolua_S,1,0); -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_experimental_SpritePolygon_setTexture'", nullptr); - return 0; - } -#endif - argc = lua_gettop(tolua_S)-1; - do{ - if (argc == 1) { - cocos2d::Texture2D* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Texture2D",&arg0, "ccexp.SpritePolygon:setTexture"); - - if (!ok) { break; } - cobj->setTexture(arg0); - lua_settop(tolua_S, 1); - return 1; - } - }while(0); - ok = true; - do{ - if (argc == 1) { - std::string arg0; - ok &= luaval_to_std_string(tolua_S, 2,&arg0, "ccexp.SpritePolygon:setTexture"); - - if (!ok) { break; } - cobj->setTexture(arg0); - lua_settop(tolua_S, 1); - return 1; - } - }while(0); - ok = true; - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "ccexp.SpritePolygon:setTexture",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_experimental_SpritePolygon_setTexture'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_experimental_SpritePolygon_initWithTexture(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::experimental::SpritePolygon* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"ccexp.SpritePolygon",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::experimental::SpritePolygon*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_experimental_SpritePolygon_initWithTexture'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 1) - { - cocos2d::Texture2D* arg0; - - ok &= luaval_to_object(tolua_S, 2, "cc.Texture2D",&arg0, "ccexp.SpritePolygon:initWithTexture"); - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_experimental_SpritePolygon_initWithTexture'", nullptr); - return 0; - } - bool ret = cobj->initWithTexture(arg0); - tolua_pushboolean(tolua_S,(bool)ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "ccexp.SpritePolygon:initWithTexture",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_experimental_SpritePolygon_initWithTexture'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_experimental_SpritePolygon_showDebug(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::experimental::SpritePolygon* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"ccexp.SpritePolygon",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::experimental::SpritePolygon*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_experimental_SpritePolygon_showDebug'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 1) - { - bool arg0; - - ok &= luaval_to_boolean(tolua_S, 2,&arg0, "ccexp.SpritePolygon:showDebug"); - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_experimental_SpritePolygon_showDebug'", nullptr); - return 0; - } - cobj->showDebug(arg0); - lua_settop(tolua_S, 1); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "ccexp.SpritePolygon:showDebug",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_experimental_SpritePolygon_showDebug'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_experimental_SpritePolygon_getTexture(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::experimental::SpritePolygon* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"ccexp.SpritePolygon",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::experimental::SpritePolygon*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_experimental_SpritePolygon_getTexture'", 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_experimental_SpritePolygon_getTexture'", nullptr); - return 0; - } - cocos2d::Texture2D* ret = cobj->getTexture(); - object_to_luaval(tolua_S, "cc.Texture2D",(cocos2d::Texture2D*)ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "ccexp.SpritePolygon:getTexture",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_experimental_SpritePolygon_getTexture'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_experimental_SpritePolygon_getArea(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::experimental::SpritePolygon* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"ccexp.SpritePolygon",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::experimental::SpritePolygon*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_experimental_SpritePolygon_getArea'", 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_experimental_SpritePolygon_getArea'", nullptr); - return 0; - } - const float ret = cobj->getArea(); - tolua_pushnumber(tolua_S,(lua_Number)ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "ccexp.SpritePolygon:getArea",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_experimental_SpritePolygon_getArea'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_experimental_SpritePolygon_initWithCache(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::experimental::SpritePolygon* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"ccexp.SpritePolygon",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::experimental::SpritePolygon*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_experimental_SpritePolygon_initWithCache'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 2) - { - std::string arg0; - cocos2d::_SpritePolygonInfo* arg1; - - ok &= luaval_to_std_string(tolua_S, 2,&arg0, "ccexp.SpritePolygon:initWithCache"); - - #pragma warning NO CONVERSION TO NATIVE FOR _SpritePolygonInfo* - ok = false; - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_experimental_SpritePolygon_initWithCache'", nullptr); - return 0; - } - bool ret = cobj->initWithCache(arg0, arg1); - tolua_pushboolean(tolua_S,(bool)ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "ccexp.SpritePolygon:initWithCache",argc, 2); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_experimental_SpritePolygon_initWithCache'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_experimental_SpritePolygon_getVertCount(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::experimental::SpritePolygon* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"ccexp.SpritePolygon",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::experimental::SpritePolygon*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_experimental_SpritePolygon_getVertCount'", 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_experimental_SpritePolygon_getVertCount'", nullptr); - return 0; - } - const ssize_t ret = cobj->getVertCount(); - tolua_pushnumber(tolua_S,(lua_Number)ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "ccexp.SpritePolygon:getVertCount",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_experimental_SpritePolygon_getVertCount'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_experimental_SpritePolygon_getTrianglesCount(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::experimental::SpritePolygon* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"ccexp.SpritePolygon",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::experimental::SpritePolygon*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_experimental_SpritePolygon_getTrianglesCount'", 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_experimental_SpritePolygon_getTrianglesCount'", nullptr); - return 0; - } - const ssize_t ret = cobj->getTrianglesCount(); - tolua_pushnumber(tolua_S,(lua_Number)ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "ccexp.SpritePolygon:getTrianglesCount",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_experimental_SpritePolygon_getTrianglesCount'.",&tolua_err); -#endif - - return 0; -} -static int lua_cocos2dx_experimental_SpritePolygon_finalize(lua_State* tolua_S) -{ - printf("luabindings: finalizing LUA object (SpritePolygon)"); - return 0; -} - -int lua_register_cocos2dx_experimental_SpritePolygon(lua_State* tolua_S) -{ - tolua_usertype(tolua_S,"ccexp.SpritePolygon"); - tolua_cclass(tolua_S,"SpritePolygon","ccexp.SpritePolygon","cc.Node",nullptr); - - tolua_beginmodule(tolua_S,"SpritePolygon"); - tolua_function(tolua_S,"setTexture",lua_cocos2dx_experimental_SpritePolygon_setTexture); - tolua_function(tolua_S,"initWithTexture",lua_cocos2dx_experimental_SpritePolygon_initWithTexture); - tolua_function(tolua_S,"showDebug",lua_cocos2dx_experimental_SpritePolygon_showDebug); - tolua_function(tolua_S,"getTexture",lua_cocos2dx_experimental_SpritePolygon_getTexture); - tolua_function(tolua_S,"getArea",lua_cocos2dx_experimental_SpritePolygon_getArea); - tolua_function(tolua_S,"initWithCache",lua_cocos2dx_experimental_SpritePolygon_initWithCache); - tolua_function(tolua_S,"getVertCount",lua_cocos2dx_experimental_SpritePolygon_getVertCount); - tolua_function(tolua_S,"getTrianglesCount",lua_cocos2dx_experimental_SpritePolygon_getTrianglesCount); - tolua_endmodule(tolua_S); - std::string typeName = typeid(cocos2d::experimental::SpritePolygon).name(); - g_luaType[typeName] = "ccexp.SpritePolygon"; - g_typeCast["SpritePolygon"] = "ccexp.SpritePolygon"; - return 1; -} TOLUA_API int register_all_cocos2dx_experimental(lua_State* tolua_S) { tolua_open(tolua_S); @@ -2301,7 +1876,6 @@ TOLUA_API int register_all_cocos2dx_experimental(lua_State* tolua_S) tolua_beginmodule(tolua_S,"ccexp"); lua_register_cocos2dx_experimental_TMXTiledMap(tolua_S); - lua_register_cocos2dx_experimental_SpritePolygon(tolua_S); lua_register_cocos2dx_experimental_TMXLayer(tolua_S); tolua_endmodule(tolua_S); diff --git a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_experimental_auto.hpp b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_experimental_auto.hpp index 1043d5d1dc..1510f395f7 100644 --- a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_experimental_auto.hpp +++ b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_experimental_auto.hpp @@ -41,15 +41,6 @@ int register_all_cocos2dx_experimental(lua_State* tolua_S); - - - - - - - - -