From 09cbc2145d00ed0284ccf2dca0f26406ba749e99 Mon Sep 17 00:00:00 2001 From: CocosRobot Date: Wed, 28 Oct 2015 03:29:16 +0000 Subject: [PATCH] [ci skip][AUTO]: updating luabinding & jsbinding automatically --- .../auto/api/jsb_cocos2dx_auto_api.js | 1252 ++-- .../js-bindings/auto/jsb_cocos2dx_auto.cpp | 3578 +++++----- .../js-bindings/auto/jsb_cocos2dx_auto.hpp | 146 +- .../lua-bindings/auto/api/SpriteFrame.lua | 154 +- .../auto/api/lua_cocos2dx_auto_api.lua | 40 +- .../lua-bindings/auto/lua_cocos2dx_auto.cpp | 5984 ++++++++--------- 6 files changed, 5577 insertions(+), 5577 deletions(-) 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 f5e11ecfcf..71ea0c5668 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 @@ -3639,30 +3639,541 @@ Follow : function ( }; /** - * @class SpriteFrame + * @class Image */ -cc.SpriteFrame = { +cc.Image = { /** - * @method clone - * @return {cc.SpriteFrame} + * @method hasPremultipliedAlpha + * @return {bool} */ -clone : function ( +hasPremultipliedAlpha : function ( ) { - return cc.SpriteFrame; + return false; }, /** - * @method setRotated + * @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 */ -setRotated : function ( +setPVRImagesHavePremultipliedAlpha : function ( bool ) { }, +/** + * @method Image + * @constructor + */ +Image : function ( +) +{ +}, + +}; + +/** + * @class GLProgramState + */ +cc.GLProgramState = { + +/** + * @method setUniformCallback +* @param {int|String} int +* @param {function|function} func +*/ +setUniformCallback : function( +str, +func +) +{ +}, + +/** + * @method getVertexAttribsFlags + * @return {unsigned int} + */ +getVertexAttribsFlags : function ( +) +{ + return 0; +}, + +/** + * @method applyAutoBinding + * @param {String} arg0 + * @param {String} arg1 + */ +applyAutoBinding : function ( +str, +str +) +{ +}, + +/** + * @method setUniformVec2 +* @param {int|String} int +* @param {vec2_object|vec2_object} vec2 +*/ +setUniformVec2 : function( +str, +vec2 +) +{ +}, + +/** + * @method setUniformVec3 +* @param {int|String} int +* @param {vec3_object|vec3_object} vec3 +*/ +setUniformVec3 : function( +str, +vec3 +) +{ +}, + +/** + * @method setVertexAttribCallback + * @param {String} arg0 + * @param {function} arg1 + */ +setVertexAttribCallback : function ( +str, +func +) +{ +}, + +/** + * @method apply + * @param {mat4_object} arg0 + */ +apply : function ( +mat4 +) +{ +}, + +/** + * @method getNodeBinding + * @return {cc.Node} + */ +getNodeBinding : function ( +) +{ + return cc.Node; +}, + +/** + * @method applyGLProgram + * @param {mat4_object} arg0 + */ +applyGLProgram : function ( +mat4 +) +{ +}, + +/** + * @method setNodeBinding + * @param {cc.Node} arg0 + */ +setNodeBinding : function ( +node +) +{ +}, + +/** + * @method setUniformInt +* @param {int|String} int +* @param {int|int} int +*/ +setUniformInt : function( +str, +int +) +{ +}, + +/** + * @method setParameterAutoBinding + * @param {String} arg0 + * @param {String} arg1 + */ +setParameterAutoBinding : function ( +str, +str +) +{ +}, + +/** + * @method setUniformVec2v +* @param {int|String} int +* @param {long|long} long +* @param {vec2_object|vec2_object} vec2 +*/ +setUniformVec2v : function( +str, +long, +vec2 +) +{ +}, + +/** + * @method getUniformCount + * @return {long} + */ +getUniformCount : function ( +) +{ + return 0; +}, + +/** + * @method applyAttributes + */ +applyAttributes : function ( +) +{ +}, + +/** + * @method clone + * @return {cc.GLProgramState} + */ +clone : function ( +) +{ + return cc.GLProgramState; +}, + +/** + * @method setGLProgram + * @param {cc.GLProgram} arg0 + */ +setGLProgram : function ( +glprogram +) +{ +}, + +/** + * @method setUniformFloatv +* @param {int|String} int +* @param {long|long} long +* @param {float|float} float +*/ +setUniformFloatv : function( +str, +long, +float +) +{ +}, + +/** + * @method getGLProgram + * @return {cc.GLProgram} + */ +getGLProgram : function ( +) +{ + return cc.GLProgram; +}, + +/** + * @method setUniformTexture +* @param {String|String|int|int} str +* @param {unsigned int|cc.Texture2D|cc.Texture2D|unsigned int} int +*/ +setUniformTexture : function( +int, +int +) +{ +}, + +/** + * @method applyUniforms + */ +applyUniforms : function ( +) +{ +}, + +/** + * @method setUniformFloat +* @param {int|String} int +* @param {float|float} float +*/ +setUniformFloat : function( +str, +float +) +{ +}, + +/** + * @method setUniformMat4 +* @param {int|String} int +* @param {mat4_object|mat4_object} mat4 +*/ +setUniformMat4 : function( +str, +mat4 +) +{ +}, + +/** + * @method setUniformVec3v +* @param {int|String} int +* @param {long|long} long +* @param {vec3_object|vec3_object} vec3 +*/ +setUniformVec3v : function( +str, +long, +vec3 +) +{ +}, + +/** + * @method getVertexAttribCount + * @return {long} + */ +getVertexAttribCount : function ( +) +{ + return 0; +}, + +/** + * @method create + * @param {cc.GLProgram} arg0 + * @return {cc.GLProgramState} + */ +create : function ( +glprogram +) +{ + return cc.GLProgramState; +}, + +/** + * @method getOrCreateWithGLProgramName + * @param {String} arg0 + * @return {cc.GLProgramState} + */ +getOrCreateWithGLProgramName : function ( +str +) +{ + return cc.GLProgramState; +}, + +/** + * @method getOrCreateWithGLProgram + * @param {cc.GLProgram} arg0 + * @return {cc.GLProgramState} + */ +getOrCreateWithGLProgram : function ( +glprogram +) +{ + return cc.GLProgramState; +}, + +/** + * @method getOrCreateWithShaders + * @param {String} arg0 + * @param {String} arg1 + * @param {String} arg2 + * @return {cc.GLProgramState} + */ +getOrCreateWithShaders : function ( +str, +str, +str +) +{ + return cc.GLProgramState; +}, + +}; + +/** + * @class SpriteFrame + */ +cc.SpriteFrame = { + /** * @method setTexture * @param {cc.Texture2D} arg0 @@ -3673,26 +4184,6 @@ texture2d { }, -/** - * @method getOffset - * @return {vec2_object} - */ -getOffset : function ( -) -{ - return cc.Vec2; -}, - -/** - * @method setRectInPixels - * @param {rect_object} arg0 - */ -setRectInPixels : function ( -rect -) -{ -}, - /** * @method getTexture * @return {cc.Texture2D} @@ -3703,16 +4194,6 @@ getTexture : function ( return cc.Texture2D; }, -/** - * @method getRect - * @return {rect_object} - */ -getRect : function ( -) -{ - return cc.Rect; -}, - /** * @method setOffsetInPixels * @param {vec2_object} arg0 @@ -3723,26 +4204,6 @@ vec2 { }, -/** - * @method getRectInPixels - * @return {rect_object} - */ -getRectInPixels : function ( -) -{ - return cc.Rect; -}, - -/** - * @method setOriginalSize - * @param {size_object} arg0 - */ -setOriginalSize : function ( -size -) -{ -}, - /** * @method getOriginalSizeInPixels * @return {size_object} @@ -3754,15 +4215,35 @@ getOriginalSizeInPixels : function ( }, /** - * @method setOriginalSizeInPixels + * @method setOriginalSize * @param {size_object} arg0 */ -setOriginalSizeInPixels : function ( +setOriginalSize : function ( size ) { }, +/** + * @method setRectInPixels + * @param {rect_object} arg0 + */ +setRectInPixels : function ( +rect +) +{ +}, + +/** + * @method getRect + * @return {rect_object} + */ +getRect : function ( +) +{ + return cc.Rect; +}, + /** * @method setOffset * @param {vec2_object} arg0 @@ -3773,36 +4254,6 @@ vec2 { }, -/** - * @method initWithTexture -* @param {cc.Texture2D|cc.Texture2D} texture2d -* @param {rect_object|rect_object} rect -* @param {bool} bool -* @param {vec2_object} vec2 -* @param {size_object} size -* @return {bool|bool} -*/ -initWithTexture : function( -texture2d, -rect, -bool, -vec2, -size -) -{ - return false; -}, - -/** - * @method isRotated - * @return {bool} - */ -isRotated : function ( -) -{ - return false; -}, - /** * @method initWithTextureFilename * @param {String|String} str @@ -3834,13 +4285,23 @@ rect }, /** - * @method getOffsetInPixels - * @return {vec2_object} - */ -getOffsetInPixels : function ( + * @method initWithTexture +* @param {cc.Texture2D|cc.Texture2D} texture2d +* @param {rect_object|rect_object} rect +* @param {bool} bool +* @param {vec2_object} vec2 +* @param {size_object} size +* @return {bool|bool} +*/ +initWithTexture : function( +texture2d, +rect, +bool, +vec2, +size ) { - return cc.Vec2; + return false; }, /** @@ -3853,6 +4314,76 @@ getOriginalSize : function ( return cc.Size; }, +/** + * @method clone + * @return {cc.SpriteFrame} + */ +clone : function ( +) +{ + return cc.SpriteFrame; +}, + +/** + * @method getRectInPixels + * @return {rect_object} + */ +getRectInPixels : function ( +) +{ + return cc.Rect; +}, + +/** + * @method isRotated + * @return {bool} + */ +isRotated : function ( +) +{ + return false; +}, + +/** + * @method setRotated + * @param {bool} arg0 + */ +setRotated : function ( +bool +) +{ +}, + +/** + * @method getOffset + * @return {vec2_object} + */ +getOffset : function ( +) +{ + return cc.Vec2; +}, + +/** + * @method setOriginalSizeInPixels + * @param {size_object} arg0 + */ +setOriginalSizeInPixels : function ( +size +) +{ +}, + +/** + * @method getOffsetInPixels + * @return {vec2_object} + */ +getOffsetInPixels : function ( +) +{ + return cc.Vec2; +}, + /** * @method create * @param {String|String} str @@ -10723,343 +11254,6 @@ float }; -/** - * @class GLProgramState - */ -cc.GLProgramState = { - -/** - * @method setUniformCallback -* @param {int|String} int -* @param {function|function} func -*/ -setUniformCallback : function( -str, -func -) -{ -}, - -/** - * @method getVertexAttribsFlags - * @return {unsigned int} - */ -getVertexAttribsFlags : function ( -) -{ - return 0; -}, - -/** - * @method applyAutoBinding - * @param {String} arg0 - * @param {String} arg1 - */ -applyAutoBinding : function ( -str, -str -) -{ -}, - -/** - * @method setUniformVec2 -* @param {int|String} int -* @param {vec2_object|vec2_object} vec2 -*/ -setUniformVec2 : function( -str, -vec2 -) -{ -}, - -/** - * @method setUniformVec3 -* @param {int|String} int -* @param {vec3_object|vec3_object} vec3 -*/ -setUniformVec3 : function( -str, -vec3 -) -{ -}, - -/** - * @method setVertexAttribCallback - * @param {String} arg0 - * @param {function} arg1 - */ -setVertexAttribCallback : function ( -str, -func -) -{ -}, - -/** - * @method apply - * @param {mat4_object} arg0 - */ -apply : function ( -mat4 -) -{ -}, - -/** - * @method getNodeBinding - * @return {cc.Node} - */ -getNodeBinding : function ( -) -{ - return cc.Node; -}, - -/** - * @method applyGLProgram - * @param {mat4_object} arg0 - */ -applyGLProgram : function ( -mat4 -) -{ -}, - -/** - * @method setNodeBinding - * @param {cc.Node} arg0 - */ -setNodeBinding : function ( -node -) -{ -}, - -/** - * @method setUniformInt -* @param {int|String} int -* @param {int|int} int -*/ -setUniformInt : function( -str, -int -) -{ -}, - -/** - * @method setParameterAutoBinding - * @param {String} arg0 - * @param {String} arg1 - */ -setParameterAutoBinding : function ( -str, -str -) -{ -}, - -/** - * @method setUniformVec2v -* @param {int|String} int -* @param {long|long} long -* @param {vec2_object|vec2_object} vec2 -*/ -setUniformVec2v : function( -str, -long, -vec2 -) -{ -}, - -/** - * @method getUniformCount - * @return {long} - */ -getUniformCount : function ( -) -{ - return 0; -}, - -/** - * @method applyAttributes - */ -applyAttributes : function ( -) -{ -}, - -/** - * @method clone - * @return {cc.GLProgramState} - */ -clone : function ( -) -{ - return cc.GLProgramState; -}, - -/** - * @method setGLProgram - * @param {cc.GLProgram} arg0 - */ -setGLProgram : function ( -glprogram -) -{ -}, - -/** - * @method setUniformFloatv -* @param {int|String} int -* @param {long|long} long -* @param {float|float} float -*/ -setUniformFloatv : function( -str, -long, -float -) -{ -}, - -/** - * @method getGLProgram - * @return {cc.GLProgram} - */ -getGLProgram : function ( -) -{ - return cc.GLProgram; -}, - -/** - * @method setUniformTexture -* @param {String|String|int|int} str -* @param {unsigned int|cc.Texture2D|cc.Texture2D|unsigned int} int -*/ -setUniformTexture : function( -int, -int -) -{ -}, - -/** - * @method applyUniforms - */ -applyUniforms : function ( -) -{ -}, - -/** - * @method setUniformFloat -* @param {int|String} int -* @param {float|float} float -*/ -setUniformFloat : function( -str, -float -) -{ -}, - -/** - * @method setUniformMat4 -* @param {int|String} int -* @param {mat4_object|mat4_object} mat4 -*/ -setUniformMat4 : function( -str, -mat4 -) -{ -}, - -/** - * @method setUniformVec3v -* @param {int|String} int -* @param {long|long} long -* @param {vec3_object|vec3_object} vec3 -*/ -setUniformVec3v : function( -str, -long, -vec3 -) -{ -}, - -/** - * @method getVertexAttribCount - * @return {long} - */ -getVertexAttribCount : function ( -) -{ - return 0; -}, - -/** - * @method create - * @param {cc.GLProgram} arg0 - * @return {cc.GLProgramState} - */ -create : function ( -glprogram -) -{ - return cc.GLProgramState; -}, - -/** - * @method getOrCreateWithGLProgramName - * @param {String} arg0 - * @return {cc.GLProgramState} - */ -getOrCreateWithGLProgramName : function ( -str -) -{ - return cc.GLProgramState; -}, - -/** - * @method getOrCreateWithGLProgram - * @param {cc.GLProgram} arg0 - * @return {cc.GLProgramState} - */ -getOrCreateWithGLProgram : function ( -glprogram -) -{ - return cc.GLProgramState; -}, - -/** - * @method getOrCreateWithShaders - * @param {String} arg0 - * @param {String} arg1 - * @param {String} arg2 - * @return {cc.GLProgramState} - */ -getOrCreateWithShaders : function ( -str, -str, -str -) -{ - return cc.GLProgramState; -}, - -}; - /** * @class AtlasNode */ @@ -16354,200 +16548,6 @@ 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 */ diff --git a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_auto.cpp b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_auto.cpp index 98c82cf8f5..6f89ef7989 100644 --- a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_auto.cpp +++ b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_auto.cpp @@ -9409,22 +9409,760 @@ void js_register_cocos2dx_Follow(JSContext *cx, JS::HandleObject global) { anonEvaluate(cx, global, "(function () { cc.Follow.extend = cc.Class.extend; })()"); } -JSClass *jsb_cocos2d_SpriteFrame_class; -JSObject *jsb_cocos2d_SpriteFrame_prototype; +JSClass *jsb_cocos2d_Image_class; +JSObject *jsb_cocos2d_Image_prototype; -bool js_cocos2dx_SpriteFrame_clone(JSContext *cx, uint32_t argc, jsval *vp) +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::SpriteFrame* cobj = (cocos2d::SpriteFrame *)(proxy ? proxy->ptr : NULL); - JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_SpriteFrame_clone : Invalid Native Object"); + cocos2d::Image* cobj = (cocos2d::Image *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Image_hasPremultipliedAlpha : Invalid Native Object"); if (argc == 0) { - cocos2d::SpriteFrame* ret = cobj->clone(); + 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 = nullptr; + ssize_t arg1 = 0; + int arg2 = 0; + int arg3 = 0; + int arg4 = 0; + #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 = nullptr; + ssize_t arg1 = 0; + int arg2 = 0; + int arg3 = 0; + int arg4 = 0; + 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."); + 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_GLProgramState_class; +JSObject *jsb_cocos2d_GLProgramState_prototype; + +bool js_cocos2dx_GLProgramState_setUniformCallback(JSContext *cx, uint32_t argc, jsval *vp) +{ + bool ok = true; + cocos2d::GLProgramState* cobj = nullptr; + + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx); + obj = args.thisv().toObjectOrNull(); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cobj = (cocos2d::GLProgramState *)(proxy ? proxy->ptr : nullptr); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_GLProgramState_setUniformCallback : Invalid Native Object"); + do { + if (argc == 2) { + int arg0 = 0; + ok &= jsval_to_int32(cx, args.get(0), (int32_t *)&arg0); + if (!ok) { ok = true; break; } + std::function arg1; + do { + if(JS_TypeOfValue(cx, args.get(1)) == JSTYPE_FUNCTION) + { + std::shared_ptr func(new JSFunctionWrapper(cx, args.thisv().toObjectOrNull(), args.get(1))); + auto lambda = [=](cocos2d::GLProgram* larg0, cocos2d::Uniform* larg1) -> void { + JSB_AUTOCOMPARTMENT_WITH_GLOBAL_OBJCET + jsval largv[2]; + do { + if (larg0) { + js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::GLProgram*)larg0); + largv[0] = OBJECT_TO_JSVAL(jsProxy->obj); + } else { + largv[0] = JSVAL_NULL; + } + } while (0); + largv[1] = uniform_to_jsval(cx, larg1); + JS::RootedValue rval(cx); + bool succeed = func->invoke(2, &largv[0], &rval); + if (!succeed && JS_IsExceptionPending(cx)) { + JS_ReportPendingException(cx); + } + }; + arg1 = lambda; + } + else + { + arg1 = nullptr; + } + } while(0) + ; + if (!ok) { ok = true; break; } + cobj->setUniformCallback(arg0, arg1); + args.rval().setUndefined(); + 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; } + std::function arg1; + do { + if(JS_TypeOfValue(cx, args.get(1)) == JSTYPE_FUNCTION) + { + std::shared_ptr func(new JSFunctionWrapper(cx, args.thisv().toObjectOrNull(), args.get(1))); + auto lambda = [=](cocos2d::GLProgram* larg0, cocos2d::Uniform* larg1) -> void { + JSB_AUTOCOMPARTMENT_WITH_GLOBAL_OBJCET + jsval largv[2]; + do { + if (larg0) { + js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::GLProgram*)larg0); + largv[0] = OBJECT_TO_JSVAL(jsProxy->obj); + } else { + largv[0] = JSVAL_NULL; + } + } while (0); + largv[1] = uniform_to_jsval(cx, larg1); + JS::RootedValue rval(cx); + bool succeed = func->invoke(2, &largv[0], &rval); + if (!succeed && JS_IsExceptionPending(cx)) { + JS_ReportPendingException(cx); + } + }; + arg1 = lambda; + } + else + { + arg1 = nullptr; + } + } while(0) + ; + if (!ok) { ok = true; break; } + cobj->setUniformCallback(arg0, arg1); + args.rval().setUndefined(); + return true; + } + } while(0); + + JS_ReportError(cx, "js_cocos2dx_GLProgramState_setUniformCallback : wrong number of arguments"); + return false; +} +bool js_cocos2dx_GLProgramState_getVertexAttribsFlags(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::GLProgramState* cobj = (cocos2d::GLProgramState *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_GLProgramState_getVertexAttribsFlags : Invalid Native Object"); + if (argc == 0) { + unsigned int ret = cobj->getVertexAttribsFlags(); + jsval jsret = JSVAL_NULL; + jsret = uint32_to_jsval(cx, ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_GLProgramState_getVertexAttribsFlags : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_GLProgramState_applyAutoBinding(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::GLProgramState* cobj = (cocos2d::GLProgramState *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_GLProgramState_applyAutoBinding : Invalid Native Object"); + if (argc == 2) { + std::string arg0; + std::string arg1; + ok &= jsval_to_std_string(cx, args.get(0), &arg0); + ok &= jsval_to_std_string(cx, args.get(1), &arg1); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_GLProgramState_applyAutoBinding : Error processing arguments"); + cobj->applyAutoBinding(arg0, arg1); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_GLProgramState_applyAutoBinding : wrong number of arguments: %d, was expecting %d", argc, 2); + return false; +} +bool js_cocos2dx_GLProgramState_setUniformVec2(JSContext *cx, uint32_t argc, jsval *vp) +{ + bool ok = true; + cocos2d::GLProgramState* cobj = nullptr; + + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx); + obj = args.thisv().toObjectOrNull(); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cobj = (cocos2d::GLProgramState *)(proxy ? proxy->ptr : nullptr); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_GLProgramState_setUniformVec2 : Invalid Native Object"); + do { + if (argc == 2) { + int arg0 = 0; + ok &= jsval_to_int32(cx, args.get(0), (int32_t *)&arg0); + if (!ok) { ok = true; break; } + cocos2d::Vec2 arg1; + ok &= jsval_to_vector2(cx, args.get(1), &arg1); + if (!ok) { ok = true; break; } + cobj->setUniformVec2(arg0, arg1); + args.rval().setUndefined(); + 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::Vec2 arg1; + ok &= jsval_to_vector2(cx, args.get(1), &arg1); + if (!ok) { ok = true; break; } + cobj->setUniformVec2(arg0, arg1); + args.rval().setUndefined(); + return true; + } + } while(0); + + JS_ReportError(cx, "js_cocos2dx_GLProgramState_setUniformVec2 : wrong number of arguments"); + return false; +} +bool js_cocos2dx_GLProgramState_setUniformVec3(JSContext *cx, uint32_t argc, jsval *vp) +{ + bool ok = true; + cocos2d::GLProgramState* cobj = nullptr; + + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx); + obj = args.thisv().toObjectOrNull(); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cobj = (cocos2d::GLProgramState *)(proxy ? proxy->ptr : nullptr); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_GLProgramState_setUniformVec3 : Invalid Native Object"); + do { + if (argc == 2) { + int arg0 = 0; + ok &= jsval_to_int32(cx, args.get(0), (int32_t *)&arg0); + if (!ok) { ok = true; break; } + cocos2d::Vec3 arg1; + ok &= jsval_to_vector3(cx, args.get(1), &arg1); + if (!ok) { ok = true; break; } + cobj->setUniformVec3(arg0, arg1); + args.rval().setUndefined(); + 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::Vec3 arg1; + ok &= jsval_to_vector3(cx, args.get(1), &arg1); + if (!ok) { ok = true; break; } + cobj->setUniformVec3(arg0, arg1); + args.rval().setUndefined(); + return true; + } + } while(0); + + JS_ReportError(cx, "js_cocos2dx_GLProgramState_setUniformVec3 : wrong number of arguments"); + return false; +} +bool js_cocos2dx_GLProgramState_setVertexAttribCallback(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::GLProgramState* cobj = (cocos2d::GLProgramState *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_GLProgramState_setVertexAttribCallback : Invalid Native Object"); + if (argc == 2) { + std::string arg0; + std::function arg1; + ok &= jsval_to_std_string(cx, args.get(0), &arg0); + do { + if(JS_TypeOfValue(cx, args.get(1)) == JSTYPE_FUNCTION) + { + std::shared_ptr func(new JSFunctionWrapper(cx, args.thisv().toObjectOrNull(), args.get(1))); + auto lambda = [=](cocos2d::VertexAttrib* larg0) -> void { + JSB_AUTOCOMPARTMENT_WITH_GLOBAL_OBJCET + jsval largv[1]; + do { + if (larg0) { + js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::VertexAttrib*)larg0); + largv[0] = OBJECT_TO_JSVAL(jsProxy->obj); + } else { + largv[0] = JSVAL_NULL; + } + } while (0); + JS::RootedValue rval(cx); + bool succeed = func->invoke(1, &largv[0], &rval); + if (!succeed && JS_IsExceptionPending(cx)) { + JS_ReportPendingException(cx); + } + }; + arg1 = lambda; + } + else + { + arg1 = nullptr; + } + } while(0) + ; + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_GLProgramState_setVertexAttribCallback : Error processing arguments"); + cobj->setVertexAttribCallback(arg0, arg1); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_GLProgramState_setVertexAttribCallback : wrong number of arguments: %d, was expecting %d", argc, 2); + return false; +} +bool js_cocos2dx_GLProgramState_apply(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::GLProgramState* cobj = (cocos2d::GLProgramState *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_GLProgramState_apply : Invalid Native Object"); + if (argc == 1) { + cocos2d::Mat4 arg0; + ok &= jsval_to_matrix(cx, args.get(0), &arg0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_GLProgramState_apply : Error processing arguments"); + cobj->apply(arg0); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_GLProgramState_apply : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} +bool js_cocos2dx_GLProgramState_getNodeBinding(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::GLProgramState* cobj = (cocos2d::GLProgramState *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_GLProgramState_getNodeBinding : Invalid Native Object"); + if (argc == 0) { + cocos2d::Node* ret = cobj->getNodeBinding(); jsval jsret = JSVAL_NULL; do { if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::SpriteFrame*)ret); + js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Node*)ret); jsret = OBJECT_TO_JSVAL(jsProxy->obj); } else { jsret = JSVAL_NULL; @@ -9434,29 +10172,818 @@ bool js_cocos2dx_SpriteFrame_clone(JSContext *cx, uint32_t argc, jsval *vp) return true; } - JS_ReportError(cx, "js_cocos2dx_SpriteFrame_clone : wrong number of arguments: %d, was expecting %d", argc, 0); + JS_ReportError(cx, "js_cocos2dx_GLProgramState_getNodeBinding : wrong number of arguments: %d, was expecting %d", argc, 0); return false; } -bool js_cocos2dx_SpriteFrame_setRotated(JSContext *cx, uint32_t argc, jsval *vp) +bool js_cocos2dx_GLProgramState_applyGLProgram(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::SpriteFrame* cobj = (cocos2d::SpriteFrame *)(proxy ? proxy->ptr : NULL); - JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_SpriteFrame_setRotated : Invalid Native Object"); + cocos2d::GLProgramState* cobj = (cocos2d::GLProgramState *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_GLProgramState_applyGLProgram : Invalid Native Object"); if (argc == 1) { - bool arg0; - arg0 = JS::ToBoolean(args.get(0)); - JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_SpriteFrame_setRotated : Error processing arguments"); - cobj->setRotated(arg0); + cocos2d::Mat4 arg0; + ok &= jsval_to_matrix(cx, args.get(0), &arg0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_GLProgramState_applyGLProgram : Error processing arguments"); + cobj->applyGLProgram(arg0); args.rval().setUndefined(); return true; } - JS_ReportError(cx, "js_cocos2dx_SpriteFrame_setRotated : wrong number of arguments: %d, was expecting %d", argc, 1); + JS_ReportError(cx, "js_cocos2dx_GLProgramState_applyGLProgram : wrong number of arguments: %d, was expecting %d", argc, 1); return false; } +bool js_cocos2dx_GLProgramState_setNodeBinding(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::GLProgramState* cobj = (cocos2d::GLProgramState *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_GLProgramState_setNodeBinding : Invalid Native Object"); + if (argc == 1) { + cocos2d::Node* arg0 = nullptr; + 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::Node*)(jsProxy ? jsProxy->ptr : NULL); + JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); + } while (0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_GLProgramState_setNodeBinding : Error processing arguments"); + cobj->setNodeBinding(arg0); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_GLProgramState_setNodeBinding : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} +bool js_cocos2dx_GLProgramState_setUniformInt(JSContext *cx, uint32_t argc, jsval *vp) +{ + bool ok = true; + cocos2d::GLProgramState* cobj = nullptr; + + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx); + obj = args.thisv().toObjectOrNull(); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cobj = (cocos2d::GLProgramState *)(proxy ? proxy->ptr : nullptr); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_GLProgramState_setUniformInt : Invalid Native Object"); + do { + if (argc == 2) { + int arg0 = 0; + ok &= jsval_to_int32(cx, args.get(0), (int32_t *)&arg0); + if (!ok) { ok = true; break; } + int arg1 = 0; + ok &= jsval_to_int32(cx, args.get(1), (int32_t *)&arg1); + if (!ok) { ok = true; break; } + cobj->setUniformInt(arg0, arg1); + args.rval().setUndefined(); + 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; } + int arg1 = 0; + ok &= jsval_to_int32(cx, args.get(1), (int32_t *)&arg1); + if (!ok) { ok = true; break; } + cobj->setUniformInt(arg0, arg1); + args.rval().setUndefined(); + return true; + } + } while(0); + + JS_ReportError(cx, "js_cocos2dx_GLProgramState_setUniformInt : wrong number of arguments"); + return false; +} +bool js_cocos2dx_GLProgramState_setParameterAutoBinding(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::GLProgramState* cobj = (cocos2d::GLProgramState *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_GLProgramState_setParameterAutoBinding : Invalid Native Object"); + if (argc == 2) { + std::string arg0; + std::string arg1; + ok &= jsval_to_std_string(cx, args.get(0), &arg0); + ok &= jsval_to_std_string(cx, args.get(1), &arg1); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_GLProgramState_setParameterAutoBinding : Error processing arguments"); + cobj->setParameterAutoBinding(arg0, arg1); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_GLProgramState_setParameterAutoBinding : wrong number of arguments: %d, was expecting %d", argc, 2); + return false; +} +bool js_cocos2dx_GLProgramState_setUniformVec2v(JSContext *cx, uint32_t argc, jsval *vp) +{ + bool ok = true; + cocos2d::GLProgramState* cobj = nullptr; + + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx); + obj = args.thisv().toObjectOrNull(); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cobj = (cocos2d::GLProgramState *)(proxy ? proxy->ptr : nullptr); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_GLProgramState_setUniformVec2v : Invalid Native Object"); + do { + if (argc == 3) { + int arg0 = 0; + ok &= jsval_to_int32(cx, args.get(0), (int32_t *)&arg0); + if (!ok) { ok = true; break; } + ssize_t arg1 = 0; + ok &= jsval_to_ssize(cx, args.get(1), &arg1); + if (!ok) { ok = true; break; } + const cocos2d::Vec2* arg2 = nullptr; + std::vector tempData;ok &= jsval_to_vector_vec2(cx, args.get(2), &tempData);arg2=tempData.data(); + if (!ok) { ok = true; break; } + cobj->setUniformVec2v(arg0, arg1, arg2); + args.rval().setUndefined(); + return true; + } + } while(0); + + do { + if (argc == 3) { + std::string arg0; + ok &= jsval_to_std_string(cx, args.get(0), &arg0); + if (!ok) { ok = true; break; } + ssize_t arg1 = 0; + ok &= jsval_to_ssize(cx, args.get(1), &arg1); + if (!ok) { ok = true; break; } + const cocos2d::Vec2* arg2 = nullptr; + std::vector tempData;ok &= jsval_to_vector_vec2(cx, args.get(2), &tempData);arg2=tempData.data(); + if (!ok) { ok = true; break; } + cobj->setUniformVec2v(arg0, arg1, arg2); + args.rval().setUndefined(); + return true; + } + } while(0); + + JS_ReportError(cx, "js_cocos2dx_GLProgramState_setUniformVec2v : wrong number of arguments"); + return false; +} +bool js_cocos2dx_GLProgramState_getUniformCount(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::GLProgramState* cobj = (cocos2d::GLProgramState *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_GLProgramState_getUniformCount : Invalid Native Object"); + if (argc == 0) { + ssize_t ret = cobj->getUniformCount(); + jsval jsret = JSVAL_NULL; + jsret = ssize_to_jsval(cx, ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_GLProgramState_getUniformCount : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_GLProgramState_applyAttributes(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::GLProgramState* cobj = (cocos2d::GLProgramState *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_GLProgramState_applyAttributes : Invalid Native Object"); + if (argc == 0) { + cobj->applyAttributes(); + args.rval().setUndefined(); + return true; + } + if (argc == 1) { + bool arg0; + arg0 = JS::ToBoolean(args.get(0)); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_GLProgramState_applyAttributes : Error processing arguments"); + cobj->applyAttributes(arg0); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_GLProgramState_applyAttributes : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_GLProgramState_clone(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::GLProgramState* cobj = (cocos2d::GLProgramState *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_GLProgramState_clone : Invalid Native Object"); + if (argc == 0) { + cocos2d::GLProgramState* ret = cobj->clone(); + jsval jsret = JSVAL_NULL; + do { + if (ret) { + js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::GLProgramState*)ret); + jsret = OBJECT_TO_JSVAL(jsProxy->obj); + } else { + jsret = JSVAL_NULL; + } + } while (0); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_GLProgramState_clone : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_GLProgramState_setGLProgram(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::GLProgramState* cobj = (cocos2d::GLProgramState *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_GLProgramState_setGLProgram : Invalid Native Object"); + if (argc == 1) { + cocos2d::GLProgram* arg0 = nullptr; + 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::GLProgram*)(jsProxy ? jsProxy->ptr : NULL); + JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); + } while (0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_GLProgramState_setGLProgram : Error processing arguments"); + cobj->setGLProgram(arg0); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_GLProgramState_setGLProgram : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} +bool js_cocos2dx_GLProgramState_setUniformFloatv(JSContext *cx, uint32_t argc, jsval *vp) +{ + bool ok = true; + cocos2d::GLProgramState* cobj = nullptr; + + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx); + obj = args.thisv().toObjectOrNull(); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cobj = (cocos2d::GLProgramState *)(proxy ? proxy->ptr : nullptr); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_GLProgramState_setUniformFloatv : Invalid Native Object"); + do { + if (argc == 3) { + int arg0 = 0; + ok &= jsval_to_int32(cx, args.get(0), (int32_t *)&arg0); + if (!ok) { ok = true; break; } + ssize_t arg1 = 0; + ok &= jsval_to_ssize(cx, args.get(1), &arg1); + if (!ok) { ok = true; break; } + const float* arg2 = 0; + #pragma warning NO CONVERSION TO NATIVE FOR float* + ok = false; + if (!ok) { ok = true; break; } + cobj->setUniformFloatv(arg0, arg1, arg2); + args.rval().setUndefined(); + return true; + } + } while(0); + + do { + if (argc == 3) { + std::string arg0; + ok &= jsval_to_std_string(cx, args.get(0), &arg0); + if (!ok) { ok = true; break; } + ssize_t arg1 = 0; + ok &= jsval_to_ssize(cx, args.get(1), &arg1); + if (!ok) { ok = true; break; } + const float* arg2 = 0; + #pragma warning NO CONVERSION TO NATIVE FOR float* + ok = false; + if (!ok) { ok = true; break; } + cobj->setUniformFloatv(arg0, arg1, arg2); + args.rval().setUndefined(); + return true; + } + } while(0); + + JS_ReportError(cx, "js_cocos2dx_GLProgramState_setUniformFloatv : wrong number of arguments"); + return false; +} +bool js_cocos2dx_GLProgramState_getGLProgram(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::GLProgramState* cobj = (cocos2d::GLProgramState *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_GLProgramState_getGLProgram : Invalid Native Object"); + if (argc == 0) { + cocos2d::GLProgram* ret = cobj->getGLProgram(); + jsval jsret = JSVAL_NULL; + do { + if (ret) { + js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::GLProgram*)ret); + jsret = OBJECT_TO_JSVAL(jsProxy->obj); + } else { + jsret = JSVAL_NULL; + } + } while (0); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_GLProgramState_getGLProgram : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_GLProgramState_setUniformTexture(JSContext *cx, uint32_t argc, jsval *vp) +{ + bool ok = true; + cocos2d::GLProgramState* cobj = nullptr; + + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx); + obj = args.thisv().toObjectOrNull(); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cobj = (cocos2d::GLProgramState *)(proxy ? proxy->ptr : nullptr); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_GLProgramState_setUniformTexture : Invalid Native Object"); + do { + if (argc == 2) { + std::string arg0; + ok &= jsval_to_std_string(cx, args.get(0), &arg0); + if (!ok) { ok = true; break; } + unsigned int arg1 = 0; + ok &= jsval_to_uint32(cx, args.get(1), &arg1); + if (!ok) { ok = true; break; } + cobj->setUniformTexture(arg0, arg1); + args.rval().setUndefined(); + 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::Texture2D* arg1 = nullptr; + 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 = (cocos2d::Texture2D*)(jsProxy ? jsProxy->ptr : NULL); + JSB_PRECONDITION2( arg1, cx, false, "Invalid Native Object"); + } while (0); + if (!ok) { ok = true; break; } + cobj->setUniformTexture(arg0, arg1); + args.rval().setUndefined(); + return true; + } + } while(0); + + do { + if (argc == 2) { + int arg0 = 0; + ok &= jsval_to_int32(cx, args.get(0), (int32_t *)&arg0); + if (!ok) { ok = true; break; } + cocos2d::Texture2D* arg1 = nullptr; + 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 = (cocos2d::Texture2D*)(jsProxy ? jsProxy->ptr : NULL); + JSB_PRECONDITION2( arg1, cx, false, "Invalid Native Object"); + } while (0); + if (!ok) { ok = true; break; } + cobj->setUniformTexture(arg0, arg1); + args.rval().setUndefined(); + return true; + } + } while(0); + + do { + if (argc == 2) { + int arg0 = 0; + ok &= jsval_to_int32(cx, args.get(0), (int32_t *)&arg0); + if (!ok) { ok = true; break; } + unsigned int arg1 = 0; + ok &= jsval_to_uint32(cx, args.get(1), &arg1); + if (!ok) { ok = true; break; } + cobj->setUniformTexture(arg0, arg1); + args.rval().setUndefined(); + return true; + } + } while(0); + + JS_ReportError(cx, "js_cocos2dx_GLProgramState_setUniformTexture : wrong number of arguments"); + return false; +} +bool js_cocos2dx_GLProgramState_applyUniforms(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::GLProgramState* cobj = (cocos2d::GLProgramState *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_GLProgramState_applyUniforms : Invalid Native Object"); + if (argc == 0) { + cobj->applyUniforms(); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_GLProgramState_applyUniforms : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_GLProgramState_setUniformFloat(JSContext *cx, uint32_t argc, jsval *vp) +{ + bool ok = true; + cocos2d::GLProgramState* cobj = nullptr; + + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx); + obj = args.thisv().toObjectOrNull(); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cobj = (cocos2d::GLProgramState *)(proxy ? proxy->ptr : nullptr); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_GLProgramState_setUniformFloat : Invalid Native Object"); + do { + if (argc == 2) { + int arg0 = 0; + ok &= jsval_to_int32(cx, args.get(0), (int32_t *)&arg0); + if (!ok) { ok = true; break; } + double arg1 = 0; + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !isnan(arg1); + if (!ok) { ok = true; break; } + cobj->setUniformFloat(arg0, arg1); + args.rval().setUndefined(); + 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; } + double arg1 = 0; + ok &= JS::ToNumber( cx, args.get(1), &arg1) && !isnan(arg1); + if (!ok) { ok = true; break; } + cobj->setUniformFloat(arg0, arg1); + args.rval().setUndefined(); + return true; + } + } while(0); + + JS_ReportError(cx, "js_cocos2dx_GLProgramState_setUniformFloat : wrong number of arguments"); + return false; +} +bool js_cocos2dx_GLProgramState_setUniformMat4(JSContext *cx, uint32_t argc, jsval *vp) +{ + bool ok = true; + cocos2d::GLProgramState* cobj = nullptr; + + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx); + obj = args.thisv().toObjectOrNull(); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cobj = (cocos2d::GLProgramState *)(proxy ? proxy->ptr : nullptr); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_GLProgramState_setUniformMat4 : Invalid Native Object"); + do { + if (argc == 2) { + int arg0 = 0; + ok &= jsval_to_int32(cx, args.get(0), (int32_t *)&arg0); + if (!ok) { ok = true; break; } + cocos2d::Mat4 arg1; + ok &= jsval_to_matrix(cx, args.get(1), &arg1); + if (!ok) { ok = true; break; } + cobj->setUniformMat4(arg0, arg1); + args.rval().setUndefined(); + 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::Mat4 arg1; + ok &= jsval_to_matrix(cx, args.get(1), &arg1); + if (!ok) { ok = true; break; } + cobj->setUniformMat4(arg0, arg1); + args.rval().setUndefined(); + return true; + } + } while(0); + + JS_ReportError(cx, "js_cocos2dx_GLProgramState_setUniformMat4 : wrong number of arguments"); + return false; +} +bool js_cocos2dx_GLProgramState_setUniformVec3v(JSContext *cx, uint32_t argc, jsval *vp) +{ + bool ok = true; + cocos2d::GLProgramState* cobj = nullptr; + + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx); + obj = args.thisv().toObjectOrNull(); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cobj = (cocos2d::GLProgramState *)(proxy ? proxy->ptr : nullptr); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_GLProgramState_setUniformVec3v : Invalid Native Object"); + do { + if (argc == 3) { + int arg0 = 0; + ok &= jsval_to_int32(cx, args.get(0), (int32_t *)&arg0); + if (!ok) { ok = true; break; } + ssize_t arg1 = 0; + ok &= jsval_to_ssize(cx, args.get(1), &arg1); + if (!ok) { ok = true; break; } + const cocos2d::Vec3* arg2 = nullptr; + do { + if (args.get(2).isNull()) { arg2 = nullptr; break; } + if (!args.get(2).isObject()) { ok = false; break; } + js_proxy_t *jsProxy; + JSObject *tmpObj = args.get(2).toObjectOrNull(); + jsProxy = jsb_get_js_proxy(tmpObj); + arg2 = (const cocos2d::Vec3*)(jsProxy ? jsProxy->ptr : NULL); + JSB_PRECONDITION2( arg2, cx, false, "Invalid Native Object"); + } while (0); + if (!ok) { ok = true; break; } + cobj->setUniformVec3v(arg0, arg1, arg2); + args.rval().setUndefined(); + return true; + } + } while(0); + + do { + if (argc == 3) { + std::string arg0; + ok &= jsval_to_std_string(cx, args.get(0), &arg0); + if (!ok) { ok = true; break; } + ssize_t arg1 = 0; + ok &= jsval_to_ssize(cx, args.get(1), &arg1); + if (!ok) { ok = true; break; } + const cocos2d::Vec3* arg2 = nullptr; + do { + if (args.get(2).isNull()) { arg2 = nullptr; break; } + if (!args.get(2).isObject()) { ok = false; break; } + js_proxy_t *jsProxy; + JSObject *tmpObj = args.get(2).toObjectOrNull(); + jsProxy = jsb_get_js_proxy(tmpObj); + arg2 = (const cocos2d::Vec3*)(jsProxy ? jsProxy->ptr : NULL); + JSB_PRECONDITION2( arg2, cx, false, "Invalid Native Object"); + } while (0); + if (!ok) { ok = true; break; } + cobj->setUniformVec3v(arg0, arg1, arg2); + args.rval().setUndefined(); + return true; + } + } while(0); + + JS_ReportError(cx, "js_cocos2dx_GLProgramState_setUniformVec3v : wrong number of arguments"); + return false; +} +bool js_cocos2dx_GLProgramState_getVertexAttribCount(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::GLProgramState* cobj = (cocos2d::GLProgramState *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_GLProgramState_getVertexAttribCount : Invalid Native Object"); + if (argc == 0) { + ssize_t ret = cobj->getVertexAttribCount(); + jsval jsret = JSVAL_NULL; + jsret = ssize_to_jsval(cx, ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_GLProgramState_getVertexAttribCount : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_GLProgramState_create(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + if (argc == 1) { + cocos2d::GLProgram* arg0 = nullptr; + 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::GLProgram*)(jsProxy ? jsProxy->ptr : NULL); + JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); + } while (0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_GLProgramState_create : Error processing arguments"); + cocos2d::GLProgramState* ret = cocos2d::GLProgramState::create(arg0); + jsval jsret = JSVAL_NULL; + do { + if (ret) { + js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::GLProgramState*)ret); + jsret = OBJECT_TO_JSVAL(jsProxy->obj); + } else { + jsret = JSVAL_NULL; + } + } while (0); + args.rval().set(jsret); + return true; + } + JS_ReportError(cx, "js_cocos2dx_GLProgramState_create : wrong number of arguments"); + return false; +} + +bool js_cocos2dx_GLProgramState_getOrCreateWithGLProgramName(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_GLProgramState_getOrCreateWithGLProgramName : Error processing arguments"); + cocos2d::GLProgramState* ret = cocos2d::GLProgramState::getOrCreateWithGLProgramName(arg0); + jsval jsret = JSVAL_NULL; + do { + if (ret) { + js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::GLProgramState*)ret); + jsret = OBJECT_TO_JSVAL(jsProxy->obj); + } else { + jsret = JSVAL_NULL; + } + } while (0); + args.rval().set(jsret); + return true; + } + JS_ReportError(cx, "js_cocos2dx_GLProgramState_getOrCreateWithGLProgramName : wrong number of arguments"); + return false; +} + +bool js_cocos2dx_GLProgramState_getOrCreateWithGLProgram(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + if (argc == 1) { + cocos2d::GLProgram* arg0 = nullptr; + 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::GLProgram*)(jsProxy ? jsProxy->ptr : NULL); + JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); + } while (0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_GLProgramState_getOrCreateWithGLProgram : Error processing arguments"); + cocos2d::GLProgramState* ret = cocos2d::GLProgramState::getOrCreateWithGLProgram(arg0); + jsval jsret = JSVAL_NULL; + do { + if (ret) { + js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::GLProgramState*)ret); + jsret = OBJECT_TO_JSVAL(jsProxy->obj); + } else { + jsret = JSVAL_NULL; + } + } while (0); + args.rval().set(jsret); + return true; + } + JS_ReportError(cx, "js_cocos2dx_GLProgramState_getOrCreateWithGLProgram : wrong number of arguments"); + return false; +} + +bool js_cocos2dx_GLProgramState_getOrCreateWithShaders(JSContext *cx, uint32_t argc, jsval *vp) +{ + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; + if (argc == 3) { + std::string arg0; + std::string arg1; + std::string arg2; + ok &= jsval_to_std_string(cx, args.get(0), &arg0); + ok &= jsval_to_std_string(cx, args.get(1), &arg1); + ok &= jsval_to_std_string(cx, args.get(2), &arg2); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_GLProgramState_getOrCreateWithShaders : Error processing arguments"); + cocos2d::GLProgramState* ret = cocos2d::GLProgramState::getOrCreateWithShaders(arg0, arg1, arg2); + jsval jsret = JSVAL_NULL; + do { + if (ret) { + js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::GLProgramState*)ret); + jsret = OBJECT_TO_JSVAL(jsProxy->obj); + } else { + jsret = JSVAL_NULL; + } + } while (0); + args.rval().set(jsret); + return true; + } + JS_ReportError(cx, "js_cocos2dx_GLProgramState_getOrCreateWithShaders : wrong number of arguments"); + return false; +} + + +void js_cocos2d_GLProgramState_finalize(JSFreeOp *fop, JSObject *obj) { + CCLOGINFO("jsbindings: finalizing JS object %p (GLProgramState)", obj); +} +void js_register_cocos2dx_GLProgramState(JSContext *cx, JS::HandleObject global) { + jsb_cocos2d_GLProgramState_class = (JSClass *)calloc(1, sizeof(JSClass)); + jsb_cocos2d_GLProgramState_class->name = "GLProgramState"; + jsb_cocos2d_GLProgramState_class->addProperty = JS_PropertyStub; + jsb_cocos2d_GLProgramState_class->delProperty = JS_DeletePropertyStub; + jsb_cocos2d_GLProgramState_class->getProperty = JS_PropertyStub; + jsb_cocos2d_GLProgramState_class->setProperty = JS_StrictPropertyStub; + jsb_cocos2d_GLProgramState_class->enumerate = JS_EnumerateStub; + jsb_cocos2d_GLProgramState_class->resolve = JS_ResolveStub; + jsb_cocos2d_GLProgramState_class->convert = JS_ConvertStub; + jsb_cocos2d_GLProgramState_class->finalize = js_cocos2d_GLProgramState_finalize; + jsb_cocos2d_GLProgramState_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("setUniformCallback", js_cocos2dx_GLProgramState_setUniformCallback, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getVertexAttribsFlags", js_cocos2dx_GLProgramState_getVertexAttribsFlags, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("applyAutoBinding", js_cocos2dx_GLProgramState_applyAutoBinding, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("setUniformVec2", js_cocos2dx_GLProgramState_setUniformVec2, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("setUniformVec3", js_cocos2dx_GLProgramState_setUniformVec3, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("setVertexAttribCallback", js_cocos2dx_GLProgramState_setVertexAttribCallback, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("apply", js_cocos2dx_GLProgramState_apply, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getNodeBinding", js_cocos2dx_GLProgramState_getNodeBinding, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("applyGLProgram", js_cocos2dx_GLProgramState_applyGLProgram, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("setNodeBinding", js_cocos2dx_GLProgramState_setNodeBinding, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("setUniformInt", js_cocos2dx_GLProgramState_setUniformInt, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("setParameterAutoBinding", js_cocos2dx_GLProgramState_setParameterAutoBinding, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("setUniformVec2v", js_cocos2dx_GLProgramState_setUniformVec2v, 3, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getUniformCount", js_cocos2dx_GLProgramState_getUniformCount, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("applyAttributes", js_cocos2dx_GLProgramState_applyAttributes, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("clone", js_cocos2dx_GLProgramState_clone, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("setGLProgram", js_cocos2dx_GLProgramState_setGLProgram, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("setUniformFloatv", js_cocos2dx_GLProgramState_setUniformFloatv, 3, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getGLProgram", js_cocos2dx_GLProgramState_getGLProgram, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("setUniformTexture", js_cocos2dx_GLProgramState_setUniformTexture, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("applyUniforms", js_cocos2dx_GLProgramState_applyUniforms, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("setUniformFloat", js_cocos2dx_GLProgramState_setUniformFloat, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("setUniformMat4", js_cocos2dx_GLProgramState_setUniformMat4, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("setUniformVec3v", js_cocos2dx_GLProgramState_setUniformVec3v, 3, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getVertexAttribCount", js_cocos2dx_GLProgramState_getVertexAttribCount, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FS_END + }; + + static JSFunctionSpec st_funcs[] = { + JS_FN("create", js_cocos2dx_GLProgramState_create, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getOrCreateWithGLProgramName", js_cocos2dx_GLProgramState_getOrCreateWithGLProgramName, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getOrCreateWithGLProgram", js_cocos2dx_GLProgramState_getOrCreateWithGLProgram, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getOrCreateWithShaders", js_cocos2dx_GLProgramState_getOrCreateWithShaders, 3, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FS_END + }; + + jsb_cocos2d_GLProgramState_prototype = JS_InitClass( + cx, global, + JS::NullPtr(), // parent proto + jsb_cocos2d_GLProgramState_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, "GLProgramState", 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_GLProgramState_class; + p->proto = jsb_cocos2d_GLProgramState_prototype; + p->parentProto = NULL; + _js_global_type_map.insert(std::make_pair(typeName, p)); + } +} + +JSClass *jsb_cocos2d_SpriteFrame_class; +JSObject *jsb_cocos2d_SpriteFrame_prototype; + bool js_cocos2dx_SpriteFrame_setTexture(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); @@ -9485,44 +11012,6 @@ bool js_cocos2dx_SpriteFrame_setTexture(JSContext *cx, uint32_t argc, jsval *vp) JS_ReportError(cx, "js_cocos2dx_SpriteFrame_setTexture : wrong number of arguments: %d, was expecting %d", argc, 1); return false; } -bool js_cocos2dx_SpriteFrame_getOffset(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::SpriteFrame* cobj = (cocos2d::SpriteFrame *)(proxy ? proxy->ptr : NULL); - JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_SpriteFrame_getOffset : Invalid Native Object"); - if (argc == 0) { - const cocos2d::Vec2& ret = cobj->getOffset(); - jsval jsret = JSVAL_NULL; - jsret = vector2_to_jsval(cx, ret); - args.rval().set(jsret); - return true; - } - - JS_ReportError(cx, "js_cocos2dx_SpriteFrame_getOffset : wrong number of arguments: %d, was expecting %d", argc, 0); - return false; -} -bool js_cocos2dx_SpriteFrame_setRectInPixels(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::SpriteFrame* cobj = (cocos2d::SpriteFrame *)(proxy ? proxy->ptr : NULL); - JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_SpriteFrame_setRectInPixels : Invalid Native Object"); - if (argc == 1) { - cocos2d::Rect arg0; - ok &= jsval_to_ccrect(cx, args.get(0), &arg0); - JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_SpriteFrame_setRectInPixels : Error processing arguments"); - cobj->setRectInPixels(arg0); - args.rval().setUndefined(); - return true; - } - - JS_ReportError(cx, "js_cocos2dx_SpriteFrame_setRectInPixels : wrong number of arguments: %d, was expecting %d", argc, 1); - return false; -} bool js_cocos2dx_SpriteFrame_getTexture(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); @@ -9548,24 +11037,6 @@ bool js_cocos2dx_SpriteFrame_getTexture(JSContext *cx, uint32_t argc, jsval *vp) JS_ReportError(cx, "js_cocos2dx_SpriteFrame_getTexture : wrong number of arguments: %d, was expecting %d", argc, 0); return false; } -bool js_cocos2dx_SpriteFrame_getRect(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::SpriteFrame* cobj = (cocos2d::SpriteFrame *)(proxy ? proxy->ptr : NULL); - JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_SpriteFrame_getRect : Invalid Native Object"); - if (argc == 0) { - const cocos2d::Rect& ret = cobj->getRect(); - jsval jsret = JSVAL_NULL; - jsret = ccrect_to_jsval(cx, ret); - args.rval().set(jsret); - return true; - } - - JS_ReportError(cx, "js_cocos2dx_SpriteFrame_getRect : wrong number of arguments: %d, was expecting %d", argc, 0); - return false; -} bool js_cocos2dx_SpriteFrame_setOffsetInPixels(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); @@ -9586,22 +11057,22 @@ bool js_cocos2dx_SpriteFrame_setOffsetInPixels(JSContext *cx, uint32_t argc, jsv JS_ReportError(cx, "js_cocos2dx_SpriteFrame_setOffsetInPixels : wrong number of arguments: %d, was expecting %d", argc, 1); return false; } -bool js_cocos2dx_SpriteFrame_getRectInPixels(JSContext *cx, uint32_t argc, jsval *vp) +bool js_cocos2dx_SpriteFrame_getOriginalSizeInPixels(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::SpriteFrame* cobj = (cocos2d::SpriteFrame *)(proxy ? proxy->ptr : NULL); - JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_SpriteFrame_getRectInPixels : Invalid Native Object"); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_SpriteFrame_getOriginalSizeInPixels : Invalid Native Object"); if (argc == 0) { - const cocos2d::Rect& ret = cobj->getRectInPixels(); + const cocos2d::Size& ret = cobj->getOriginalSizeInPixels(); jsval jsret = JSVAL_NULL; - jsret = ccrect_to_jsval(cx, ret); + jsret = ccsize_to_jsval(cx, ret); args.rval().set(jsret); return true; } - JS_ReportError(cx, "js_cocos2dx_SpriteFrame_getRectInPixels : wrong number of arguments: %d, was expecting %d", argc, 0); + JS_ReportError(cx, "js_cocos2dx_SpriteFrame_getOriginalSizeInPixels : wrong number of arguments: %d, was expecting %d", argc, 0); return false; } bool js_cocos2dx_SpriteFrame_setOriginalSize(JSContext *cx, uint32_t argc, jsval *vp) @@ -9624,42 +11095,42 @@ bool js_cocos2dx_SpriteFrame_setOriginalSize(JSContext *cx, uint32_t argc, jsval JS_ReportError(cx, "js_cocos2dx_SpriteFrame_setOriginalSize : wrong number of arguments: %d, was expecting %d", argc, 1); return false; } -bool js_cocos2dx_SpriteFrame_getOriginalSizeInPixels(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::SpriteFrame* cobj = (cocos2d::SpriteFrame *)(proxy ? proxy->ptr : NULL); - JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_SpriteFrame_getOriginalSizeInPixels : Invalid Native Object"); - if (argc == 0) { - const cocos2d::Size& ret = cobj->getOriginalSizeInPixels(); - jsval jsret = JSVAL_NULL; - jsret = ccsize_to_jsval(cx, ret); - args.rval().set(jsret); - return true; - } - - JS_ReportError(cx, "js_cocos2dx_SpriteFrame_getOriginalSizeInPixels : wrong number of arguments: %d, was expecting %d", argc, 0); - return false; -} -bool js_cocos2dx_SpriteFrame_setOriginalSizeInPixels(JSContext *cx, uint32_t argc, jsval *vp) +bool js_cocos2dx_SpriteFrame_setRectInPixels(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::SpriteFrame* cobj = (cocos2d::SpriteFrame *)(proxy ? proxy->ptr : NULL); - JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_SpriteFrame_setOriginalSizeInPixels : Invalid Native Object"); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_SpriteFrame_setRectInPixels : Invalid Native Object"); if (argc == 1) { - cocos2d::Size arg0; - ok &= jsval_to_ccsize(cx, args.get(0), &arg0); - JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_SpriteFrame_setOriginalSizeInPixels : Error processing arguments"); - cobj->setOriginalSizeInPixels(arg0); + cocos2d::Rect arg0; + ok &= jsval_to_ccrect(cx, args.get(0), &arg0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_SpriteFrame_setRectInPixels : Error processing arguments"); + cobj->setRectInPixels(arg0); args.rval().setUndefined(); return true; } - JS_ReportError(cx, "js_cocos2dx_SpriteFrame_setOriginalSizeInPixels : wrong number of arguments: %d, was expecting %d", argc, 1); + JS_ReportError(cx, "js_cocos2dx_SpriteFrame_setRectInPixels : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} +bool js_cocos2dx_SpriteFrame_getRect(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::SpriteFrame* cobj = (cocos2d::SpriteFrame *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_SpriteFrame_getRect : Invalid Native Object"); + if (argc == 0) { + const cocos2d::Rect& ret = cobj->getRect(); + jsval jsret = JSVAL_NULL; + jsret = ccrect_to_jsval(cx, ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_SpriteFrame_getRect : wrong number of arguments: %d, was expecting %d", argc, 0); return false; } bool js_cocos2dx_SpriteFrame_setOffset(JSContext *cx, uint32_t argc, jsval *vp) @@ -9682,94 +11153,6 @@ bool js_cocos2dx_SpriteFrame_setOffset(JSContext *cx, uint32_t argc, jsval *vp) JS_ReportError(cx, "js_cocos2dx_SpriteFrame_setOffset : wrong number of arguments: %d, was expecting %d", argc, 1); return false; } -bool js_cocos2dx_SpriteFrame_initWithTexture(JSContext *cx, uint32_t argc, jsval *vp) -{ - bool ok = true; - cocos2d::SpriteFrame* cobj = nullptr; - - JS::CallArgs args = JS::CallArgsFromVp(argc, vp); - JS::RootedObject obj(cx); - obj = args.thisv().toObjectOrNull(); - js_proxy_t *proxy = jsb_get_js_proxy(obj); - cobj = (cocos2d::SpriteFrame *)(proxy ? proxy->ptr : nullptr); - JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_SpriteFrame_initWithTexture : Invalid Native Object"); - do { - if (argc == 5) { - cocos2d::Texture2D* arg0 = nullptr; - 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)); - cocos2d::Vec2 arg3; - ok &= jsval_to_vector2(cx, args.get(3), &arg3); - if (!ok) { ok = true; break; } - cocos2d::Size arg4; - ok &= jsval_to_ccsize(cx, args.get(4), &arg4); - if (!ok) { ok = true; break; } - bool ret = cobj->initWithTexture(arg0, arg1, arg2, arg3, arg4); - jsval jsret = JSVAL_NULL; - jsret = BOOLEAN_TO_JSVAL(ret); - args.rval().set(jsret); - return true; - } - } while(0); - - do { - if (argc == 2) { - cocos2d::Texture2D* arg0 = nullptr; - 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 ret = cobj->initWithTexture(arg0, arg1); - jsval jsret = JSVAL_NULL; - jsret = BOOLEAN_TO_JSVAL(ret); - args.rval().set(jsret); - return true; - } - } while(0); - - JS_ReportError(cx, "js_cocos2dx_SpriteFrame_initWithTexture : wrong number of arguments"); - return false; -} -bool js_cocos2dx_SpriteFrame_isRotated(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::SpriteFrame* cobj = (cocos2d::SpriteFrame *)(proxy ? proxy->ptr : NULL); - JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_SpriteFrame_isRotated : Invalid Native Object"); - if (argc == 0) { - bool ret = cobj->isRotated(); - jsval jsret = JSVAL_NULL; - jsret = BOOLEAN_TO_JSVAL(ret); - args.rval().set(jsret); - return true; - } - - JS_ReportError(cx, "js_cocos2dx_SpriteFrame_isRotated : wrong number of arguments: %d, was expecting %d", argc, 0); - return false; -} bool js_cocos2dx_SpriteFrame_initWithTextureFilename(JSContext *cx, uint32_t argc, jsval *vp) { bool ok = true; @@ -9844,22 +11227,74 @@ bool js_cocos2dx_SpriteFrame_setRect(JSContext *cx, uint32_t argc, jsval *vp) JS_ReportError(cx, "js_cocos2dx_SpriteFrame_setRect : wrong number of arguments: %d, was expecting %d", argc, 1); return false; } -bool js_cocos2dx_SpriteFrame_getOffsetInPixels(JSContext *cx, uint32_t argc, jsval *vp) +bool js_cocos2dx_SpriteFrame_initWithTexture(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::SpriteFrame* cobj = (cocos2d::SpriteFrame *)(proxy ? proxy->ptr : NULL); - JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_SpriteFrame_getOffsetInPixels : Invalid Native Object"); - if (argc == 0) { - const cocos2d::Vec2& ret = cobj->getOffsetInPixels(); - jsval jsret = JSVAL_NULL; - jsret = vector2_to_jsval(cx, ret); - args.rval().set(jsret); - return true; - } + bool ok = true; + cocos2d::SpriteFrame* cobj = nullptr; - JS_ReportError(cx, "js_cocos2dx_SpriteFrame_getOffsetInPixels : wrong number of arguments: %d, was expecting %d", argc, 0); + JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + JS::RootedObject obj(cx); + obj = args.thisv().toObjectOrNull(); + js_proxy_t *proxy = jsb_get_js_proxy(obj); + cobj = (cocos2d::SpriteFrame *)(proxy ? proxy->ptr : nullptr); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_SpriteFrame_initWithTexture : Invalid Native Object"); + do { + if (argc == 5) { + cocos2d::Texture2D* arg0 = nullptr; + 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)); + cocos2d::Vec2 arg3; + ok &= jsval_to_vector2(cx, args.get(3), &arg3); + if (!ok) { ok = true; break; } + cocos2d::Size arg4; + ok &= jsval_to_ccsize(cx, args.get(4), &arg4); + if (!ok) { ok = true; break; } + bool ret = cobj->initWithTexture(arg0, arg1, arg2, arg3, arg4); + jsval jsret = JSVAL_NULL; + jsret = BOOLEAN_TO_JSVAL(ret); + args.rval().set(jsret); + return true; + } + } while(0); + + do { + if (argc == 2) { + cocos2d::Texture2D* arg0 = nullptr; + 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 ret = cobj->initWithTexture(arg0, arg1); + jsval jsret = JSVAL_NULL; + jsret = BOOLEAN_TO_JSVAL(ret); + args.rval().set(jsret); + return true; + } + } while(0); + + JS_ReportError(cx, "js_cocos2dx_SpriteFrame_initWithTexture : wrong number of arguments"); return false; } bool js_cocos2dx_SpriteFrame_getOriginalSize(JSContext *cx, uint32_t argc, jsval *vp) @@ -9880,6 +11315,143 @@ bool js_cocos2dx_SpriteFrame_getOriginalSize(JSContext *cx, uint32_t argc, jsval JS_ReportError(cx, "js_cocos2dx_SpriteFrame_getOriginalSize : wrong number of arguments: %d, was expecting %d", argc, 0); return false; } +bool js_cocos2dx_SpriteFrame_clone(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::SpriteFrame* cobj = (cocos2d::SpriteFrame *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_SpriteFrame_clone : Invalid Native Object"); + if (argc == 0) { + cocos2d::SpriteFrame* ret = cobj->clone(); + jsval jsret = JSVAL_NULL; + do { + if (ret) { + js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::SpriteFrame*)ret); + jsret = OBJECT_TO_JSVAL(jsProxy->obj); + } else { + jsret = JSVAL_NULL; + } + } while (0); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_SpriteFrame_clone : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_SpriteFrame_getRectInPixels(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::SpriteFrame* cobj = (cocos2d::SpriteFrame *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_SpriteFrame_getRectInPixels : Invalid Native Object"); + if (argc == 0) { + const cocos2d::Rect& ret = cobj->getRectInPixels(); + jsval jsret = JSVAL_NULL; + jsret = ccrect_to_jsval(cx, ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_SpriteFrame_getRectInPixels : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_SpriteFrame_isRotated(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::SpriteFrame* cobj = (cocos2d::SpriteFrame *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_SpriteFrame_isRotated : Invalid Native Object"); + if (argc == 0) { + bool ret = cobj->isRotated(); + jsval jsret = JSVAL_NULL; + jsret = BOOLEAN_TO_JSVAL(ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_SpriteFrame_isRotated : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_SpriteFrame_setRotated(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::SpriteFrame* cobj = (cocos2d::SpriteFrame *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_SpriteFrame_setRotated : Invalid Native Object"); + if (argc == 1) { + bool arg0; + arg0 = JS::ToBoolean(args.get(0)); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_SpriteFrame_setRotated : Error processing arguments"); + cobj->setRotated(arg0); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_SpriteFrame_setRotated : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} +bool js_cocos2dx_SpriteFrame_getOffset(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::SpriteFrame* cobj = (cocos2d::SpriteFrame *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_SpriteFrame_getOffset : Invalid Native Object"); + if (argc == 0) { + const cocos2d::Vec2& ret = cobj->getOffset(); + jsval jsret = JSVAL_NULL; + jsret = vector2_to_jsval(cx, ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_SpriteFrame_getOffset : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} +bool js_cocos2dx_SpriteFrame_setOriginalSizeInPixels(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::SpriteFrame* cobj = (cocos2d::SpriteFrame *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_SpriteFrame_setOriginalSizeInPixels : Invalid Native Object"); + if (argc == 1) { + cocos2d::Size arg0; + ok &= jsval_to_ccsize(cx, args.get(0), &arg0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_SpriteFrame_setOriginalSizeInPixels : Error processing arguments"); + cobj->setOriginalSizeInPixels(arg0); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_SpriteFrame_setOriginalSizeInPixels : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} +bool js_cocos2dx_SpriteFrame_getOffsetInPixels(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::SpriteFrame* cobj = (cocos2d::SpriteFrame *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_SpriteFrame_getOffsetInPixels : Invalid Native Object"); + if (argc == 0) { + const cocos2d::Vec2& ret = cobj->getOffsetInPixels(); + jsval jsret = JSVAL_NULL; + jsret = vector2_to_jsval(cx, ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_SpriteFrame_getOffsetInPixels : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} bool js_cocos2dx_SpriteFrame_create(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); @@ -10086,25 +11658,25 @@ void js_register_cocos2dx_SpriteFrame(JSContext *cx, JS::HandleObject global) { }; static JSFunctionSpec funcs[] = { - JS_FN("clone", js_cocos2dx_SpriteFrame_clone, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), - JS_FN("setRotated", js_cocos2dx_SpriteFrame_setRotated, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("setTexture", js_cocos2dx_SpriteFrame_setTexture, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), - JS_FN("getOffset", js_cocos2dx_SpriteFrame_getOffset, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), - JS_FN("setRectInPixels", js_cocos2dx_SpriteFrame_setRectInPixels, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("getTexture", js_cocos2dx_SpriteFrame_getTexture, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), - JS_FN("getRect", js_cocos2dx_SpriteFrame_getRect, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("setOffsetInPixels", js_cocos2dx_SpriteFrame_setOffsetInPixels, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), - JS_FN("getRectInPixels", js_cocos2dx_SpriteFrame_getRectInPixels, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), - JS_FN("setOriginalSize", js_cocos2dx_SpriteFrame_setOriginalSize, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("getOriginalSizeInPixels", js_cocos2dx_SpriteFrame_getOriginalSizeInPixels, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), - JS_FN("setOriginalSizeInPixels", js_cocos2dx_SpriteFrame_setOriginalSizeInPixels, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("setOriginalSize", js_cocos2dx_SpriteFrame_setOriginalSize, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("setRectInPixels", js_cocos2dx_SpriteFrame_setRectInPixels, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getRect", js_cocos2dx_SpriteFrame_getRect, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("setOffset", js_cocos2dx_SpriteFrame_setOffset, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), - JS_FN("initWithTexture", js_cocos2dx_SpriteFrame_initWithTexture, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE), - JS_FN("isRotated", js_cocos2dx_SpriteFrame_isRotated, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("initWithTextureFilename", js_cocos2dx_SpriteFrame_initWithTextureFilename, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("setRect", js_cocos2dx_SpriteFrame_setRect, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), - JS_FN("getOffsetInPixels", js_cocos2dx_SpriteFrame_getOffsetInPixels, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("initWithTexture", js_cocos2dx_SpriteFrame_initWithTexture, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("getOriginalSize", js_cocos2dx_SpriteFrame_getOriginalSize, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("clone", js_cocos2dx_SpriteFrame_clone, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getRectInPixels", js_cocos2dx_SpriteFrame_getRectInPixels, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("isRotated", js_cocos2dx_SpriteFrame_isRotated, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("setRotated", js_cocos2dx_SpriteFrame_setRotated, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getOffset", js_cocos2dx_SpriteFrame_getOffset, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("setOriginalSizeInPixels", js_cocos2dx_SpriteFrame_setOriginalSizeInPixels, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getOffsetInPixels", js_cocos2dx_SpriteFrame_getOffsetInPixels, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("ctor", js_cocos2dx_SpriteFrame_ctor, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FS_END }; @@ -34305,1134 +35877,6 @@ void js_register_cocos2dx_ActionTween(JSContext *cx, JS::HandleObject global) { anonEvaluate(cx, global, "(function () { cc.ActionTween.extend = cc.Class.extend; })()"); } -JSClass *jsb_cocos2d_GLProgramState_class; -JSObject *jsb_cocos2d_GLProgramState_prototype; - -bool js_cocos2dx_GLProgramState_setUniformCallback(JSContext *cx, uint32_t argc, jsval *vp) -{ - bool ok = true; - cocos2d::GLProgramState* cobj = nullptr; - - JS::CallArgs args = JS::CallArgsFromVp(argc, vp); - JS::RootedObject obj(cx); - obj = args.thisv().toObjectOrNull(); - js_proxy_t *proxy = jsb_get_js_proxy(obj); - cobj = (cocos2d::GLProgramState *)(proxy ? proxy->ptr : nullptr); - JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_GLProgramState_setUniformCallback : Invalid Native Object"); - do { - if (argc == 2) { - int arg0 = 0; - ok &= jsval_to_int32(cx, args.get(0), (int32_t *)&arg0); - if (!ok) { ok = true; break; } - std::function arg1; - do { - if(JS_TypeOfValue(cx, args.get(1)) == JSTYPE_FUNCTION) - { - std::shared_ptr func(new JSFunctionWrapper(cx, args.thisv().toObjectOrNull(), args.get(1))); - auto lambda = [=](cocos2d::GLProgram* larg0, cocos2d::Uniform* larg1) -> void { - JSB_AUTOCOMPARTMENT_WITH_GLOBAL_OBJCET - jsval largv[2]; - do { - if (larg0) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::GLProgram*)larg0); - largv[0] = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - largv[0] = JSVAL_NULL; - } - } while (0); - largv[1] = uniform_to_jsval(cx, larg1); - JS::RootedValue rval(cx); - bool succeed = func->invoke(2, &largv[0], &rval); - if (!succeed && JS_IsExceptionPending(cx)) { - JS_ReportPendingException(cx); - } - }; - arg1 = lambda; - } - else - { - arg1 = nullptr; - } - } while(0) - ; - if (!ok) { ok = true; break; } - cobj->setUniformCallback(arg0, arg1); - args.rval().setUndefined(); - 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; } - std::function arg1; - do { - if(JS_TypeOfValue(cx, args.get(1)) == JSTYPE_FUNCTION) - { - std::shared_ptr func(new JSFunctionWrapper(cx, args.thisv().toObjectOrNull(), args.get(1))); - auto lambda = [=](cocos2d::GLProgram* larg0, cocos2d::Uniform* larg1) -> void { - JSB_AUTOCOMPARTMENT_WITH_GLOBAL_OBJCET - jsval largv[2]; - do { - if (larg0) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::GLProgram*)larg0); - largv[0] = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - largv[0] = JSVAL_NULL; - } - } while (0); - largv[1] = uniform_to_jsval(cx, larg1); - JS::RootedValue rval(cx); - bool succeed = func->invoke(2, &largv[0], &rval); - if (!succeed && JS_IsExceptionPending(cx)) { - JS_ReportPendingException(cx); - } - }; - arg1 = lambda; - } - else - { - arg1 = nullptr; - } - } while(0) - ; - if (!ok) { ok = true; break; } - cobj->setUniformCallback(arg0, arg1); - args.rval().setUndefined(); - return true; - } - } while(0); - - JS_ReportError(cx, "js_cocos2dx_GLProgramState_setUniformCallback : wrong number of arguments"); - return false; -} -bool js_cocos2dx_GLProgramState_getVertexAttribsFlags(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::GLProgramState* cobj = (cocos2d::GLProgramState *)(proxy ? proxy->ptr : NULL); - JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_GLProgramState_getVertexAttribsFlags : Invalid Native Object"); - if (argc == 0) { - unsigned int ret = cobj->getVertexAttribsFlags(); - jsval jsret = JSVAL_NULL; - jsret = uint32_to_jsval(cx, ret); - args.rval().set(jsret); - return true; - } - - JS_ReportError(cx, "js_cocos2dx_GLProgramState_getVertexAttribsFlags : wrong number of arguments: %d, was expecting %d", argc, 0); - return false; -} -bool js_cocos2dx_GLProgramState_applyAutoBinding(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::GLProgramState* cobj = (cocos2d::GLProgramState *)(proxy ? proxy->ptr : NULL); - JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_GLProgramState_applyAutoBinding : Invalid Native Object"); - if (argc == 2) { - std::string arg0; - std::string arg1; - ok &= jsval_to_std_string(cx, args.get(0), &arg0); - ok &= jsval_to_std_string(cx, args.get(1), &arg1); - JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_GLProgramState_applyAutoBinding : Error processing arguments"); - cobj->applyAutoBinding(arg0, arg1); - args.rval().setUndefined(); - return true; - } - - JS_ReportError(cx, "js_cocos2dx_GLProgramState_applyAutoBinding : wrong number of arguments: %d, was expecting %d", argc, 2); - return false; -} -bool js_cocos2dx_GLProgramState_setUniformVec2(JSContext *cx, uint32_t argc, jsval *vp) -{ - bool ok = true; - cocos2d::GLProgramState* cobj = nullptr; - - JS::CallArgs args = JS::CallArgsFromVp(argc, vp); - JS::RootedObject obj(cx); - obj = args.thisv().toObjectOrNull(); - js_proxy_t *proxy = jsb_get_js_proxy(obj); - cobj = (cocos2d::GLProgramState *)(proxy ? proxy->ptr : nullptr); - JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_GLProgramState_setUniformVec2 : Invalid Native Object"); - do { - if (argc == 2) { - int arg0 = 0; - ok &= jsval_to_int32(cx, args.get(0), (int32_t *)&arg0); - if (!ok) { ok = true; break; } - cocos2d::Vec2 arg1; - ok &= jsval_to_vector2(cx, args.get(1), &arg1); - if (!ok) { ok = true; break; } - cobj->setUniformVec2(arg0, arg1); - args.rval().setUndefined(); - 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::Vec2 arg1; - ok &= jsval_to_vector2(cx, args.get(1), &arg1); - if (!ok) { ok = true; break; } - cobj->setUniformVec2(arg0, arg1); - args.rval().setUndefined(); - return true; - } - } while(0); - - JS_ReportError(cx, "js_cocos2dx_GLProgramState_setUniformVec2 : wrong number of arguments"); - return false; -} -bool js_cocos2dx_GLProgramState_setUniformVec3(JSContext *cx, uint32_t argc, jsval *vp) -{ - bool ok = true; - cocos2d::GLProgramState* cobj = nullptr; - - JS::CallArgs args = JS::CallArgsFromVp(argc, vp); - JS::RootedObject obj(cx); - obj = args.thisv().toObjectOrNull(); - js_proxy_t *proxy = jsb_get_js_proxy(obj); - cobj = (cocos2d::GLProgramState *)(proxy ? proxy->ptr : nullptr); - JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_GLProgramState_setUniformVec3 : Invalid Native Object"); - do { - if (argc == 2) { - int arg0 = 0; - ok &= jsval_to_int32(cx, args.get(0), (int32_t *)&arg0); - if (!ok) { ok = true; break; } - cocos2d::Vec3 arg1; - ok &= jsval_to_vector3(cx, args.get(1), &arg1); - if (!ok) { ok = true; break; } - cobj->setUniformVec3(arg0, arg1); - args.rval().setUndefined(); - 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::Vec3 arg1; - ok &= jsval_to_vector3(cx, args.get(1), &arg1); - if (!ok) { ok = true; break; } - cobj->setUniformVec3(arg0, arg1); - args.rval().setUndefined(); - return true; - } - } while(0); - - JS_ReportError(cx, "js_cocos2dx_GLProgramState_setUniformVec3 : wrong number of arguments"); - return false; -} -bool js_cocos2dx_GLProgramState_setVertexAttribCallback(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::GLProgramState* cobj = (cocos2d::GLProgramState *)(proxy ? proxy->ptr : NULL); - JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_GLProgramState_setVertexAttribCallback : Invalid Native Object"); - if (argc == 2) { - std::string arg0; - std::function arg1; - ok &= jsval_to_std_string(cx, args.get(0), &arg0); - do { - if(JS_TypeOfValue(cx, args.get(1)) == JSTYPE_FUNCTION) - { - std::shared_ptr func(new JSFunctionWrapper(cx, args.thisv().toObjectOrNull(), args.get(1))); - auto lambda = [=](cocos2d::VertexAttrib* larg0) -> void { - JSB_AUTOCOMPARTMENT_WITH_GLOBAL_OBJCET - jsval largv[1]; - do { - if (larg0) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::VertexAttrib*)larg0); - largv[0] = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - largv[0] = JSVAL_NULL; - } - } while (0); - JS::RootedValue rval(cx); - bool succeed = func->invoke(1, &largv[0], &rval); - if (!succeed && JS_IsExceptionPending(cx)) { - JS_ReportPendingException(cx); - } - }; - arg1 = lambda; - } - else - { - arg1 = nullptr; - } - } while(0) - ; - JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_GLProgramState_setVertexAttribCallback : Error processing arguments"); - cobj->setVertexAttribCallback(arg0, arg1); - args.rval().setUndefined(); - return true; - } - - JS_ReportError(cx, "js_cocos2dx_GLProgramState_setVertexAttribCallback : wrong number of arguments: %d, was expecting %d", argc, 2); - return false; -} -bool js_cocos2dx_GLProgramState_apply(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::GLProgramState* cobj = (cocos2d::GLProgramState *)(proxy ? proxy->ptr : NULL); - JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_GLProgramState_apply : Invalid Native Object"); - if (argc == 1) { - cocos2d::Mat4 arg0; - ok &= jsval_to_matrix(cx, args.get(0), &arg0); - JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_GLProgramState_apply : Error processing arguments"); - cobj->apply(arg0); - args.rval().setUndefined(); - return true; - } - - JS_ReportError(cx, "js_cocos2dx_GLProgramState_apply : wrong number of arguments: %d, was expecting %d", argc, 1); - return false; -} -bool js_cocos2dx_GLProgramState_getNodeBinding(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::GLProgramState* cobj = (cocos2d::GLProgramState *)(proxy ? proxy->ptr : NULL); - JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_GLProgramState_getNodeBinding : Invalid Native Object"); - if (argc == 0) { - cocos2d::Node* ret = cobj->getNodeBinding(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Node*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); - return true; - } - - JS_ReportError(cx, "js_cocos2dx_GLProgramState_getNodeBinding : wrong number of arguments: %d, was expecting %d", argc, 0); - return false; -} -bool js_cocos2dx_GLProgramState_applyGLProgram(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::GLProgramState* cobj = (cocos2d::GLProgramState *)(proxy ? proxy->ptr : NULL); - JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_GLProgramState_applyGLProgram : Invalid Native Object"); - if (argc == 1) { - cocos2d::Mat4 arg0; - ok &= jsval_to_matrix(cx, args.get(0), &arg0); - JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_GLProgramState_applyGLProgram : Error processing arguments"); - cobj->applyGLProgram(arg0); - args.rval().setUndefined(); - return true; - } - - JS_ReportError(cx, "js_cocos2dx_GLProgramState_applyGLProgram : wrong number of arguments: %d, was expecting %d", argc, 1); - return false; -} -bool js_cocos2dx_GLProgramState_setNodeBinding(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::GLProgramState* cobj = (cocos2d::GLProgramState *)(proxy ? proxy->ptr : NULL); - JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_GLProgramState_setNodeBinding : Invalid Native Object"); - if (argc == 1) { - cocos2d::Node* arg0 = nullptr; - 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::Node*)(jsProxy ? jsProxy->ptr : NULL); - JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); - } while (0); - JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_GLProgramState_setNodeBinding : Error processing arguments"); - cobj->setNodeBinding(arg0); - args.rval().setUndefined(); - return true; - } - - JS_ReportError(cx, "js_cocos2dx_GLProgramState_setNodeBinding : wrong number of arguments: %d, was expecting %d", argc, 1); - return false; -} -bool js_cocos2dx_GLProgramState_setUniformInt(JSContext *cx, uint32_t argc, jsval *vp) -{ - bool ok = true; - cocos2d::GLProgramState* cobj = nullptr; - - JS::CallArgs args = JS::CallArgsFromVp(argc, vp); - JS::RootedObject obj(cx); - obj = args.thisv().toObjectOrNull(); - js_proxy_t *proxy = jsb_get_js_proxy(obj); - cobj = (cocos2d::GLProgramState *)(proxy ? proxy->ptr : nullptr); - JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_GLProgramState_setUniformInt : Invalid Native Object"); - do { - if (argc == 2) { - int arg0 = 0; - ok &= jsval_to_int32(cx, args.get(0), (int32_t *)&arg0); - if (!ok) { ok = true; break; } - int arg1 = 0; - ok &= jsval_to_int32(cx, args.get(1), (int32_t *)&arg1); - if (!ok) { ok = true; break; } - cobj->setUniformInt(arg0, arg1); - args.rval().setUndefined(); - 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; } - int arg1 = 0; - ok &= jsval_to_int32(cx, args.get(1), (int32_t *)&arg1); - if (!ok) { ok = true; break; } - cobj->setUniformInt(arg0, arg1); - args.rval().setUndefined(); - return true; - } - } while(0); - - JS_ReportError(cx, "js_cocos2dx_GLProgramState_setUniformInt : wrong number of arguments"); - return false; -} -bool js_cocos2dx_GLProgramState_setParameterAutoBinding(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::GLProgramState* cobj = (cocos2d::GLProgramState *)(proxy ? proxy->ptr : NULL); - JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_GLProgramState_setParameterAutoBinding : Invalid Native Object"); - if (argc == 2) { - std::string arg0; - std::string arg1; - ok &= jsval_to_std_string(cx, args.get(0), &arg0); - ok &= jsval_to_std_string(cx, args.get(1), &arg1); - JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_GLProgramState_setParameterAutoBinding : Error processing arguments"); - cobj->setParameterAutoBinding(arg0, arg1); - args.rval().setUndefined(); - return true; - } - - JS_ReportError(cx, "js_cocos2dx_GLProgramState_setParameterAutoBinding : wrong number of arguments: %d, was expecting %d", argc, 2); - return false; -} -bool js_cocos2dx_GLProgramState_setUniformVec2v(JSContext *cx, uint32_t argc, jsval *vp) -{ - bool ok = true; - cocos2d::GLProgramState* cobj = nullptr; - - JS::CallArgs args = JS::CallArgsFromVp(argc, vp); - JS::RootedObject obj(cx); - obj = args.thisv().toObjectOrNull(); - js_proxy_t *proxy = jsb_get_js_proxy(obj); - cobj = (cocos2d::GLProgramState *)(proxy ? proxy->ptr : nullptr); - JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_GLProgramState_setUniformVec2v : Invalid Native Object"); - do { - if (argc == 3) { - int arg0 = 0; - ok &= jsval_to_int32(cx, args.get(0), (int32_t *)&arg0); - if (!ok) { ok = true; break; } - ssize_t arg1 = 0; - ok &= jsval_to_ssize(cx, args.get(1), &arg1); - if (!ok) { ok = true; break; } - const cocos2d::Vec2* arg2 = nullptr; - std::vector tempData;ok &= jsval_to_vector_vec2(cx, args.get(2), &tempData);arg2=tempData.data(); - if (!ok) { ok = true; break; } - cobj->setUniformVec2v(arg0, arg1, arg2); - args.rval().setUndefined(); - return true; - } - } while(0); - - do { - if (argc == 3) { - std::string arg0; - ok &= jsval_to_std_string(cx, args.get(0), &arg0); - if (!ok) { ok = true; break; } - ssize_t arg1 = 0; - ok &= jsval_to_ssize(cx, args.get(1), &arg1); - if (!ok) { ok = true; break; } - const cocos2d::Vec2* arg2 = nullptr; - std::vector tempData;ok &= jsval_to_vector_vec2(cx, args.get(2), &tempData);arg2=tempData.data(); - if (!ok) { ok = true; break; } - cobj->setUniformVec2v(arg0, arg1, arg2); - args.rval().setUndefined(); - return true; - } - } while(0); - - JS_ReportError(cx, "js_cocos2dx_GLProgramState_setUniformVec2v : wrong number of arguments"); - return false; -} -bool js_cocos2dx_GLProgramState_getUniformCount(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::GLProgramState* cobj = (cocos2d::GLProgramState *)(proxy ? proxy->ptr : NULL); - JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_GLProgramState_getUniformCount : Invalid Native Object"); - if (argc == 0) { - ssize_t ret = cobj->getUniformCount(); - jsval jsret = JSVAL_NULL; - jsret = ssize_to_jsval(cx, ret); - args.rval().set(jsret); - return true; - } - - JS_ReportError(cx, "js_cocos2dx_GLProgramState_getUniformCount : wrong number of arguments: %d, was expecting %d", argc, 0); - return false; -} -bool js_cocos2dx_GLProgramState_applyAttributes(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::GLProgramState* cobj = (cocos2d::GLProgramState *)(proxy ? proxy->ptr : NULL); - JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_GLProgramState_applyAttributes : Invalid Native Object"); - if (argc == 0) { - cobj->applyAttributes(); - args.rval().setUndefined(); - return true; - } - if (argc == 1) { - bool arg0; - arg0 = JS::ToBoolean(args.get(0)); - JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_GLProgramState_applyAttributes : Error processing arguments"); - cobj->applyAttributes(arg0); - args.rval().setUndefined(); - return true; - } - - JS_ReportError(cx, "js_cocos2dx_GLProgramState_applyAttributes : wrong number of arguments: %d, was expecting %d", argc, 0); - return false; -} -bool js_cocos2dx_GLProgramState_clone(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::GLProgramState* cobj = (cocos2d::GLProgramState *)(proxy ? proxy->ptr : NULL); - JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_GLProgramState_clone : Invalid Native Object"); - if (argc == 0) { - cocos2d::GLProgramState* ret = cobj->clone(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::GLProgramState*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); - return true; - } - - JS_ReportError(cx, "js_cocos2dx_GLProgramState_clone : wrong number of arguments: %d, was expecting %d", argc, 0); - return false; -} -bool js_cocos2dx_GLProgramState_setGLProgram(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::GLProgramState* cobj = (cocos2d::GLProgramState *)(proxy ? proxy->ptr : NULL); - JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_GLProgramState_setGLProgram : Invalid Native Object"); - if (argc == 1) { - cocos2d::GLProgram* arg0 = nullptr; - 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::GLProgram*)(jsProxy ? jsProxy->ptr : NULL); - JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); - } while (0); - JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_GLProgramState_setGLProgram : Error processing arguments"); - cobj->setGLProgram(arg0); - args.rval().setUndefined(); - return true; - } - - JS_ReportError(cx, "js_cocos2dx_GLProgramState_setGLProgram : wrong number of arguments: %d, was expecting %d", argc, 1); - return false; -} -bool js_cocos2dx_GLProgramState_setUniformFloatv(JSContext *cx, uint32_t argc, jsval *vp) -{ - bool ok = true; - cocos2d::GLProgramState* cobj = nullptr; - - JS::CallArgs args = JS::CallArgsFromVp(argc, vp); - JS::RootedObject obj(cx); - obj = args.thisv().toObjectOrNull(); - js_proxy_t *proxy = jsb_get_js_proxy(obj); - cobj = (cocos2d::GLProgramState *)(proxy ? proxy->ptr : nullptr); - JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_GLProgramState_setUniformFloatv : Invalid Native Object"); - do { - if (argc == 3) { - int arg0 = 0; - ok &= jsval_to_int32(cx, args.get(0), (int32_t *)&arg0); - if (!ok) { ok = true; break; } - ssize_t arg1 = 0; - ok &= jsval_to_ssize(cx, args.get(1), &arg1); - if (!ok) { ok = true; break; } - const float* arg2 = 0; - #pragma warning NO CONVERSION TO NATIVE FOR float* - ok = false; - if (!ok) { ok = true; break; } - cobj->setUniformFloatv(arg0, arg1, arg2); - args.rval().setUndefined(); - return true; - } - } while(0); - - do { - if (argc == 3) { - std::string arg0; - ok &= jsval_to_std_string(cx, args.get(0), &arg0); - if (!ok) { ok = true; break; } - ssize_t arg1 = 0; - ok &= jsval_to_ssize(cx, args.get(1), &arg1); - if (!ok) { ok = true; break; } - const float* arg2 = 0; - #pragma warning NO CONVERSION TO NATIVE FOR float* - ok = false; - if (!ok) { ok = true; break; } - cobj->setUniformFloatv(arg0, arg1, arg2); - args.rval().setUndefined(); - return true; - } - } while(0); - - JS_ReportError(cx, "js_cocos2dx_GLProgramState_setUniformFloatv : wrong number of arguments"); - return false; -} -bool js_cocos2dx_GLProgramState_getGLProgram(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::GLProgramState* cobj = (cocos2d::GLProgramState *)(proxy ? proxy->ptr : NULL); - JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_GLProgramState_getGLProgram : Invalid Native Object"); - if (argc == 0) { - cocos2d::GLProgram* ret = cobj->getGLProgram(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::GLProgram*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); - return true; - } - - JS_ReportError(cx, "js_cocos2dx_GLProgramState_getGLProgram : wrong number of arguments: %d, was expecting %d", argc, 0); - return false; -} -bool js_cocos2dx_GLProgramState_setUniformTexture(JSContext *cx, uint32_t argc, jsval *vp) -{ - bool ok = true; - cocos2d::GLProgramState* cobj = nullptr; - - JS::CallArgs args = JS::CallArgsFromVp(argc, vp); - JS::RootedObject obj(cx); - obj = args.thisv().toObjectOrNull(); - js_proxy_t *proxy = jsb_get_js_proxy(obj); - cobj = (cocos2d::GLProgramState *)(proxy ? proxy->ptr : nullptr); - JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_GLProgramState_setUniformTexture : Invalid Native Object"); - do { - if (argc == 2) { - std::string arg0; - ok &= jsval_to_std_string(cx, args.get(0), &arg0); - if (!ok) { ok = true; break; } - unsigned int arg1 = 0; - ok &= jsval_to_uint32(cx, args.get(1), &arg1); - if (!ok) { ok = true; break; } - cobj->setUniformTexture(arg0, arg1); - args.rval().setUndefined(); - 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::Texture2D* arg1 = nullptr; - 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 = (cocos2d::Texture2D*)(jsProxy ? jsProxy->ptr : NULL); - JSB_PRECONDITION2( arg1, cx, false, "Invalid Native Object"); - } while (0); - if (!ok) { ok = true; break; } - cobj->setUniformTexture(arg0, arg1); - args.rval().setUndefined(); - return true; - } - } while(0); - - do { - if (argc == 2) { - int arg0 = 0; - ok &= jsval_to_int32(cx, args.get(0), (int32_t *)&arg0); - if (!ok) { ok = true; break; } - cocos2d::Texture2D* arg1 = nullptr; - 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 = (cocos2d::Texture2D*)(jsProxy ? jsProxy->ptr : NULL); - JSB_PRECONDITION2( arg1, cx, false, "Invalid Native Object"); - } while (0); - if (!ok) { ok = true; break; } - cobj->setUniformTexture(arg0, arg1); - args.rval().setUndefined(); - return true; - } - } while(0); - - do { - if (argc == 2) { - int arg0 = 0; - ok &= jsval_to_int32(cx, args.get(0), (int32_t *)&arg0); - if (!ok) { ok = true; break; } - unsigned int arg1 = 0; - ok &= jsval_to_uint32(cx, args.get(1), &arg1); - if (!ok) { ok = true; break; } - cobj->setUniformTexture(arg0, arg1); - args.rval().setUndefined(); - return true; - } - } while(0); - - JS_ReportError(cx, "js_cocos2dx_GLProgramState_setUniformTexture : wrong number of arguments"); - return false; -} -bool js_cocos2dx_GLProgramState_applyUniforms(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::GLProgramState* cobj = (cocos2d::GLProgramState *)(proxy ? proxy->ptr : NULL); - JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_GLProgramState_applyUniforms : Invalid Native Object"); - if (argc == 0) { - cobj->applyUniforms(); - args.rval().setUndefined(); - return true; - } - - JS_ReportError(cx, "js_cocos2dx_GLProgramState_applyUniforms : wrong number of arguments: %d, was expecting %d", argc, 0); - return false; -} -bool js_cocos2dx_GLProgramState_setUniformFloat(JSContext *cx, uint32_t argc, jsval *vp) -{ - bool ok = true; - cocos2d::GLProgramState* cobj = nullptr; - - JS::CallArgs args = JS::CallArgsFromVp(argc, vp); - JS::RootedObject obj(cx); - obj = args.thisv().toObjectOrNull(); - js_proxy_t *proxy = jsb_get_js_proxy(obj); - cobj = (cocos2d::GLProgramState *)(proxy ? proxy->ptr : nullptr); - JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_GLProgramState_setUniformFloat : Invalid Native Object"); - do { - if (argc == 2) { - int arg0 = 0; - ok &= jsval_to_int32(cx, args.get(0), (int32_t *)&arg0); - if (!ok) { ok = true; break; } - double arg1 = 0; - ok &= JS::ToNumber( cx, args.get(1), &arg1) && !isnan(arg1); - if (!ok) { ok = true; break; } - cobj->setUniformFloat(arg0, arg1); - args.rval().setUndefined(); - 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; } - double arg1 = 0; - ok &= JS::ToNumber( cx, args.get(1), &arg1) && !isnan(arg1); - if (!ok) { ok = true; break; } - cobj->setUniformFloat(arg0, arg1); - args.rval().setUndefined(); - return true; - } - } while(0); - - JS_ReportError(cx, "js_cocos2dx_GLProgramState_setUniformFloat : wrong number of arguments"); - return false; -} -bool js_cocos2dx_GLProgramState_setUniformMat4(JSContext *cx, uint32_t argc, jsval *vp) -{ - bool ok = true; - cocos2d::GLProgramState* cobj = nullptr; - - JS::CallArgs args = JS::CallArgsFromVp(argc, vp); - JS::RootedObject obj(cx); - obj = args.thisv().toObjectOrNull(); - js_proxy_t *proxy = jsb_get_js_proxy(obj); - cobj = (cocos2d::GLProgramState *)(proxy ? proxy->ptr : nullptr); - JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_GLProgramState_setUniformMat4 : Invalid Native Object"); - do { - if (argc == 2) { - int arg0 = 0; - ok &= jsval_to_int32(cx, args.get(0), (int32_t *)&arg0); - if (!ok) { ok = true; break; } - cocos2d::Mat4 arg1; - ok &= jsval_to_matrix(cx, args.get(1), &arg1); - if (!ok) { ok = true; break; } - cobj->setUniformMat4(arg0, arg1); - args.rval().setUndefined(); - 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::Mat4 arg1; - ok &= jsval_to_matrix(cx, args.get(1), &arg1); - if (!ok) { ok = true; break; } - cobj->setUniformMat4(arg0, arg1); - args.rval().setUndefined(); - return true; - } - } while(0); - - JS_ReportError(cx, "js_cocos2dx_GLProgramState_setUniformMat4 : wrong number of arguments"); - return false; -} -bool js_cocos2dx_GLProgramState_setUniformVec3v(JSContext *cx, uint32_t argc, jsval *vp) -{ - bool ok = true; - cocos2d::GLProgramState* cobj = nullptr; - - JS::CallArgs args = JS::CallArgsFromVp(argc, vp); - JS::RootedObject obj(cx); - obj = args.thisv().toObjectOrNull(); - js_proxy_t *proxy = jsb_get_js_proxy(obj); - cobj = (cocos2d::GLProgramState *)(proxy ? proxy->ptr : nullptr); - JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_GLProgramState_setUniformVec3v : Invalid Native Object"); - do { - if (argc == 3) { - int arg0 = 0; - ok &= jsval_to_int32(cx, args.get(0), (int32_t *)&arg0); - if (!ok) { ok = true; break; } - ssize_t arg1 = 0; - ok &= jsval_to_ssize(cx, args.get(1), &arg1); - if (!ok) { ok = true; break; } - const cocos2d::Vec3* arg2 = nullptr; - do { - if (args.get(2).isNull()) { arg2 = nullptr; break; } - if (!args.get(2).isObject()) { ok = false; break; } - js_proxy_t *jsProxy; - JSObject *tmpObj = args.get(2).toObjectOrNull(); - jsProxy = jsb_get_js_proxy(tmpObj); - arg2 = (const cocos2d::Vec3*)(jsProxy ? jsProxy->ptr : NULL); - JSB_PRECONDITION2( arg2, cx, false, "Invalid Native Object"); - } while (0); - if (!ok) { ok = true; break; } - cobj->setUniformVec3v(arg0, arg1, arg2); - args.rval().setUndefined(); - return true; - } - } while(0); - - do { - if (argc == 3) { - std::string arg0; - ok &= jsval_to_std_string(cx, args.get(0), &arg0); - if (!ok) { ok = true; break; } - ssize_t arg1 = 0; - ok &= jsval_to_ssize(cx, args.get(1), &arg1); - if (!ok) { ok = true; break; } - const cocos2d::Vec3* arg2 = nullptr; - do { - if (args.get(2).isNull()) { arg2 = nullptr; break; } - if (!args.get(2).isObject()) { ok = false; break; } - js_proxy_t *jsProxy; - JSObject *tmpObj = args.get(2).toObjectOrNull(); - jsProxy = jsb_get_js_proxy(tmpObj); - arg2 = (const cocos2d::Vec3*)(jsProxy ? jsProxy->ptr : NULL); - JSB_PRECONDITION2( arg2, cx, false, "Invalid Native Object"); - } while (0); - if (!ok) { ok = true; break; } - cobj->setUniformVec3v(arg0, arg1, arg2); - args.rval().setUndefined(); - return true; - } - } while(0); - - JS_ReportError(cx, "js_cocos2dx_GLProgramState_setUniformVec3v : wrong number of arguments"); - return false; -} -bool js_cocos2dx_GLProgramState_getVertexAttribCount(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::GLProgramState* cobj = (cocos2d::GLProgramState *)(proxy ? proxy->ptr : NULL); - JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_GLProgramState_getVertexAttribCount : Invalid Native Object"); - if (argc == 0) { - ssize_t ret = cobj->getVertexAttribCount(); - jsval jsret = JSVAL_NULL; - jsret = ssize_to_jsval(cx, ret); - args.rval().set(jsret); - return true; - } - - JS_ReportError(cx, "js_cocos2dx_GLProgramState_getVertexAttribCount : wrong number of arguments: %d, was expecting %d", argc, 0); - return false; -} -bool js_cocos2dx_GLProgramState_create(JSContext *cx, uint32_t argc, jsval *vp) -{ - JS::CallArgs args = JS::CallArgsFromVp(argc, vp); - bool ok = true; - if (argc == 1) { - cocos2d::GLProgram* arg0 = nullptr; - 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::GLProgram*)(jsProxy ? jsProxy->ptr : NULL); - JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); - } while (0); - JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_GLProgramState_create : Error processing arguments"); - cocos2d::GLProgramState* ret = cocos2d::GLProgramState::create(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::GLProgramState*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); - return true; - } - JS_ReportError(cx, "js_cocos2dx_GLProgramState_create : wrong number of arguments"); - return false; -} - -bool js_cocos2dx_GLProgramState_getOrCreateWithGLProgramName(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_GLProgramState_getOrCreateWithGLProgramName : Error processing arguments"); - cocos2d::GLProgramState* ret = cocos2d::GLProgramState::getOrCreateWithGLProgramName(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::GLProgramState*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); - return true; - } - JS_ReportError(cx, "js_cocos2dx_GLProgramState_getOrCreateWithGLProgramName : wrong number of arguments"); - return false; -} - -bool js_cocos2dx_GLProgramState_getOrCreateWithGLProgram(JSContext *cx, uint32_t argc, jsval *vp) -{ - JS::CallArgs args = JS::CallArgsFromVp(argc, vp); - bool ok = true; - if (argc == 1) { - cocos2d::GLProgram* arg0 = nullptr; - 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::GLProgram*)(jsProxy ? jsProxy->ptr : NULL); - JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); - } while (0); - JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_GLProgramState_getOrCreateWithGLProgram : Error processing arguments"); - cocos2d::GLProgramState* ret = cocos2d::GLProgramState::getOrCreateWithGLProgram(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::GLProgramState*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); - return true; - } - JS_ReportError(cx, "js_cocos2dx_GLProgramState_getOrCreateWithGLProgram : wrong number of arguments"); - return false; -} - -bool js_cocos2dx_GLProgramState_getOrCreateWithShaders(JSContext *cx, uint32_t argc, jsval *vp) -{ - JS::CallArgs args = JS::CallArgsFromVp(argc, vp); - bool ok = true; - if (argc == 3) { - std::string arg0; - std::string arg1; - std::string arg2; - ok &= jsval_to_std_string(cx, args.get(0), &arg0); - ok &= jsval_to_std_string(cx, args.get(1), &arg1); - ok &= jsval_to_std_string(cx, args.get(2), &arg2); - JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_GLProgramState_getOrCreateWithShaders : Error processing arguments"); - cocos2d::GLProgramState* ret = cocos2d::GLProgramState::getOrCreateWithShaders(arg0, arg1, arg2); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::GLProgramState*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); - return true; - } - JS_ReportError(cx, "js_cocos2dx_GLProgramState_getOrCreateWithShaders : wrong number of arguments"); - return false; -} - - -void js_cocos2d_GLProgramState_finalize(JSFreeOp *fop, JSObject *obj) { - CCLOGINFO("jsbindings: finalizing JS object %p (GLProgramState)", obj); -} -void js_register_cocos2dx_GLProgramState(JSContext *cx, JS::HandleObject global) { - jsb_cocos2d_GLProgramState_class = (JSClass *)calloc(1, sizeof(JSClass)); - jsb_cocos2d_GLProgramState_class->name = "GLProgramState"; - jsb_cocos2d_GLProgramState_class->addProperty = JS_PropertyStub; - jsb_cocos2d_GLProgramState_class->delProperty = JS_DeletePropertyStub; - jsb_cocos2d_GLProgramState_class->getProperty = JS_PropertyStub; - jsb_cocos2d_GLProgramState_class->setProperty = JS_StrictPropertyStub; - jsb_cocos2d_GLProgramState_class->enumerate = JS_EnumerateStub; - jsb_cocos2d_GLProgramState_class->resolve = JS_ResolveStub; - jsb_cocos2d_GLProgramState_class->convert = JS_ConvertStub; - jsb_cocos2d_GLProgramState_class->finalize = js_cocos2d_GLProgramState_finalize; - jsb_cocos2d_GLProgramState_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("setUniformCallback", js_cocos2dx_GLProgramState_setUniformCallback, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE), - JS_FN("getVertexAttribsFlags", js_cocos2dx_GLProgramState_getVertexAttribsFlags, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), - JS_FN("applyAutoBinding", js_cocos2dx_GLProgramState_applyAutoBinding, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE), - JS_FN("setUniformVec2", js_cocos2dx_GLProgramState_setUniformVec2, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE), - JS_FN("setUniformVec3", js_cocos2dx_GLProgramState_setUniformVec3, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE), - JS_FN("setVertexAttribCallback", js_cocos2dx_GLProgramState_setVertexAttribCallback, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE), - JS_FN("apply", js_cocos2dx_GLProgramState_apply, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), - JS_FN("getNodeBinding", js_cocos2dx_GLProgramState_getNodeBinding, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), - JS_FN("applyGLProgram", js_cocos2dx_GLProgramState_applyGLProgram, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), - JS_FN("setNodeBinding", js_cocos2dx_GLProgramState_setNodeBinding, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), - JS_FN("setUniformInt", js_cocos2dx_GLProgramState_setUniformInt, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE), - JS_FN("setParameterAutoBinding", js_cocos2dx_GLProgramState_setParameterAutoBinding, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE), - JS_FN("setUniformVec2v", js_cocos2dx_GLProgramState_setUniformVec2v, 3, JSPROP_PERMANENT | JSPROP_ENUMERATE), - JS_FN("getUniformCount", js_cocos2dx_GLProgramState_getUniformCount, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), - JS_FN("applyAttributes", js_cocos2dx_GLProgramState_applyAttributes, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), - JS_FN("clone", js_cocos2dx_GLProgramState_clone, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), - JS_FN("setGLProgram", js_cocos2dx_GLProgramState_setGLProgram, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), - JS_FN("setUniformFloatv", js_cocos2dx_GLProgramState_setUniformFloatv, 3, JSPROP_PERMANENT | JSPROP_ENUMERATE), - JS_FN("getGLProgram", js_cocos2dx_GLProgramState_getGLProgram, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), - JS_FN("setUniformTexture", js_cocos2dx_GLProgramState_setUniformTexture, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE), - JS_FN("applyUniforms", js_cocos2dx_GLProgramState_applyUniforms, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), - JS_FN("setUniformFloat", js_cocos2dx_GLProgramState_setUniformFloat, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE), - JS_FN("setUniformMat4", js_cocos2dx_GLProgramState_setUniformMat4, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE), - JS_FN("setUniformVec3v", js_cocos2dx_GLProgramState_setUniformVec3v, 3, JSPROP_PERMANENT | JSPROP_ENUMERATE), - JS_FN("getVertexAttribCount", js_cocos2dx_GLProgramState_getVertexAttribCount, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), - JS_FS_END - }; - - static JSFunctionSpec st_funcs[] = { - JS_FN("create", js_cocos2dx_GLProgramState_create, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), - JS_FN("getOrCreateWithGLProgramName", js_cocos2dx_GLProgramState_getOrCreateWithGLProgramName, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), - JS_FN("getOrCreateWithGLProgram", js_cocos2dx_GLProgramState_getOrCreateWithGLProgram, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), - JS_FN("getOrCreateWithShaders", js_cocos2dx_GLProgramState_getOrCreateWithShaders, 3, JSPROP_PERMANENT | JSPROP_ENUMERATE), - JS_FS_END - }; - - jsb_cocos2d_GLProgramState_prototype = JS_InitClass( - cx, global, - JS::NullPtr(), // parent proto - jsb_cocos2d_GLProgramState_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, "GLProgramState", 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_GLProgramState_class; - p->proto = jsb_cocos2d_GLProgramState_prototype; - p->parentProto = NULL; - _js_global_type_map.insert(std::make_pair(typeName, p)); - } -} - JSClass *jsb_cocos2d_AtlasNode_class; JSObject *jsb_cocos2d_AtlasNode_prototype; @@ -50394,450 +50838,6 @@ 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 = nullptr; - ssize_t arg1 = 0; - int arg2 = 0; - int arg3 = 0; - int arg4 = 0; - #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 = nullptr; - ssize_t arg1 = 0; - int arg2 = 0; - int arg3 = 0; - int arg4 = 0; - 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."); - 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; @@ -71592,7 +71592,7 @@ void register_all_cocos2dx(JSContext* cx, JS::HandleObject obj) { js_register_cocos2dx_FadeTo(cx, ns); js_register_cocos2dx_FadeIn(cx, ns); js_register_cocos2dx_DirectionLight(cx, ns); - js_register_cocos2dx_GLProgramState(cx, ns); + js_register_cocos2dx_ShakyTiles3D(cx, ns); js_register_cocos2dx_EventListenerCustom(cx, ns); js_register_cocos2dx_FlipX3D(cx, ns); js_register_cocos2dx_FlipY3D(cx, ns); @@ -71724,7 +71724,7 @@ void register_all_cocos2dx(JSContext* cx, JS::HandleObject obj) { js_register_cocos2dx_ScaleTo(cx, ns); js_register_cocos2dx_Spawn(cx, ns); js_register_cocos2dx_EaseQuarticActionInOut(cx, ns); - js_register_cocos2dx_ShakyTiles3D(cx, ns); + js_register_cocos2dx_GLProgramState(cx, ns); js_register_cocos2dx_PageTurn3D(cx, ns); js_register_cocos2dx_TransitionSlideInL(cx, ns); js_register_cocos2dx_TransitionSlideInT(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 5288740317..8ee7d60804 100644 --- a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_auto.hpp +++ b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_auto.hpp @@ -485,6 +485,68 @@ bool js_cocos2dx_Follow_isBoundarySet(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_Follow_create(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_Follow_Follow(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_GLProgramState_class; +extern JSObject *jsb_cocos2d_GLProgramState_prototype; + +bool js_cocos2dx_GLProgramState_constructor(JSContext *cx, uint32_t argc, jsval *vp); +void js_cocos2dx_GLProgramState_finalize(JSContext *cx, JSObject *obj); +void js_register_cocos2dx_GLProgramState(JSContext *cx, JS::HandleObject global); +void register_all_cocos2dx(JSContext* cx, JS::HandleObject obj); +bool js_cocos2dx_GLProgramState_setUniformCallback(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_GLProgramState_getVertexAttribsFlags(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_GLProgramState_applyAutoBinding(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_GLProgramState_setUniformVec2(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_GLProgramState_setUniformVec3(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_GLProgramState_setVertexAttribCallback(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_GLProgramState_apply(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_GLProgramState_getNodeBinding(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_GLProgramState_applyGLProgram(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_GLProgramState_setNodeBinding(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_GLProgramState_setUniformInt(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_GLProgramState_setParameterAutoBinding(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_GLProgramState_setUniformVec2v(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_GLProgramState_getUniformCount(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_GLProgramState_applyAttributes(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_GLProgramState_clone(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_GLProgramState_setGLProgram(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_GLProgramState_setUniformFloatv(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_GLProgramState_getGLProgram(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_GLProgramState_setUniformTexture(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_GLProgramState_applyUniforms(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_GLProgramState_setUniformFloat(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_GLProgramState_setUniformMat4(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_GLProgramState_setUniformVec3v(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_GLProgramState_getVertexAttribCount(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_GLProgramState_create(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_GLProgramState_getOrCreateWithGLProgramName(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_GLProgramState_getOrCreateWithGLProgram(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_GLProgramState_getOrCreateWithShaders(JSContext *cx, uint32_t argc, jsval *vp); + extern JSClass *jsb_cocos2d_SpriteFrame_class; extern JSObject *jsb_cocos2d_SpriteFrame_prototype; @@ -492,25 +554,25 @@ bool js_cocos2dx_SpriteFrame_constructor(JSContext *cx, uint32_t argc, jsval *vp void js_cocos2dx_SpriteFrame_finalize(JSContext *cx, JSObject *obj); void js_register_cocos2dx_SpriteFrame(JSContext *cx, JS::HandleObject global); void register_all_cocos2dx(JSContext* cx, JS::HandleObject obj); -bool js_cocos2dx_SpriteFrame_clone(JSContext *cx, uint32_t argc, jsval *vp); -bool js_cocos2dx_SpriteFrame_setRotated(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_SpriteFrame_setTexture(JSContext *cx, uint32_t argc, jsval *vp); -bool js_cocos2dx_SpriteFrame_getOffset(JSContext *cx, uint32_t argc, jsval *vp); -bool js_cocos2dx_SpriteFrame_setRectInPixels(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_SpriteFrame_getTexture(JSContext *cx, uint32_t argc, jsval *vp); -bool js_cocos2dx_SpriteFrame_getRect(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_SpriteFrame_setOffsetInPixels(JSContext *cx, uint32_t argc, jsval *vp); -bool js_cocos2dx_SpriteFrame_getRectInPixels(JSContext *cx, uint32_t argc, jsval *vp); -bool js_cocos2dx_SpriteFrame_setOriginalSize(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_SpriteFrame_getOriginalSizeInPixels(JSContext *cx, uint32_t argc, jsval *vp); -bool js_cocos2dx_SpriteFrame_setOriginalSizeInPixels(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_SpriteFrame_setOriginalSize(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_SpriteFrame_setRectInPixels(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_SpriteFrame_getRect(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_SpriteFrame_setOffset(JSContext *cx, uint32_t argc, jsval *vp); -bool js_cocos2dx_SpriteFrame_initWithTexture(JSContext *cx, uint32_t argc, jsval *vp); -bool js_cocos2dx_SpriteFrame_isRotated(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_SpriteFrame_initWithTextureFilename(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_SpriteFrame_setRect(JSContext *cx, uint32_t argc, jsval *vp); -bool js_cocos2dx_SpriteFrame_getOffsetInPixels(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_SpriteFrame_initWithTexture(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_SpriteFrame_getOriginalSize(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_SpriteFrame_clone(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_SpriteFrame_getRectInPixels(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_SpriteFrame_isRotated(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_SpriteFrame_setRotated(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_SpriteFrame_getOffset(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_SpriteFrame_setOriginalSizeInPixels(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_SpriteFrame_getOffsetInPixels(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_SpriteFrame_create(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_SpriteFrame_createWithTexture(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_SpriteFrame_SpriteFrame(JSContext *cx, uint32_t argc, jsval *vp); @@ -2073,43 +2135,6 @@ void register_all_cocos2dx(JSContext* cx, JS::HandleObject obj); bool js_cocos2dx_ActionTween_initWithDuration(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_ActionTween_create(JSContext *cx, uint32_t argc, jsval *vp); -extern JSClass *jsb_cocos2d_GLProgramState_class; -extern JSObject *jsb_cocos2d_GLProgramState_prototype; - -bool js_cocos2dx_GLProgramState_constructor(JSContext *cx, uint32_t argc, jsval *vp); -void js_cocos2dx_GLProgramState_finalize(JSContext *cx, JSObject *obj); -void js_register_cocos2dx_GLProgramState(JSContext *cx, JS::HandleObject global); -void register_all_cocos2dx(JSContext* cx, JS::HandleObject obj); -bool js_cocos2dx_GLProgramState_setUniformCallback(JSContext *cx, uint32_t argc, jsval *vp); -bool js_cocos2dx_GLProgramState_getVertexAttribsFlags(JSContext *cx, uint32_t argc, jsval *vp); -bool js_cocos2dx_GLProgramState_applyAutoBinding(JSContext *cx, uint32_t argc, jsval *vp); -bool js_cocos2dx_GLProgramState_setUniformVec2(JSContext *cx, uint32_t argc, jsval *vp); -bool js_cocos2dx_GLProgramState_setUniformVec3(JSContext *cx, uint32_t argc, jsval *vp); -bool js_cocos2dx_GLProgramState_setVertexAttribCallback(JSContext *cx, uint32_t argc, jsval *vp); -bool js_cocos2dx_GLProgramState_apply(JSContext *cx, uint32_t argc, jsval *vp); -bool js_cocos2dx_GLProgramState_getNodeBinding(JSContext *cx, uint32_t argc, jsval *vp); -bool js_cocos2dx_GLProgramState_applyGLProgram(JSContext *cx, uint32_t argc, jsval *vp); -bool js_cocos2dx_GLProgramState_setNodeBinding(JSContext *cx, uint32_t argc, jsval *vp); -bool js_cocos2dx_GLProgramState_setUniformInt(JSContext *cx, uint32_t argc, jsval *vp); -bool js_cocos2dx_GLProgramState_setParameterAutoBinding(JSContext *cx, uint32_t argc, jsval *vp); -bool js_cocos2dx_GLProgramState_setUniformVec2v(JSContext *cx, uint32_t argc, jsval *vp); -bool js_cocos2dx_GLProgramState_getUniformCount(JSContext *cx, uint32_t argc, jsval *vp); -bool js_cocos2dx_GLProgramState_applyAttributes(JSContext *cx, uint32_t argc, jsval *vp); -bool js_cocos2dx_GLProgramState_clone(JSContext *cx, uint32_t argc, jsval *vp); -bool js_cocos2dx_GLProgramState_setGLProgram(JSContext *cx, uint32_t argc, jsval *vp); -bool js_cocos2dx_GLProgramState_setUniformFloatv(JSContext *cx, uint32_t argc, jsval *vp); -bool js_cocos2dx_GLProgramState_getGLProgram(JSContext *cx, uint32_t argc, jsval *vp); -bool js_cocos2dx_GLProgramState_setUniformTexture(JSContext *cx, uint32_t argc, jsval *vp); -bool js_cocos2dx_GLProgramState_applyUniforms(JSContext *cx, uint32_t argc, jsval *vp); -bool js_cocos2dx_GLProgramState_setUniformFloat(JSContext *cx, uint32_t argc, jsval *vp); -bool js_cocos2dx_GLProgramState_setUniformMat4(JSContext *cx, uint32_t argc, jsval *vp); -bool js_cocos2dx_GLProgramState_setUniformVec3v(JSContext *cx, uint32_t argc, jsval *vp); -bool js_cocos2dx_GLProgramState_getVertexAttribCount(JSContext *cx, uint32_t argc, jsval *vp); -bool js_cocos2dx_GLProgramState_create(JSContext *cx, uint32_t argc, jsval *vp); -bool js_cocos2dx_GLProgramState_getOrCreateWithGLProgramName(JSContext *cx, uint32_t argc, jsval *vp); -bool js_cocos2dx_GLProgramState_getOrCreateWithGLProgram(JSContext *cx, uint32_t argc, jsval *vp); -bool js_cocos2dx_GLProgramState_getOrCreateWithShaders(JSContext *cx, uint32_t argc, jsval *vp); - extern JSClass *jsb_cocos2d_AtlasNode_class; extern JSObject *jsb_cocos2d_AtlasNode_prototype; @@ -2886,31 +2911,6 @@ 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; diff --git a/cocos/scripting/lua-bindings/auto/api/SpriteFrame.lua b/cocos/scripting/lua-bindings/auto/api/SpriteFrame.lua index 265775acc2..50d04d3576 100644 --- a/cocos/scripting/lua-bindings/auto/api/SpriteFrame.lua +++ b/cocos/scripting/lua-bindings/auto/api/SpriteFrame.lua @@ -4,20 +4,6 @@ -- @extend Ref -- @parent_module cc --------------------------------- --- --- @function [parent=#SpriteFrame] clone --- @param self --- @return SpriteFrame#SpriteFrame ret (return value: cc.SpriteFrame) - --------------------------------- --- Set rotated of the sprite frame.
--- param rotated Rotated the sprite frame if true. --- @function [parent=#SpriteFrame] setRotated --- @param self --- @param #bool rotated --- @return SpriteFrame#SpriteFrame self (return value: cc.SpriteFrame) - -------------------------------- -- Set texture of the frame, the texture is retained.
-- param pobTexture The texture of the sprite frame. @@ -26,21 +12,6 @@ -- @param #cc.Texture2D pobTexture -- @return SpriteFrame#SpriteFrame self (return value: cc.SpriteFrame) --------------------------------- --- Get offset of the frame.
--- return The offset of the sprite frame. --- @function [parent=#SpriteFrame] getOffset --- @param self --- @return vec2_table#vec2_table ret (return value: vec2_table) - --------------------------------- --- Set rect of the sprite frame.
--- param rectInPixels The rect of the sprite frame, in pixels. --- @function [parent=#SpriteFrame] setRectInPixels --- @param self --- @param #rect_table rectInPixels --- @return SpriteFrame#SpriteFrame self (return value: cc.SpriteFrame) - -------------------------------- -- Get texture of the frame.
-- return The texture of the sprite frame. @@ -48,13 +19,6 @@ -- @param self -- @return Texture2D#Texture2D ret (return value: cc.Texture2D) --------------------------------- --- Get rect of the frame.
--- return The rect of the sprite frame. --- @function [parent=#SpriteFrame] getRect --- @param self --- @return rect_table#rect_table ret (return value: rect_table) - -------------------------------- -- Set offset of the frame.
-- param offsetInPixels The offset of the sprite frame, in pixels. @@ -63,21 +27,6 @@ -- @param #vec2_table offsetInPixels -- @return SpriteFrame#SpriteFrame self (return value: cc.SpriteFrame) --------------------------------- --- Get rect of the sprite frame.
--- return The rect of the sprite frame, in pixels. --- @function [parent=#SpriteFrame] getRectInPixels --- @param self --- @return rect_table#rect_table ret (return value: rect_table) - --------------------------------- --- Set original size of the trimmed image.
--- param sizeInPixels The original size of the trimmed image. --- @function [parent=#SpriteFrame] setOriginalSize --- @param self --- @param #size_table sizeInPixels --- @return SpriteFrame#SpriteFrame self (return value: cc.SpriteFrame) - -------------------------------- -- Get original size of the trimmed image.
-- return The original size of the trimmed image, in pixels. @@ -87,12 +36,27 @@ -------------------------------- -- Set original size of the trimmed image.
--- param sizeInPixels The original size of the trimmed image, in pixels. --- @function [parent=#SpriteFrame] setOriginalSizeInPixels +-- param sizeInPixels The original size of the trimmed image. +-- @function [parent=#SpriteFrame] setOriginalSize -- @param self -- @param #size_table sizeInPixels -- @return SpriteFrame#SpriteFrame self (return value: cc.SpriteFrame) +-------------------------------- +-- Set rect of the sprite frame.
+-- param rectInPixels The rect of the sprite frame, in pixels. +-- @function [parent=#SpriteFrame] setRectInPixels +-- @param self +-- @param #rect_table rectInPixels +-- @return SpriteFrame#SpriteFrame self (return value: cc.SpriteFrame) + +-------------------------------- +-- Get rect of the frame.
+-- return The rect of the sprite frame. +-- @function [parent=#SpriteFrame] getRect +-- @param self +-- @return rect_table#rect_table ret (return value: rect_table) + -------------------------------- -- Set offset of the frame.
-- param offsets The offset of the sprite frame. @@ -101,25 +65,6 @@ -- @param #vec2_table offsets -- @return SpriteFrame#SpriteFrame self (return value: cc.SpriteFrame) --------------------------------- --- @overload self, cc.Texture2D, rect_table, bool, vec2_table, size_table --- @overload self, cc.Texture2D, rect_table --- @function [parent=#SpriteFrame] initWithTexture --- @param self --- @param #cc.Texture2D pobTexture --- @param #rect_table rect --- @param #bool rotated --- @param #vec2_table offset --- @param #size_table originalSize --- @return bool#bool ret (return value: bool) - --------------------------------- --- Is the sprite frame rotated or not.
--- return Is rotated if true. --- @function [parent=#SpriteFrame] isRotated --- @param self --- @return bool#bool ret (return value: bool) - -------------------------------- -- @overload self, string, rect_table, bool, vec2_table, size_table -- @overload self, string, rect_table @@ -141,12 +86,17 @@ -- @return SpriteFrame#SpriteFrame self (return value: cc.SpriteFrame) -------------------------------- --- Get offset of the frame.
--- return The offset of the sprite frame, in pixels. --- @function [parent=#SpriteFrame] getOffsetInPixels +-- @overload self, cc.Texture2D, rect_table, bool, vec2_table, size_table +-- @overload self, cc.Texture2D, rect_table +-- @function [parent=#SpriteFrame] initWithTexture -- @param self --- @return vec2_table#vec2_table ret (return value: vec2_table) - +-- @param #cc.Texture2D pobTexture +-- @param #rect_table rect +-- @param #bool rotated +-- @param #vec2_table offset +-- @param #size_table originalSize +-- @return bool#bool ret (return value: bool) + -------------------------------- -- Get original size of the trimmed image.
-- return The original size of the trimmed image. @@ -154,6 +104,56 @@ -- @param self -- @return size_table#size_table ret (return value: size_table) +-------------------------------- +-- +-- @function [parent=#SpriteFrame] clone +-- @param self +-- @return SpriteFrame#SpriteFrame ret (return value: cc.SpriteFrame) + +-------------------------------- +-- Get rect of the sprite frame.
+-- return The rect of the sprite frame, in pixels. +-- @function [parent=#SpriteFrame] getRectInPixels +-- @param self +-- @return rect_table#rect_table ret (return value: rect_table) + +-------------------------------- +-- Is the sprite frame rotated or not.
+-- return Is rotated if true. +-- @function [parent=#SpriteFrame] isRotated +-- @param self +-- @return bool#bool ret (return value: bool) + +-------------------------------- +-- Set rotated of the sprite frame.
+-- param rotated Rotated the sprite frame if true. +-- @function [parent=#SpriteFrame] setRotated +-- @param self +-- @param #bool rotated +-- @return SpriteFrame#SpriteFrame self (return value: cc.SpriteFrame) + +-------------------------------- +-- Get offset of the frame.
+-- return The offset of the sprite frame. +-- @function [parent=#SpriteFrame] getOffset +-- @param self +-- @return vec2_table#vec2_table ret (return value: vec2_table) + +-------------------------------- +-- Set original size of the trimmed image.
+-- param sizeInPixels The original size of the trimmed image, in pixels. +-- @function [parent=#SpriteFrame] setOriginalSizeInPixels +-- @param self +-- @param #size_table sizeInPixels +-- @return SpriteFrame#SpriteFrame self (return value: cc.SpriteFrame) + +-------------------------------- +-- Get offset of the frame.
+-- return The offset of the sprite frame, in pixels. +-- @function [parent=#SpriteFrame] getOffsetInPixels +-- @param self +-- @return vec2_table#vec2_table ret (return value: vec2_table) + -------------------------------- -- @overload self, string, rect_table, bool, vec2_table, size_table -- @overload self, string, rect_table 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 c2805eff72..ff4bbb12f9 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 @@ -96,6 +96,26 @@ -- @field [parent=#cc] Follow#Follow Follow preloaded module +-------------------------------------------------------- +-- the cc Image +-- @field [parent=#cc] Image#Image Image preloaded module + + +-------------------------------------------------------- +-- the cc GLProgramState +-- @field [parent=#cc] GLProgramState#GLProgramState GLProgramState 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 SpriteFrame -- @field [parent=#cc] SpriteFrame#SpriteFrame SpriteFrame preloaded module @@ -746,11 +766,6 @@ -- @field [parent=#cc] ActionTween#ActionTween ActionTween preloaded module --------------------------------------------------------- --- the cc GLProgramState --- @field [parent=#cc] GLProgramState#GLProgramState GLProgramState preloaded module - - -------------------------------------------------------- -- the cc AtlasNode -- @field [parent=#cc] AtlasNode#AtlasNode AtlasNode preloaded module @@ -936,21 +951,6 @@ -- @field [parent=#cc] ProtectedNode#ProtectedNode ProtectedNode 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 diff --git a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.cpp b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.cpp index 27c1ec31d8..6eead82ba4 100644 --- a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.cpp +++ b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.cpp @@ -17907,10 +17907,10 @@ int lua_register_cocos2dx_Follow(lua_State* tolua_S) return 1; } -int lua_cocos2dx_SpriteFrame_clone(lua_State* tolua_S) +int lua_cocos2dx_Image_hasPremultipliedAlpha(lua_State* tolua_S) { int argc = 0; - cocos2d::SpriteFrame* cobj = nullptr; + cocos2d::Image* cobj = nullptr; bool ok = true; #if COCOS2D_DEBUG >= 1 @@ -17919,15 +17919,15 @@ int lua_cocos2dx_SpriteFrame_clone(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.SpriteFrame",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"cc.Image",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (cocos2d::SpriteFrame*)tolua_tousertype(tolua_S,1,0); + 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_SpriteFrame_clone'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Image_hasPremultipliedAlpha'", nullptr); return 0; } #endif @@ -17937,27 +17937,27 @@ int lua_cocos2dx_SpriteFrame_clone(lua_State* tolua_S) { if(!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_SpriteFrame_clone'", nullptr); + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Image_hasPremultipliedAlpha'", nullptr); return 0; } - cocos2d::SpriteFrame* ret = cobj->clone(); - object_to_luaval(tolua_S, "cc.SpriteFrame",(cocos2d::SpriteFrame*)ret); + 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.SpriteFrame:clone",argc, 0); + 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_SpriteFrame_clone'.",&tolua_err); + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Image_hasPremultipliedAlpha'.",&tolua_err); #endif return 0; } -int lua_cocos2dx_SpriteFrame_setRotated(lua_State* tolua_S) +int lua_cocos2dx_Image_saveToFile(lua_State* tolua_S) { int argc = 0; - cocos2d::SpriteFrame* cobj = nullptr; + cocos2d::Image* cobj = nullptr; bool ok = true; #if COCOS2D_DEBUG >= 1 @@ -17966,15 +17966,15 @@ int lua_cocos2dx_SpriteFrame_setRotated(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.SpriteFrame",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"cc.Image",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (cocos2d::SpriteFrame*)tolua_tousertype(tolua_S,1,0); + 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_SpriteFrame_setRotated'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Image_saveToFile'", nullptr); return 0; } #endif @@ -17982,28 +17982,2536 @@ int lua_cocos2dx_SpriteFrame_setRotated(lua_State* tolua_S) argc = lua_gettop(tolua_S)-1; if (argc == 1) { - bool arg0; + std::string arg0; - ok &= luaval_to_boolean(tolua_S, 2,&arg0, "cc.SpriteFrame:setRotated"); + ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.Image:saveToFile"); if(!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_SpriteFrame_setRotated'", nullptr); + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Image_saveToFile'", nullptr); return 0; } - cobj->setRotated(arg0); - lua_settop(tolua_S, 1); + bool ret = cobj->saveToFile(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.SpriteFrame:setRotated",argc, 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_SpriteFrame_setRotated'.",&tolua_err); + 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_GLProgramState_getVertexAttribsFlags(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::GLProgramState* 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.GLProgramState",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::GLProgramState*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_GLProgramState_getVertexAttribsFlags'", 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_GLProgramState_getVertexAttribsFlags'", nullptr); + return 0; + } + unsigned int ret = cobj->getVertexAttribsFlags(); + 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.GLProgramState:getVertexAttribsFlags",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgramState_getVertexAttribsFlags'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_GLProgramState_setUniformVec4(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::GLProgramState* 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.GLProgramState",0,&tolua_err)) goto tolua_lerror; +#endif + cobj = (cocos2d::GLProgramState*)tolua_tousertype(tolua_S,1,0); +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_GLProgramState_setUniformVec4'", nullptr); + return 0; + } +#endif + argc = lua_gettop(tolua_S)-1; + do{ + if (argc == 2) { + int arg0; + ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "cc.GLProgramState:setUniformVec4"); + + if (!ok) { break; } + cocos2d::Vec4 arg1; + ok &= luaval_to_vec4(tolua_S, 3, &arg1, "cc.GLProgramState:setUniformVec4"); + + if (!ok) { break; } + cobj->setUniformVec4(arg0, arg1); + lua_settop(tolua_S, 1); + return 1; + } + }while(0); + ok = true; + do{ + if (argc == 2) { + std::string arg0; + ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.GLProgramState:setUniformVec4"); + + if (!ok) { break; } + cocos2d::Vec4 arg1; + ok &= luaval_to_vec4(tolua_S, 3, &arg1, "cc.GLProgramState:setUniformVec4"); + + if (!ok) { break; } + cobj->setUniformVec4(arg0, arg1); + 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", "cc.GLProgramState:setUniformVec4",argc, 2); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgramState_setUniformVec4'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_GLProgramState_applyAutoBinding(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::GLProgramState* 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.GLProgramState",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::GLProgramState*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_GLProgramState_applyAutoBinding'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 2) + { + std::string arg0; + std::string arg1; + + ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.GLProgramState:applyAutoBinding"); + + ok &= luaval_to_std_string(tolua_S, 3,&arg1, "cc.GLProgramState:applyAutoBinding"); + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_GLProgramState_applyAutoBinding'", nullptr); + return 0; + } + cobj->applyAutoBinding(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.GLProgramState:applyAutoBinding",argc, 2); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgramState_applyAutoBinding'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_GLProgramState_setUniformVec2(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::GLProgramState* 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.GLProgramState",0,&tolua_err)) goto tolua_lerror; +#endif + cobj = (cocos2d::GLProgramState*)tolua_tousertype(tolua_S,1,0); +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_GLProgramState_setUniformVec2'", nullptr); + return 0; + } +#endif + argc = lua_gettop(tolua_S)-1; + do{ + if (argc == 2) { + int arg0; + ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "cc.GLProgramState:setUniformVec2"); + + if (!ok) { break; } + cocos2d::Vec2 arg1; + ok &= luaval_to_vec2(tolua_S, 3, &arg1, "cc.GLProgramState:setUniformVec2"); + + if (!ok) { break; } + cobj->setUniformVec2(arg0, arg1); + lua_settop(tolua_S, 1); + return 1; + } + }while(0); + ok = true; + do{ + if (argc == 2) { + std::string arg0; + ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.GLProgramState:setUniformVec2"); + + if (!ok) { break; } + cocos2d::Vec2 arg1; + ok &= luaval_to_vec2(tolua_S, 3, &arg1, "cc.GLProgramState:setUniformVec2"); + + if (!ok) { break; } + cobj->setUniformVec2(arg0, arg1); + 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", "cc.GLProgramState:setUniformVec2",argc, 2); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgramState_setUniformVec2'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_GLProgramState_setUniformVec3(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::GLProgramState* 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.GLProgramState",0,&tolua_err)) goto tolua_lerror; +#endif + cobj = (cocos2d::GLProgramState*)tolua_tousertype(tolua_S,1,0); +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_GLProgramState_setUniformVec3'", nullptr); + return 0; + } +#endif + argc = lua_gettop(tolua_S)-1; + do{ + if (argc == 2) { + int arg0; + ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "cc.GLProgramState:setUniformVec3"); + + if (!ok) { break; } + cocos2d::Vec3 arg1; + ok &= luaval_to_vec3(tolua_S, 3, &arg1, "cc.GLProgramState:setUniformVec3"); + + if (!ok) { break; } + cobj->setUniformVec3(arg0, arg1); + lua_settop(tolua_S, 1); + return 1; + } + }while(0); + ok = true; + do{ + if (argc == 2) { + std::string arg0; + ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.GLProgramState:setUniformVec3"); + + if (!ok) { break; } + cocos2d::Vec3 arg1; + ok &= luaval_to_vec3(tolua_S, 3, &arg1, "cc.GLProgramState:setUniformVec3"); + + if (!ok) { break; } + cobj->setUniformVec3(arg0, arg1); + 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", "cc.GLProgramState:setUniformVec3",argc, 2); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgramState_setUniformVec3'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_GLProgramState_apply(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::GLProgramState* 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.GLProgramState",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::GLProgramState*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_GLProgramState_apply'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + cocos2d::Mat4 arg0; + + ok &= luaval_to_mat4(tolua_S, 2, &arg0, "cc.GLProgramState:apply"); + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_GLProgramState_apply'", nullptr); + return 0; + } + cobj->apply(arg0); + lua_settop(tolua_S, 1); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.GLProgramState:apply",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgramState_apply'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_GLProgramState_getNodeBinding(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::GLProgramState* 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.GLProgramState",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::GLProgramState*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_GLProgramState_getNodeBinding'", 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_GLProgramState_getNodeBinding'", nullptr); + return 0; + } + cocos2d::Node* ret = cobj->getNodeBinding(); + object_to_luaval(tolua_S, "cc.Node",(cocos2d::Node*)ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.GLProgramState:getNodeBinding",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgramState_getNodeBinding'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_GLProgramState_setUniformVec4v(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::GLProgramState* 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.GLProgramState",0,&tolua_err)) goto tolua_lerror; +#endif + cobj = (cocos2d::GLProgramState*)tolua_tousertype(tolua_S,1,0); +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_GLProgramState_setUniformVec4v'", nullptr); + return 0; + } +#endif + argc = lua_gettop(tolua_S)-1; + do{ + if (argc == 3) { + int arg0; + ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "cc.GLProgramState:setUniformVec4v"); + + if (!ok) { break; } + ssize_t arg1; + ok &= luaval_to_ssize(tolua_S, 3, &arg1, "cc.GLProgramState:setUniformVec4v"); + + if (!ok) { break; } + const cocos2d::Vec4* arg2; + ok &= luaval_to_object(tolua_S, 4, "cc.Vec4",&arg2, "cc.GLProgramState:setUniformVec4v"); + + if (!ok) { break; } + cobj->setUniformVec4v(arg0, arg1, arg2); + lua_settop(tolua_S, 1); + return 1; + } + }while(0); + ok = true; + do{ + if (argc == 3) { + std::string arg0; + ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.GLProgramState:setUniformVec4v"); + + if (!ok) { break; } + ssize_t arg1; + ok &= luaval_to_ssize(tolua_S, 3, &arg1, "cc.GLProgramState:setUniformVec4v"); + + if (!ok) { break; } + const cocos2d::Vec4* arg2; + ok &= luaval_to_object(tolua_S, 4, "cc.Vec4",&arg2, "cc.GLProgramState:setUniformVec4v"); + + if (!ok) { break; } + cobj->setUniformVec4v(arg0, arg1, arg2); + 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", "cc.GLProgramState:setUniformVec4v",argc, 3); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgramState_setUniformVec4v'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_GLProgramState_applyGLProgram(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::GLProgramState* 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.GLProgramState",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::GLProgramState*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_GLProgramState_applyGLProgram'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + cocos2d::Mat4 arg0; + + ok &= luaval_to_mat4(tolua_S, 2, &arg0, "cc.GLProgramState:applyGLProgram"); + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_GLProgramState_applyGLProgram'", nullptr); + return 0; + } + cobj->applyGLProgram(arg0); + lua_settop(tolua_S, 1); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.GLProgramState:applyGLProgram",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgramState_applyGLProgram'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_GLProgramState_setNodeBinding(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::GLProgramState* 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.GLProgramState",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::GLProgramState*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_GLProgramState_setNodeBinding'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + cocos2d::Node* arg0; + + ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0, "cc.GLProgramState:setNodeBinding"); + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_GLProgramState_setNodeBinding'", nullptr); + return 0; + } + cobj->setNodeBinding(arg0); + lua_settop(tolua_S, 1); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.GLProgramState:setNodeBinding",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgramState_setNodeBinding'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_GLProgramState_setUniformInt(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::GLProgramState* 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.GLProgramState",0,&tolua_err)) goto tolua_lerror; +#endif + cobj = (cocos2d::GLProgramState*)tolua_tousertype(tolua_S,1,0); +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_GLProgramState_setUniformInt'", nullptr); + return 0; + } +#endif + argc = lua_gettop(tolua_S)-1; + do{ + if (argc == 2) { + int arg0; + ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "cc.GLProgramState:setUniformInt"); + + if (!ok) { break; } + int arg1; + ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1, "cc.GLProgramState:setUniformInt"); + + if (!ok) { break; } + cobj->setUniformInt(arg0, arg1); + lua_settop(tolua_S, 1); + return 1; + } + }while(0); + ok = true; + do{ + if (argc == 2) { + std::string arg0; + ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.GLProgramState:setUniformInt"); + + if (!ok) { break; } + int arg1; + ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1, "cc.GLProgramState:setUniformInt"); + + if (!ok) { break; } + cobj->setUniformInt(arg0, arg1); + 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", "cc.GLProgramState:setUniformInt",argc, 2); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgramState_setUniformInt'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_GLProgramState_setParameterAutoBinding(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::GLProgramState* 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.GLProgramState",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::GLProgramState*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_GLProgramState_setParameterAutoBinding'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 2) + { + std::string arg0; + std::string arg1; + + ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.GLProgramState:setParameterAutoBinding"); + + ok &= luaval_to_std_string(tolua_S, 3,&arg1, "cc.GLProgramState:setParameterAutoBinding"); + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_GLProgramState_setParameterAutoBinding'", nullptr); + return 0; + } + cobj->setParameterAutoBinding(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.GLProgramState:setParameterAutoBinding",argc, 2); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgramState_setParameterAutoBinding'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_GLProgramState_setUniformVec2v(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::GLProgramState* 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.GLProgramState",0,&tolua_err)) goto tolua_lerror; +#endif + cobj = (cocos2d::GLProgramState*)tolua_tousertype(tolua_S,1,0); +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_GLProgramState_setUniformVec2v'", nullptr); + return 0; + } +#endif + argc = lua_gettop(tolua_S)-1; + do{ + if (argc == 3) { + int arg0; + ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "cc.GLProgramState:setUniformVec2v"); + + if (!ok) { break; } + ssize_t arg1; + ok &= luaval_to_ssize(tolua_S, 3, &arg1, "cc.GLProgramState:setUniformVec2v"); + + if (!ok) { break; } + const cocos2d::Vec2* arg2; + ok &= luaval_to_object(tolua_S, 4, "cc.Vec2",&arg2, "cc.GLProgramState:setUniformVec2v"); + + if (!ok) { break; } + cobj->setUniformVec2v(arg0, arg1, arg2); + lua_settop(tolua_S, 1); + return 1; + } + }while(0); + ok = true; + do{ + if (argc == 3) { + std::string arg0; + ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.GLProgramState:setUniformVec2v"); + + if (!ok) { break; } + ssize_t arg1; + ok &= luaval_to_ssize(tolua_S, 3, &arg1, "cc.GLProgramState:setUniformVec2v"); + + if (!ok) { break; } + const cocos2d::Vec2* arg2; + ok &= luaval_to_object(tolua_S, 4, "cc.Vec2",&arg2, "cc.GLProgramState:setUniformVec2v"); + + if (!ok) { break; } + cobj->setUniformVec2v(arg0, arg1, arg2); + 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", "cc.GLProgramState:setUniformVec2v",argc, 3); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgramState_setUniformVec2v'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_GLProgramState_getUniformCount(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::GLProgramState* 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.GLProgramState",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::GLProgramState*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_GLProgramState_getUniformCount'", 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_GLProgramState_getUniformCount'", nullptr); + return 0; + } + ssize_t ret = cobj->getUniformCount(); + 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.GLProgramState:getUniformCount",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgramState_getUniformCount'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_GLProgramState_applyAttributes(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::GLProgramState* 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.GLProgramState",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::GLProgramState*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_GLProgramState_applyAttributes'", 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_GLProgramState_applyAttributes'", nullptr); + return 0; + } + cobj->applyAttributes(); + lua_settop(tolua_S, 1); + return 1; + } + if (argc == 1) + { + bool arg0; + + ok &= luaval_to_boolean(tolua_S, 2,&arg0, "cc.GLProgramState:applyAttributes"); + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_GLProgramState_applyAttributes'", nullptr); + return 0; + } + cobj->applyAttributes(arg0); + lua_settop(tolua_S, 1); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.GLProgramState:applyAttributes",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgramState_applyAttributes'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_GLProgramState_clone(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::GLProgramState* 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.GLProgramState",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::GLProgramState*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_GLProgramState_clone'", 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_GLProgramState_clone'", nullptr); + return 0; + } + cocos2d::GLProgramState* ret = cobj->clone(); + object_to_luaval(tolua_S, "cc.GLProgramState",(cocos2d::GLProgramState*)ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.GLProgramState:clone",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgramState_clone'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_GLProgramState_setGLProgram(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::GLProgramState* 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.GLProgramState",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::GLProgramState*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_GLProgramState_setGLProgram'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + cocos2d::GLProgram* arg0; + + ok &= luaval_to_object(tolua_S, 2, "cc.GLProgram",&arg0, "cc.GLProgramState:setGLProgram"); + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_GLProgramState_setGLProgram'", nullptr); + return 0; + } + cobj->setGLProgram(arg0); + lua_settop(tolua_S, 1); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.GLProgramState:setGLProgram",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgramState_setGLProgram'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_GLProgramState_setUniformFloatv(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::GLProgramState* 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.GLProgramState",0,&tolua_err)) goto tolua_lerror; +#endif + cobj = (cocos2d::GLProgramState*)tolua_tousertype(tolua_S,1,0); +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_GLProgramState_setUniformFloatv'", nullptr); + return 0; + } +#endif + argc = lua_gettop(tolua_S)-1; + do{ + if (argc == 3) { + int arg0; + ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "cc.GLProgramState:setUniformFloatv"); + + if (!ok) { break; } + ssize_t arg1; + ok &= luaval_to_ssize(tolua_S, 3, &arg1, "cc.GLProgramState:setUniformFloatv"); + + if (!ok) { break; } + const float* arg2; + #pragma warning NO CONVERSION TO NATIVE FOR float* + ok = false; + + if (!ok) { break; } + cobj->setUniformFloatv(arg0, arg1, arg2); + lua_settop(tolua_S, 1); + return 1; + } + }while(0); + ok = true; + do{ + if (argc == 3) { + std::string arg0; + ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.GLProgramState:setUniformFloatv"); + + if (!ok) { break; } + ssize_t arg1; + ok &= luaval_to_ssize(tolua_S, 3, &arg1, "cc.GLProgramState:setUniformFloatv"); + + if (!ok) { break; } + const float* arg2; + #pragma warning NO CONVERSION TO NATIVE FOR float* + ok = false; + + if (!ok) { break; } + cobj->setUniformFloatv(arg0, arg1, arg2); + 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", "cc.GLProgramState:setUniformFloatv",argc, 3); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgramState_setUniformFloatv'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_GLProgramState_getGLProgram(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::GLProgramState* 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.GLProgramState",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::GLProgramState*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_GLProgramState_getGLProgram'", 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_GLProgramState_getGLProgram'", nullptr); + return 0; + } + cocos2d::GLProgram* ret = cobj->getGLProgram(); + object_to_luaval(tolua_S, "cc.GLProgram",(cocos2d::GLProgram*)ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.GLProgramState:getGLProgram",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgramState_getGLProgram'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_GLProgramState_setUniformTexture(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::GLProgramState* 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.GLProgramState",0,&tolua_err)) goto tolua_lerror; +#endif + cobj = (cocos2d::GLProgramState*)tolua_tousertype(tolua_S,1,0); +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_GLProgramState_setUniformTexture'", nullptr); + return 0; + } +#endif + argc = lua_gettop(tolua_S)-1; + do{ + if (argc == 2) { + std::string arg0; + ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.GLProgramState:setUniformTexture"); + + if (!ok) { break; } + unsigned int arg1; + ok &= luaval_to_uint32(tolua_S, 3,&arg1, "cc.GLProgramState:setUniformTexture"); + + if (!ok) { break; } + cobj->setUniformTexture(arg0, arg1); + lua_settop(tolua_S, 1); + return 1; + } + }while(0); + ok = true; + do{ + if (argc == 2) { + std::string arg0; + ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.GLProgramState:setUniformTexture"); + + if (!ok) { break; } + cocos2d::Texture2D* arg1; + ok &= luaval_to_object(tolua_S, 3, "cc.Texture2D",&arg1, "cc.GLProgramState:setUniformTexture"); + + if (!ok) { break; } + cobj->setUniformTexture(arg0, arg1); + lua_settop(tolua_S, 1); + return 1; + } + }while(0); + ok = true; + do{ + if (argc == 2) { + int arg0; + ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "cc.GLProgramState:setUniformTexture"); + + if (!ok) { break; } + cocos2d::Texture2D* arg1; + ok &= luaval_to_object(tolua_S, 3, "cc.Texture2D",&arg1, "cc.GLProgramState:setUniformTexture"); + + if (!ok) { break; } + cobj->setUniformTexture(arg0, arg1); + lua_settop(tolua_S, 1); + return 1; + } + }while(0); + ok = true; + do{ + if (argc == 2) { + int arg0; + ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "cc.GLProgramState:setUniformTexture"); + + if (!ok) { break; } + unsigned int arg1; + ok &= luaval_to_uint32(tolua_S, 3,&arg1, "cc.GLProgramState:setUniformTexture"); + + if (!ok) { break; } + cobj->setUniformTexture(arg0, arg1); + 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", "cc.GLProgramState:setUniformTexture",argc, 2); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgramState_setUniformTexture'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_GLProgramState_applyUniforms(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::GLProgramState* 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.GLProgramState",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::GLProgramState*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_GLProgramState_applyUniforms'", 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_GLProgramState_applyUniforms'", nullptr); + return 0; + } + cobj->applyUniforms(); + lua_settop(tolua_S, 1); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.GLProgramState:applyUniforms",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgramState_applyUniforms'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_GLProgramState_setUniformFloat(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::GLProgramState* 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.GLProgramState",0,&tolua_err)) goto tolua_lerror; +#endif + cobj = (cocos2d::GLProgramState*)tolua_tousertype(tolua_S,1,0); +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_GLProgramState_setUniformFloat'", nullptr); + return 0; + } +#endif + argc = lua_gettop(tolua_S)-1; + do{ + if (argc == 2) { + int arg0; + ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "cc.GLProgramState:setUniformFloat"); + + if (!ok) { break; } + double arg1; + ok &= luaval_to_number(tolua_S, 3,&arg1, "cc.GLProgramState:setUniformFloat"); + + if (!ok) { break; } + cobj->setUniformFloat(arg0, arg1); + lua_settop(tolua_S, 1); + return 1; + } + }while(0); + ok = true; + do{ + if (argc == 2) { + std::string arg0; + ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.GLProgramState:setUniformFloat"); + + if (!ok) { break; } + double arg1; + ok &= luaval_to_number(tolua_S, 3,&arg1, "cc.GLProgramState:setUniformFloat"); + + if (!ok) { break; } + cobj->setUniformFloat(arg0, arg1); + 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", "cc.GLProgramState:setUniformFloat",argc, 2); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgramState_setUniformFloat'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_GLProgramState_setUniformMat4(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::GLProgramState* 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.GLProgramState",0,&tolua_err)) goto tolua_lerror; +#endif + cobj = (cocos2d::GLProgramState*)tolua_tousertype(tolua_S,1,0); +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_GLProgramState_setUniformMat4'", nullptr); + return 0; + } +#endif + argc = lua_gettop(tolua_S)-1; + do{ + if (argc == 2) { + int arg0; + ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "cc.GLProgramState:setUniformMat4"); + + if (!ok) { break; } + cocos2d::Mat4 arg1; + ok &= luaval_to_mat4(tolua_S, 3, &arg1, "cc.GLProgramState:setUniformMat4"); + + if (!ok) { break; } + cobj->setUniformMat4(arg0, arg1); + lua_settop(tolua_S, 1); + return 1; + } + }while(0); + ok = true; + do{ + if (argc == 2) { + std::string arg0; + ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.GLProgramState:setUniformMat4"); + + if (!ok) { break; } + cocos2d::Mat4 arg1; + ok &= luaval_to_mat4(tolua_S, 3, &arg1, "cc.GLProgramState:setUniformMat4"); + + if (!ok) { break; } + cobj->setUniformMat4(arg0, arg1); + 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", "cc.GLProgramState:setUniformMat4",argc, 2); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgramState_setUniformMat4'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_GLProgramState_setUniformVec3v(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::GLProgramState* 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.GLProgramState",0,&tolua_err)) goto tolua_lerror; +#endif + cobj = (cocos2d::GLProgramState*)tolua_tousertype(tolua_S,1,0); +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_GLProgramState_setUniformVec3v'", nullptr); + return 0; + } +#endif + argc = lua_gettop(tolua_S)-1; + do{ + if (argc == 3) { + int arg0; + ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "cc.GLProgramState:setUniformVec3v"); + + if (!ok) { break; } + ssize_t arg1; + ok &= luaval_to_ssize(tolua_S, 3, &arg1, "cc.GLProgramState:setUniformVec3v"); + + if (!ok) { break; } + const cocos2d::Vec3* arg2; + ok &= luaval_to_object(tolua_S, 4, "cc.Vec3",&arg2, "cc.GLProgramState:setUniformVec3v"); + + if (!ok) { break; } + cobj->setUniformVec3v(arg0, arg1, arg2); + lua_settop(tolua_S, 1); + return 1; + } + }while(0); + ok = true; + do{ + if (argc == 3) { + std::string arg0; + ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.GLProgramState:setUniformVec3v"); + + if (!ok) { break; } + ssize_t arg1; + ok &= luaval_to_ssize(tolua_S, 3, &arg1, "cc.GLProgramState:setUniformVec3v"); + + if (!ok) { break; } + const cocos2d::Vec3* arg2; + ok &= luaval_to_object(tolua_S, 4, "cc.Vec3",&arg2, "cc.GLProgramState:setUniformVec3v"); + + if (!ok) { break; } + cobj->setUniformVec3v(arg0, arg1, arg2); + 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", "cc.GLProgramState:setUniformVec3v",argc, 3); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgramState_setUniformVec3v'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_GLProgramState_getVertexAttribCount(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::GLProgramState* 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.GLProgramState",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::GLProgramState*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_GLProgramState_getVertexAttribCount'", 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_GLProgramState_getVertexAttribCount'", nullptr); + return 0; + } + ssize_t ret = cobj->getVertexAttribCount(); + 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.GLProgramState:getVertexAttribCount",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgramState_getVertexAttribCount'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_GLProgramState_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.GLProgramState",0,&tolua_err)) goto tolua_lerror; +#endif + + argc = lua_gettop(tolua_S) - 1; + + if (argc == 1) + { + cocos2d::GLProgram* arg0; + ok &= luaval_to_object(tolua_S, 2, "cc.GLProgram",&arg0, "cc.GLProgramState:create"); + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_GLProgramState_create'", nullptr); + return 0; + } + cocos2d::GLProgramState* ret = cocos2d::GLProgramState::create(arg0); + object_to_luaval(tolua_S, "cc.GLProgramState",(cocos2d::GLProgramState*)ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d\n ", "cc.GLProgramState:create",argc, 1); + return 0; +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgramState_create'.",&tolua_err); +#endif + return 0; +} +int lua_cocos2dx_GLProgramState_getOrCreateWithGLProgramName(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.GLProgramState",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.GLProgramState:getOrCreateWithGLProgramName"); + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_GLProgramState_getOrCreateWithGLProgramName'", nullptr); + return 0; + } + cocos2d::GLProgramState* ret = cocos2d::GLProgramState::getOrCreateWithGLProgramName(arg0); + object_to_luaval(tolua_S, "cc.GLProgramState",(cocos2d::GLProgramState*)ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d\n ", "cc.GLProgramState:getOrCreateWithGLProgramName",argc, 1); + return 0; +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgramState_getOrCreateWithGLProgramName'.",&tolua_err); +#endif + return 0; +} +int lua_cocos2dx_GLProgramState_getOrCreateWithGLProgram(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.GLProgramState",0,&tolua_err)) goto tolua_lerror; +#endif + + argc = lua_gettop(tolua_S) - 1; + + if (argc == 1) + { + cocos2d::GLProgram* arg0; + ok &= luaval_to_object(tolua_S, 2, "cc.GLProgram",&arg0, "cc.GLProgramState:getOrCreateWithGLProgram"); + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_GLProgramState_getOrCreateWithGLProgram'", nullptr); + return 0; + } + cocos2d::GLProgramState* ret = cocos2d::GLProgramState::getOrCreateWithGLProgram(arg0); + object_to_luaval(tolua_S, "cc.GLProgramState",(cocos2d::GLProgramState*)ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d\n ", "cc.GLProgramState:getOrCreateWithGLProgram",argc, 1); + return 0; +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgramState_getOrCreateWithGLProgram'.",&tolua_err); +#endif + return 0; +} +int lua_cocos2dx_GLProgramState_getOrCreateWithShaders(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.GLProgramState",0,&tolua_err)) goto tolua_lerror; +#endif + + argc = lua_gettop(tolua_S) - 1; + + if (argc == 3) + { + std::string arg0; + std::string arg1; + std::string arg2; + ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.GLProgramState:getOrCreateWithShaders"); + ok &= luaval_to_std_string(tolua_S, 3,&arg1, "cc.GLProgramState:getOrCreateWithShaders"); + ok &= luaval_to_std_string(tolua_S, 4,&arg2, "cc.GLProgramState:getOrCreateWithShaders"); + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_GLProgramState_getOrCreateWithShaders'", nullptr); + return 0; + } + cocos2d::GLProgramState* ret = cocos2d::GLProgramState::getOrCreateWithShaders(arg0, arg1, arg2); + object_to_luaval(tolua_S, "cc.GLProgramState",(cocos2d::GLProgramState*)ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d\n ", "cc.GLProgramState:getOrCreateWithShaders",argc, 3); + return 0; +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgramState_getOrCreateWithShaders'.",&tolua_err); +#endif + return 0; +} +static int lua_cocos2dx_GLProgramState_finalize(lua_State* tolua_S) +{ + printf("luabindings: finalizing LUA object (GLProgramState)"); + return 0; +} + +int lua_register_cocos2dx_GLProgramState(lua_State* tolua_S) +{ + tolua_usertype(tolua_S,"cc.GLProgramState"); + tolua_cclass(tolua_S,"GLProgramState","cc.GLProgramState","cc.Ref",nullptr); + + tolua_beginmodule(tolua_S,"GLProgramState"); + tolua_function(tolua_S,"getVertexAttribsFlags",lua_cocos2dx_GLProgramState_getVertexAttribsFlags); + tolua_function(tolua_S,"setUniformVec4",lua_cocos2dx_GLProgramState_setUniformVec4); + tolua_function(tolua_S,"applyAutoBinding",lua_cocos2dx_GLProgramState_applyAutoBinding); + tolua_function(tolua_S,"setUniformVec2",lua_cocos2dx_GLProgramState_setUniformVec2); + tolua_function(tolua_S,"setUniformVec3",lua_cocos2dx_GLProgramState_setUniformVec3); + tolua_function(tolua_S,"apply",lua_cocos2dx_GLProgramState_apply); + tolua_function(tolua_S,"getNodeBinding",lua_cocos2dx_GLProgramState_getNodeBinding); + tolua_function(tolua_S,"setUniformVec4v",lua_cocos2dx_GLProgramState_setUniformVec4v); + tolua_function(tolua_S,"applyGLProgram",lua_cocos2dx_GLProgramState_applyGLProgram); + tolua_function(tolua_S,"setNodeBinding",lua_cocos2dx_GLProgramState_setNodeBinding); + tolua_function(tolua_S,"setUniformInt",lua_cocos2dx_GLProgramState_setUniformInt); + tolua_function(tolua_S,"setParameterAutoBinding",lua_cocos2dx_GLProgramState_setParameterAutoBinding); + tolua_function(tolua_S,"setUniformVec2v",lua_cocos2dx_GLProgramState_setUniformVec2v); + tolua_function(tolua_S,"getUniformCount",lua_cocos2dx_GLProgramState_getUniformCount); + tolua_function(tolua_S,"applyAttributes",lua_cocos2dx_GLProgramState_applyAttributes); + tolua_function(tolua_S,"clone",lua_cocos2dx_GLProgramState_clone); + tolua_function(tolua_S,"setGLProgram",lua_cocos2dx_GLProgramState_setGLProgram); + tolua_function(tolua_S,"setUniformFloatv",lua_cocos2dx_GLProgramState_setUniformFloatv); + tolua_function(tolua_S,"getGLProgram",lua_cocos2dx_GLProgramState_getGLProgram); + tolua_function(tolua_S,"setUniformTexture",lua_cocos2dx_GLProgramState_setUniformTexture); + tolua_function(tolua_S,"applyUniforms",lua_cocos2dx_GLProgramState_applyUniforms); + tolua_function(tolua_S,"setUniformFloat",lua_cocos2dx_GLProgramState_setUniformFloat); + tolua_function(tolua_S,"setUniformMat4",lua_cocos2dx_GLProgramState_setUniformMat4); + tolua_function(tolua_S,"setUniformVec3v",lua_cocos2dx_GLProgramState_setUniformVec3v); + tolua_function(tolua_S,"getVertexAttribCount",lua_cocos2dx_GLProgramState_getVertexAttribCount); + tolua_function(tolua_S,"create", lua_cocos2dx_GLProgramState_create); + tolua_function(tolua_S,"getOrCreateWithGLProgramName", lua_cocos2dx_GLProgramState_getOrCreateWithGLProgramName); + tolua_function(tolua_S,"getOrCreateWithGLProgram", lua_cocos2dx_GLProgramState_getOrCreateWithGLProgram); + tolua_function(tolua_S,"getOrCreateWithShaders", lua_cocos2dx_GLProgramState_getOrCreateWithShaders); + tolua_endmodule(tolua_S); + std::string typeName = typeid(cocos2d::GLProgramState).name(); + g_luaType[typeName] = "cc.GLProgramState"; + g_typeCast["GLProgramState"] = "cc.GLProgramState"; + 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_SpriteFrame_setTexture(lua_State* tolua_S) { int argc = 0; @@ -18054,103 +20562,6 @@ int lua_cocos2dx_SpriteFrame_setTexture(lua_State* tolua_S) return 0; } -int lua_cocos2dx_SpriteFrame_getOffset(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::SpriteFrame* 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.SpriteFrame",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::SpriteFrame*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_SpriteFrame_getOffset'", 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_SpriteFrame_getOffset'", nullptr); - return 0; - } - const cocos2d::Vec2& ret = cobj->getOffset(); - vec2_to_luaval(tolua_S, ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.SpriteFrame:getOffset",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_SpriteFrame_getOffset'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_SpriteFrame_setRectInPixels(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::SpriteFrame* 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.SpriteFrame",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::SpriteFrame*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_SpriteFrame_setRectInPixels'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 1) - { - cocos2d::Rect arg0; - - ok &= luaval_to_rect(tolua_S, 2, &arg0, "cc.SpriteFrame:setRectInPixels"); - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_SpriteFrame_setRectInPixels'", nullptr); - return 0; - } - cobj->setRectInPixels(arg0); - lua_settop(tolua_S, 1); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.SpriteFrame:setRectInPixels",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_SpriteFrame_setRectInPixels'.",&tolua_err); -#endif - - return 0; -} int lua_cocos2dx_SpriteFrame_getTexture(lua_State* tolua_S) { int argc = 0; @@ -18198,53 +20609,6 @@ int lua_cocos2dx_SpriteFrame_getTexture(lua_State* tolua_S) return 0; } -int lua_cocos2dx_SpriteFrame_getRect(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::SpriteFrame* 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.SpriteFrame",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::SpriteFrame*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_SpriteFrame_getRect'", 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_SpriteFrame_getRect'", nullptr); - return 0; - } - const cocos2d::Rect& ret = cobj->getRect(); - rect_to_luaval(tolua_S, ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.SpriteFrame:getRect",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_SpriteFrame_getRect'.",&tolua_err); -#endif - - return 0; -} int lua_cocos2dx_SpriteFrame_setOffsetInPixels(lua_State* tolua_S) { int argc = 0; @@ -18295,7 +20659,7 @@ int lua_cocos2dx_SpriteFrame_setOffsetInPixels(lua_State* tolua_S) return 0; } -int lua_cocos2dx_SpriteFrame_getRectInPixels(lua_State* tolua_S) +int lua_cocos2dx_SpriteFrame_getOriginalSizeInPixels(lua_State* tolua_S) { int argc = 0; cocos2d::SpriteFrame* cobj = nullptr; @@ -18315,7 +20679,7 @@ int lua_cocos2dx_SpriteFrame_getRectInPixels(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_SpriteFrame_getRectInPixels'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_SpriteFrame_getOriginalSizeInPixels'", nullptr); return 0; } #endif @@ -18325,19 +20689,19 @@ int lua_cocos2dx_SpriteFrame_getRectInPixels(lua_State* tolua_S) { if(!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_SpriteFrame_getRectInPixels'", nullptr); + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_SpriteFrame_getOriginalSizeInPixels'", nullptr); return 0; } - const cocos2d::Rect& ret = cobj->getRectInPixels(); - rect_to_luaval(tolua_S, ret); + const cocos2d::Size& ret = cobj->getOriginalSizeInPixels(); + size_to_luaval(tolua_S, ret); return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.SpriteFrame:getRectInPixels",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.SpriteFrame:getOriginalSizeInPixels",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_SpriteFrame_getRectInPixels'.",&tolua_err); + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_SpriteFrame_getOriginalSizeInPixels'.",&tolua_err); #endif return 0; @@ -18392,7 +20756,7 @@ int lua_cocos2dx_SpriteFrame_setOriginalSize(lua_State* tolua_S) return 0; } -int lua_cocos2dx_SpriteFrame_getOriginalSizeInPixels(lua_State* tolua_S) +int lua_cocos2dx_SpriteFrame_setRectInPixels(lua_State* tolua_S) { int argc = 0; cocos2d::SpriteFrame* cobj = nullptr; @@ -18412,7 +20776,57 @@ int lua_cocos2dx_SpriteFrame_getOriginalSizeInPixels(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_SpriteFrame_getOriginalSizeInPixels'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_SpriteFrame_setRectInPixels'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + cocos2d::Rect arg0; + + ok &= luaval_to_rect(tolua_S, 2, &arg0, "cc.SpriteFrame:setRectInPixels"); + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_SpriteFrame_setRectInPixels'", nullptr); + return 0; + } + cobj->setRectInPixels(arg0); + lua_settop(tolua_S, 1); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.SpriteFrame:setRectInPixels",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_SpriteFrame_setRectInPixels'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_SpriteFrame_getRect(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::SpriteFrame* 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.SpriteFrame",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::SpriteFrame*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_SpriteFrame_getRect'", nullptr); return 0; } #endif @@ -18422,69 +20836,19 @@ int lua_cocos2dx_SpriteFrame_getOriginalSizeInPixels(lua_State* tolua_S) { if(!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_SpriteFrame_getOriginalSizeInPixels'", nullptr); + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_SpriteFrame_getRect'", nullptr); return 0; } - const cocos2d::Size& ret = cobj->getOriginalSizeInPixels(); - size_to_luaval(tolua_S, ret); + const cocos2d::Rect& ret = cobj->getRect(); + rect_to_luaval(tolua_S, ret); return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.SpriteFrame:getOriginalSizeInPixels",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.SpriteFrame:getRect",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_SpriteFrame_getOriginalSizeInPixels'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_SpriteFrame_setOriginalSizeInPixels(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::SpriteFrame* 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.SpriteFrame",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::SpriteFrame*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_SpriteFrame_setOriginalSizeInPixels'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 1) - { - cocos2d::Size arg0; - - ok &= luaval_to_size(tolua_S, 2, &arg0, "cc.SpriteFrame:setOriginalSizeInPixels"); - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_SpriteFrame_setOriginalSizeInPixels'", nullptr); - return 0; - } - cobj->setOriginalSizeInPixels(arg0); - lua_settop(tolua_S, 1); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.SpriteFrame:setOriginalSizeInPixels",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_SpriteFrame_setOriginalSizeInPixels'.",&tolua_err); + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_SpriteFrame_getRect'.",&tolua_err); #endif return 0; @@ -18539,128 +20903,6 @@ int lua_cocos2dx_SpriteFrame_setOffset(lua_State* tolua_S) return 0; } -int lua_cocos2dx_SpriteFrame_initWithTexture(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::SpriteFrame* 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.SpriteFrame",0,&tolua_err)) goto tolua_lerror; -#endif - cobj = (cocos2d::SpriteFrame*)tolua_tousertype(tolua_S,1,0); -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_SpriteFrame_initWithTexture'", nullptr); - return 0; - } -#endif - argc = lua_gettop(tolua_S)-1; - do{ - if (argc == 5) { - cocos2d::Texture2D* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Texture2D",&arg0, "cc.SpriteFrame:initWithTexture"); - - if (!ok) { break; } - cocos2d::Rect arg1; - ok &= luaval_to_rect(tolua_S, 3, &arg1, "cc.SpriteFrame:initWithTexture"); - - if (!ok) { break; } - bool arg2; - ok &= luaval_to_boolean(tolua_S, 4,&arg2, "cc.SpriteFrame:initWithTexture"); - - if (!ok) { break; } - cocos2d::Vec2 arg3; - ok &= luaval_to_vec2(tolua_S, 5, &arg3, "cc.SpriteFrame:initWithTexture"); - - if (!ok) { break; } - cocos2d::Size arg4; - ok &= luaval_to_size(tolua_S, 6, &arg4, "cc.SpriteFrame:initWithTexture"); - - if (!ok) { break; } - bool ret = cobj->initWithTexture(arg0, arg1, arg2, arg3, arg4); - tolua_pushboolean(tolua_S,(bool)ret); - return 1; - } - }while(0); - ok = true; - do{ - if (argc == 2) { - cocos2d::Texture2D* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Texture2D",&arg0, "cc.SpriteFrame:initWithTexture"); - - if (!ok) { break; } - cocos2d::Rect arg1; - ok &= luaval_to_rect(tolua_S, 3, &arg1, "cc.SpriteFrame:initWithTexture"); - - if (!ok) { break; } - bool ret = cobj->initWithTexture(arg0, arg1); - tolua_pushboolean(tolua_S,(bool)ret); - return 1; - } - }while(0); - ok = true; - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.SpriteFrame:initWithTexture",argc, 2); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_SpriteFrame_initWithTexture'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_SpriteFrame_isRotated(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::SpriteFrame* 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.SpriteFrame",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::SpriteFrame*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_SpriteFrame_isRotated'", 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_SpriteFrame_isRotated'", nullptr); - return 0; - } - bool ret = cobj->isRotated(); - tolua_pushboolean(tolua_S,(bool)ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.SpriteFrame:isRotated",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_SpriteFrame_isRotated'.",&tolua_err); -#endif - - return 0; -} int lua_cocos2dx_SpriteFrame_initWithTextureFilename(lua_State* tolua_S) { int argc = 0; @@ -18786,49 +21028,77 @@ int lua_cocos2dx_SpriteFrame_setRect(lua_State* tolua_S) return 0; } -int lua_cocos2dx_SpriteFrame_getOffsetInPixels(lua_State* tolua_S) +int lua_cocos2dx_SpriteFrame_initWithTexture(lua_State* tolua_S) { int argc = 0; cocos2d::SpriteFrame* 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.SpriteFrame",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (cocos2d::SpriteFrame*)tolua_tousertype(tolua_S,1,0); - #if COCOS2D_DEBUG >= 1 - if (!cobj) + if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_SpriteFrame_getOffsetInPixels'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_SpriteFrame_initWithTexture'", 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_SpriteFrame_getOffsetInPixels'", nullptr); - return 0; + do{ + if (argc == 5) { + cocos2d::Texture2D* arg0; + ok &= luaval_to_object(tolua_S, 2, "cc.Texture2D",&arg0, "cc.SpriteFrame:initWithTexture"); + + if (!ok) { break; } + cocos2d::Rect arg1; + ok &= luaval_to_rect(tolua_S, 3, &arg1, "cc.SpriteFrame:initWithTexture"); + + if (!ok) { break; } + bool arg2; + ok &= luaval_to_boolean(tolua_S, 4,&arg2, "cc.SpriteFrame:initWithTexture"); + + if (!ok) { break; } + cocos2d::Vec2 arg3; + ok &= luaval_to_vec2(tolua_S, 5, &arg3, "cc.SpriteFrame:initWithTexture"); + + if (!ok) { break; } + cocos2d::Size arg4; + ok &= luaval_to_size(tolua_S, 6, &arg4, "cc.SpriteFrame:initWithTexture"); + + if (!ok) { break; } + bool ret = cobj->initWithTexture(arg0, arg1, arg2, arg3, arg4); + tolua_pushboolean(tolua_S,(bool)ret); + return 1; } - const cocos2d::Vec2& ret = cobj->getOffsetInPixels(); - vec2_to_luaval(tolua_S, ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.SpriteFrame:getOffsetInPixels",argc, 0); + }while(0); + ok = true; + do{ + if (argc == 2) { + cocos2d::Texture2D* arg0; + ok &= luaval_to_object(tolua_S, 2, "cc.Texture2D",&arg0, "cc.SpriteFrame:initWithTexture"); + + if (!ok) { break; } + cocos2d::Rect arg1; + ok &= luaval_to_rect(tolua_S, 3, &arg1, "cc.SpriteFrame:initWithTexture"); + + if (!ok) { break; } + bool ret = cobj->initWithTexture(arg0, arg1); + tolua_pushboolean(tolua_S,(bool)ret); + return 1; + } + }while(0); + ok = true; + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.SpriteFrame:initWithTexture",argc, 2); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_SpriteFrame_getOffsetInPixels'.",&tolua_err); + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_SpriteFrame_initWithTexture'.",&tolua_err); #endif return 0; @@ -18880,6 +21150,341 @@ int lua_cocos2dx_SpriteFrame_getOriginalSize(lua_State* tolua_S) return 0; } +int lua_cocos2dx_SpriteFrame_clone(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::SpriteFrame* 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.SpriteFrame",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::SpriteFrame*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_SpriteFrame_clone'", 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_SpriteFrame_clone'", nullptr); + return 0; + } + cocos2d::SpriteFrame* ret = cobj->clone(); + object_to_luaval(tolua_S, "cc.SpriteFrame",(cocos2d::SpriteFrame*)ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.SpriteFrame:clone",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_SpriteFrame_clone'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_SpriteFrame_getRectInPixels(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::SpriteFrame* 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.SpriteFrame",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::SpriteFrame*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_SpriteFrame_getRectInPixels'", 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_SpriteFrame_getRectInPixels'", nullptr); + return 0; + } + const cocos2d::Rect& ret = cobj->getRectInPixels(); + rect_to_luaval(tolua_S, ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.SpriteFrame:getRectInPixels",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_SpriteFrame_getRectInPixels'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_SpriteFrame_isRotated(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::SpriteFrame* 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.SpriteFrame",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::SpriteFrame*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_SpriteFrame_isRotated'", 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_SpriteFrame_isRotated'", nullptr); + return 0; + } + bool ret = cobj->isRotated(); + tolua_pushboolean(tolua_S,(bool)ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.SpriteFrame:isRotated",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_SpriteFrame_isRotated'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_SpriteFrame_setRotated(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::SpriteFrame* 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.SpriteFrame",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::SpriteFrame*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_SpriteFrame_setRotated'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + bool arg0; + + ok &= luaval_to_boolean(tolua_S, 2,&arg0, "cc.SpriteFrame:setRotated"); + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_SpriteFrame_setRotated'", nullptr); + return 0; + } + cobj->setRotated(arg0); + lua_settop(tolua_S, 1); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.SpriteFrame:setRotated",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_SpriteFrame_setRotated'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_SpriteFrame_getOffset(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::SpriteFrame* 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.SpriteFrame",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::SpriteFrame*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_SpriteFrame_getOffset'", 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_SpriteFrame_getOffset'", nullptr); + return 0; + } + const cocos2d::Vec2& ret = cobj->getOffset(); + vec2_to_luaval(tolua_S, ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.SpriteFrame:getOffset",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_SpriteFrame_getOffset'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_SpriteFrame_setOriginalSizeInPixels(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::SpriteFrame* 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.SpriteFrame",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::SpriteFrame*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_SpriteFrame_setOriginalSizeInPixels'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + cocos2d::Size arg0; + + ok &= luaval_to_size(tolua_S, 2, &arg0, "cc.SpriteFrame:setOriginalSizeInPixels"); + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_SpriteFrame_setOriginalSizeInPixels'", nullptr); + return 0; + } + cobj->setOriginalSizeInPixels(arg0); + lua_settop(tolua_S, 1); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.SpriteFrame:setOriginalSizeInPixels",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_SpriteFrame_setOriginalSizeInPixels'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_SpriteFrame_getOffsetInPixels(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::SpriteFrame* 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.SpriteFrame",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::SpriteFrame*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_SpriteFrame_getOffsetInPixels'", 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_SpriteFrame_getOffsetInPixels'", nullptr); + return 0; + } + const cocos2d::Vec2& ret = cobj->getOffsetInPixels(); + vec2_to_luaval(tolua_S, ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.SpriteFrame:getOffsetInPixels",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_SpriteFrame_getOffsetInPixels'.",&tolua_err); +#endif + + return 0; +} int lua_cocos2dx_SpriteFrame_create(lua_State* tolua_S) { int argc = 0; @@ -19056,25 +21661,25 @@ int lua_register_cocos2dx_SpriteFrame(lua_State* tolua_S) tolua_beginmodule(tolua_S,"SpriteFrame"); tolua_function(tolua_S,"new",lua_cocos2dx_SpriteFrame_constructor); - tolua_function(tolua_S,"clone",lua_cocos2dx_SpriteFrame_clone); - tolua_function(tolua_S,"setRotated",lua_cocos2dx_SpriteFrame_setRotated); tolua_function(tolua_S,"setTexture",lua_cocos2dx_SpriteFrame_setTexture); - tolua_function(tolua_S,"getOffset",lua_cocos2dx_SpriteFrame_getOffset); - tolua_function(tolua_S,"setRectInPixels",lua_cocos2dx_SpriteFrame_setRectInPixels); tolua_function(tolua_S,"getTexture",lua_cocos2dx_SpriteFrame_getTexture); - tolua_function(tolua_S,"getRect",lua_cocos2dx_SpriteFrame_getRect); tolua_function(tolua_S,"setOffsetInPixels",lua_cocos2dx_SpriteFrame_setOffsetInPixels); - tolua_function(tolua_S,"getRectInPixels",lua_cocos2dx_SpriteFrame_getRectInPixels); - tolua_function(tolua_S,"setOriginalSize",lua_cocos2dx_SpriteFrame_setOriginalSize); tolua_function(tolua_S,"getOriginalSizeInPixels",lua_cocos2dx_SpriteFrame_getOriginalSizeInPixels); - tolua_function(tolua_S,"setOriginalSizeInPixels",lua_cocos2dx_SpriteFrame_setOriginalSizeInPixels); + tolua_function(tolua_S,"setOriginalSize",lua_cocos2dx_SpriteFrame_setOriginalSize); + tolua_function(tolua_S,"setRectInPixels",lua_cocos2dx_SpriteFrame_setRectInPixels); + tolua_function(tolua_S,"getRect",lua_cocos2dx_SpriteFrame_getRect); tolua_function(tolua_S,"setOffset",lua_cocos2dx_SpriteFrame_setOffset); - tolua_function(tolua_S,"initWithTexture",lua_cocos2dx_SpriteFrame_initWithTexture); - tolua_function(tolua_S,"isRotated",lua_cocos2dx_SpriteFrame_isRotated); tolua_function(tolua_S,"initWithTextureFilename",lua_cocos2dx_SpriteFrame_initWithTextureFilename); tolua_function(tolua_S,"setRect",lua_cocos2dx_SpriteFrame_setRect); - tolua_function(tolua_S,"getOffsetInPixels",lua_cocos2dx_SpriteFrame_getOffsetInPixels); + tolua_function(tolua_S,"initWithTexture",lua_cocos2dx_SpriteFrame_initWithTexture); tolua_function(tolua_S,"getOriginalSize",lua_cocos2dx_SpriteFrame_getOriginalSize); + tolua_function(tolua_S,"clone",lua_cocos2dx_SpriteFrame_clone); + tolua_function(tolua_S,"getRectInPixels",lua_cocos2dx_SpriteFrame_getRectInPixels); + tolua_function(tolua_S,"isRotated",lua_cocos2dx_SpriteFrame_isRotated); + tolua_function(tolua_S,"setRotated",lua_cocos2dx_SpriteFrame_setRotated); + tolua_function(tolua_S,"getOffset",lua_cocos2dx_SpriteFrame_getOffset); + tolua_function(tolua_S,"setOriginalSizeInPixels",lua_cocos2dx_SpriteFrame_setOriginalSizeInPixels); + tolua_function(tolua_S,"getOffsetInPixels",lua_cocos2dx_SpriteFrame_getOffsetInPixels); tolua_function(tolua_S,"create", lua_cocos2dx_SpriteFrame_create); tolua_function(tolua_S,"createWithTexture", lua_cocos2dx_SpriteFrame_createWithTexture); tolua_endmodule(tolua_S); @@ -45297,1657 +47902,6 @@ int lua_register_cocos2dx_ActionTween(lua_State* tolua_S) return 1; } -int lua_cocos2dx_GLProgramState_getVertexAttribsFlags(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::GLProgramState* 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.GLProgramState",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::GLProgramState*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_GLProgramState_getVertexAttribsFlags'", 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_GLProgramState_getVertexAttribsFlags'", nullptr); - return 0; - } - unsigned int ret = cobj->getVertexAttribsFlags(); - 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.GLProgramState:getVertexAttribsFlags",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgramState_getVertexAttribsFlags'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_GLProgramState_setUniformVec4(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::GLProgramState* 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.GLProgramState",0,&tolua_err)) goto tolua_lerror; -#endif - cobj = (cocos2d::GLProgramState*)tolua_tousertype(tolua_S,1,0); -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_GLProgramState_setUniformVec4'", nullptr); - return 0; - } -#endif - argc = lua_gettop(tolua_S)-1; - do{ - if (argc == 2) { - int arg0; - ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "cc.GLProgramState:setUniformVec4"); - - if (!ok) { break; } - cocos2d::Vec4 arg1; - ok &= luaval_to_vec4(tolua_S, 3, &arg1, "cc.GLProgramState:setUniformVec4"); - - if (!ok) { break; } - cobj->setUniformVec4(arg0, arg1); - lua_settop(tolua_S, 1); - return 1; - } - }while(0); - ok = true; - do{ - if (argc == 2) { - std::string arg0; - ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.GLProgramState:setUniformVec4"); - - if (!ok) { break; } - cocos2d::Vec4 arg1; - ok &= luaval_to_vec4(tolua_S, 3, &arg1, "cc.GLProgramState:setUniformVec4"); - - if (!ok) { break; } - cobj->setUniformVec4(arg0, arg1); - 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", "cc.GLProgramState:setUniformVec4",argc, 2); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgramState_setUniformVec4'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_GLProgramState_applyAutoBinding(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::GLProgramState* 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.GLProgramState",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::GLProgramState*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_GLProgramState_applyAutoBinding'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 2) - { - std::string arg0; - std::string arg1; - - ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.GLProgramState:applyAutoBinding"); - - ok &= luaval_to_std_string(tolua_S, 3,&arg1, "cc.GLProgramState:applyAutoBinding"); - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_GLProgramState_applyAutoBinding'", nullptr); - return 0; - } - cobj->applyAutoBinding(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.GLProgramState:applyAutoBinding",argc, 2); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgramState_applyAutoBinding'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_GLProgramState_setUniformVec2(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::GLProgramState* 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.GLProgramState",0,&tolua_err)) goto tolua_lerror; -#endif - cobj = (cocos2d::GLProgramState*)tolua_tousertype(tolua_S,1,0); -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_GLProgramState_setUniformVec2'", nullptr); - return 0; - } -#endif - argc = lua_gettop(tolua_S)-1; - do{ - if (argc == 2) { - int arg0; - ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "cc.GLProgramState:setUniformVec2"); - - if (!ok) { break; } - cocos2d::Vec2 arg1; - ok &= luaval_to_vec2(tolua_S, 3, &arg1, "cc.GLProgramState:setUniformVec2"); - - if (!ok) { break; } - cobj->setUniformVec2(arg0, arg1); - lua_settop(tolua_S, 1); - return 1; - } - }while(0); - ok = true; - do{ - if (argc == 2) { - std::string arg0; - ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.GLProgramState:setUniformVec2"); - - if (!ok) { break; } - cocos2d::Vec2 arg1; - ok &= luaval_to_vec2(tolua_S, 3, &arg1, "cc.GLProgramState:setUniformVec2"); - - if (!ok) { break; } - cobj->setUniformVec2(arg0, arg1); - 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", "cc.GLProgramState:setUniformVec2",argc, 2); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgramState_setUniformVec2'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_GLProgramState_setUniformVec3(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::GLProgramState* 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.GLProgramState",0,&tolua_err)) goto tolua_lerror; -#endif - cobj = (cocos2d::GLProgramState*)tolua_tousertype(tolua_S,1,0); -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_GLProgramState_setUniformVec3'", nullptr); - return 0; - } -#endif - argc = lua_gettop(tolua_S)-1; - do{ - if (argc == 2) { - int arg0; - ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "cc.GLProgramState:setUniformVec3"); - - if (!ok) { break; } - cocos2d::Vec3 arg1; - ok &= luaval_to_vec3(tolua_S, 3, &arg1, "cc.GLProgramState:setUniformVec3"); - - if (!ok) { break; } - cobj->setUniformVec3(arg0, arg1); - lua_settop(tolua_S, 1); - return 1; - } - }while(0); - ok = true; - do{ - if (argc == 2) { - std::string arg0; - ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.GLProgramState:setUniformVec3"); - - if (!ok) { break; } - cocos2d::Vec3 arg1; - ok &= luaval_to_vec3(tolua_S, 3, &arg1, "cc.GLProgramState:setUniformVec3"); - - if (!ok) { break; } - cobj->setUniformVec3(arg0, arg1); - 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", "cc.GLProgramState:setUniformVec3",argc, 2); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgramState_setUniformVec3'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_GLProgramState_apply(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::GLProgramState* 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.GLProgramState",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::GLProgramState*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_GLProgramState_apply'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 1) - { - cocos2d::Mat4 arg0; - - ok &= luaval_to_mat4(tolua_S, 2, &arg0, "cc.GLProgramState:apply"); - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_GLProgramState_apply'", nullptr); - return 0; - } - cobj->apply(arg0); - lua_settop(tolua_S, 1); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.GLProgramState:apply",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgramState_apply'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_GLProgramState_getNodeBinding(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::GLProgramState* 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.GLProgramState",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::GLProgramState*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_GLProgramState_getNodeBinding'", 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_GLProgramState_getNodeBinding'", nullptr); - return 0; - } - cocos2d::Node* ret = cobj->getNodeBinding(); - object_to_luaval(tolua_S, "cc.Node",(cocos2d::Node*)ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.GLProgramState:getNodeBinding",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgramState_getNodeBinding'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_GLProgramState_setUniformVec4v(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::GLProgramState* 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.GLProgramState",0,&tolua_err)) goto tolua_lerror; -#endif - cobj = (cocos2d::GLProgramState*)tolua_tousertype(tolua_S,1,0); -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_GLProgramState_setUniformVec4v'", nullptr); - return 0; - } -#endif - argc = lua_gettop(tolua_S)-1; - do{ - if (argc == 3) { - int arg0; - ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "cc.GLProgramState:setUniformVec4v"); - - if (!ok) { break; } - ssize_t arg1; - ok &= luaval_to_ssize(tolua_S, 3, &arg1, "cc.GLProgramState:setUniformVec4v"); - - if (!ok) { break; } - const cocos2d::Vec4* arg2; - ok &= luaval_to_object(tolua_S, 4, "cc.Vec4",&arg2, "cc.GLProgramState:setUniformVec4v"); - - if (!ok) { break; } - cobj->setUniformVec4v(arg0, arg1, arg2); - lua_settop(tolua_S, 1); - return 1; - } - }while(0); - ok = true; - do{ - if (argc == 3) { - std::string arg0; - ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.GLProgramState:setUniformVec4v"); - - if (!ok) { break; } - ssize_t arg1; - ok &= luaval_to_ssize(tolua_S, 3, &arg1, "cc.GLProgramState:setUniformVec4v"); - - if (!ok) { break; } - const cocos2d::Vec4* arg2; - ok &= luaval_to_object(tolua_S, 4, "cc.Vec4",&arg2, "cc.GLProgramState:setUniformVec4v"); - - if (!ok) { break; } - cobj->setUniformVec4v(arg0, arg1, arg2); - 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", "cc.GLProgramState:setUniformVec4v",argc, 3); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgramState_setUniformVec4v'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_GLProgramState_applyGLProgram(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::GLProgramState* 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.GLProgramState",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::GLProgramState*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_GLProgramState_applyGLProgram'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 1) - { - cocos2d::Mat4 arg0; - - ok &= luaval_to_mat4(tolua_S, 2, &arg0, "cc.GLProgramState:applyGLProgram"); - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_GLProgramState_applyGLProgram'", nullptr); - return 0; - } - cobj->applyGLProgram(arg0); - lua_settop(tolua_S, 1); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.GLProgramState:applyGLProgram",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgramState_applyGLProgram'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_GLProgramState_setNodeBinding(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::GLProgramState* 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.GLProgramState",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::GLProgramState*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_GLProgramState_setNodeBinding'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 1) - { - cocos2d::Node* arg0; - - ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0, "cc.GLProgramState:setNodeBinding"); - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_GLProgramState_setNodeBinding'", nullptr); - return 0; - } - cobj->setNodeBinding(arg0); - lua_settop(tolua_S, 1); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.GLProgramState:setNodeBinding",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgramState_setNodeBinding'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_GLProgramState_setUniformInt(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::GLProgramState* 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.GLProgramState",0,&tolua_err)) goto tolua_lerror; -#endif - cobj = (cocos2d::GLProgramState*)tolua_tousertype(tolua_S,1,0); -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_GLProgramState_setUniformInt'", nullptr); - return 0; - } -#endif - argc = lua_gettop(tolua_S)-1; - do{ - if (argc == 2) { - int arg0; - ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "cc.GLProgramState:setUniformInt"); - - if (!ok) { break; } - int arg1; - ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1, "cc.GLProgramState:setUniformInt"); - - if (!ok) { break; } - cobj->setUniformInt(arg0, arg1); - lua_settop(tolua_S, 1); - return 1; - } - }while(0); - ok = true; - do{ - if (argc == 2) { - std::string arg0; - ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.GLProgramState:setUniformInt"); - - if (!ok) { break; } - int arg1; - ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1, "cc.GLProgramState:setUniformInt"); - - if (!ok) { break; } - cobj->setUniformInt(arg0, arg1); - 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", "cc.GLProgramState:setUniformInt",argc, 2); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgramState_setUniformInt'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_GLProgramState_setParameterAutoBinding(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::GLProgramState* 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.GLProgramState",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::GLProgramState*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_GLProgramState_setParameterAutoBinding'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 2) - { - std::string arg0; - std::string arg1; - - ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.GLProgramState:setParameterAutoBinding"); - - ok &= luaval_to_std_string(tolua_S, 3,&arg1, "cc.GLProgramState:setParameterAutoBinding"); - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_GLProgramState_setParameterAutoBinding'", nullptr); - return 0; - } - cobj->setParameterAutoBinding(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.GLProgramState:setParameterAutoBinding",argc, 2); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgramState_setParameterAutoBinding'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_GLProgramState_setUniformVec2v(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::GLProgramState* 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.GLProgramState",0,&tolua_err)) goto tolua_lerror; -#endif - cobj = (cocos2d::GLProgramState*)tolua_tousertype(tolua_S,1,0); -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_GLProgramState_setUniformVec2v'", nullptr); - return 0; - } -#endif - argc = lua_gettop(tolua_S)-1; - do{ - if (argc == 3) { - int arg0; - ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "cc.GLProgramState:setUniformVec2v"); - - if (!ok) { break; } - ssize_t arg1; - ok &= luaval_to_ssize(tolua_S, 3, &arg1, "cc.GLProgramState:setUniformVec2v"); - - if (!ok) { break; } - const cocos2d::Vec2* arg2; - ok &= luaval_to_object(tolua_S, 4, "cc.Vec2",&arg2, "cc.GLProgramState:setUniformVec2v"); - - if (!ok) { break; } - cobj->setUniformVec2v(arg0, arg1, arg2); - lua_settop(tolua_S, 1); - return 1; - } - }while(0); - ok = true; - do{ - if (argc == 3) { - std::string arg0; - ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.GLProgramState:setUniformVec2v"); - - if (!ok) { break; } - ssize_t arg1; - ok &= luaval_to_ssize(tolua_S, 3, &arg1, "cc.GLProgramState:setUniformVec2v"); - - if (!ok) { break; } - const cocos2d::Vec2* arg2; - ok &= luaval_to_object(tolua_S, 4, "cc.Vec2",&arg2, "cc.GLProgramState:setUniformVec2v"); - - if (!ok) { break; } - cobj->setUniformVec2v(arg0, arg1, arg2); - 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", "cc.GLProgramState:setUniformVec2v",argc, 3); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgramState_setUniformVec2v'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_GLProgramState_getUniformCount(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::GLProgramState* 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.GLProgramState",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::GLProgramState*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_GLProgramState_getUniformCount'", 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_GLProgramState_getUniformCount'", nullptr); - return 0; - } - ssize_t ret = cobj->getUniformCount(); - 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.GLProgramState:getUniformCount",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgramState_getUniformCount'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_GLProgramState_applyAttributes(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::GLProgramState* 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.GLProgramState",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::GLProgramState*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_GLProgramState_applyAttributes'", 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_GLProgramState_applyAttributes'", nullptr); - return 0; - } - cobj->applyAttributes(); - lua_settop(tolua_S, 1); - return 1; - } - if (argc == 1) - { - bool arg0; - - ok &= luaval_to_boolean(tolua_S, 2,&arg0, "cc.GLProgramState:applyAttributes"); - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_GLProgramState_applyAttributes'", nullptr); - return 0; - } - cobj->applyAttributes(arg0); - lua_settop(tolua_S, 1); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.GLProgramState:applyAttributes",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgramState_applyAttributes'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_GLProgramState_clone(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::GLProgramState* 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.GLProgramState",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::GLProgramState*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_GLProgramState_clone'", 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_GLProgramState_clone'", nullptr); - return 0; - } - cocos2d::GLProgramState* ret = cobj->clone(); - object_to_luaval(tolua_S, "cc.GLProgramState",(cocos2d::GLProgramState*)ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.GLProgramState:clone",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgramState_clone'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_GLProgramState_setGLProgram(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::GLProgramState* 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.GLProgramState",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::GLProgramState*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_GLProgramState_setGLProgram'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 1) - { - cocos2d::GLProgram* arg0; - - ok &= luaval_to_object(tolua_S, 2, "cc.GLProgram",&arg0, "cc.GLProgramState:setGLProgram"); - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_GLProgramState_setGLProgram'", nullptr); - return 0; - } - cobj->setGLProgram(arg0); - lua_settop(tolua_S, 1); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.GLProgramState:setGLProgram",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgramState_setGLProgram'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_GLProgramState_setUniformFloatv(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::GLProgramState* 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.GLProgramState",0,&tolua_err)) goto tolua_lerror; -#endif - cobj = (cocos2d::GLProgramState*)tolua_tousertype(tolua_S,1,0); -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_GLProgramState_setUniformFloatv'", nullptr); - return 0; - } -#endif - argc = lua_gettop(tolua_S)-1; - do{ - if (argc == 3) { - int arg0; - ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "cc.GLProgramState:setUniformFloatv"); - - if (!ok) { break; } - ssize_t arg1; - ok &= luaval_to_ssize(tolua_S, 3, &arg1, "cc.GLProgramState:setUniformFloatv"); - - if (!ok) { break; } - const float* arg2; - #pragma warning NO CONVERSION TO NATIVE FOR float* - ok = false; - - if (!ok) { break; } - cobj->setUniformFloatv(arg0, arg1, arg2); - lua_settop(tolua_S, 1); - return 1; - } - }while(0); - ok = true; - do{ - if (argc == 3) { - std::string arg0; - ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.GLProgramState:setUniformFloatv"); - - if (!ok) { break; } - ssize_t arg1; - ok &= luaval_to_ssize(tolua_S, 3, &arg1, "cc.GLProgramState:setUniformFloatv"); - - if (!ok) { break; } - const float* arg2; - #pragma warning NO CONVERSION TO NATIVE FOR float* - ok = false; - - if (!ok) { break; } - cobj->setUniformFloatv(arg0, arg1, arg2); - 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", "cc.GLProgramState:setUniformFloatv",argc, 3); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgramState_setUniformFloatv'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_GLProgramState_getGLProgram(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::GLProgramState* 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.GLProgramState",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::GLProgramState*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_GLProgramState_getGLProgram'", 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_GLProgramState_getGLProgram'", nullptr); - return 0; - } - cocos2d::GLProgram* ret = cobj->getGLProgram(); - object_to_luaval(tolua_S, "cc.GLProgram",(cocos2d::GLProgram*)ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.GLProgramState:getGLProgram",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgramState_getGLProgram'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_GLProgramState_setUniformTexture(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::GLProgramState* 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.GLProgramState",0,&tolua_err)) goto tolua_lerror; -#endif - cobj = (cocos2d::GLProgramState*)tolua_tousertype(tolua_S,1,0); -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_GLProgramState_setUniformTexture'", nullptr); - return 0; - } -#endif - argc = lua_gettop(tolua_S)-1; - do{ - if (argc == 2) { - std::string arg0; - ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.GLProgramState:setUniformTexture"); - - if (!ok) { break; } - unsigned int arg1; - ok &= luaval_to_uint32(tolua_S, 3,&arg1, "cc.GLProgramState:setUniformTexture"); - - if (!ok) { break; } - cobj->setUniformTexture(arg0, arg1); - lua_settop(tolua_S, 1); - return 1; - } - }while(0); - ok = true; - do{ - if (argc == 2) { - std::string arg0; - ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.GLProgramState:setUniformTexture"); - - if (!ok) { break; } - cocos2d::Texture2D* arg1; - ok &= luaval_to_object(tolua_S, 3, "cc.Texture2D",&arg1, "cc.GLProgramState:setUniformTexture"); - - if (!ok) { break; } - cobj->setUniformTexture(arg0, arg1); - lua_settop(tolua_S, 1); - return 1; - } - }while(0); - ok = true; - do{ - if (argc == 2) { - int arg0; - ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "cc.GLProgramState:setUniformTexture"); - - if (!ok) { break; } - cocos2d::Texture2D* arg1; - ok &= luaval_to_object(tolua_S, 3, "cc.Texture2D",&arg1, "cc.GLProgramState:setUniformTexture"); - - if (!ok) { break; } - cobj->setUniformTexture(arg0, arg1); - lua_settop(tolua_S, 1); - return 1; - } - }while(0); - ok = true; - do{ - if (argc == 2) { - int arg0; - ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "cc.GLProgramState:setUniformTexture"); - - if (!ok) { break; } - unsigned int arg1; - ok &= luaval_to_uint32(tolua_S, 3,&arg1, "cc.GLProgramState:setUniformTexture"); - - if (!ok) { break; } - cobj->setUniformTexture(arg0, arg1); - 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", "cc.GLProgramState:setUniformTexture",argc, 2); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgramState_setUniformTexture'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_GLProgramState_applyUniforms(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::GLProgramState* 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.GLProgramState",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::GLProgramState*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_GLProgramState_applyUniforms'", 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_GLProgramState_applyUniforms'", nullptr); - return 0; - } - cobj->applyUniforms(); - lua_settop(tolua_S, 1); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.GLProgramState:applyUniforms",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgramState_applyUniforms'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_GLProgramState_setUniformFloat(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::GLProgramState* 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.GLProgramState",0,&tolua_err)) goto tolua_lerror; -#endif - cobj = (cocos2d::GLProgramState*)tolua_tousertype(tolua_S,1,0); -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_GLProgramState_setUniformFloat'", nullptr); - return 0; - } -#endif - argc = lua_gettop(tolua_S)-1; - do{ - if (argc == 2) { - int arg0; - ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "cc.GLProgramState:setUniformFloat"); - - if (!ok) { break; } - double arg1; - ok &= luaval_to_number(tolua_S, 3,&arg1, "cc.GLProgramState:setUniformFloat"); - - if (!ok) { break; } - cobj->setUniformFloat(arg0, arg1); - lua_settop(tolua_S, 1); - return 1; - } - }while(0); - ok = true; - do{ - if (argc == 2) { - std::string arg0; - ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.GLProgramState:setUniformFloat"); - - if (!ok) { break; } - double arg1; - ok &= luaval_to_number(tolua_S, 3,&arg1, "cc.GLProgramState:setUniformFloat"); - - if (!ok) { break; } - cobj->setUniformFloat(arg0, arg1); - 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", "cc.GLProgramState:setUniformFloat",argc, 2); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgramState_setUniformFloat'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_GLProgramState_setUniformMat4(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::GLProgramState* 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.GLProgramState",0,&tolua_err)) goto tolua_lerror; -#endif - cobj = (cocos2d::GLProgramState*)tolua_tousertype(tolua_S,1,0); -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_GLProgramState_setUniformMat4'", nullptr); - return 0; - } -#endif - argc = lua_gettop(tolua_S)-1; - do{ - if (argc == 2) { - int arg0; - ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "cc.GLProgramState:setUniformMat4"); - - if (!ok) { break; } - cocos2d::Mat4 arg1; - ok &= luaval_to_mat4(tolua_S, 3, &arg1, "cc.GLProgramState:setUniformMat4"); - - if (!ok) { break; } - cobj->setUniformMat4(arg0, arg1); - lua_settop(tolua_S, 1); - return 1; - } - }while(0); - ok = true; - do{ - if (argc == 2) { - std::string arg0; - ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.GLProgramState:setUniformMat4"); - - if (!ok) { break; } - cocos2d::Mat4 arg1; - ok &= luaval_to_mat4(tolua_S, 3, &arg1, "cc.GLProgramState:setUniformMat4"); - - if (!ok) { break; } - cobj->setUniformMat4(arg0, arg1); - 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", "cc.GLProgramState:setUniformMat4",argc, 2); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgramState_setUniformMat4'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_GLProgramState_setUniformVec3v(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::GLProgramState* 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.GLProgramState",0,&tolua_err)) goto tolua_lerror; -#endif - cobj = (cocos2d::GLProgramState*)tolua_tousertype(tolua_S,1,0); -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_GLProgramState_setUniformVec3v'", nullptr); - return 0; - } -#endif - argc = lua_gettop(tolua_S)-1; - do{ - if (argc == 3) { - int arg0; - ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "cc.GLProgramState:setUniformVec3v"); - - if (!ok) { break; } - ssize_t arg1; - ok &= luaval_to_ssize(tolua_S, 3, &arg1, "cc.GLProgramState:setUniformVec3v"); - - if (!ok) { break; } - const cocos2d::Vec3* arg2; - ok &= luaval_to_object(tolua_S, 4, "cc.Vec3",&arg2, "cc.GLProgramState:setUniformVec3v"); - - if (!ok) { break; } - cobj->setUniformVec3v(arg0, arg1, arg2); - lua_settop(tolua_S, 1); - return 1; - } - }while(0); - ok = true; - do{ - if (argc == 3) { - std::string arg0; - ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.GLProgramState:setUniformVec3v"); - - if (!ok) { break; } - ssize_t arg1; - ok &= luaval_to_ssize(tolua_S, 3, &arg1, "cc.GLProgramState:setUniformVec3v"); - - if (!ok) { break; } - const cocos2d::Vec3* arg2; - ok &= luaval_to_object(tolua_S, 4, "cc.Vec3",&arg2, "cc.GLProgramState:setUniformVec3v"); - - if (!ok) { break; } - cobj->setUniformVec3v(arg0, arg1, arg2); - 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", "cc.GLProgramState:setUniformVec3v",argc, 3); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgramState_setUniformVec3v'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_GLProgramState_getVertexAttribCount(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::GLProgramState* 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.GLProgramState",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::GLProgramState*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_GLProgramState_getVertexAttribCount'", 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_GLProgramState_getVertexAttribCount'", nullptr); - return 0; - } - ssize_t ret = cobj->getVertexAttribCount(); - 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.GLProgramState:getVertexAttribCount",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgramState_getVertexAttribCount'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_GLProgramState_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.GLProgramState",0,&tolua_err)) goto tolua_lerror; -#endif - - argc = lua_gettop(tolua_S) - 1; - - if (argc == 1) - { - cocos2d::GLProgram* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.GLProgram",&arg0, "cc.GLProgramState:create"); - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_GLProgramState_create'", nullptr); - return 0; - } - cocos2d::GLProgramState* ret = cocos2d::GLProgramState::create(arg0); - object_to_luaval(tolua_S, "cc.GLProgramState",(cocos2d::GLProgramState*)ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d\n ", "cc.GLProgramState:create",argc, 1); - return 0; -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgramState_create'.",&tolua_err); -#endif - return 0; -} -int lua_cocos2dx_GLProgramState_getOrCreateWithGLProgramName(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.GLProgramState",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.GLProgramState:getOrCreateWithGLProgramName"); - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_GLProgramState_getOrCreateWithGLProgramName'", nullptr); - return 0; - } - cocos2d::GLProgramState* ret = cocos2d::GLProgramState::getOrCreateWithGLProgramName(arg0); - object_to_luaval(tolua_S, "cc.GLProgramState",(cocos2d::GLProgramState*)ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d\n ", "cc.GLProgramState:getOrCreateWithGLProgramName",argc, 1); - return 0; -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgramState_getOrCreateWithGLProgramName'.",&tolua_err); -#endif - return 0; -} -int lua_cocos2dx_GLProgramState_getOrCreateWithGLProgram(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.GLProgramState",0,&tolua_err)) goto tolua_lerror; -#endif - - argc = lua_gettop(tolua_S) - 1; - - if (argc == 1) - { - cocos2d::GLProgram* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.GLProgram",&arg0, "cc.GLProgramState:getOrCreateWithGLProgram"); - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_GLProgramState_getOrCreateWithGLProgram'", nullptr); - return 0; - } - cocos2d::GLProgramState* ret = cocos2d::GLProgramState::getOrCreateWithGLProgram(arg0); - object_to_luaval(tolua_S, "cc.GLProgramState",(cocos2d::GLProgramState*)ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d\n ", "cc.GLProgramState:getOrCreateWithGLProgram",argc, 1); - return 0; -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgramState_getOrCreateWithGLProgram'.",&tolua_err); -#endif - return 0; -} -int lua_cocos2dx_GLProgramState_getOrCreateWithShaders(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.GLProgramState",0,&tolua_err)) goto tolua_lerror; -#endif - - argc = lua_gettop(tolua_S) - 1; - - if (argc == 3) - { - std::string arg0; - std::string arg1; - std::string arg2; - ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.GLProgramState:getOrCreateWithShaders"); - ok &= luaval_to_std_string(tolua_S, 3,&arg1, "cc.GLProgramState:getOrCreateWithShaders"); - ok &= luaval_to_std_string(tolua_S, 4,&arg2, "cc.GLProgramState:getOrCreateWithShaders"); - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_GLProgramState_getOrCreateWithShaders'", nullptr); - return 0; - } - cocos2d::GLProgramState* ret = cocos2d::GLProgramState::getOrCreateWithShaders(arg0, arg1, arg2); - object_to_luaval(tolua_S, "cc.GLProgramState",(cocos2d::GLProgramState*)ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d\n ", "cc.GLProgramState:getOrCreateWithShaders",argc, 3); - return 0; -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgramState_getOrCreateWithShaders'.",&tolua_err); -#endif - return 0; -} -static int lua_cocos2dx_GLProgramState_finalize(lua_State* tolua_S) -{ - printf("luabindings: finalizing LUA object (GLProgramState)"); - return 0; -} - -int lua_register_cocos2dx_GLProgramState(lua_State* tolua_S) -{ - tolua_usertype(tolua_S,"cc.GLProgramState"); - tolua_cclass(tolua_S,"GLProgramState","cc.GLProgramState","cc.Ref",nullptr); - - tolua_beginmodule(tolua_S,"GLProgramState"); - tolua_function(tolua_S,"getVertexAttribsFlags",lua_cocos2dx_GLProgramState_getVertexAttribsFlags); - tolua_function(tolua_S,"setUniformVec4",lua_cocos2dx_GLProgramState_setUniformVec4); - tolua_function(tolua_S,"applyAutoBinding",lua_cocos2dx_GLProgramState_applyAutoBinding); - tolua_function(tolua_S,"setUniformVec2",lua_cocos2dx_GLProgramState_setUniformVec2); - tolua_function(tolua_S,"setUniformVec3",lua_cocos2dx_GLProgramState_setUniformVec3); - tolua_function(tolua_S,"apply",lua_cocos2dx_GLProgramState_apply); - tolua_function(tolua_S,"getNodeBinding",lua_cocos2dx_GLProgramState_getNodeBinding); - tolua_function(tolua_S,"setUniformVec4v",lua_cocos2dx_GLProgramState_setUniformVec4v); - tolua_function(tolua_S,"applyGLProgram",lua_cocos2dx_GLProgramState_applyGLProgram); - tolua_function(tolua_S,"setNodeBinding",lua_cocos2dx_GLProgramState_setNodeBinding); - tolua_function(tolua_S,"setUniformInt",lua_cocos2dx_GLProgramState_setUniformInt); - tolua_function(tolua_S,"setParameterAutoBinding",lua_cocos2dx_GLProgramState_setParameterAutoBinding); - tolua_function(tolua_S,"setUniformVec2v",lua_cocos2dx_GLProgramState_setUniformVec2v); - tolua_function(tolua_S,"getUniformCount",lua_cocos2dx_GLProgramState_getUniformCount); - tolua_function(tolua_S,"applyAttributes",lua_cocos2dx_GLProgramState_applyAttributes); - tolua_function(tolua_S,"clone",lua_cocos2dx_GLProgramState_clone); - tolua_function(tolua_S,"setGLProgram",lua_cocos2dx_GLProgramState_setGLProgram); - tolua_function(tolua_S,"setUniformFloatv",lua_cocos2dx_GLProgramState_setUniformFloatv); - tolua_function(tolua_S,"getGLProgram",lua_cocos2dx_GLProgramState_getGLProgram); - tolua_function(tolua_S,"setUniformTexture",lua_cocos2dx_GLProgramState_setUniformTexture); - tolua_function(tolua_S,"applyUniforms",lua_cocos2dx_GLProgramState_applyUniforms); - tolua_function(tolua_S,"setUniformFloat",lua_cocos2dx_GLProgramState_setUniformFloat); - tolua_function(tolua_S,"setUniformMat4",lua_cocos2dx_GLProgramState_setUniformMat4); - tolua_function(tolua_S,"setUniformVec3v",lua_cocos2dx_GLProgramState_setUniformVec3v); - tolua_function(tolua_S,"getVertexAttribCount",lua_cocos2dx_GLProgramState_getVertexAttribCount); - tolua_function(tolua_S,"create", lua_cocos2dx_GLProgramState_create); - tolua_function(tolua_S,"getOrCreateWithGLProgramName", lua_cocos2dx_GLProgramState_getOrCreateWithGLProgramName); - tolua_function(tolua_S,"getOrCreateWithGLProgram", lua_cocos2dx_GLProgramState_getOrCreateWithGLProgram); - tolua_function(tolua_S,"getOrCreateWithShaders", lua_cocos2dx_GLProgramState_getOrCreateWithShaders); - tolua_endmodule(tolua_S); - std::string typeName = typeid(cocos2d::GLProgramState).name(); - g_luaType[typeName] = "cc.GLProgramState"; - g_typeCast["GLProgramState"] = "cc.GLProgramState"; - return 1; -} - int lua_cocos2dx_AtlasNode_updateAtlasValues(lua_State* tolua_S) { int argc = 0; @@ -68652,960 +69606,6 @@ 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; @@ -96522,7 +96522,7 @@ TOLUA_API int register_all_cocos2dx(lua_State* tolua_S) lua_register_cocos2dx_FadeTo(tolua_S); lua_register_cocos2dx_FadeIn(tolua_S); lua_register_cocos2dx_DirectionLight(tolua_S); - lua_register_cocos2dx_GLProgramState(tolua_S); + lua_register_cocos2dx_ShakyTiles3D(tolua_S); lua_register_cocos2dx_EventListenerCustom(tolua_S); lua_register_cocos2dx_FlipX3D(tolua_S); lua_register_cocos2dx_FlipY3D(tolua_S); @@ -96541,7 +96541,7 @@ TOLUA_API int register_all_cocos2dx(lua_State* tolua_S) lua_register_cocos2dx_MenuItem(tolua_S); lua_register_cocos2dx_MenuItemSprite(tolua_S); lua_register_cocos2dx_MenuItemImage(tolua_S); - lua_register_cocos2dx_ParticleFire(tolua_S); + lua_register_cocos2dx_AutoPolygon(tolua_S); lua_register_cocos2dx_ParticleSmoke(tolua_S); lua_register_cocos2dx_TransitionZoomFlipAngular(tolua_S); lua_register_cocos2dx_EaseRateAction(tolua_S); @@ -96572,7 +96572,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_AutoPolygon(tolua_S); + lua_register_cocos2dx_ParticleFire(tolua_S); lua_register_cocos2dx_FlipX(tolua_S); lua_register_cocos2dx_FlipY(tolua_S); lua_register_cocos2dx_EventKeyboard(tolua_S); @@ -96650,7 +96650,7 @@ TOLUA_API int register_all_cocos2dx(lua_State* tolua_S) lua_register_cocos2dx_EventListenerFocus(tolua_S); lua_register_cocos2dx_Spawn(tolua_S); lua_register_cocos2dx_EaseQuarticActionInOut(tolua_S); - lua_register_cocos2dx_ShakyTiles3D(tolua_S); + lua_register_cocos2dx_GLProgramState(tolua_S); lua_register_cocos2dx_PageTurn3D(tolua_S); lua_register_cocos2dx_PolygonInfo(tolua_S); lua_register_cocos2dx_TransitionSlideInL(tolua_S);