diff --git a/cocos/2d/CCAnimation.cpp b/cocos/2d/CCAnimation.cpp index 3d8631a4bd..cff9efbcc0 100644 --- a/cocos/2d/CCAnimation.cpp +++ b/cocos/2d/CCAnimation.cpp @@ -82,7 +82,7 @@ AnimationFrame* AnimationFrame::clone() const // implementation of Animation -Animation* Animation::create(void) +Animation* Animation::create() { Animation *animation = new (std::nothrow) Animation(); animation->init(); diff --git a/cocos/2d/CCCamera.cpp b/cocos/2d/CCCamera.cpp index bf6ffc9b8f..b44c20b24b 100644 --- a/cocos/2d/CCCamera.cpp +++ b/cocos/2d/CCCamera.cpp @@ -481,4 +481,9 @@ void Camera::setBackgroundBrush(CameraBackgroundBrush* clearBrush) _clearBrush = clearBrush; } +bool Camera::isBrushValid() +{ + return _clearBrush != nullptr && _clearBrush->isValid(); +} + NS_CC_END diff --git a/cocos/2d/CCCamera.h b/cocos/2d/CCCamera.h index 8aa01a7c52..7f030c6602 100644 --- a/cocos/2d/CCCamera.h +++ b/cocos/2d/CCCamera.h @@ -271,7 +271,9 @@ public: CameraBackgroundBrush* getBackgroundBrush() const { return _clearBrush; } virtual void visit(Renderer* renderer, const Mat4 &parentTransform, uint32_t parentFlags) override; - + + bool isBrushValid(); + CC_CONSTRUCTOR_ACCESS: Camera(); ~Camera(); diff --git a/cocos/2d/CCCameraBackgroundBrush.cpp b/cocos/2d/CCCameraBackgroundBrush.cpp index 756d773324..8f52b2ea74 100644 --- a/cocos/2d/CCCameraBackgroundBrush.cpp +++ b/cocos/2d/CCCameraBackgroundBrush.cpp @@ -232,6 +232,8 @@ CameraBackgroundSkyBoxBrush::CameraBackgroundSkyBoxBrush() , _vertexBuffer(0) , _indexBuffer(0) , _texture(nullptr) +, _actived(false) +, _textureValid(false) { #if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_WINRT) _backToForegroundListener = EventListenerCustom::create(EVENT_RENDERER_RECREATED, @@ -296,6 +298,9 @@ CameraBackgroundSkyBoxBrush* CameraBackgroundSkyBoxBrush::create() void CameraBackgroundSkyBoxBrush::drawBackground(Camera* camera) { + if (!_actived) + return; + Mat4 cameraModelMat = camera->getNodeToWorldTransform(); Vec4 color(1.f, 1.f, 1.f, 1.f); @@ -427,4 +432,23 @@ void CameraBackgroundSkyBoxBrush::setTexture(TextureCube* texture) _glProgramState->setUniformTexture("u_Env", _texture); } +bool CameraBackgroundSkyBoxBrush::isActived() const +{ + return _actived; +} +void CameraBackgroundSkyBoxBrush::setActived(bool actived) +{ + _actived = actived; +} + +void CameraBackgroundSkyBoxBrush::setTextureValid(bool valid) +{ + _textureValid = valid; +} + +bool CameraBackgroundSkyBoxBrush::isValid() +{ + return _actived; +} + NS_CC_END diff --git a/cocos/2d/CCCameraBackgroundBrush.h b/cocos/2d/CCCameraBackgroundBrush.h index ef7e8294e1..b235f452d4 100644 --- a/cocos/2d/CCCameraBackgroundBrush.h +++ b/cocos/2d/CCCameraBackgroundBrush.h @@ -103,8 +103,10 @@ public: * draw the background */ virtual void drawBackground(Camera* camera) {} - -CC_CONSTRUCTOR_ACCESS: + + virtual bool isValid() { return true; } + +CC_CONSTRUCTOR_ACCESS : CameraBackgroundBrush(); virtual ~CameraBackgroundBrush(); @@ -236,8 +238,13 @@ public: * Draw background */ virtual void drawBackground(Camera* camera) override; - -CC_CONSTRUCTOR_ACCESS: + + bool isActived() const; + void setActived(bool actived); + virtual void setTextureValid(bool valid); + virtual bool isValid()override; + +CC_CONSTRUCTOR_ACCESS : CameraBackgroundSkyBoxBrush(); virtual ~CameraBackgroundSkyBoxBrush(); @@ -258,6 +265,10 @@ protected: #if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_WINRT) EventListenerCustom* _backToForegroundListener; #endif + +private: + bool _actived; + bool _textureValid; }; NS_CC_END diff --git a/cocos/2d/CCDrawNode.cpp b/cocos/2d/CCDrawNode.cpp index 1fb58dd323..ee14525d29 100644 --- a/cocos/2d/CCDrawNode.cpp +++ b/cocos/2d/CCDrawNode.cpp @@ -104,9 +104,7 @@ static inline Tex2F __t(const Vec2 &v) // implementation of DrawNode -static const int DEFAULT_LINE_WIDTH = 2; - -DrawNode::DrawNode() +DrawNode::DrawNode(int lineWidth) : _vao(0) , _vbo(0) , _vaoGLPoint(0) @@ -125,7 +123,8 @@ DrawNode::DrawNode() , _dirty(false) , _dirtyGLPoint(false) , _dirtyGLLine(false) -, _lineWidth(DEFAULT_LINE_WIDTH) +, _lineWidth(lineWidth) +, _defaultLineWidth(lineWidth) { _blendFunc = BlendFunc::ALPHA_PREMULTIPLIED; } @@ -156,9 +155,9 @@ DrawNode::~DrawNode() } } -DrawNode* DrawNode::create() +DrawNode* DrawNode::create(int defaultLineWidth) { - DrawNode* ret = new (std::nothrow) DrawNode(); + DrawNode* ret = new (std::nothrow) DrawNode(defaultLineWidth); if (ret && ret->init()) { ret->autorelease(); @@ -398,6 +397,7 @@ void DrawNode::onDrawGLLine(const Mat4 &transform, uint32_t flags) // texcood glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_TEX_COORD, 2, GL_FLOAT, GL_FALSE, sizeof(V2F_C4B_T2F), (GLvoid *)offsetof(V2F_C4B_T2F, texCoords)); } + glLineWidth(_lineWidth); glDrawArrays(GL_LINES, 0, _bufferCountGLLine); @@ -407,8 +407,8 @@ void DrawNode::onDrawGLLine(const Mat4 &transform, uint32_t flags) } glBindBuffer(GL_ARRAY_BUFFER, 0); - CC_INCREMENT_GL_DRAWN_BATCHES_AND_VERTICES(1,_bufferCountGLLine); + CHECK_GL_ERROR_DEBUG(); } @@ -928,7 +928,7 @@ void DrawNode::clear() _dirtyGLLine = true; _bufferCountGLPoint = 0; _dirtyGLPoint = true; - _lineWidth = DEFAULT_LINE_WIDTH; + _lineWidth = _defaultLineWidth; } const BlendFunc& DrawNode::getBlendFunc() const @@ -946,4 +946,9 @@ void DrawNode::setLineWidth(int lineWidth) _lineWidth = lineWidth; } +float DrawNode::getLineWidth() +{ + return this->_lineWidth; +} + NS_CC_END diff --git a/cocos/2d/CCDrawNode.h b/cocos/2d/CCDrawNode.h index 0ea1c29eac..f296e0ac06 100644 --- a/cocos/2d/CCDrawNode.h +++ b/cocos/2d/CCDrawNode.h @@ -38,6 +38,8 @@ NS_CC_BEGIN +static const int DEFAULT_LINE_WIDTH = 2; + class PointArray; /** * @addtogroup _2d @@ -56,7 +58,7 @@ public: * * @return Return an autorelease object. */ - static DrawNode* create(); + static DrawNode* create(int defaultLineWidth = DEFAULT_LINE_WIDTH); /** Draw a point. * @@ -298,23 +300,26 @@ public: /** * @js NA */ - void onDraw(const Mat4 &transform, uint32_t flags); + virtual void onDraw(const Mat4 &transform, uint32_t flags); /** * @js NA */ - void onDrawGLLine(const Mat4 &transform, uint32_t flags); + virtual void onDrawGLLine(const Mat4 &transform, uint32_t flags); /** * @js NA */ - void onDrawGLPoint(const Mat4 &transform, uint32_t flags); + virtual void onDrawGLPoint(const Mat4 &transform, uint32_t flags); // Overrides virtual void draw(Renderer *renderer, const Mat4 &transform, uint32_t flags) override; void setLineWidth(int lineWidth); - + + // Get CocosStudio guide lines width. + float getLineWidth(); + CC_CONSTRUCTOR_ACCESS: - DrawNode(); + DrawNode(int lineWidth = DEFAULT_LINE_WIDTH); virtual ~DrawNode(); virtual bool init() override; @@ -355,6 +360,7 @@ protected: int _lineWidth; + int _defaultLineWidth; private: CC_DISALLOW_COPY_AND_ASSIGN(DrawNode); }; diff --git a/cocos/2d/CCFontAtlasCache.cpp b/cocos/2d/CCFontAtlasCache.cpp index 95609ea12e..2fdc1f98f0 100644 --- a/cocos/2d/CCFontAtlasCache.cpp +++ b/cocos/2d/CCFontAtlasCache.cpp @@ -238,4 +238,42 @@ bool FontAtlasCache::releaseFontAtlas(FontAtlas *atlas) return false; } +void FontAtlasCache::reloadFontAtlasFNT(const std::string& fontFileName, const Vec2& imageOffset/* = Vec2::ZERO*/) +{ + std::string atlasName = generateFontName(fontFileName, 0, false); + auto it = _atlasMap.find(atlasName); + + if (it != _atlasMap.end()) + { + CC_SAFE_RELEASE_NULL(it->second); + _atlasMap.erase(it); + } + FontFNT::reloadBMFontResource(fontFileName); + auto font = FontFNT::create(fontFileName, imageOffset); + if (font) + { + auto tempAtlas = font->createFontAtlas(); + if (tempAtlas) + { + _atlasMap[atlasName] = tempAtlas; + } + } + +} + +void FontAtlasCache::unloadFontAtlasTTF(const std::string& fontFileName) +{ + auto item = _atlasMap.begin(); + while (item != _atlasMap.end()) + { + if (item->first.find(fontFileName) >= 0) + { + CC_SAFE_RELEASE_NULL(item->second); + item = _atlasMap.erase(item); + } + else + item++; + } +} + NS_CC_END diff --git a/cocos/2d/CCFontAtlasCache.h b/cocos/2d/CCFontAtlasCache.h index e197a9812f..b3ebd9bbf2 100644 --- a/cocos/2d/CCFontAtlasCache.h +++ b/cocos/2d/CCFontAtlasCache.h @@ -53,7 +53,19 @@ public: It will purge the textures atlas and if multiple texture exist in one FontAtlas. */ static void purgeCachedData(); - + + /** Release current FNT texutre and reload it. + CAUTION : All component use this font texture should be reset font name, though the file name is same! + otherwise, it will cause program crash! + */ + static void reloadFontAtlasFNT(const std::string& fontFileName, const Vec2& imageOffset = Vec2::ZERO); + + /** Unload all texture atlas texture create by special file name. + CAUTION : All component use this font texture should be reset font name, though the file name is same! + otherwise, it will cause program crash! + */ + static void unloadFontAtlasTTF(const std::string& fontFileName); + private: static std::string generateFontName(const std::string& fontFileName, float size, bool useDistanceField); static std::unordered_map _atlasMap; diff --git a/cocos/2d/CCFontFNT.cpp b/cocos/2d/CCFontFNT.cpp index 4971d8d57e..1d95388eee 100644 --- a/cocos/2d/CCFontFNT.cpp +++ b/cocos/2d/CCFontFNT.cpp @@ -805,5 +805,25 @@ FontAtlas * FontFNT::createFontAtlas() return tempAtlas; } +void FontFNT::reloadBMFontResource(const std::string& fntFilePath) +{ + if (s_configurations == nullptr) + { + s_configurations = new (std::nothrow) Map(); + } + + BMFontConfiguration *ret = s_configurations->at(fntFilePath); + if (ret != nullptr) + { + s_configurations->erase(fntFilePath); + } + ret = BMFontConfiguration::create(fntFilePath.c_str()); + if (ret) + { + s_configurations->insert(fntFilePath, ret); + TextureCache::getInstance()->reloadTexture(ret->getAtlasName()); + + } +} NS_CC_END diff --git a/cocos/2d/CCFontFNT.h b/cocos/2d/CCFontFNT.h index ba734ae1e9..c38b2fbd23 100644 --- a/cocos/2d/CCFontFNT.h +++ b/cocos/2d/CCFontFNT.h @@ -48,6 +48,9 @@ public: virtual FontAtlas *createFontAtlas() override; void setFontSize(float fontSize); int getOriginalFontSize()const; + + static void reloadBMFontResource(const std::string& fntFilePath); + protected: FontFNT(BMFontConfiguration *theContfig, const Vec2& imageOffset = Vec2::ZERO); diff --git a/cocos/2d/CCFontFreeType.cpp b/cocos/2d/CCFontFreeType.cpp index 9076f23aca..0bc9234b4f 100644 --- a/cocos/2d/CCFontFreeType.cpp +++ b/cocos/2d/CCFontFreeType.cpp @@ -634,4 +634,16 @@ const char* FontFreeType::getGlyphCollection() const return glyphCollection; } +void FontFreeType::releaseFont(const std::string &fontName) +{ + auto item = s_cacheFontData.begin(); + while (s_cacheFontData.end() != item) + { + if (item->first.find(fontName) >= 0) + item = s_cacheFontData.erase(item); + else + item++; + } +} + NS_CC_END diff --git a/cocos/2d/CCFontFreeType.h b/cocos/2d/CCFontFreeType.h index 57eda9ddbb..51600e1b30 100644 --- a/cocos/2d/CCFontFreeType.h +++ b/cocos/2d/CCFontFreeType.h @@ -74,6 +74,9 @@ public: virtual FontAtlas* createFontAtlas() override; virtual int getFontMaxHeight() const override { return _lineHeight; } + + static void releaseFont(const std::string &fontName); + private: static const char* _glyphASCII; static const char* _glyphNEHE; diff --git a/cocos/2d/CCParticleSystem.cpp b/cocos/2d/CCParticleSystem.cpp index 169a7f854b..2459a79004 100644 --- a/cocos/2d/CCParticleSystem.cpp +++ b/cocos/2d/CCParticleSystem.cpp @@ -1332,5 +1332,4 @@ void ParticleSystem::setScaleY(float newScaleY) Node::setScaleY(newScaleY); } - NS_CC_END diff --git a/cocos/2d/CCParticleSystem.h b/cocos/2d/CCParticleSystem.h index a4c3ba4b24..eb7ab4afa9 100644 --- a/cocos/2d/CCParticleSystem.h +++ b/cocos/2d/CCParticleSystem.h @@ -760,7 +760,9 @@ public: * @lua NA */ virtual const BlendFunc &getBlendFunc() const override; - + + const std::string getResourceFile() const { return _plistFile; } + CC_CONSTRUCTOR_ACCESS: /** * @js ctor diff --git a/cocos/2d/CCScene.h b/cocos/2d/CCScene.h index 7ff478c835..fc1735c8bd 100644 --- a/cocos/2d/CCScene.h +++ b/cocos/2d/CCScene.h @@ -109,7 +109,7 @@ public: * @param renderer The renderer use to render the scene. * @js NA */ - void render(Renderer* renderer); + virtual void render(Renderer* renderer); /** override function */ virtual void removeAllChildren() override; diff --git a/cocos/2d/CCSprite.cpp b/cocos/2d/CCSprite.cpp index d89b1d6811..e401be8d6b 100644 --- a/cocos/2d/CCSprite.cpp +++ b/cocos/2d/CCSprite.cpp @@ -164,7 +164,14 @@ bool Sprite::initWithTexture(Texture2D *texture, const Rect& rect) bool Sprite::initWithFile(const std::string& filename) { - CCASSERT(filename.size()>0, "Invalid filename for sprite"); + if (filename.empty()) + { + CCLOG("Call Sprite::initWithFile with blank resource filename."); + return false; + } + + _fileName = filename; + _fileType = 0; Texture2D *texture = Director::getInstance()->getTextureCache()->addImage(filename); if (texture) @@ -184,6 +191,9 @@ bool Sprite::initWithFile(const std::string &filename, const Rect& rect) { CCASSERT(filename.size()>0, "Invalid filename"); + _fileName = filename; + _fileType = 0; + Texture2D *texture = Director::getInstance()->getTextureCache()->addImage(filename); if (texture) { @@ -200,6 +210,9 @@ bool Sprite::initWithSpriteFrameName(const std::string& spriteFrameName) { CCASSERT(spriteFrameName.size() > 0, "Invalid spriteFrameName"); + _fileName = spriteFrameName; + _fileType = 1; + SpriteFrame *frame = SpriteFrameCache::getInstance()->getSpriteFrameByName(spriteFrameName); return initWithSpriteFrame(frame); } @@ -329,7 +342,7 @@ void Sprite::setTexture(const std::string &filename) { Texture2D *texture = Director::getInstance()->getTextureCache()->addImage(filename); setTexture(texture); - + _unflippedOffsetPositionFromCenter = Vec2::ZERO; Rect rect = Rect::ZERO; if (texture) rect.size = texture->getContentSize(); diff --git a/cocos/2d/CCSprite.h b/cocos/2d/CCSprite.h index bcb5655b67..737b77045e 100644 --- a/cocos/2d/CCSprite.h +++ b/cocos/2d/CCSprite.h @@ -474,7 +474,10 @@ public: virtual bool isOpacityModifyRGB() const override; /// @} -CC_CONSTRUCTOR_ACCESS: + const int getResourceType() const { return _fileType; } + const std::string getResourceName() const { return _fileName; } + +CC_CONSTRUCTOR_ACCESS : /** * @js ctor */ @@ -633,6 +636,10 @@ protected: bool _flippedY; /// Whether the sprite is flipped vertically or not bool _insideBounds; /// whether or not the sprite was inside bounds the previous frame + + std::string _fileName; + int _fileType; + private: CC_DISALLOW_COPY_AND_ASSIGN(Sprite); }; diff --git a/cocos/2d/CCSpriteFrameCache.cpp b/cocos/2d/CCSpriteFrameCache.cpp index c029b895c3..dde20244e6 100644 --- a/cocos/2d/CCSpriteFrameCache.cpp +++ b/cocos/2d/CCSpriteFrameCache.cpp @@ -150,7 +150,9 @@ void SpriteFrameCache::addSpriteFramesWithDictionary(ValueMap& dictionary, Textu Version 3 with TexturePacker 4.0 polygon mesh packing */ - + if (dictionary["frames"].getType() != cocos2d::Value::Type::MAP) + return; + ValueMap& framesDict = dictionary["frames"].asValueMap(); int format = 0; @@ -493,6 +495,9 @@ void SpriteFrameCache::removeSpriteFramesFromFileContent(const std::string& plis void SpriteFrameCache::removeSpriteFramesFromDictionary(ValueMap& dictionary) { + if (dictionary["frames"].getType() != cocos2d::Value::Type::MAP) + return; + ValueMap framesDict = dictionary["frames"].asValueMap(); std::vector keysToRemove; @@ -543,4 +548,175 @@ SpriteFrame* SpriteFrameCache::getSpriteFrameByName(const std::string& name) return frame; } +void SpriteFrameCache::reloadSpriteFramesWithDictionary(ValueMap& dictionary, Texture2D *texture) +{ + ValueMap& framesDict = dictionary["frames"].asValueMap(); + int format = 0; + + // get the format + if (dictionary.find("metadata") != dictionary.end()) + { + ValueMap& metadataDict = dictionary["metadata"].asValueMap(); + format = metadataDict["format"].asInt(); + } + + // check the format + CCASSERT(format >= 0 && format <= 3, "format is not supported for SpriteFrameCache addSpriteFramesWithDictionary:textureFilename:"); + + for (auto iter = framesDict.begin(); iter != framesDict.end(); ++iter) + { + ValueMap& frameDict = iter->second.asValueMap(); + std::string spriteFrameName = iter->first; + + auto it = _spriteFrames.find(spriteFrameName); + if (it != _spriteFrames.end()) + { + _spriteFrames.erase(it); + } + + SpriteFrame* spriteFrame = nullptr; + + if (format == 0) + { + float x = frameDict["x"].asFloat(); + float y = frameDict["y"].asFloat(); + float w = frameDict["width"].asFloat(); + float h = frameDict["height"].asFloat(); + float ox = frameDict["offsetX"].asFloat(); + float oy = frameDict["offsetY"].asFloat(); + int ow = frameDict["originalWidth"].asInt(); + int oh = frameDict["originalHeight"].asInt(); + // check ow/oh + if (!ow || !oh) + { + CCLOGWARN("cocos2d: WARNING: originalWidth/Height not found on the SpriteFrame. AnchorPoint won't work as expected. Regenrate the .plist"); + } + // abs ow/oh + ow = abs(ow); + oh = abs(oh); + // create frame + spriteFrame = SpriteFrame::createWithTexture(texture, + Rect(x, y, w, h), + false, + Vec2(ox, oy), + Size((float)ow, (float)oh) + ); + } + else if (format == 1 || format == 2) + { + Rect frame = RectFromString(frameDict["frame"].asString()); + bool rotated = false; + + // rotation + if (format == 2) + { + rotated = frameDict["rotated"].asBool(); + } + + Vec2 offset = PointFromString(frameDict["offset"].asString()); + Size sourceSize = SizeFromString(frameDict["sourceSize"].asString()); + + // create frame + spriteFrame = SpriteFrame::createWithTexture(texture, + frame, + rotated, + offset, + sourceSize + ); + } + else if (format == 3) + { + // get values + Size spriteSize = SizeFromString(frameDict["spriteSize"].asString()); + Vec2 spriteOffset = PointFromString(frameDict["spriteOffset"].asString()); + Size spriteSourceSize = SizeFromString(frameDict["spriteSourceSize"].asString()); + Rect textureRect = RectFromString(frameDict["textureRect"].asString()); + bool textureRotated = frameDict["textureRotated"].asBool(); + + // get aliases + ValueVector& aliases = frameDict["aliases"].asValueVector(); + + for (const auto &value : aliases) { + std::string oneAlias = value.asString(); + if (_spriteFramesAliases.find(oneAlias) != _spriteFramesAliases.end()) + { + CCLOGWARN("cocos2d: WARNING: an alias with name %s already exists", oneAlias.c_str()); + } + + _spriteFramesAliases[oneAlias] = Value(spriteFrameName); + } + + // create frame + spriteFrame = SpriteFrame::createWithTexture(texture, + Rect(textureRect.origin.x, textureRect.origin.y, spriteSize.width, spriteSize.height), + textureRotated, + spriteOffset, + spriteSourceSize); + } + + // add sprite frame + _spriteFrames.insert(spriteFrameName, spriteFrame); + } +} + +bool SpriteFrameCache::reloadTexture(const std::string& plist) +{ + CCASSERT(plist.size()>0, "plist filename should not be nullptr"); + + auto it = _loadedFileNames->find(plist); + if (it != _loadedFileNames->end()) { + _loadedFileNames->erase(it); + } + else + { + //If one plist has't be loaded, we don't load it here. + return false; + } + + std::string fullPath = FileUtils::getInstance()->fullPathForFilename(plist); + ValueMap dict = FileUtils::getInstance()->getValueMapFromFile(fullPath); + + string texturePath(""); + + if (dict.find("metadata") != dict.end()) + { + ValueMap& metadataDict = dict["metadata"].asValueMap(); + // try to read texture file name from meta data + texturePath = metadataDict["textureFileName"].asString(); + } + + if (!texturePath.empty()) + { + // build texture path relative to plist file + texturePath = FileUtils::getInstance()->fullPathFromRelativeFile(texturePath.c_str(), plist); + } + else + { + // build texture path by replacing file extension + texturePath = plist; + + // remove .xxx + size_t startPos = texturePath.find_last_of("."); + texturePath = texturePath.erase(startPos); + + // append .png + texturePath = texturePath.append(".png"); + } + + Texture2D *texture = nullptr; + if (Director::getInstance()->getTextureCache()->reloadTexture(texturePath.c_str())) + texture = Director::getInstance()->getTextureCache()->getTextureForKey(texturePath); + + if (texture) + { + reloadSpriteFramesWithDictionary(dict, texture); + _loadedFileNames->insert(plist); + } + else + { + CCLOG("cocos2d: SpriteFrameCache: Couldn't load texture"); + } + return true; +} + NS_CC_END diff --git a/cocos/2d/CCSpriteFrameCache.h b/cocos/2d/CCSpriteFrameCache.h index 0a2873687f..cb305ba20c 100644 --- a/cocos/2d/CCSpriteFrameCache.h +++ b/cocos/2d/CCSpriteFrameCache.h @@ -236,6 +236,8 @@ public: /** @deprecated use getSpriteFrameByName() instead */ CC_DEPRECATED_ATTRIBUTE SpriteFrame* spriteFrameByName(const std::string&name) { return getSpriteFrameByName(name); } + bool reloadTexture(const std::string& plist); + protected: // MARMALADE: Made this protected not private, as deriving from this class is pretty useful SpriteFrameCache(){} @@ -260,6 +262,8 @@ protected: const std::vector &triangleIndices, PolygonInfo &polygonInfo); + void reloadSpriteFramesWithDictionary(ValueMap& dictionary, Texture2D *texture); + Map _spriteFrames; ValueMap _spriteFramesAliases; std::set* _loadedFileNames; diff --git a/cocos/2d/CCTMXTiledMap.cpp b/cocos/2d/CCTMXTiledMap.cpp index 4f7913fad8..93967c4504 100644 --- a/cocos/2d/CCTMXTiledMap.cpp +++ b/cocos/2d/CCTMXTiledMap.cpp @@ -61,7 +61,9 @@ TMXTiledMap* TMXTiledMap::createWithXML(const std::string& tmxString, const std: bool TMXTiledMap::initWithTMXFile(const std::string& tmxFile) { CCASSERT(tmxFile.size()>0, "TMXTiledMap: tmx file should not be empty"); - + + _tmxFile = tmxFile; + setContentSize(Size::ZERO); TMXMapInfo *mapInfo = TMXMapInfo::create(tmxFile); @@ -78,6 +80,8 @@ bool TMXTiledMap::initWithTMXFile(const std::string& tmxFile) bool TMXTiledMap::initWithXML(const std::string& tmxString, const std::string& resourcePath) { + _tmxFile = tmxString; + setContentSize(Size::ZERO); TMXMapInfo *mapInfo = TMXMapInfo::createWithXML(tmxString, resourcePath); @@ -91,6 +95,8 @@ bool TMXTiledMap::initWithXML(const std::string& tmxString, const std::string& r TMXTiledMap::TMXTiledMap() :_mapSize(Size::ZERO) ,_tileSize(Size::ZERO) + ,_tmxFile("") + , _tmxLayerNum(0) { } @@ -173,28 +179,30 @@ void TMXTiledMap::buildWithMapInfo(TMXMapInfo* mapInfo) _tileProperties = mapInfo->getTileProperties(); - int idx=0; + int idx = 0; auto& layers = mapInfo->getLayers(); - for(const auto &layerInfo : layers) { + for (const auto &layerInfo : layers) { if (layerInfo->_visible) { TMXLayer *child = parseLayer(layerInfo, mapInfo); if (child == nullptr) { idx++; continue; } - addChild(child, idx, idx); - + addChild(child, 0, idx); + child->setOrderOfArrival(idx); + child->setTag(TMXLayerTag); // update content size with the max size const Size& childSize = child->getContentSize(); Size currentSize = this->getContentSize(); - currentSize.width = std::max( currentSize.width, childSize.width ); - currentSize.height = std::max( currentSize.height, childSize.height ); + currentSize.width = std::max(currentSize.width, childSize.width); + currentSize.height = std::max(currentSize.height, childSize.height); this->setContentSize(currentSize); - + idx++; } } + _tmxLayerNum = idx; } // public @@ -270,5 +278,9 @@ std::string TMXTiledMap::getDescription() const return StringUtils::format("(_children.size())); } +int TMXTiledMap::getLayerNum() +{ + return _tmxLayerNum; +} NS_CC_END diff --git a/cocos/2d/CCTMXTiledMap.h b/cocos/2d/CCTMXTiledMap.h index 0e196c9ff0..d9a35ef096 100644 --- a/cocos/2d/CCTMXTiledMap.h +++ b/cocos/2d/CCTMXTiledMap.h @@ -251,7 +251,10 @@ public: * @js NA */ virtual std::string getDescription() const override; - + + int getLayerNum(); + const std::string getResourceFile() const { return _tmxFile; } + CC_CONSTRUCTOR_ACCESS: /** * @js ctor @@ -288,6 +291,11 @@ protected: //! tile properties ValueMapIntKey _tileProperties; + std::string _tmxFile; + int _tmxLayerNum; + + static const int TMXLayerTag = 32768; + private: CC_DISALLOW_COPY_AND_ASSIGN(TMXTiledMap); diff --git a/cocos/2d/CCTMXXMLParser.cpp b/cocos/2d/CCTMXXMLParser.cpp index 2a7425bb10..ee1e557424 100644 --- a/cocos/2d/CCTMXXMLParser.cpp +++ b/cocos/2d/CCTMXXMLParser.cpp @@ -266,6 +266,8 @@ void TMXMapInfo::startElement(void *ctx, const char *name, const char **atts) std::string externalTilesetFilename = attributeDict["source"].asString(); if (externalTilesetFilename != "") { + _externalTilesetFilename = externalTilesetFilename; + // Tileset file will be relative to the map file. So we need to convert it to an absolute path if (_TMXFileName.find_last_of("/") != string::npos) { @@ -388,6 +390,7 @@ void TMXMapInfo::startElement(void *ctx, const char *name, const char **atts) // build full path std::string imagename = attributeDict["source"].asString(); + tileset->_originSourceImage = imagename; if (_TMXFileName.find_last_of("/") != string::npos) { diff --git a/cocos/2d/CCTMXXMLParser.h b/cocos/2d/CCTMXXMLParser.h index 83009f2da7..3531852628 100644 --- a/cocos/2d/CCTMXXMLParser.h +++ b/cocos/2d/CCTMXXMLParser.h @@ -139,6 +139,8 @@ public: std::string _sourceImage; //! size in pixels of the image Size _imageSize; + std::string _originSourceImage; + public: /** * @js ctor @@ -279,6 +281,7 @@ public: inline void setCurrentString(const std::string& currentString){ _currentString = currentString; } inline const std::string& getTMXFileName() const { return _TMXFileName; } inline void setTMXFileName(const std::string& fileName){ _TMXFileName = fileName; } + inline const std::string& getExternalTilesetFileName() const { return _externalTilesetFilename; } protected: void internalInit(const std::string& tmxFileName, const std::string& resourcePath); @@ -318,6 +321,7 @@ protected: ValueMapIntKey _tileProperties; int _currentFirstGID; bool _recordFirstGID; + std::string _externalTilesetFilename; }; // end of tilemap_parallax_nodes group diff --git a/cocos/3d/CCSprite3D.cpp b/cocos/3d/CCSprite3D.cpp index f10423102d..4a3ec6ca69 100644 --- a/cocos/3d/CCSprite3D.cpp +++ b/cocos/3d/CCSprite3D.cpp @@ -457,9 +457,9 @@ void Sprite3D::setMaterial(Material *material, int meshIndex) if (meshIndex == -1) { - for (auto mesh: _meshes) + for (size_t i = 0; i < _meshes.size(); i++) { - mesh->setMaterial(material); + _meshes.at(i)->setMaterial(i == 0 ? material : material->clone()); } } else diff --git a/cocos/editor-support/cocostudio/CocosStudioExtension.cpp b/cocos/editor-support/cocostudio/CocosStudioExtension.cpp new file mode 100644 index 0000000000..6daa9a8cd8 --- /dev/null +++ b/cocos/editor-support/cocostudio/CocosStudioExtension.cpp @@ -0,0 +1,13 @@ +#include "CocosStudioExtension.h" + +NS_CC_BEGIN + +NodeExtension::NodeExtension() +{ +} + +NodeExtension::~NodeExtension() +{ +} + +NS_CC_END \ No newline at end of file diff --git a/cocos/2d/CocosStudioExtension.h b/cocos/editor-support/cocostudio/CocosStudioExtension.h similarity index 100% rename from cocos/2d/CocosStudioExtension.h rename to cocos/editor-support/cocostudio/CocosStudioExtension.h diff --git a/cocos/renderer/CCGLProgramState.h b/cocos/renderer/CCGLProgramState.h index ba070a4e30..21b042dcc1 100644 --- a/cocos/renderer/CCGLProgramState.h +++ b/cocos/renderer/CCGLProgramState.h @@ -437,7 +437,7 @@ public: protected: GLProgramState(); - ~GLProgramState(); + virtual ~GLProgramState(); bool init(GLProgram* program); void resetGLProgram(); void updateUniformsAndAttributes(); 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 79e864224d..1bb76c58a2 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 @@ -4903,32 +4903,6 @@ getElapsed : function ( */ cc.Sequence = { -/** - * @method init - * @param {Array} arg0 - * @return {bool} - */ -init : function ( -array -) -{ - return false; -}, - -/** - * @method initWithTwoActions - * @param {cc.FiniteTimeAction} arg0 - * @param {cc.FiniteTimeAction} arg1 - * @return {bool} - */ -initWithTwoActions : function ( -finitetimeaction, -finitetimeaction -) -{ - return false; -}, - /** * @method Sequence * @constructor @@ -5069,32 +5043,6 @@ RepeatForever : function ( */ cc.Spawn = { -/** - * @method init - * @param {Array} arg0 - * @return {bool} - */ -init : function ( -array -) -{ - return false; -}, - -/** - * @method initWithTwoActions - * @param {cc.FiniteTimeAction} arg0 - * @param {cc.FiniteTimeAction} arg1 - * @return {bool} - */ -initWithTwoActions : function ( -finitetimeaction, -finitetimeaction -) -{ - return false; -}, - /** * @method Spawn * @constructor @@ -11911,6 +11859,16 @@ color4f { }, +/** + * @method getLineWidth + * @return {float} + */ +getLineWidth : function ( +) +{ + return 0; +}, + /** * @method drawPoint * @param {vec2_object} arg0 @@ -15223,6 +15181,16 @@ getStartSpin : function ( return 0; }, +/** + * @method getResourceFile + * @return {String} + */ +getResourceFile : function ( +) +{ + return ; +}, + /** * @method getRotatePerSecond * @return {float} @@ -16805,6 +16773,16 @@ float { }, +/** + * @method getResourceType + * @return {int} + */ +getResourceType : function ( +) +{ + return 0; +}, + /** * @method initWithTexture * @param {cc.Texture2D|cc.Texture2D|cc.Texture2D} texture2d @@ -16951,6 +16929,16 @@ getSpriteFrame : function ( return cc.SpriteFrame; }, +/** + * @method getResourceName + * @return {String} + */ +getResourceName : function ( +) +{ + return ; +}, + /** * @method isDirty * @return {bool} @@ -18798,6 +18786,16 @@ getProjectionMatrix : function ( return cc.Mat4; }, +/** + * @method isBrushValid + * @return {bool} + */ +isBrushValid : function ( +) +{ + return false; +}, + /** * @method getDepthInView * @param {mat4_object} arg0 @@ -19158,6 +19156,16 @@ init : function ( return false; }, +/** + * @method isValid + * @return {bool} + */ +isValid : function ( +) +{ + return false; +}, + /** * @method createSkyboxBrush * @param {String} arg0 @@ -19308,6 +19316,16 @@ CameraBackgroundColorBrush : function ( */ cc.CameraBackgroundSkyBoxBrush = { +/** + * @method setTextureValid + * @param {bool} arg0 + */ +setTextureValid : function ( +bool +) +{ +}, + /** * @method setTexture * @param {cc.TextureCube} arg0 @@ -19318,6 +19336,26 @@ texturecube { }, +/** + * @method setActived + * @param {bool} arg0 + */ +setActived : function ( +bool +) +{ +}, + +/** + * @method isActived + * @return {bool} + */ +isActived : function ( +) +{ + return false; +}, + /** * @method create * @param {String} str @@ -21583,6 +21621,18 @@ SpriteBatchNode : function ( */ cc.SpriteFrameCache = { +/** + * @method reloadTexture + * @param {String} arg0 + * @return {bool} + */ +reloadTexture : function ( +str +) +{ + return false; +}, + /** * @method addSpriteFramesWithFileContent * @param {String} arg0 @@ -22336,6 +22386,16 @@ getTileProperties : function ( return map_object; }, +/** + * @method getExternalTilesetFileName + * @return {String} + */ +getExternalTilesetFileName : function ( +) +{ + return ; +}, + /** * @method getObjectGroups * @return {Array|Array} @@ -22798,6 +22858,16 @@ str return cc.Value; }, +/** + * @method getLayerNum + * @return {int} + */ +getLayerNum : function ( +) +{ + return 0; +}, + /** * @method setMapSize * @param {size_object} arg0 @@ -22831,17 +22901,13 @@ getObjectGroups : function( }, /** - * @method initWithXML - * @param {String} arg0 - * @param {String} arg1 - * @return {bool} + * @method getResourceFile + * @return {String} */ -initWithXML : function ( -str, -str +getResourceFile : function ( ) { - return false; + return ; }, /** @@ -22876,6 +22942,20 @@ getMapSize : function ( return cc.Size; }, +/** + * @method initWithXML + * @param {String} arg0 + * @param {String} arg1 + * @return {bool} + */ +initWithXML : function ( +str, +str +) +{ + return false; +}, + /** * @method getProperties * @return {map_object} diff --git a/cocos/scripting/js-bindings/auto/api/jsb_cocos2dx_ui_auto_api.js b/cocos/scripting/js-bindings/auto/api/jsb_cocos2dx_ui_auto_api.js index 900ebe9f42..7d4f650858 100644 --- a/cocos/scripting/js-bindings/auto/api/jsb_cocos2dx_ui_auto_api.js +++ b/cocos/scripting/js-bindings/auto/api/jsb_cocos2dx_ui_auto_api.js @@ -1312,16 +1312,6 @@ create : function ( return ccui.Layout; }, -/** - * @method createInstance - * @return {cc.Ref} - */ -createInstance : function ( -) -{ - return cc.Ref; -}, - /** * @method Layout * @constructor @@ -1742,16 +1732,6 @@ texturerestype return ccui.Button; }, -/** - * @method createInstance - * @return {cc.Ref} - */ -createInstance : function ( -) -{ - return cc.Ref; -}, - /** * @method Button * @constructor @@ -2049,16 +2029,6 @@ texturerestype return ccui.CheckBox; }, -/** - * @method createInstance - * @return {cc.Ref} - */ -createInstance : function ( -) -{ - return cc.Ref; -}, - /** * @method CheckBox * @constructor @@ -2107,16 +2077,6 @@ texturerestype return ccui.RadioButton; }, -/** - * @method createInstance - * @return {cc.Ref} - */ -createInstance : function ( -) -{ - return cc.Ref; -}, - /** * @method RadioButton * @constructor @@ -2369,16 +2329,6 @@ texturerestype return ccui.ImageView; }, -/** - * @method createInstance - * @return {cc.Ref} - */ -createInstance : function ( -) -{ - return cc.Ref; -}, - /** * @method ImageView * @constructor @@ -2657,16 +2607,6 @@ float return ccui.Text; }, -/** - * @method createInstance - * @return {cc.Ref} - */ -createInstance : function ( -) -{ - return cc.Ref; -}, - /** * @method Text * @constructor @@ -2769,16 +2709,6 @@ str return ccui.TextAtlas; }, -/** - * @method createInstance - * @return {cc.Ref} - */ -createInstance : function ( -) -{ - return cc.Ref; -}, - /** * @method TextAtlas * @constructor @@ -2913,16 +2843,6 @@ float return ccui.LoadingBar; }, -/** - * @method createInstance - * @return {cc.Ref} - */ -createInstance : function ( -) -{ - return cc.Ref; -}, - /** * @method LoadingBar * @constructor @@ -3471,16 +3391,6 @@ create : function ( return ccui.ScrollView; }, -/** - * @method createInstance - * @return {cc.Ref} - */ -createInstance : function ( -) -{ - return cc.Ref; -}, - /** * @method ScrollView * @constructor @@ -3823,16 +3733,6 @@ create : function ( return ccui.ListView; }, -/** - * @method createInstance - * @return {cc.Ref} - */ -createInstance : function ( -) -{ - return cc.Ref; -}, - /** * @method ListView * @constructor @@ -4131,16 +4031,6 @@ texturerestype return ccui.Slider; }, -/** - * @method createInstance - * @return {cc.Ref} - */ -createInstance : function ( -) -{ - return cc.Ref; -}, - /** * @method Slider * @constructor @@ -4873,16 +4763,6 @@ int return ccui.TextField; }, -/** - * @method createInstance - * @return {cc.Ref} - */ -createInstance : function ( -) -{ - return cc.Ref; -}, - /** * @method TextField * @constructor @@ -4963,16 +4843,6 @@ str return ccui.TextBMFont; }, -/** - * @method createInstance - * @return {cc.Ref} - */ -createInstance : function ( -) -{ - return cc.Ref; -}, - /** * @method TextBMFont * @constructor @@ -5199,16 +5069,6 @@ create : function ( return ccui.PageView; }, -/** - * @method createInstance - * @return {cc.Ref} - */ -createInstance : function ( -) -{ - return cc.Ref; -}, - /** * @method PageView * @constructor diff --git a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_3d_auto.cpp b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_3d_auto.cpp index 056782ac66..0c732036a9 100644 --- a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_3d_auto.cpp +++ b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_3d_auto.cpp @@ -126,17 +126,11 @@ bool js_cocos2dx_3d_Animation3D_create(JSContext *cx, uint32_t argc, jsval *vp) std::string arg0; ok &= jsval_to_std_string(cx, args.get(0), &arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_3d_Animation3D_create : Error processing arguments"); - cocos2d::Animation3D* ret = cocos2d::Animation3D::create(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Animation3D*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::Animation3D::create(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::Animation3D")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } if (argc == 2) { @@ -145,17 +139,11 @@ bool js_cocos2dx_3d_Animation3D_create(JSContext *cx, uint32_t argc, jsval *vp) 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_3d_Animation3D_create : Error processing arguments"); - cocos2d::Animation3D* ret = cocos2d::Animation3D::create(arg0, arg1); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Animation3D*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::Animation3D::create(arg0, arg1); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::Animation3D")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_3d_Animation3D_create : wrong number of arguments"); @@ -589,6 +577,7 @@ bool js_cocos2dx_3d_Animate3D_getTransitionTime(JSContext *cx, uint32_t argc, js { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { + double ret = cocos2d::Animate3D::getTransitionTime(); jsval jsret = JSVAL_NULL; jsret = DOUBLE_TO_JSVAL(ret); @@ -619,17 +608,11 @@ bool js_cocos2dx_3d_Animate3D_createWithFrames(JSContext *cx, uint32_t argc, jsv ok &= jsval_to_int32(cx, args.get(1), (int32_t *)&arg1); ok &= jsval_to_int32(cx, args.get(2), (int32_t *)&arg2); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_3d_Animate3D_createWithFrames : Error processing arguments"); - cocos2d::Animate3D* ret = cocos2d::Animate3D::createWithFrames(arg0, arg1, arg2); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Animate3D*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::Animate3D::createWithFrames(arg0, arg1, arg2); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::Animate3D")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } if (argc == 4) { @@ -650,17 +633,11 @@ bool js_cocos2dx_3d_Animate3D_createWithFrames(JSContext *cx, uint32_t argc, jsv ok &= jsval_to_int32(cx, args.get(2), (int32_t *)&arg2); ok &= JS::ToNumber( cx, args.get(3), &arg3) && !isnan(arg3); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_3d_Animate3D_createWithFrames : Error processing arguments"); - cocos2d::Animate3D* ret = cocos2d::Animate3D::createWithFrames(arg0, arg1, arg2, arg3); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Animate3D*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::Animate3D::createWithFrames(arg0, arg1, arg2, arg3); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::Animate3D")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_3d_Animate3D_createWithFrames : wrong number of arguments"); @@ -799,17 +776,11 @@ bool js_cocos2dx_3d_TextureCube_create(JSContext *cx, uint32_t argc, jsval *vp) ok &= jsval_to_std_string(cx, args.get(4), &arg4); ok &= jsval_to_std_string(cx, args.get(5), &arg5); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_3d_TextureCube_create : Error processing arguments"); - cocos2d::TextureCube* ret = cocos2d::TextureCube::create(arg0, arg1, arg2, arg3, arg4, arg5); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::TextureCube*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::TextureCube::create(arg0, arg1, arg2, arg3, arg4, arg5); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::TextureCube")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_3d_TextureCube_create : wrong number of arguments"); @@ -898,17 +869,11 @@ bool js_cocos2dx_3d_AttachNode_create(JSContext *cx, uint32_t argc, jsval *vp) JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_3d_AttachNode_create : Error processing arguments"); - cocos2d::AttachNode* ret = cocos2d::AttachNode::create(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::AttachNode*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::AttachNode::create(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::AttachNode")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_3d_AttachNode_create : wrong number of arguments"); @@ -1167,17 +1132,11 @@ bool js_cocos2dx_3d_BillBoard_createWithTexture(JSContext *cx, uint32_t argc, js JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_3d_BillBoard_createWithTexture : Error processing arguments"); - cocos2d::BillBoard* ret = cocos2d::BillBoard::createWithTexture(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::BillBoard*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::BillBoard::createWithTexture(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::BillBoard")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } if (argc == 2) { @@ -1194,17 +1153,11 @@ bool js_cocos2dx_3d_BillBoard_createWithTexture(JSContext *cx, uint32_t argc, js } while (0); ok &= jsval_to_int32(cx, args.get(1), (int32_t *)&arg1); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_3d_BillBoard_createWithTexture : Error processing arguments"); - cocos2d::BillBoard* ret = cocos2d::BillBoard::createWithTexture(arg0, arg1); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::BillBoard*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::BillBoard::createWithTexture(arg0, arg1); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::BillBoard")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_3d_BillBoard_createWithTexture : wrong number of arguments"); @@ -3476,6 +3429,7 @@ bool js_cocos2dx_3d_Sprite3DCache_getInstance(JSContext *cx, uint32_t argc, jsva { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { + cocos2d::Sprite3DCache* ret = cocos2d::Sprite3DCache::getInstance(); jsval jsret = JSVAL_NULL; do { @@ -4362,6 +4316,7 @@ bool js_cocos2dx_3d_Bundle3D_createBundle(JSContext *cx, uint32_t argc, jsval *v { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { + cocos2d::Bundle3D* ret = cocos2d::Bundle3D::createBundle(); jsval jsret = JSVAL_NULL; do { @@ -4420,6 +4375,7 @@ bool js_cocos2dx_3d_Bundle3D_loadObj(JSContext *cx, uint32_t argc, jsval *vp) ok = false; ok &= jsval_to_std_string(cx, args.get(3), &arg3); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_3d_Bundle3D_loadObj : Error processing arguments"); + bool ret = cocos2d::Bundle3D::loadObj(arg0, arg1, arg2, arg3); jsval jsret = JSVAL_NULL; jsret = BOOLEAN_TO_JSVAL(ret); @@ -4441,6 +4397,7 @@ bool js_cocos2dx_3d_Bundle3D_loadObj(JSContext *cx, uint32_t argc, jsval *vp) ok &= jsval_to_std_string(cx, args.get(3), &arg3); std::string arg4_tmp; ok &= jsval_to_std_string(cx, args.get(4), &arg4_tmp); arg4 = arg4_tmp.c_str(); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_3d_Bundle3D_loadObj : Error processing arguments"); + bool ret = cocos2d::Bundle3D::loadObj(arg0, arg1, arg2, arg3, arg4); jsval jsret = JSVAL_NULL; jsret = BOOLEAN_TO_JSVAL(ret); diff --git a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_audioengine_auto.cpp b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_audioengine_auto.cpp index fd778cd515..7dea6a6a6b 100644 --- a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_audioengine_auto.cpp +++ b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_audioengine_auto.cpp @@ -193,6 +193,7 @@ bool js_cocos2dx_audioengine_AudioEngine_lazyInit(JSContext *cx, uint32_t argc, { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { + bool ret = cocos2d::experimental::AudioEngine::lazyInit(); jsval jsret = JSVAL_NULL; jsret = BOOLEAN_TO_JSVAL(ret); @@ -213,6 +214,7 @@ bool js_cocos2dx_audioengine_AudioEngine_setCurrentTime(JSContext *cx, uint32_t ok &= jsval_to_int32(cx, args.get(0), (int32_t *)&arg0); ok &= JS::ToNumber( cx, args.get(1), &arg1) && !isnan(arg1); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_audioengine_AudioEngine_setCurrentTime : Error processing arguments"); + bool ret = cocos2d::experimental::AudioEngine::setCurrentTime(arg0, arg1); jsval jsret = JSVAL_NULL; jsret = BOOLEAN_TO_JSVAL(ret); @@ -231,6 +233,7 @@ bool js_cocos2dx_audioengine_AudioEngine_getVolume(JSContext *cx, uint32_t argc, int arg0 = 0; ok &= jsval_to_int32(cx, args.get(0), (int32_t *)&arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_audioengine_AudioEngine_getVolume : Error processing arguments"); + double ret = cocos2d::experimental::AudioEngine::getVolume(arg0); jsval jsret = JSVAL_NULL; jsret = DOUBLE_TO_JSVAL(ret); @@ -313,6 +316,7 @@ bool js_cocos2dx_audioengine_AudioEngine_getMaxAudioInstance(JSContext *cx, uint { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { + int ret = cocos2d::experimental::AudioEngine::getMaxAudioInstance(); jsval jsret = JSVAL_NULL; jsret = int32_to_jsval(cx, ret); @@ -331,6 +335,7 @@ bool js_cocos2dx_audioengine_AudioEngine_getCurrentTime(JSContext *cx, uint32_t int arg0 = 0; ok &= jsval_to_int32(cx, args.get(0), (int32_t *)&arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_audioengine_AudioEngine_getCurrentTime : Error processing arguments"); + double ret = cocos2d::experimental::AudioEngine::getCurrentTime(arg0); jsval jsret = JSVAL_NULL; jsret = DOUBLE_TO_JSVAL(ret); @@ -349,6 +354,7 @@ bool js_cocos2dx_audioengine_AudioEngine_setMaxAudioInstance(JSContext *cx, uint int arg0 = 0; ok &= jsval_to_int32(cx, args.get(0), (int32_t *)&arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_audioengine_AudioEngine_setMaxAudioInstance : Error processing arguments"); + bool ret = cocos2d::experimental::AudioEngine::setMaxAudioInstance(arg0); jsval jsret = JSVAL_NULL; jsret = BOOLEAN_TO_JSVAL(ret); @@ -367,6 +373,7 @@ bool js_cocos2dx_audioengine_AudioEngine_isLoop(JSContext *cx, uint32_t argc, js int arg0 = 0; ok &= jsval_to_int32(cx, args.get(0), (int32_t *)&arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_audioengine_AudioEngine_isLoop : Error processing arguments"); + bool ret = cocos2d::experimental::AudioEngine::isLoop(arg0); jsval jsret = JSVAL_NULL; jsret = BOOLEAN_TO_JSVAL(ret); @@ -479,6 +486,7 @@ bool js_cocos2dx_audioengine_AudioEngine_play2d(JSContext *cx, uint32_t argc, js std::string arg0; ok &= jsval_to_std_string(cx, args.get(0), &arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_audioengine_AudioEngine_play2d : Error processing arguments"); + int ret = cocos2d::experimental::AudioEngine::play2d(arg0); jsval jsret = JSVAL_NULL; jsret = int32_to_jsval(cx, ret); @@ -491,6 +499,7 @@ bool js_cocos2dx_audioengine_AudioEngine_play2d(JSContext *cx, uint32_t argc, js ok &= jsval_to_std_string(cx, args.get(0), &arg0); arg1 = JS::ToBoolean(args.get(1)); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_audioengine_AudioEngine_play2d : Error processing arguments"); + int ret = cocos2d::experimental::AudioEngine::play2d(arg0, arg1); jsval jsret = JSVAL_NULL; jsret = int32_to_jsval(cx, ret); @@ -505,6 +514,7 @@ bool js_cocos2dx_audioengine_AudioEngine_play2d(JSContext *cx, uint32_t argc, js arg1 = JS::ToBoolean(args.get(1)); ok &= JS::ToNumber( cx, args.get(2), &arg2) && !isnan(arg2); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_audioengine_AudioEngine_play2d : Error processing arguments"); + int ret = cocos2d::experimental::AudioEngine::play2d(arg0, arg1, arg2); jsval jsret = JSVAL_NULL; jsret = int32_to_jsval(cx, ret); @@ -529,6 +539,7 @@ bool js_cocos2dx_audioengine_AudioEngine_play2d(JSContext *cx, uint32_t argc, js JSB_PRECONDITION2( arg3, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_audioengine_AudioEngine_play2d : Error processing arguments"); + int ret = cocos2d::experimental::AudioEngine::play2d(arg0, arg1, arg2, arg3); jsval jsret = JSVAL_NULL; jsret = int32_to_jsval(cx, ret); @@ -547,6 +558,7 @@ bool js_cocos2dx_audioengine_AudioEngine_getState(JSContext *cx, uint32_t argc, int arg0 = 0; ok &= jsval_to_int32(cx, args.get(0), (int32_t *)&arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_audioengine_AudioEngine_getState : Error processing arguments"); + int ret = (int)cocos2d::experimental::AudioEngine::getState(arg0); jsval jsret = JSVAL_NULL; jsret = int32_to_jsval(cx, ret); @@ -597,6 +609,7 @@ bool js_cocos2dx_audioengine_AudioEngine_getDuration(JSContext *cx, uint32_t arg int arg0 = 0; ok &= jsval_to_int32(cx, args.get(0), (int32_t *)&arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_audioengine_AudioEngine_getDuration : Error processing arguments"); + double ret = cocos2d::experimental::AudioEngine::getDuration(arg0); jsval jsret = JSVAL_NULL; jsret = DOUBLE_TO_JSVAL(ret); @@ -629,6 +642,7 @@ bool js_cocos2dx_audioengine_AudioEngine_getDefaultProfile(JSContext *cx, uint32 { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { + cocos2d::experimental::AudioProfile* ret = cocos2d::experimental::AudioEngine::getDefaultProfile(); jsval jsret = JSVAL_NULL; do { diff --git a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_auto.cpp b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_auto.cpp index 017bc4a707..364f6ff6da 100644 --- a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_auto.cpp +++ b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_auto.cpp @@ -766,6 +766,7 @@ bool js_cocos2dx_Texture2D_getDefaultAlphaPixelFormat(JSContext *cx, uint32_t ar { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { + int ret = (int)cocos2d::Texture2D::getDefaultAlphaPixelFormat(); jsval jsret = JSVAL_NULL; jsret = int32_to_jsval(cx, ret); @@ -1778,17 +1779,11 @@ bool js_cocos2dx_Component_create(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocos2d::Component* ret = cocos2d::Component::create(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Component*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::Component::create(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::Component")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_Component_create : wrong number of arguments"); @@ -5232,17 +5227,11 @@ bool js_cocos2dx_Node_create(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocos2d::Node* ret = cocos2d::Node::create(); - 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); + + auto ret = cocos2d::Node::create(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::Node")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_Node_create : wrong number of arguments"); @@ -5688,17 +5677,11 @@ bool js_cocos2dx_Scene_createWithSize(JSContext *cx, uint32_t argc, jsval *vp) cocos2d::Size arg0; ok &= jsval_to_ccsize(cx, args.get(0), &arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Scene_createWithSize : Error processing arguments"); - cocos2d::Scene* ret = cocos2d::Scene::createWithSize(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Scene*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::Scene::createWithSize(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::Scene")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_Scene_createWithSize : wrong number of arguments"); @@ -5709,17 +5692,11 @@ bool js_cocos2dx_Scene_create(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocos2d::Scene* ret = cocos2d::Scene::create(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Scene*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::Scene::create(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::Scene")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_Scene_create : wrong number of arguments"); @@ -6375,6 +6352,7 @@ bool js_cocos2dx_GLView_getGLContextAttrs(JSContext *cx, uint32_t argc, jsval *v { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { + GLContextAttrs ret = cocos2d::GLView::getGLContextAttrs(); jsval jsret = JSVAL_NULL; #pragma warning NO CONVERSION FROM NATIVE FOR GLContextAttrs; @@ -7741,6 +7719,7 @@ bool js_cocos2dx_Director_getInstance(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { + cocos2d::Director* ret = cocos2d::Director::getInstance(); jsval jsret = JSVAL_NULL; do { @@ -8123,6 +8102,7 @@ bool js_cocos2dx_AsyncTaskPool_getInstance(JSContext *cx, uint32_t argc, jsval * { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { + cocos2d::AsyncTaskPool* ret = cocos2d::AsyncTaskPool::getInstance(); jsval jsret = JSVAL_NULL; do { @@ -8807,17 +8787,11 @@ bool js_cocos2dx_Speed_create(JSContext *cx, uint32_t argc, jsval *vp) } while (0); ok &= JS::ToNumber( cx, args.get(1), &arg1) && !isnan(arg1); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Speed_create : Error processing arguments"); - cocos2d::Speed* ret = cocos2d::Speed::create(arg0, arg1); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Speed*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::Speed::create(arg0, arg1); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::Speed")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_Speed_create : wrong number of arguments"); @@ -8998,17 +8972,11 @@ bool js_cocos2dx_Follow_create(JSContext *cx, uint32_t argc, jsval *vp) JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Follow_create : Error processing arguments"); - cocos2d::Follow* ret = cocos2d::Follow::create(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Follow*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::Follow::create(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::Follow")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } if (argc == 2) { @@ -9025,17 +8993,11 @@ bool js_cocos2dx_Follow_create(JSContext *cx, uint32_t argc, jsval *vp) } while (0); ok &= jsval_to_ccrect(cx, args.get(1), &arg1); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Follow_create : Error processing arguments"); - cocos2d::Follow* ret = cocos2d::Follow::create(arg0, arg1); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Follow*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::Follow::create(arg0, arg1); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::Follow")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_Follow_create : wrong number of arguments"); @@ -10499,17 +10461,11 @@ bool js_cocos2dx_GLProgramState_create(JSContext *cx, uint32_t argc, jsval *vp) 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); + + auto ret = cocos2d::GLProgramState::create(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::GLProgramState")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_GLProgramState_create : wrong number of arguments"); @@ -10524,6 +10480,7 @@ bool js_cocos2dx_GLProgramState_getOrCreateWithGLProgramName(JSContext *cx, uint 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 { @@ -10557,6 +10514,7 @@ bool js_cocos2dx_GLProgramState_getOrCreateWithGLProgram(JSContext *cx, uint32_t 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 { @@ -10586,6 +10544,7 @@ bool js_cocos2dx_GLProgramState_getOrCreateWithShaders(JSContext *cx, uint32_t a 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 { @@ -11607,17 +11566,11 @@ bool js_cocos2dx_AnimationFrame_create(JSContext *cx, uint32_t argc, jsval *vp) ok &= JS::ToNumber( cx, args.get(1), &arg1) && !isnan(arg1); ok &= jsval_to_ccvaluemap(cx, args.get(2), &arg2); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_AnimationFrame_create : Error processing arguments"); - cocos2d::AnimationFrame* ret = cocos2d::AnimationFrame::create(arg0, arg1, arg2); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::AnimationFrame*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::AnimationFrame::create(arg0, arg1, arg2); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::AnimationFrame")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_AnimationFrame_create : wrong number of arguments"); @@ -12173,17 +12126,11 @@ bool js_cocos2dx_Animation_createWithSpriteFrames(JSContext *cx, uint32_t argc, cocos2d::Vector arg0; ok &= jsval_to_ccvector(cx, args.get(0), &arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Animation_createWithSpriteFrames : Error processing arguments"); - cocos2d::Animation* ret = cocos2d::Animation::createWithSpriteFrames(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Animation*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::Animation::createWithSpriteFrames(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::Animation")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } if (argc == 2) { @@ -12192,17 +12139,11 @@ bool js_cocos2dx_Animation_createWithSpriteFrames(JSContext *cx, uint32_t argc, ok &= jsval_to_ccvector(cx, args.get(0), &arg0); ok &= JS::ToNumber( cx, args.get(1), &arg1) && !isnan(arg1); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Animation_createWithSpriteFrames : Error processing arguments"); - cocos2d::Animation* ret = cocos2d::Animation::createWithSpriteFrames(arg0, arg1); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Animation*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::Animation::createWithSpriteFrames(arg0, arg1); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::Animation")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } if (argc == 3) { @@ -12213,17 +12154,11 @@ bool js_cocos2dx_Animation_createWithSpriteFrames(JSContext *cx, uint32_t argc, ok &= JS::ToNumber( cx, args.get(1), &arg1) && !isnan(arg1); ok &= jsval_to_uint32(cx, args.get(2), &arg2); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Animation_createWithSpriteFrames : Error processing arguments"); - cocos2d::Animation* ret = cocos2d::Animation::createWithSpriteFrames(arg0, arg1, arg2); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Animation*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::Animation::createWithSpriteFrames(arg0, arg1, arg2); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::Animation")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_Animation_createWithSpriteFrames : wrong number of arguments"); @@ -12454,68 +12389,6 @@ void js_register_cocos2dx_ActionInterval(JSContext *cx, JS::HandleObject global) JSClass *jsb_cocos2d_Sequence_class; JSObject *jsb_cocos2d_Sequence_prototype; -bool js_cocos2dx_Sequence_init(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::Sequence* cobj = (cocos2d::Sequence *)(proxy ? proxy->ptr : NULL); - JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Sequence_init : Invalid Native Object"); - if (argc == 1) { - cocos2d::Vector arg0; - ok &= jsval_to_ccvector(cx, args.get(0), &arg0); - JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Sequence_init : Error processing arguments"); - bool ret = cobj->init(arg0); - jsval jsret = JSVAL_NULL; - jsret = BOOLEAN_TO_JSVAL(ret); - args.rval().set(jsret); - return true; - } - - JS_ReportError(cx, "js_cocos2dx_Sequence_init : wrong number of arguments: %d, was expecting %d", argc, 1); - return false; -} -bool js_cocos2dx_Sequence_initWithTwoActions(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::Sequence* cobj = (cocos2d::Sequence *)(proxy ? proxy->ptr : NULL); - JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Sequence_initWithTwoActions : Invalid Native Object"); - if (argc == 2) { - cocos2d::FiniteTimeAction* arg0 = nullptr; - cocos2d::FiniteTimeAction* arg1 = nullptr; - do { - if (args.get(0).isNull()) { arg0 = nullptr; break; } - if (!args.get(0).isObject()) { ok = false; break; } - js_proxy_t *jsProxy; - JS::RootedObject tmpObj(cx, args.get(0).toObjectOrNull()); - jsProxy = jsb_get_js_proxy(tmpObj); - arg0 = (cocos2d::FiniteTimeAction*)(jsProxy ? jsProxy->ptr : NULL); - JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); - } while (0); - do { - if (args.get(1).isNull()) { arg1 = nullptr; break; } - if (!args.get(1).isObject()) { ok = false; break; } - js_proxy_t *jsProxy; - JS::RootedObject tmpObj(cx, args.get(1).toObjectOrNull()); - jsProxy = jsb_get_js_proxy(tmpObj); - arg1 = (cocos2d::FiniteTimeAction*)(jsProxy ? jsProxy->ptr : NULL); - JSB_PRECONDITION2( arg1, cx, false, "Invalid Native Object"); - } while (0); - JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Sequence_initWithTwoActions : Error processing arguments"); - bool ret = cobj->initWithTwoActions(arg0, arg1); - jsval jsret = JSVAL_NULL; - jsret = BOOLEAN_TO_JSVAL(ret); - args.rval().set(jsret); - return true; - } - - JS_ReportError(cx, "js_cocos2dx_Sequence_initWithTwoActions : wrong number of arguments: %d, was expecting %d", argc, 2); - return false; -} bool js_cocos2dx_Sequence_constructor(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); @@ -12568,8 +12441,6 @@ void js_register_cocos2dx_Sequence(JSContext *cx, JS::HandleObject global) { }; static JSFunctionSpec funcs[] = { - JS_FN("init", js_cocos2dx_Sequence_init, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), - JS_FN("initWithTwoActions", js_cocos2dx_Sequence_initWithTwoActions, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("ctor", js_cocos2dx_Sequence_ctor, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FS_END }; @@ -12699,17 +12570,11 @@ bool js_cocos2dx_Repeat_create(JSContext *cx, uint32_t argc, jsval *vp) } while (0); ok &= jsval_to_uint32(cx, args.get(1), &arg1); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Repeat_create : Error processing arguments"); - cocos2d::Repeat* ret = cocos2d::Repeat::create(arg0, arg1); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Repeat*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::Repeat::create(arg0, arg1); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::Repeat")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_Repeat_create : wrong number of arguments"); @@ -12899,17 +12764,11 @@ bool js_cocos2dx_RepeatForever_create(JSContext *cx, uint32_t argc, jsval *vp) JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_RepeatForever_create : Error processing arguments"); - cocos2d::RepeatForever* ret = cocos2d::RepeatForever::create(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::RepeatForever*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::RepeatForever::create(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::RepeatForever")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_RepeatForever_create : wrong number of arguments"); @@ -13000,68 +12859,6 @@ void js_register_cocos2dx_RepeatForever(JSContext *cx, JS::HandleObject global) JSClass *jsb_cocos2d_Spawn_class; JSObject *jsb_cocos2d_Spawn_prototype; -bool js_cocos2dx_Spawn_init(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::Spawn* cobj = (cocos2d::Spawn *)(proxy ? proxy->ptr : NULL); - JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Spawn_init : Invalid Native Object"); - if (argc == 1) { - cocos2d::Vector arg0; - ok &= jsval_to_ccvector(cx, args.get(0), &arg0); - JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Spawn_init : Error processing arguments"); - bool ret = cobj->init(arg0); - jsval jsret = JSVAL_NULL; - jsret = BOOLEAN_TO_JSVAL(ret); - args.rval().set(jsret); - return true; - } - - JS_ReportError(cx, "js_cocos2dx_Spawn_init : wrong number of arguments: %d, was expecting %d", argc, 1); - return false; -} -bool js_cocos2dx_Spawn_initWithTwoActions(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::Spawn* cobj = (cocos2d::Spawn *)(proxy ? proxy->ptr : NULL); - JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Spawn_initWithTwoActions : Invalid Native Object"); - if (argc == 2) { - cocos2d::FiniteTimeAction* arg0 = nullptr; - cocos2d::FiniteTimeAction* arg1 = nullptr; - do { - if (args.get(0).isNull()) { arg0 = nullptr; break; } - if (!args.get(0).isObject()) { ok = false; break; } - js_proxy_t *jsProxy; - JS::RootedObject tmpObj(cx, args.get(0).toObjectOrNull()); - jsProxy = jsb_get_js_proxy(tmpObj); - arg0 = (cocos2d::FiniteTimeAction*)(jsProxy ? jsProxy->ptr : NULL); - JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); - } while (0); - do { - if (args.get(1).isNull()) { arg1 = nullptr; break; } - if (!args.get(1).isObject()) { ok = false; break; } - js_proxy_t *jsProxy; - JS::RootedObject tmpObj(cx, args.get(1).toObjectOrNull()); - jsProxy = jsb_get_js_proxy(tmpObj); - arg1 = (cocos2d::FiniteTimeAction*)(jsProxy ? jsProxy->ptr : NULL); - JSB_PRECONDITION2( arg1, cx, false, "Invalid Native Object"); - } while (0); - JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Spawn_initWithTwoActions : Error processing arguments"); - bool ret = cobj->initWithTwoActions(arg0, arg1); - jsval jsret = JSVAL_NULL; - jsret = BOOLEAN_TO_JSVAL(ret); - args.rval().set(jsret); - return true; - } - - JS_ReportError(cx, "js_cocos2dx_Spawn_initWithTwoActions : wrong number of arguments: %d, was expecting %d", argc, 2); - return false; -} bool js_cocos2dx_Spawn_constructor(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); @@ -13114,8 +12911,6 @@ void js_register_cocos2dx_Spawn(JSContext *cx, JS::HandleObject global) { }; static JSFunctionSpec funcs[] = { - JS_FN("init", js_cocos2dx_Spawn_init, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), - JS_FN("initWithTwoActions", js_cocos2dx_Spawn_initWithTwoActions, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("ctor", js_cocos2dx_Spawn_ctor, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FS_END }; @@ -13978,17 +13773,11 @@ bool js_cocos2dx_SkewTo_create(JSContext *cx, uint32_t argc, jsval *vp) ok &= JS::ToNumber( cx, args.get(1), &arg1) && !isnan(arg1); ok &= JS::ToNumber( cx, args.get(2), &arg2) && !isnan(arg2); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_SkewTo_create : Error processing arguments"); - cocos2d::SkewTo* ret = cocos2d::SkewTo::create(arg0, arg1, arg2); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::SkewTo*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::SkewTo::create(arg0, arg1, arg2); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::SkewTo")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_SkewTo_create : wrong number of arguments"); @@ -14115,17 +13904,11 @@ bool js_cocos2dx_SkewBy_create(JSContext *cx, uint32_t argc, jsval *vp) ok &= JS::ToNumber( cx, args.get(1), &arg1) && !isnan(arg1); ok &= JS::ToNumber( cx, args.get(2), &arg2) && !isnan(arg2); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_SkewBy_create : Error processing arguments"); - cocos2d::SkewBy* ret = cocos2d::SkewBy::create(arg0, arg1, arg2); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::SkewBy*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::SkewBy::create(arg0, arg1, arg2); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::SkewBy")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_SkewBy_create : wrong number of arguments"); @@ -14256,17 +14039,11 @@ bool js_cocos2dx_JumpBy_create(JSContext *cx, uint32_t argc, jsval *vp) ok &= JS::ToNumber( cx, args.get(2), &arg2) && !isnan(arg2); ok &= jsval_to_int32(cx, args.get(3), (int32_t *)&arg3); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_JumpBy_create : Error processing arguments"); - cocos2d::JumpBy* ret = cocos2d::JumpBy::create(arg0, arg1, arg2, arg3); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::JumpBy*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::JumpBy::create(arg0, arg1, arg2, arg3); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::JumpBy")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_JumpBy_create : wrong number of arguments"); @@ -14397,17 +14174,11 @@ bool js_cocos2dx_JumpTo_create(JSContext *cx, uint32_t argc, jsval *vp) ok &= JS::ToNumber( cx, args.get(2), &arg2) && !isnan(arg2); ok &= jsval_to_int32(cx, args.get(3), (int32_t *)&arg3); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_JumpTo_create : Error processing arguments"); - cocos2d::JumpTo* ret = cocos2d::JumpTo::create(arg0, arg1, arg2, arg3); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::JumpTo*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::JumpTo::create(arg0, arg1, arg2, arg3); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::JumpTo")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_JumpTo_create : wrong number of arguments"); @@ -15090,17 +14861,11 @@ bool js_cocos2dx_Blink_create(JSContext *cx, uint32_t argc, jsval *vp) ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); ok &= jsval_to_int32(cx, args.get(1), (int32_t *)&arg1); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Blink_create : Error processing arguments"); - cocos2d::Blink* ret = cocos2d::Blink::create(arg0, arg1); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Blink*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::Blink::create(arg0, arg1); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::Blink")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_Blink_create : wrong number of arguments"); @@ -15223,17 +14988,11 @@ bool js_cocos2dx_FadeTo_create(JSContext *cx, uint32_t argc, jsval *vp) ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); ok &= jsval_to_uint16(cx, args.get(1), &arg1); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_FadeTo_create : Error processing arguments"); - cocos2d::FadeTo* ret = cocos2d::FadeTo::create(arg0, arg1); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::FadeTo*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::FadeTo::create(arg0, arg1); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::FadeTo")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_FadeTo_create : wrong number of arguments"); @@ -15358,17 +15117,11 @@ bool js_cocos2dx_FadeIn_create(JSContext *cx, uint32_t argc, jsval *vp) double arg0 = 0; ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_FadeIn_create : Error processing arguments"); - cocos2d::FadeIn* ret = cocos2d::FadeIn::create(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::FadeIn*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::FadeIn::create(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::FadeIn")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_FadeIn_create : wrong number of arguments"); @@ -15493,17 +15246,11 @@ bool js_cocos2dx_FadeOut_create(JSContext *cx, uint32_t argc, jsval *vp) double arg0 = 0; ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_FadeOut_create : Error processing arguments"); - cocos2d::FadeOut* ret = cocos2d::FadeOut::create(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::FadeOut*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::FadeOut::create(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::FadeOut")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_FadeOut_create : wrong number of arguments"); @@ -15803,17 +15550,11 @@ bool js_cocos2dx_TintBy_create(JSContext *cx, uint32_t argc, jsval *vp) ok &= jsval_to_int32(cx, args.get(2), &arg2); ok &= jsval_to_int32(cx, args.get(3), &arg3); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_TintBy_create : Error processing arguments"); - cocos2d::TintBy* ret = cocos2d::TintBy::create(arg0, arg1, arg2, arg3); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::TintBy*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::TintBy::create(arg0, arg1, arg2, arg3); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::TintBy")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_TintBy_create : wrong number of arguments"); @@ -15910,17 +15651,11 @@ bool js_cocos2dx_DelayTime_create(JSContext *cx, uint32_t argc, jsval *vp) double arg0 = 0; ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_DelayTime_create : Error processing arguments"); - cocos2d::DelayTime* ret = cocos2d::DelayTime::create(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::DelayTime*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::DelayTime::create(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::DelayTime")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_DelayTime_create : wrong number of arguments"); @@ -16054,17 +15789,11 @@ bool js_cocos2dx_ReverseTime_create(JSContext *cx, uint32_t argc, jsval *vp) JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ReverseTime_create : Error processing arguments"); - cocos2d::ReverseTime* ret = cocos2d::ReverseTime::create(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ReverseTime*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::ReverseTime::create(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::ReverseTime")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_ReverseTime_create : wrong number of arguments"); @@ -16293,17 +16022,11 @@ bool js_cocos2dx_Animate_create(JSContext *cx, uint32_t argc, jsval *vp) JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Animate_create : Error processing arguments"); - cocos2d::Animate* ret = cocos2d::Animate::create(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Animate*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::Animate::create(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::Animate")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_Animate_create : wrong number of arguments"); @@ -16537,17 +16260,11 @@ bool js_cocos2dx_TargetedAction_create(JSContext *cx, uint32_t argc, jsval *vp) JSB_PRECONDITION2( arg1, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_TargetedAction_create : Error processing arguments"); - cocos2d::TargetedAction* ret = cocos2d::TargetedAction::create(arg0, arg1); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::TargetedAction*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::TargetedAction::create(arg0, arg1); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::TargetedAction")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_TargetedAction_create : wrong number of arguments"); @@ -16724,17 +16441,11 @@ bool js_cocos2dx_ActionFloat_create(JSContext *cx, uint32_t argc, jsval *vp) } while(0) ; JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ActionFloat_create : Error processing arguments"); - cocos2d::ActionFloat* ret = cocos2d::ActionFloat::create(arg0, arg1, arg2, arg3); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ActionFloat*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::ActionFloat::create(arg0, arg1, arg2, arg3); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::ActionFloat")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_ActionFloat_create : wrong number of arguments"); @@ -17259,6 +16970,7 @@ bool js_cocos2dx_Configuration_getInstance(JSContext *cx, uint32_t argc, jsval * { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { + cocos2d::Configuration* ret = cocos2d::Configuration::getInstance(); jsval jsret = JSVAL_NULL; do { @@ -18124,6 +17836,7 @@ bool js_cocos2dx_Properties_parseVec3(JSContext *cx, uint32_t argc, jsval *vp) JSB_PRECONDITION2( arg1, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Properties_parseVec3 : Error processing arguments"); + bool ret = cocos2d::Properties::parseVec3(arg0, arg1); jsval jsret = JSVAL_NULL; jsret = BOOLEAN_TO_JSVAL(ret); @@ -18152,6 +17865,7 @@ bool js_cocos2dx_Properties_parseAxisAngle(JSContext *cx, uint32_t argc, jsval * JSB_PRECONDITION2( arg1, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Properties_parseAxisAngle : Error processing arguments"); + bool ret = cocos2d::Properties::parseAxisAngle(arg0, arg1); jsval jsret = JSVAL_NULL; jsret = BOOLEAN_TO_JSVAL(ret); @@ -18172,6 +17886,7 @@ bool js_cocos2dx_Properties_parseVec2(JSContext *cx, uint32_t argc, jsval *vp) std::string arg0_tmp; ok &= jsval_to_std_string(cx, args.get(0), &arg0_tmp); arg0 = arg0_tmp.c_str(); std::vector tempData;ok &= jsval_to_vector_vec2(cx, args.get(1), &tempData);arg1=tempData.data(); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Properties_parseVec2 : Error processing arguments"); + bool ret = cocos2d::Properties::parseVec2(arg0, arg1); jsval jsret = JSVAL_NULL; jsret = BOOLEAN_TO_JSVAL(ret); @@ -18190,6 +17905,7 @@ bool js_cocos2dx_Properties_createNonRefCounted(JSContext *cx, uint32_t argc, js std::string arg0; ok &= jsval_to_std_string(cx, args.get(0), &arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Properties_createNonRefCounted : Error processing arguments"); + cocos2d::Properties* ret = cocos2d::Properties::createNonRefCounted(arg0); jsval jsret = JSVAL_NULL; do { @@ -18225,6 +17941,7 @@ bool js_cocos2dx_Properties_parseVec4(JSContext *cx, uint32_t argc, jsval *vp) JSB_PRECONDITION2( arg1, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Properties_parseVec4 : Error processing arguments"); + bool ret = cocos2d::Properties::parseVec4(arg0, arg1); jsval jsret = JSVAL_NULL; jsret = BOOLEAN_TO_JSVAL(ret); @@ -19083,6 +18800,7 @@ bool js_cocos2dx_FileUtils_getInstance(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { + cocos2d::FileUtils* ret = cocos2d::FileUtils::getInstance(); jsval jsret = JSVAL_NULL; do { @@ -20147,17 +19865,11 @@ bool js_cocos2dx_EventListenerAcceleration_create(JSContext *cx, uint32_t argc, } while(0) ; JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_EventListenerAcceleration_create : Error processing arguments"); - cocos2d::EventListenerAcceleration* ret = cocos2d::EventListenerAcceleration::create(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::EventListenerAcceleration*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::EventListenerAcceleration::create(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::EventListenerAcceleration")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_EventListenerAcceleration_create : wrong number of arguments"); @@ -20269,17 +19981,11 @@ bool js_cocos2dx_EventListenerCustom_create(JSContext *cx, uint32_t argc, jsval } while(0) ; JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_EventListenerCustom_create : Error processing arguments"); - cocos2d::EventListenerCustom* ret = cocos2d::EventListenerCustom::create(arg0, arg1); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::EventListenerCustom*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::EventListenerCustom::create(arg0, arg1); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::EventListenerCustom")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_EventListenerCustom_create : wrong number of arguments"); @@ -21457,17 +21163,11 @@ bool js_cocos2dx_OrbitCamera_create(JSContext *cx, uint32_t argc, jsval *vp) ok &= JS::ToNumber( cx, args.get(5), &arg5) && !isnan(arg5); ok &= JS::ToNumber( cx, args.get(6), &arg6) && !isnan(arg6); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_OrbitCamera_create : Error processing arguments"); - cocos2d::OrbitCamera* ret = cocos2d::OrbitCamera::create(arg0, arg1, arg2, arg3, arg4, arg5, arg6); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::OrbitCamera*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::OrbitCamera::create(arg0, arg1, arg2, arg3, arg4, arg5, arg6); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::OrbitCamera")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_OrbitCamera_create : wrong number of arguments"); @@ -22011,17 +21711,11 @@ bool js_cocos2dx_EaseRateAction_create(JSContext *cx, uint32_t argc, jsval *vp) } while (0); ok &= JS::ToNumber( cx, args.get(1), &arg1) && !isnan(arg1); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_EaseRateAction_create : Error processing arguments"); - cocos2d::EaseRateAction* ret = cocos2d::EaseRateAction::create(arg0, arg1); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::EaseRateAction*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::EaseRateAction::create(arg0, arg1); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::EaseRateAction")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_EaseRateAction_create : wrong number of arguments"); @@ -22098,17 +21792,11 @@ bool js_cocos2dx_EaseIn_create(JSContext *cx, uint32_t argc, jsval *vp) } while (0); ok &= JS::ToNumber( cx, args.get(1), &arg1) && !isnan(arg1); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_EaseIn_create : Error processing arguments"); - cocos2d::EaseIn* ret = cocos2d::EaseIn::create(arg0, arg1); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::EaseIn*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::EaseIn::create(arg0, arg1); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::EaseIn")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_EaseIn_create : wrong number of arguments"); @@ -22214,17 +21902,11 @@ bool js_cocos2dx_EaseOut_create(JSContext *cx, uint32_t argc, jsval *vp) } while (0); ok &= JS::ToNumber( cx, args.get(1), &arg1) && !isnan(arg1); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_EaseOut_create : Error processing arguments"); - cocos2d::EaseOut* ret = cocos2d::EaseOut::create(arg0, arg1); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::EaseOut*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::EaseOut::create(arg0, arg1); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::EaseOut")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_EaseOut_create : wrong number of arguments"); @@ -22330,17 +22012,11 @@ bool js_cocos2dx_EaseInOut_create(JSContext *cx, uint32_t argc, jsval *vp) } while (0); ok &= JS::ToNumber( cx, args.get(1), &arg1) && !isnan(arg1); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_EaseInOut_create : Error processing arguments"); - cocos2d::EaseInOut* ret = cocos2d::EaseInOut::create(arg0, arg1); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::EaseInOut*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::EaseInOut::create(arg0, arg1); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::EaseInOut")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_EaseInOut_create : wrong number of arguments"); @@ -22444,17 +22120,11 @@ bool js_cocos2dx_EaseExponentialIn_create(JSContext *cx, uint32_t argc, jsval *v JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_EaseExponentialIn_create : Error processing arguments"); - cocos2d::EaseExponentialIn* ret = cocos2d::EaseExponentialIn::create(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::EaseExponentialIn*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::EaseExponentialIn::create(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::EaseExponentialIn")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_EaseExponentialIn_create : wrong number of arguments"); @@ -22558,17 +22228,11 @@ bool js_cocos2dx_EaseExponentialOut_create(JSContext *cx, uint32_t argc, jsval * JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_EaseExponentialOut_create : Error processing arguments"); - cocos2d::EaseExponentialOut* ret = cocos2d::EaseExponentialOut::create(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::EaseExponentialOut*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::EaseExponentialOut::create(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::EaseExponentialOut")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_EaseExponentialOut_create : wrong number of arguments"); @@ -22672,17 +22336,11 @@ bool js_cocos2dx_EaseExponentialInOut_create(JSContext *cx, uint32_t argc, jsval JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_EaseExponentialInOut_create : Error processing arguments"); - cocos2d::EaseExponentialInOut* ret = cocos2d::EaseExponentialInOut::create(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::EaseExponentialInOut*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::EaseExponentialInOut::create(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::EaseExponentialInOut")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_EaseExponentialInOut_create : wrong number of arguments"); @@ -22786,17 +22444,11 @@ bool js_cocos2dx_EaseSineIn_create(JSContext *cx, uint32_t argc, jsval *vp) JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_EaseSineIn_create : Error processing arguments"); - cocos2d::EaseSineIn* ret = cocos2d::EaseSineIn::create(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::EaseSineIn*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::EaseSineIn::create(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::EaseSineIn")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_EaseSineIn_create : wrong number of arguments"); @@ -22900,17 +22552,11 @@ bool js_cocos2dx_EaseSineOut_create(JSContext *cx, uint32_t argc, jsval *vp) JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_EaseSineOut_create : Error processing arguments"); - cocos2d::EaseSineOut* ret = cocos2d::EaseSineOut::create(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::EaseSineOut*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::EaseSineOut::create(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::EaseSineOut")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_EaseSineOut_create : wrong number of arguments"); @@ -23014,17 +22660,11 @@ bool js_cocos2dx_EaseSineInOut_create(JSContext *cx, uint32_t argc, jsval *vp) JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_EaseSineInOut_create : Error processing arguments"); - cocos2d::EaseSineInOut* ret = cocos2d::EaseSineInOut::create(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::EaseSineInOut*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::EaseSineInOut::create(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::EaseSineInOut")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_EaseSineInOut_create : wrong number of arguments"); @@ -23752,17 +23392,11 @@ bool js_cocos2dx_EaseBounceIn_create(JSContext *cx, uint32_t argc, jsval *vp) JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_EaseBounceIn_create : Error processing arguments"); - cocos2d::EaseBounceIn* ret = cocos2d::EaseBounceIn::create(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::EaseBounceIn*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::EaseBounceIn::create(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::EaseBounceIn")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_EaseBounceIn_create : wrong number of arguments"); @@ -23866,17 +23500,11 @@ bool js_cocos2dx_EaseBounceOut_create(JSContext *cx, uint32_t argc, jsval *vp) JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_EaseBounceOut_create : Error processing arguments"); - cocos2d::EaseBounceOut* ret = cocos2d::EaseBounceOut::create(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::EaseBounceOut*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::EaseBounceOut::create(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::EaseBounceOut")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_EaseBounceOut_create : wrong number of arguments"); @@ -23980,17 +23608,11 @@ bool js_cocos2dx_EaseBounceInOut_create(JSContext *cx, uint32_t argc, jsval *vp) JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_EaseBounceInOut_create : Error processing arguments"); - cocos2d::EaseBounceInOut* ret = cocos2d::EaseBounceInOut::create(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::EaseBounceInOut*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::EaseBounceInOut::create(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::EaseBounceInOut")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_EaseBounceInOut_create : wrong number of arguments"); @@ -24094,17 +23716,11 @@ bool js_cocos2dx_EaseBackIn_create(JSContext *cx, uint32_t argc, jsval *vp) JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_EaseBackIn_create : Error processing arguments"); - cocos2d::EaseBackIn* ret = cocos2d::EaseBackIn::create(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::EaseBackIn*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::EaseBackIn::create(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::EaseBackIn")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_EaseBackIn_create : wrong number of arguments"); @@ -24208,17 +23824,11 @@ bool js_cocos2dx_EaseBackOut_create(JSContext *cx, uint32_t argc, jsval *vp) JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_EaseBackOut_create : Error processing arguments"); - cocos2d::EaseBackOut* ret = cocos2d::EaseBackOut::create(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::EaseBackOut*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::EaseBackOut::create(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::EaseBackOut")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_EaseBackOut_create : wrong number of arguments"); @@ -24322,17 +23932,11 @@ bool js_cocos2dx_EaseBackInOut_create(JSContext *cx, uint32_t argc, jsval *vp) JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_EaseBackInOut_create : Error processing arguments"); - cocos2d::EaseBackInOut* ret = cocos2d::EaseBackInOut::create(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::EaseBackInOut*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::EaseBackInOut::create(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::EaseBackInOut")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_EaseBackInOut_create : wrong number of arguments"); @@ -24462,17 +24066,11 @@ bool js_cocos2dx_EaseBezierAction_create(JSContext *cx, uint32_t argc, jsval *vp JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_EaseBezierAction_create : Error processing arguments"); - cocos2d::EaseBezierAction* ret = cocos2d::EaseBezierAction::create(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::EaseBezierAction*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::EaseBezierAction::create(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::EaseBezierAction")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_EaseBezierAction_create : wrong number of arguments"); @@ -24577,17 +24175,11 @@ bool js_cocos2dx_EaseQuadraticActionIn_create(JSContext *cx, uint32_t argc, jsva JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_EaseQuadraticActionIn_create : Error processing arguments"); - cocos2d::EaseQuadraticActionIn* ret = cocos2d::EaseQuadraticActionIn::create(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::EaseQuadraticActionIn*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::EaseQuadraticActionIn::create(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::EaseQuadraticActionIn")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_EaseQuadraticActionIn_create : wrong number of arguments"); @@ -24691,17 +24283,11 @@ bool js_cocos2dx_EaseQuadraticActionOut_create(JSContext *cx, uint32_t argc, jsv JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_EaseQuadraticActionOut_create : Error processing arguments"); - cocos2d::EaseQuadraticActionOut* ret = cocos2d::EaseQuadraticActionOut::create(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::EaseQuadraticActionOut*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::EaseQuadraticActionOut::create(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::EaseQuadraticActionOut")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_EaseQuadraticActionOut_create : wrong number of arguments"); @@ -24805,17 +24391,11 @@ bool js_cocos2dx_EaseQuadraticActionInOut_create(JSContext *cx, uint32_t argc, j JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_EaseQuadraticActionInOut_create : Error processing arguments"); - cocos2d::EaseQuadraticActionInOut* ret = cocos2d::EaseQuadraticActionInOut::create(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::EaseQuadraticActionInOut*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::EaseQuadraticActionInOut::create(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::EaseQuadraticActionInOut")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_EaseQuadraticActionInOut_create : wrong number of arguments"); @@ -24919,17 +24499,11 @@ bool js_cocos2dx_EaseQuarticActionIn_create(JSContext *cx, uint32_t argc, jsval JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_EaseQuarticActionIn_create : Error processing arguments"); - cocos2d::EaseQuarticActionIn* ret = cocos2d::EaseQuarticActionIn::create(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::EaseQuarticActionIn*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::EaseQuarticActionIn::create(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::EaseQuarticActionIn")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_EaseQuarticActionIn_create : wrong number of arguments"); @@ -25033,17 +24607,11 @@ bool js_cocos2dx_EaseQuarticActionOut_create(JSContext *cx, uint32_t argc, jsval JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_EaseQuarticActionOut_create : Error processing arguments"); - cocos2d::EaseQuarticActionOut* ret = cocos2d::EaseQuarticActionOut::create(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::EaseQuarticActionOut*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::EaseQuarticActionOut::create(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::EaseQuarticActionOut")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_EaseQuarticActionOut_create : wrong number of arguments"); @@ -25147,17 +24715,11 @@ bool js_cocos2dx_EaseQuarticActionInOut_create(JSContext *cx, uint32_t argc, jsv JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_EaseQuarticActionInOut_create : Error processing arguments"); - cocos2d::EaseQuarticActionInOut* ret = cocos2d::EaseQuarticActionInOut::create(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::EaseQuarticActionInOut*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::EaseQuarticActionInOut::create(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::EaseQuarticActionInOut")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_EaseQuarticActionInOut_create : wrong number of arguments"); @@ -25261,17 +24823,11 @@ bool js_cocos2dx_EaseQuinticActionIn_create(JSContext *cx, uint32_t argc, jsval JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_EaseQuinticActionIn_create : Error processing arguments"); - cocos2d::EaseQuinticActionIn* ret = cocos2d::EaseQuinticActionIn::create(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::EaseQuinticActionIn*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::EaseQuinticActionIn::create(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::EaseQuinticActionIn")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_EaseQuinticActionIn_create : wrong number of arguments"); @@ -25375,17 +24931,11 @@ bool js_cocos2dx_EaseQuinticActionOut_create(JSContext *cx, uint32_t argc, jsval JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_EaseQuinticActionOut_create : Error processing arguments"); - cocos2d::EaseQuinticActionOut* ret = cocos2d::EaseQuinticActionOut::create(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::EaseQuinticActionOut*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::EaseQuinticActionOut::create(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::EaseQuinticActionOut")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_EaseQuinticActionOut_create : wrong number of arguments"); @@ -25489,17 +25039,11 @@ bool js_cocos2dx_EaseQuinticActionInOut_create(JSContext *cx, uint32_t argc, jsv JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_EaseQuinticActionInOut_create : Error processing arguments"); - cocos2d::EaseQuinticActionInOut* ret = cocos2d::EaseQuinticActionInOut::create(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::EaseQuinticActionInOut*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::EaseQuinticActionInOut::create(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::EaseQuinticActionInOut")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_EaseQuinticActionInOut_create : wrong number of arguments"); @@ -25603,17 +25147,11 @@ bool js_cocos2dx_EaseCircleActionIn_create(JSContext *cx, uint32_t argc, jsval * JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_EaseCircleActionIn_create : Error processing arguments"); - cocos2d::EaseCircleActionIn* ret = cocos2d::EaseCircleActionIn::create(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::EaseCircleActionIn*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::EaseCircleActionIn::create(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::EaseCircleActionIn")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_EaseCircleActionIn_create : wrong number of arguments"); @@ -25717,17 +25255,11 @@ bool js_cocos2dx_EaseCircleActionOut_create(JSContext *cx, uint32_t argc, jsval JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_EaseCircleActionOut_create : Error processing arguments"); - cocos2d::EaseCircleActionOut* ret = cocos2d::EaseCircleActionOut::create(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::EaseCircleActionOut*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::EaseCircleActionOut::create(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::EaseCircleActionOut")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_EaseCircleActionOut_create : wrong number of arguments"); @@ -25831,17 +25363,11 @@ bool js_cocos2dx_EaseCircleActionInOut_create(JSContext *cx, uint32_t argc, jsva JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_EaseCircleActionInOut_create : Error processing arguments"); - cocos2d::EaseCircleActionInOut* ret = cocos2d::EaseCircleActionInOut::create(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::EaseCircleActionInOut*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::EaseCircleActionInOut::create(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::EaseCircleActionInOut")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_EaseCircleActionInOut_create : wrong number of arguments"); @@ -25945,17 +25471,11 @@ bool js_cocos2dx_EaseCubicActionIn_create(JSContext *cx, uint32_t argc, jsval *v JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_EaseCubicActionIn_create : Error processing arguments"); - cocos2d::EaseCubicActionIn* ret = cocos2d::EaseCubicActionIn::create(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::EaseCubicActionIn*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::EaseCubicActionIn::create(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::EaseCubicActionIn")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_EaseCubicActionIn_create : wrong number of arguments"); @@ -26059,17 +25579,11 @@ bool js_cocos2dx_EaseCubicActionOut_create(JSContext *cx, uint32_t argc, jsval * JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_EaseCubicActionOut_create : Error processing arguments"); - cocos2d::EaseCubicActionOut* ret = cocos2d::EaseCubicActionOut::create(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::EaseCubicActionOut*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::EaseCubicActionOut::create(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::EaseCubicActionOut")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_EaseCubicActionOut_create : wrong number of arguments"); @@ -26173,17 +25687,11 @@ bool js_cocos2dx_EaseCubicActionInOut_create(JSContext *cx, uint32_t argc, jsval JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_EaseCubicActionInOut_create : Error processing arguments"); - cocos2d::EaseCubicActionInOut* ret = cocos2d::EaseCubicActionInOut::create(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::EaseCubicActionInOut*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::EaseCubicActionInOut::create(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::EaseCubicActionInOut")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_EaseCubicActionInOut_create : wrong number of arguments"); @@ -26321,17 +25829,11 @@ bool js_cocos2dx_Show_create(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocos2d::Show* ret = cocos2d::Show::create(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Show*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::Show::create(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::Show")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_Show_create : wrong number of arguments"); @@ -26423,17 +25925,11 @@ bool js_cocos2dx_Hide_create(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocos2d::Hide* ret = cocos2d::Hide::create(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Hide*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::Hide::create(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::Hide")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_Hide_create : wrong number of arguments"); @@ -26525,17 +26021,11 @@ bool js_cocos2dx_ToggleVisibility_create(JSContext *cx, uint32_t argc, jsval *vp { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocos2d::ToggleVisibility* ret = cocos2d::ToggleVisibility::create(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ToggleVisibility*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::ToggleVisibility::create(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::ToggleVisibility")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_ToggleVisibility_create : wrong number of arguments"); @@ -26634,34 +26124,22 @@ bool js_cocos2dx_RemoveSelf_create(JSContext *cx, uint32_t argc, jsval *vp) JS::CallArgs args = JS::CallArgsFromVp(argc, vp); bool ok = true; if (argc == 0) { - cocos2d::RemoveSelf* ret = cocos2d::RemoveSelf::create(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::RemoveSelf*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::RemoveSelf::create(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::RemoveSelf")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } if (argc == 1) { bool arg0; arg0 = JS::ToBoolean(args.get(0)); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_RemoveSelf_create : Error processing arguments"); - cocos2d::RemoveSelf* ret = cocos2d::RemoveSelf::create(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::RemoveSelf*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::RemoveSelf::create(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::RemoveSelf")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_RemoveSelf_create : wrong number of arguments"); @@ -26764,17 +26242,11 @@ bool js_cocos2dx_FlipX_create(JSContext *cx, uint32_t argc, jsval *vp) bool arg0; arg0 = JS::ToBoolean(args.get(0)); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_FlipX_create : Error processing arguments"); - cocos2d::FlipX* ret = cocos2d::FlipX::create(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::FlipX*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::FlipX::create(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::FlipX")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_FlipX_create : wrong number of arguments"); @@ -26893,17 +26365,11 @@ bool js_cocos2dx_FlipY_create(JSContext *cx, uint32_t argc, jsval *vp) bool arg0; arg0 = JS::ToBoolean(args.get(0)); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_FlipY_create : Error processing arguments"); - cocos2d::FlipY* ret = cocos2d::FlipY::create(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::FlipY*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::FlipY::create(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::FlipY")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_FlipY_create : wrong number of arguments"); @@ -27022,17 +26488,11 @@ bool js_cocos2dx_Place_create(JSContext *cx, uint32_t argc, jsval *vp) cocos2d::Vec2 arg0; ok &= jsval_to_vector2(cx, args.get(0), &arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Place_create : Error processing arguments"); - cocos2d::Place* ret = cocos2d::Place::create(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Place*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::Place::create(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::Place")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_Place_create : wrong number of arguments"); @@ -27506,17 +26966,11 @@ bool js_cocos2dx_StopGrid_create(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocos2d::StopGrid* ret = cocos2d::StopGrid::create(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::StopGrid*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::StopGrid::create(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::StopGrid")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_StopGrid_create : wrong number of arguments"); @@ -27618,17 +27072,11 @@ bool js_cocos2dx_ReuseGrid_create(JSContext *cx, uint32_t argc, jsval *vp) int arg0 = 0; ok &= jsval_to_int32(cx, args.get(0), (int32_t *)&arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ReuseGrid_create : Error processing arguments"); - cocos2d::ReuseGrid* ret = cocos2d::ReuseGrid::create(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ReuseGrid*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::ReuseGrid::create(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::ReuseGrid")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_ReuseGrid_create : wrong number of arguments"); @@ -27819,17 +27267,11 @@ bool js_cocos2dx_Waves3D_create(JSContext *cx, uint32_t argc, jsval *vp) ok &= jsval_to_uint32(cx, args.get(2), &arg2); ok &= JS::ToNumber( cx, args.get(3), &arg3) && !isnan(arg3); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Waves3D_create : Error processing arguments"); - cocos2d::Waves3D* ret = cocos2d::Waves3D::create(arg0, arg1, arg2, arg3); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Waves3D*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::Waves3D::create(arg0, arg1, arg2, arg3); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::Waves3D")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_Waves3D_create : wrong number of arguments"); @@ -27960,17 +27402,11 @@ bool js_cocos2dx_FlipX3D_create(JSContext *cx, uint32_t argc, jsval *vp) double arg0 = 0; ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_FlipX3D_create : Error processing arguments"); - cocos2d::FlipX3D* ret = cocos2d::FlipX3D::create(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::FlipX3D*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::FlipX3D::create(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::FlipX3D")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_FlipX3D_create : wrong number of arguments"); @@ -28068,17 +27504,11 @@ bool js_cocos2dx_FlipY3D_create(JSContext *cx, uint32_t argc, jsval *vp) double arg0 = 0; ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_FlipY3D_create : Error processing arguments"); - cocos2d::FlipY3D* ret = cocos2d::FlipY3D::create(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::FlipY3D*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::FlipY3D::create(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::FlipY3D")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_FlipY3D_create : wrong number of arguments"); @@ -28304,17 +27734,11 @@ bool js_cocos2dx_Lens3D_create(JSContext *cx, uint32_t argc, jsval *vp) ok &= jsval_to_vector2(cx, args.get(2), &arg2); ok &= JS::ToNumber( cx, args.get(3), &arg3) && !isnan(arg3); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Lens3D_create : Error processing arguments"); - cocos2d::Lens3D* ret = cocos2d::Lens3D::create(arg0, arg1, arg2, arg3); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Lens3D*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::Lens3D::create(arg0, arg1, arg2, arg3); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::Lens3D")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_Lens3D_create : wrong number of arguments"); @@ -28556,17 +27980,11 @@ bool js_cocos2dx_Ripple3D_create(JSContext *cx, uint32_t argc, jsval *vp) ok &= jsval_to_uint32(cx, args.get(4), &arg4); ok &= JS::ToNumber( cx, args.get(5), &arg5) && !isnan(arg5); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Ripple3D_create : Error processing arguments"); - cocos2d::Ripple3D* ret = cocos2d::Ripple3D::create(arg0, arg1, arg2, arg3, arg4, arg5); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Ripple3D*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::Ripple3D::create(arg0, arg1, arg2, arg3, arg4, arg5); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::Ripple3D")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_Ripple3D_create : wrong number of arguments"); @@ -28687,17 +28105,11 @@ bool js_cocos2dx_Shaky3D_create(JSContext *cx, uint32_t argc, jsval *vp) ok &= jsval_to_int32(cx, args.get(2), (int32_t *)&arg2); arg3 = JS::ToBoolean(args.get(3)); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Shaky3D_create : Error processing arguments"); - cocos2d::Shaky3D* ret = cocos2d::Shaky3D::create(arg0, arg1, arg2, arg3); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Shaky3D*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::Shaky3D::create(arg0, arg1, arg2, arg3); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::Shaky3D")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_Shaky3D_create : wrong number of arguments"); @@ -28888,17 +28300,11 @@ bool js_cocos2dx_Liquid_create(JSContext *cx, uint32_t argc, jsval *vp) ok &= jsval_to_uint32(cx, args.get(2), &arg2); ok &= JS::ToNumber( cx, args.get(3), &arg3) && !isnan(arg3); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Liquid_create : Error processing arguments"); - cocos2d::Liquid* ret = cocos2d::Liquid::create(arg0, arg1, arg2, arg3); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Liquid*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::Liquid::create(arg0, arg1, arg2, arg3); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::Liquid")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_Liquid_create : wrong number of arguments"); @@ -29101,17 +28507,11 @@ bool js_cocos2dx_Waves_create(JSContext *cx, uint32_t argc, jsval *vp) arg4 = JS::ToBoolean(args.get(4)); arg5 = JS::ToBoolean(args.get(5)); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Waves_create : Error processing arguments"); - cocos2d::Waves* ret = cocos2d::Waves::create(arg0, arg1, arg2, arg3, arg4, arg5); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Waves*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::Waves::create(arg0, arg1, arg2, arg3, arg4, arg5); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::Waves")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_Waves_create : wrong number of arguments"); @@ -29348,17 +28748,11 @@ bool js_cocos2dx_Twirl_create(JSContext *cx, uint32_t argc, jsval *vp) ok &= jsval_to_uint32(cx, args.get(3), &arg3); ok &= JS::ToNumber( cx, args.get(4), &arg4) && !isnan(arg4); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Twirl_create : Error processing arguments"); - cocos2d::Twirl* ret = cocos2d::Twirl::create(arg0, arg1, arg2, arg3, arg4); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Twirl*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::Twirl::create(arg0, arg1, arg2, arg3, arg4); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::Twirl")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_Twirl_create : wrong number of arguments"); @@ -29921,17 +29315,11 @@ bool js_cocos2dx_PageTurn3D_create(JSContext *cx, uint32_t argc, jsval *vp) ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); ok &= jsval_to_ccsize(cx, args.get(1), &arg1); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_PageTurn3D_create : Error processing arguments"); - cocos2d::PageTurn3D* ret = cocos2d::PageTurn3D::create(arg0, arg1); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::PageTurn3D*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::PageTurn3D::create(arg0, arg1); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::PageTurn3D")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_PageTurn3D_create : wrong number of arguments"); @@ -30021,17 +29409,11 @@ bool js_cocos2dx_ProgressTo_create(JSContext *cx, uint32_t argc, jsval *vp) ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); ok &= JS::ToNumber( cx, args.get(1), &arg1) && !isnan(arg1); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ProgressTo_create : Error processing arguments"); - cocos2d::ProgressTo* ret = cocos2d::ProgressTo::create(arg0, arg1); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ProgressTo*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::ProgressTo::create(arg0, arg1); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::ProgressTo")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_ProgressTo_create : wrong number of arguments"); @@ -30158,17 +29540,11 @@ bool js_cocos2dx_ProgressFromTo_create(JSContext *cx, uint32_t argc, jsval *vp) ok &= JS::ToNumber( cx, args.get(1), &arg1) && !isnan(arg1); ok &= JS::ToNumber( cx, args.get(2), &arg2) && !isnan(arg2); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ProgressFromTo_create : Error processing arguments"); - cocos2d::ProgressFromTo* ret = cocos2d::ProgressFromTo::create(arg0, arg1, arg2); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ProgressFromTo*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::ProgressFromTo::create(arg0, arg1, arg2); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::ProgressFromTo")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_ProgressFromTo_create : wrong number of arguments"); @@ -30299,17 +29675,11 @@ bool js_cocos2dx_ShakyTiles3D_create(JSContext *cx, uint32_t argc, jsval *vp) ok &= jsval_to_int32(cx, args.get(2), (int32_t *)&arg2); arg3 = JS::ToBoolean(args.get(3)); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ShakyTiles3D_create : Error processing arguments"); - cocos2d::ShakyTiles3D* ret = cocos2d::ShakyTiles3D::create(arg0, arg1, arg2, arg3); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ShakyTiles3D*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::ShakyTiles3D::create(arg0, arg1, arg2, arg3); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::ShakyTiles3D")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_ShakyTiles3D_create : wrong number of arguments"); @@ -30424,17 +29794,11 @@ bool js_cocos2dx_ShatteredTiles3D_create(JSContext *cx, uint32_t argc, jsval *vp ok &= jsval_to_int32(cx, args.get(2), (int32_t *)&arg2); arg3 = JS::ToBoolean(args.get(3)); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ShatteredTiles3D_create : Error processing arguments"); - cocos2d::ShatteredTiles3D* ret = cocos2d::ShatteredTiles3D::create(arg0, arg1, arg2, arg3); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ShatteredTiles3D*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::ShatteredTiles3D::create(arg0, arg1, arg2, arg3); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::ShatteredTiles3D")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_ShatteredTiles3D_create : wrong number of arguments"); @@ -30613,17 +29977,11 @@ bool js_cocos2dx_ShuffleTiles_create(JSContext *cx, uint32_t argc, jsval *vp) ok &= jsval_to_ccsize(cx, args.get(1), &arg1); ok &= jsval_to_uint32(cx, args.get(2), &arg2); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ShuffleTiles_create : Error processing arguments"); - cocos2d::ShuffleTiles* ret = cocos2d::ShuffleTiles::create(arg0, arg1, arg2); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ShuffleTiles*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::ShuffleTiles::create(arg0, arg1, arg2); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::ShuffleTiles")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_ShuffleTiles_create : wrong number of arguments"); @@ -30795,17 +30153,11 @@ bool js_cocos2dx_FadeOutTRTiles_create(JSContext *cx, uint32_t argc, jsval *vp) ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); ok &= jsval_to_ccsize(cx, args.get(1), &arg1); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_FadeOutTRTiles_create : Error processing arguments"); - cocos2d::FadeOutTRTiles* ret = cocos2d::FadeOutTRTiles::create(arg0, arg1); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::FadeOutTRTiles*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::FadeOutTRTiles::create(arg0, arg1); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::FadeOutTRTiles")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_FadeOutTRTiles_create : wrong number of arguments"); @@ -30907,17 +30259,11 @@ bool js_cocos2dx_FadeOutBLTiles_create(JSContext *cx, uint32_t argc, jsval *vp) ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); ok &= jsval_to_ccsize(cx, args.get(1), &arg1); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_FadeOutBLTiles_create : Error processing arguments"); - cocos2d::FadeOutBLTiles* ret = cocos2d::FadeOutBLTiles::create(arg0, arg1); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::FadeOutBLTiles*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::FadeOutBLTiles::create(arg0, arg1); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::FadeOutBLTiles")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_FadeOutBLTiles_create : wrong number of arguments"); @@ -31015,17 +30361,11 @@ bool js_cocos2dx_FadeOutUpTiles_create(JSContext *cx, uint32_t argc, jsval *vp) ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); ok &= jsval_to_ccsize(cx, args.get(1), &arg1); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_FadeOutUpTiles_create : Error processing arguments"); - cocos2d::FadeOutUpTiles* ret = cocos2d::FadeOutUpTiles::create(arg0, arg1); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::FadeOutUpTiles*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::FadeOutUpTiles::create(arg0, arg1); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::FadeOutUpTiles")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_FadeOutUpTiles_create : wrong number of arguments"); @@ -31123,17 +30463,11 @@ bool js_cocos2dx_FadeOutDownTiles_create(JSContext *cx, uint32_t argc, jsval *vp ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); ok &= jsval_to_ccsize(cx, args.get(1), &arg1); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_FadeOutDownTiles_create : Error processing arguments"); - cocos2d::FadeOutDownTiles* ret = cocos2d::FadeOutDownTiles::create(arg0, arg1); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::FadeOutDownTiles*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::FadeOutDownTiles::create(arg0, arg1); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::FadeOutDownTiles")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_FadeOutDownTiles_create : wrong number of arguments"); @@ -31553,17 +30887,11 @@ bool js_cocos2dx_WavesTiles3D_create(JSContext *cx, uint32_t argc, jsval *vp) ok &= jsval_to_uint32(cx, args.get(2), &arg2); ok &= JS::ToNumber( cx, args.get(3), &arg3) && !isnan(arg3); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_WavesTiles3D_create : Error processing arguments"); - cocos2d::WavesTiles3D* ret = cocos2d::WavesTiles3D::create(arg0, arg1, arg2, arg3); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::WavesTiles3D*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::WavesTiles3D::create(arg0, arg1, arg2, arg3); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::WavesTiles3D")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_WavesTiles3D_create : wrong number of arguments"); @@ -31758,17 +31086,11 @@ bool js_cocos2dx_JumpTiles3D_create(JSContext *cx, uint32_t argc, jsval *vp) ok &= jsval_to_uint32(cx, args.get(2), &arg2); ok &= JS::ToNumber( cx, args.get(3), &arg3) && !isnan(arg3); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_JumpTiles3D_create : Error processing arguments"); - cocos2d::JumpTiles3D* ret = cocos2d::JumpTiles3D::create(arg0, arg1, arg2, arg3); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::JumpTiles3D*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::JumpTiles3D::create(arg0, arg1, arg2, arg3); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::JumpTiles3D")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_JumpTiles3D_create : wrong number of arguments"); @@ -31895,17 +31217,11 @@ bool js_cocos2dx_SplitRows_create(JSContext *cx, uint32_t argc, jsval *vp) ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); ok &= jsval_to_uint32(cx, args.get(1), &arg1); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_SplitRows_create : Error processing arguments"); - cocos2d::SplitRows* ret = cocos2d::SplitRows::create(arg0, arg1); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::SplitRows*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::SplitRows::create(arg0, arg1); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::SplitRows")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_SplitRows_create : wrong number of arguments"); @@ -32012,17 +31328,11 @@ bool js_cocos2dx_SplitCols_create(JSContext *cx, uint32_t argc, jsval *vp) ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); ok &= jsval_to_uint32(cx, args.get(1), &arg1); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_SplitCols_create : Error processing arguments"); - cocos2d::SplitCols* ret = cocos2d::SplitCols::create(arg0, arg1); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::SplitCols*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::SplitCols::create(arg0, arg1); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::SplitCols")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_SplitCols_create : wrong number of arguments"); @@ -32137,17 +31447,11 @@ bool js_cocos2dx_ActionTween_create(JSContext *cx, uint32_t argc, jsval *vp) ok &= JS::ToNumber( cx, args.get(2), &arg2) && !isnan(arg2); ok &= JS::ToNumber( cx, args.get(3), &arg3) && !isnan(arg3); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ActionTween_create : Error processing arguments"); - cocos2d::ActionTween* ret = cocos2d::ActionTween::create(arg0, arg1, arg2, arg3); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ActionTween*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::ActionTween::create(arg0, arg1, arg2, arg3); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::ActionTween")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_ActionTween_create : wrong number of arguments"); @@ -32481,17 +31785,11 @@ bool js_cocos2dx_AtlasNode_create(JSContext *cx, uint32_t argc, jsval *vp) ok &= jsval_to_int32(cx, args.get(2), (int32_t *)&arg2); ok &= jsval_to_int32(cx, args.get(3), (int32_t *)&arg3); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_AtlasNode_create : Error processing arguments"); - cocos2d::AtlasNode* ret = cocos2d::AtlasNode::create(arg0, arg1, arg2, arg3); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::AtlasNode*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::AtlasNode::create(arg0, arg1, arg2, arg3); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::AtlasNode")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_AtlasNode_create : wrong number of arguments"); @@ -33496,6 +32794,24 @@ bool js_cocos2dx_DrawNode_drawSolidRect(JSContext *cx, uint32_t argc, jsval *vp) JS_ReportError(cx, "js_cocos2dx_DrawNode_drawSolidRect : wrong number of arguments: %d, was expecting %d", argc, 3); return false; } +bool js_cocos2dx_DrawNode_getLineWidth(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::DrawNode* cobj = (cocos2d::DrawNode *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_DrawNode_getLineWidth : Invalid Native Object"); + if (argc == 0) { + double ret = cobj->getLineWidth(); + jsval jsret = JSVAL_NULL; + jsret = DOUBLE_TO_JSVAL(ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_DrawNode_getLineWidth : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} bool js_cocos2dx_DrawNode_drawPoint(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); @@ -33553,18 +32869,24 @@ bool js_cocos2dx_DrawNode_drawCubicBezier(JSContext *cx, uint32_t argc, jsval *v bool js_cocos2dx_DrawNode_create(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); + bool ok = true; if (argc == 0) { - cocos2d::DrawNode* ret = cocos2d::DrawNode::create(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::DrawNode*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::DrawNode::create(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::DrawNode")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); + return true; + } + if (argc == 1) { + int arg0 = 0; + ok &= jsval_to_int32(cx, args.get(0), (int32_t *)&arg0); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_DrawNode_create : Error processing arguments"); + + auto ret = cocos2d::DrawNode::create(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::DrawNode")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_DrawNode_create : wrong number of arguments"); @@ -33644,6 +32966,7 @@ void js_register_cocos2dx_DrawNode(JSContext *cx, JS::HandleObject global) { JS_FN("clear", js_cocos2dx_DrawNode_clear, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("drawCardinalSpline", js_cocos2dx_DrawNode_drawCardinalSpline, 4, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("drawSolidRect", js_cocos2dx_DrawNode_drawSolidRect, 3, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getLineWidth", js_cocos2dx_DrawNode_getLineWidth, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("drawPoint", js_cocos2dx_DrawNode_drawPoint, 3, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("drawCubicBezier", js_cocos2dx_DrawNode_drawCubicBezier, 6, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("ctor", js_cocos2dx_DrawNode_ctor, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), @@ -35026,17 +34349,11 @@ bool js_cocos2dx_Label_createWithBMFont(JSContext *cx, uint32_t argc, jsval *vp) 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_Label_createWithBMFont : Error processing arguments"); - cocos2d::Label* ret = cocos2d::Label::createWithBMFont(arg0, arg1); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Label*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::Label::createWithBMFont(arg0, arg1); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::Label")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } if (argc == 3) { @@ -35047,17 +34364,11 @@ bool js_cocos2dx_Label_createWithBMFont(JSContext *cx, uint32_t argc, jsval *vp) ok &= jsval_to_std_string(cx, args.get(1), &arg1); ok &= jsval_to_int32(cx, args.get(2), (int32_t *)&arg2); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Label_createWithBMFont : Error processing arguments"); - cocos2d::Label* ret = cocos2d::Label::createWithBMFont(arg0, arg1, arg2); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Label*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::Label::createWithBMFont(arg0, arg1, arg2); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::Label")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } if (argc == 4) { @@ -35070,17 +34381,11 @@ bool js_cocos2dx_Label_createWithBMFont(JSContext *cx, uint32_t argc, jsval *vp) ok &= jsval_to_int32(cx, args.get(2), (int32_t *)&arg2); ok &= jsval_to_int32(cx, args.get(3), (int32_t *)&arg3); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Label_createWithBMFont : Error processing arguments"); - cocos2d::Label* ret = cocos2d::Label::createWithBMFont(arg0, arg1, arg2, arg3); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Label*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::Label::createWithBMFont(arg0, arg1, arg2, arg3); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::Label")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } if (argc == 5) { @@ -35095,17 +34400,11 @@ bool js_cocos2dx_Label_createWithBMFont(JSContext *cx, uint32_t argc, jsval *vp) ok &= jsval_to_int32(cx, args.get(3), (int32_t *)&arg3); ok &= jsval_to_vector2(cx, args.get(4), &arg4); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Label_createWithBMFont : Error processing arguments"); - cocos2d::Label* ret = cocos2d::Label::createWithBMFont(arg0, arg1, arg2, arg3, arg4); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Label*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::Label::createWithBMFont(arg0, arg1, arg2, arg3, arg4); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::Label")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_Label_createWithBMFont : wrong number of arguments"); @@ -35116,17 +34415,11 @@ bool js_cocos2dx_Label_create(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocos2d::Label* ret = cocos2d::Label::create(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Label*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::Label::create(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::Label")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_Label_create : wrong number of arguments"); @@ -35238,17 +34531,11 @@ bool js_cocos2dx_Label_createWithSystemFont(JSContext *cx, uint32_t argc, jsval ok &= jsval_to_std_string(cx, args.get(1), &arg1); ok &= JS::ToNumber( cx, args.get(2), &arg2) && !isnan(arg2); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Label_createWithSystemFont : Error processing arguments"); - cocos2d::Label* ret = cocos2d::Label::createWithSystemFont(arg0, arg1, arg2); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Label*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::Label::createWithSystemFont(arg0, arg1, arg2); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::Label")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } if (argc == 4) { @@ -35261,17 +34548,11 @@ bool js_cocos2dx_Label_createWithSystemFont(JSContext *cx, uint32_t argc, jsval ok &= JS::ToNumber( cx, args.get(2), &arg2) && !isnan(arg2); ok &= jsval_to_ccsize(cx, args.get(3), &arg3); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Label_createWithSystemFont : Error processing arguments"); - cocos2d::Label* ret = cocos2d::Label::createWithSystemFont(arg0, arg1, arg2, arg3); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Label*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::Label::createWithSystemFont(arg0, arg1, arg2, arg3); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::Label")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } if (argc == 5) { @@ -35286,17 +34567,11 @@ bool js_cocos2dx_Label_createWithSystemFont(JSContext *cx, uint32_t argc, jsval ok &= jsval_to_ccsize(cx, args.get(3), &arg3); ok &= jsval_to_int32(cx, args.get(4), (int32_t *)&arg4); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Label_createWithSystemFont : Error processing arguments"); - cocos2d::Label* ret = cocos2d::Label::createWithSystemFont(arg0, arg1, arg2, arg3, arg4); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Label*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::Label::createWithSystemFont(arg0, arg1, arg2, arg3, arg4); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::Label")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } if (argc == 6) { @@ -35313,17 +34588,11 @@ bool js_cocos2dx_Label_createWithSystemFont(JSContext *cx, uint32_t argc, jsval ok &= jsval_to_int32(cx, args.get(4), (int32_t *)&arg4); ok &= jsval_to_int32(cx, args.get(5), (int32_t *)&arg5); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Label_createWithSystemFont : Error processing arguments"); - cocos2d::Label* ret = cocos2d::Label::createWithSystemFont(arg0, arg1, arg2, arg3, arg4, arg5); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Label*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::Label::createWithSystemFont(arg0, arg1, arg2, arg3, arg4, arg5); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::Label")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_Label_createWithSystemFont : wrong number of arguments"); @@ -37018,17 +36287,11 @@ bool js_cocos2dx_LabelTTF_createWithFontDefinition(JSContext *cx, uint32_t argc, ok &= jsval_to_std_string(cx, args.get(0), &arg0); ok &= jsval_to_FontDefinition(cx, args.get(1), &arg1); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_LabelTTF_createWithFontDefinition : Error processing arguments"); - cocos2d::LabelTTF* ret = cocos2d::LabelTTF::createWithFontDefinition(arg0, arg1); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::LabelTTF*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::LabelTTF::createWithFontDefinition(arg0, arg1); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::LabelTTF")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_LabelTTF_createWithFontDefinition : wrong number of arguments"); @@ -37146,17 +36409,11 @@ bool js_cocos2dx_Layer_create(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocos2d::Layer* ret = cocos2d::Layer::create(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Layer*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::Layer::create(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::Layer")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_Layer_create : wrong number of arguments"); @@ -37248,17 +36505,11 @@ bool js_cocos2dx___LayerRGBA_create(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocos2d::__LayerRGBA* ret = cocos2d::__LayerRGBA::create(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::__LayerRGBA*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::__LayerRGBA::create(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::__LayerRGBA")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx___LayerRGBA_create : wrong number of arguments"); @@ -39103,6 +38354,7 @@ bool js_cocos2dx_MenuItemFont_getFontSize(JSContext *cx, uint32_t argc, jsval *v { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { + int ret = cocos2d::MenuItemFont::getFontSize(); jsval jsret = JSVAL_NULL; jsret = int32_to_jsval(cx, ret); @@ -39117,6 +38369,7 @@ bool js_cocos2dx_MenuItemFont_getFontName(JSContext *cx, uint32_t argc, jsval *v { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { + const std::string& ret = cocos2d::MenuItemFont::getFontName(); jsval jsret = JSVAL_NULL; jsret = std_string_to_jsval(cx, ret); @@ -41288,17 +40541,11 @@ bool js_cocos2dx_ParticleBatchNode_create(JSContext *cx, uint32_t argc, jsval *v std::string arg0; ok &= jsval_to_std_string(cx, args.get(0), &arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ParticleBatchNode_create : Error processing arguments"); - cocos2d::ParticleBatchNode* ret = cocos2d::ParticleBatchNode::create(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ParticleBatchNode*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::ParticleBatchNode::create(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::ParticleBatchNode")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } if (argc == 2) { @@ -41307,17 +40554,11 @@ bool js_cocos2dx_ParticleBatchNode_create(JSContext *cx, uint32_t argc, jsval *v ok &= jsval_to_std_string(cx, args.get(0), &arg0); ok &= jsval_to_int32(cx, args.get(1), (int32_t *)&arg1); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ParticleBatchNode_create : Error processing arguments"); - cocos2d::ParticleBatchNode* ret = cocos2d::ParticleBatchNode::create(arg0, arg1); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ParticleBatchNode*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::ParticleBatchNode::create(arg0, arg1); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::ParticleBatchNode")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_ParticleBatchNode_create : wrong number of arguments"); @@ -41340,17 +40581,11 @@ bool js_cocos2dx_ParticleBatchNode_createWithTexture(JSContext *cx, uint32_t arg JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ParticleBatchNode_createWithTexture : Error processing arguments"); - cocos2d::ParticleBatchNode* ret = cocos2d::ParticleBatchNode::createWithTexture(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ParticleBatchNode*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::ParticleBatchNode::createWithTexture(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::ParticleBatchNode")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } if (argc == 2) { @@ -41367,17 +40602,11 @@ bool js_cocos2dx_ParticleBatchNode_createWithTexture(JSContext *cx, uint32_t arg } while (0); ok &= jsval_to_int32(cx, args.get(1), (int32_t *)&arg1); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ParticleBatchNode_createWithTexture : Error processing arguments"); - cocos2d::ParticleBatchNode* ret = cocos2d::ParticleBatchNode::createWithTexture(arg0, arg1); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ParticleBatchNode*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::ParticleBatchNode::createWithTexture(arg0, arg1); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::ParticleBatchNode")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_ParticleBatchNode_createWithTexture : wrong number of arguments"); @@ -42626,6 +41855,24 @@ bool js_cocos2dx_ParticleSystem_getStartSpin(JSContext *cx, uint32_t argc, jsval JS_ReportError(cx, "js_cocos2dx_ParticleSystem_getStartSpin : wrong number of arguments: %d, was expecting %d", argc, 0); return false; } +bool js_cocos2dx_ParticleSystem_getResourceFile(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::ParticleSystem* cobj = (cocos2d::ParticleSystem *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_ParticleSystem_getResourceFile : Invalid Native Object"); + if (argc == 0) { + const std::string ret = cobj->getResourceFile(); + jsval jsret = JSVAL_NULL; + jsret = std_string_to_jsval(cx, ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_ParticleSystem_getResourceFile : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} bool js_cocos2dx_ParticleSystem_getRotatePerSecond(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); @@ -43555,17 +42802,11 @@ bool js_cocos2dx_ParticleSystem_create(JSContext *cx, uint32_t argc, jsval *vp) std::string arg0; ok &= jsval_to_std_string(cx, args.get(0), &arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ParticleSystem_create : Error processing arguments"); - cocos2d::ParticleSystem* ret = cocos2d::ParticleSystem::create(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ParticleSystem*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::ParticleSystem::create(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::ParticleSystem")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_ParticleSystem_create : wrong number of arguments"); @@ -43580,17 +42821,11 @@ bool js_cocos2dx_ParticleSystem_createWithTotalParticles(JSContext *cx, uint32_t int arg0 = 0; ok &= jsval_to_int32(cx, args.get(0), (int32_t *)&arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ParticleSystem_createWithTotalParticles : Error processing arguments"); - cocos2d::ParticleSystem* ret = cocos2d::ParticleSystem::createWithTotalParticles(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ParticleSystem*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::ParticleSystem::createWithTotalParticles(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::ParticleSystem")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_ParticleSystem_createWithTotalParticles : wrong number of arguments"); @@ -43700,6 +42935,7 @@ void js_register_cocos2dx_ParticleSystem(JSContext *cx, JS::HandleObject global) JS_FN("setStartSize", js_cocos2dx_ParticleSystem_setStartSize, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("setSpeed", js_cocos2dx_ParticleSystem_setSpeed, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("getStartSpin", js_cocos2dx_ParticleSystem_getStartSpin, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getResourceFile", js_cocos2dx_ParticleSystem_getResourceFile, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("getRotatePerSecond", js_cocos2dx_ParticleSystem_getRotatePerSecond, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("setEmitterMode", js_cocos2dx_ParticleSystem_setEmitterMode, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("getDuration", js_cocos2dx_ParticleSystem_getDuration, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), @@ -43935,17 +43171,11 @@ bool js_cocos2dx_ParticleSystemQuad_createWithTotalParticles(JSContext *cx, uint int arg0 = 0; ok &= jsval_to_int32(cx, args.get(0), (int32_t *)&arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ParticleSystemQuad_createWithTotalParticles : Error processing arguments"); - cocos2d::ParticleSystemQuad* ret = cocos2d::ParticleSystemQuad::createWithTotalParticles(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ParticleSystemQuad*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::ParticleSystemQuad::createWithTotalParticles(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::ParticleSystemQuad")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_ParticleSystemQuad_createWithTotalParticles : wrong number of arguments"); @@ -44025,17 +43255,11 @@ bool js_cocos2dx_ParticleFire_create(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocos2d::ParticleFire* ret = cocos2d::ParticleFire::create(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ParticleFire*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::ParticleFire::create(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::ParticleFire")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_ParticleFire_create : wrong number of arguments"); @@ -44050,17 +43274,11 @@ bool js_cocos2dx_ParticleFire_createWithTotalParticles(JSContext *cx, uint32_t a int arg0 = 0; ok &= jsval_to_int32(cx, args.get(0), (int32_t *)&arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ParticleFire_createWithTotalParticles : Error processing arguments"); - cocos2d::ParticleFire* ret = cocos2d::ParticleFire::createWithTotalParticles(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ParticleFire*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::ParticleFire::createWithTotalParticles(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::ParticleFire")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_ParticleFire_createWithTotalParticles : wrong number of arguments"); @@ -44177,17 +43395,11 @@ bool js_cocos2dx_ParticleFireworks_create(JSContext *cx, uint32_t argc, jsval *v { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocos2d::ParticleFireworks* ret = cocos2d::ParticleFireworks::create(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ParticleFireworks*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::ParticleFireworks::create(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::ParticleFireworks")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_ParticleFireworks_create : wrong number of arguments"); @@ -44202,17 +43414,11 @@ bool js_cocos2dx_ParticleFireworks_createWithTotalParticles(JSContext *cx, uint3 int arg0 = 0; ok &= jsval_to_int32(cx, args.get(0), (int32_t *)&arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ParticleFireworks_createWithTotalParticles : Error processing arguments"); - cocos2d::ParticleFireworks* ret = cocos2d::ParticleFireworks::createWithTotalParticles(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ParticleFireworks*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::ParticleFireworks::createWithTotalParticles(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::ParticleFireworks")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_ParticleFireworks_createWithTotalParticles : wrong number of arguments"); @@ -44331,17 +43537,11 @@ bool js_cocos2dx_ParticleSun_create(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocos2d::ParticleSun* ret = cocos2d::ParticleSun::create(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ParticleSun*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::ParticleSun::create(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::ParticleSun")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_ParticleSun_create : wrong number of arguments"); @@ -44356,17 +43556,11 @@ bool js_cocos2dx_ParticleSun_createWithTotalParticles(JSContext *cx, uint32_t ar int arg0 = 0; ok &= jsval_to_int32(cx, args.get(0), (int32_t *)&arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ParticleSun_createWithTotalParticles : Error processing arguments"); - cocos2d::ParticleSun* ret = cocos2d::ParticleSun::createWithTotalParticles(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ParticleSun*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::ParticleSun::createWithTotalParticles(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::ParticleSun")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_ParticleSun_createWithTotalParticles : wrong number of arguments"); @@ -44485,17 +43679,11 @@ bool js_cocos2dx_ParticleGalaxy_create(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocos2d::ParticleGalaxy* ret = cocos2d::ParticleGalaxy::create(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ParticleGalaxy*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::ParticleGalaxy::create(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::ParticleGalaxy")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_ParticleGalaxy_create : wrong number of arguments"); @@ -44510,17 +43698,11 @@ bool js_cocos2dx_ParticleGalaxy_createWithTotalParticles(JSContext *cx, uint32_t int arg0 = 0; ok &= jsval_to_int32(cx, args.get(0), (int32_t *)&arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ParticleGalaxy_createWithTotalParticles : Error processing arguments"); - cocos2d::ParticleGalaxy* ret = cocos2d::ParticleGalaxy::createWithTotalParticles(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ParticleGalaxy*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::ParticleGalaxy::createWithTotalParticles(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::ParticleGalaxy")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_ParticleGalaxy_createWithTotalParticles : wrong number of arguments"); @@ -44639,17 +43821,11 @@ bool js_cocos2dx_ParticleFlower_create(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocos2d::ParticleFlower* ret = cocos2d::ParticleFlower::create(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ParticleFlower*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::ParticleFlower::create(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::ParticleFlower")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_ParticleFlower_create : wrong number of arguments"); @@ -44664,17 +43840,11 @@ bool js_cocos2dx_ParticleFlower_createWithTotalParticles(JSContext *cx, uint32_t int arg0 = 0; ok &= jsval_to_int32(cx, args.get(0), (int32_t *)&arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ParticleFlower_createWithTotalParticles : Error processing arguments"); - cocos2d::ParticleFlower* ret = cocos2d::ParticleFlower::createWithTotalParticles(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ParticleFlower*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::ParticleFlower::createWithTotalParticles(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::ParticleFlower")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_ParticleFlower_createWithTotalParticles : wrong number of arguments"); @@ -44793,17 +43963,11 @@ bool js_cocos2dx_ParticleMeteor_create(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocos2d::ParticleMeteor* ret = cocos2d::ParticleMeteor::create(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ParticleMeteor*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::ParticleMeteor::create(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::ParticleMeteor")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_ParticleMeteor_create : wrong number of arguments"); @@ -44818,17 +43982,11 @@ bool js_cocos2dx_ParticleMeteor_createWithTotalParticles(JSContext *cx, uint32_t int arg0 = 0; ok &= jsval_to_int32(cx, args.get(0), (int32_t *)&arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ParticleMeteor_createWithTotalParticles : Error processing arguments"); - cocos2d::ParticleMeteor* ret = cocos2d::ParticleMeteor::createWithTotalParticles(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ParticleMeteor*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::ParticleMeteor::createWithTotalParticles(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::ParticleMeteor")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_ParticleMeteor_createWithTotalParticles : wrong number of arguments"); @@ -44947,17 +44105,11 @@ bool js_cocos2dx_ParticleSpiral_create(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocos2d::ParticleSpiral* ret = cocos2d::ParticleSpiral::create(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ParticleSpiral*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::ParticleSpiral::create(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::ParticleSpiral")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_ParticleSpiral_create : wrong number of arguments"); @@ -44972,17 +44124,11 @@ bool js_cocos2dx_ParticleSpiral_createWithTotalParticles(JSContext *cx, uint32_t int arg0 = 0; ok &= jsval_to_int32(cx, args.get(0), (int32_t *)&arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ParticleSpiral_createWithTotalParticles : Error processing arguments"); - cocos2d::ParticleSpiral* ret = cocos2d::ParticleSpiral::createWithTotalParticles(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ParticleSpiral*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::ParticleSpiral::createWithTotalParticles(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::ParticleSpiral")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_ParticleSpiral_createWithTotalParticles : wrong number of arguments"); @@ -45101,17 +44247,11 @@ bool js_cocos2dx_ParticleExplosion_create(JSContext *cx, uint32_t argc, jsval *v { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocos2d::ParticleExplosion* ret = cocos2d::ParticleExplosion::create(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ParticleExplosion*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::ParticleExplosion::create(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::ParticleExplosion")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_ParticleExplosion_create : wrong number of arguments"); @@ -45126,17 +44266,11 @@ bool js_cocos2dx_ParticleExplosion_createWithTotalParticles(JSContext *cx, uint3 int arg0 = 0; ok &= jsval_to_int32(cx, args.get(0), (int32_t *)&arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ParticleExplosion_createWithTotalParticles : Error processing arguments"); - cocos2d::ParticleExplosion* ret = cocos2d::ParticleExplosion::createWithTotalParticles(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ParticleExplosion*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::ParticleExplosion::createWithTotalParticles(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::ParticleExplosion")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_ParticleExplosion_createWithTotalParticles : wrong number of arguments"); @@ -45255,17 +44389,11 @@ bool js_cocos2dx_ParticleSmoke_create(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocos2d::ParticleSmoke* ret = cocos2d::ParticleSmoke::create(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ParticleSmoke*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::ParticleSmoke::create(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::ParticleSmoke")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_ParticleSmoke_create : wrong number of arguments"); @@ -45280,17 +44408,11 @@ bool js_cocos2dx_ParticleSmoke_createWithTotalParticles(JSContext *cx, uint32_t int arg0 = 0; ok &= jsval_to_int32(cx, args.get(0), (int32_t *)&arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ParticleSmoke_createWithTotalParticles : Error processing arguments"); - cocos2d::ParticleSmoke* ret = cocos2d::ParticleSmoke::createWithTotalParticles(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ParticleSmoke*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::ParticleSmoke::createWithTotalParticles(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::ParticleSmoke")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_ParticleSmoke_createWithTotalParticles : wrong number of arguments"); @@ -45409,17 +44531,11 @@ bool js_cocos2dx_ParticleSnow_create(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocos2d::ParticleSnow* ret = cocos2d::ParticleSnow::create(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ParticleSnow*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::ParticleSnow::create(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::ParticleSnow")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_ParticleSnow_create : wrong number of arguments"); @@ -45434,17 +44550,11 @@ bool js_cocos2dx_ParticleSnow_createWithTotalParticles(JSContext *cx, uint32_t a int arg0 = 0; ok &= jsval_to_int32(cx, args.get(0), (int32_t *)&arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ParticleSnow_createWithTotalParticles : Error processing arguments"); - cocos2d::ParticleSnow* ret = cocos2d::ParticleSnow::createWithTotalParticles(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ParticleSnow*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::ParticleSnow::createWithTotalParticles(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::ParticleSnow")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_ParticleSnow_createWithTotalParticles : wrong number of arguments"); @@ -45563,17 +44673,11 @@ bool js_cocos2dx_ParticleRain_create(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocos2d::ParticleRain* ret = cocos2d::ParticleRain::create(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ParticleRain*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::ParticleRain::create(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::ParticleRain")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_ParticleRain_create : wrong number of arguments"); @@ -45588,17 +44692,11 @@ bool js_cocos2dx_ParticleRain_createWithTotalParticles(JSContext *cx, uint32_t a int arg0 = 0; ok &= jsval_to_int32(cx, args.get(0), (int32_t *)&arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ParticleRain_createWithTotalParticles : Error processing arguments"); - cocos2d::ParticleRain* ret = cocos2d::ParticleRain::createWithTotalParticles(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ParticleRain*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::ParticleRain::createWithTotalParticles(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::ParticleRain")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_ParticleRain_createWithTotalParticles : wrong number of arguments"); @@ -45976,17 +45074,11 @@ bool js_cocos2dx_ProgressTimer_create(JSContext *cx, uint32_t argc, jsval *vp) JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ProgressTimer_create : Error processing arguments"); - cocos2d::ProgressTimer* ret = cocos2d::ProgressTimer::create(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ProgressTimer*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::ProgressTimer::create(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::ProgressTimer")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_ProgressTimer_create : wrong number of arguments"); @@ -46390,17 +45482,11 @@ bool js_cocos2dx_ProtectedNode_create(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocos2d::ProtectedNode* ret = cocos2d::ProtectedNode::create(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ProtectedNode*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::ProtectedNode::create(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::ProtectedNode")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_ProtectedNode_create : wrong number of arguments"); @@ -46675,6 +45761,24 @@ bool js_cocos2dx_Sprite_setRotationSkewY(JSContext *cx, uint32_t argc, jsval *vp JS_ReportError(cx, "js_cocos2dx_Sprite_setRotationSkewY : wrong number of arguments: %d, was expecting %d", argc, 1); return false; } +bool js_cocos2dx_Sprite_getResourceType(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::Sprite* cobj = (cocos2d::Sprite *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Sprite_getResourceType : Invalid Native Object"); + if (argc == 0) { + const int ret = cobj->getResourceType(); + jsval jsret = JSVAL_NULL; + jsret = int32_to_jsval(cx, ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_Sprite_getResourceType : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} bool js_cocos2dx_Sprite_initWithTexture(JSContext *cx, uint32_t argc, jsval *vp) { bool ok = true; @@ -47055,6 +46159,24 @@ bool js_cocos2dx_Sprite_getSpriteFrame(JSContext *cx, uint32_t argc, jsval *vp) JS_ReportError(cx, "js_cocos2dx_Sprite_getSpriteFrame : wrong number of arguments: %d, was expecting %d", argc, 0); return false; } +bool js_cocos2dx_Sprite_getResourceName(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::Sprite* cobj = (cocos2d::Sprite *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Sprite_getResourceName : Invalid Native Object"); + if (argc == 0) { + const std::string ret = cobj->getResourceName(); + jsval jsret = JSVAL_NULL; + jsret = std_string_to_jsval(cx, ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_Sprite_getResourceName : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} bool js_cocos2dx_Sprite_isDirty(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); @@ -47382,6 +46504,7 @@ void js_register_cocos2dx_Sprite(JSContext *cx, JS::HandleObject global) { JS_FN("setFlippedX", js_cocos2dx_Sprite_setFlippedX, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("setRotationSkewX", js_cocos2dx_Sprite_setRotationSkewX, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("setRotationSkewY", js_cocos2dx_Sprite_setRotationSkewY, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getResourceType", js_cocos2dx_Sprite_getResourceType, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("initWithTexture", js_cocos2dx_Sprite_initWithTexture, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("getBatchNode", js_cocos2dx_Sprite_getBatchNode, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("getOffsetPosition", js_cocos2dx_Sprite_getOffsetPosition, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), @@ -47395,6 +46518,7 @@ void js_register_cocos2dx_Sprite(JSContext *cx, JS::HandleObject global) { JS_FN("setDisplayFrameWithAnimationName", js_cocos2dx_Sprite_setDisplayFrameWithAnimationName, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("setTextureAtlas", js_cocos2dx_Sprite_setTextureAtlas, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("getSpriteFrame", js_cocos2dx_Sprite_getSpriteFrame, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getResourceName", js_cocos2dx_Sprite_getResourceName, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("isDirty", js_cocos2dx_Sprite_isDirty, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("setAtlasIndex", js_cocos2dx_Sprite_setAtlasIndex, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("setDirty", js_cocos2dx_Sprite_setDirty, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), @@ -48410,17 +47534,11 @@ bool js_cocos2dx_TransitionScene_create(JSContext *cx, uint32_t argc, jsval *vp) JSB_PRECONDITION2( arg1, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_TransitionScene_create : Error processing arguments"); - cocos2d::TransitionScene* ret = cocos2d::TransitionScene::create(arg0, arg1); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::TransitionScene*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::TransitionScene::create(arg0, arg1); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::TransitionScene")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_TransitionScene_create : wrong number of arguments"); @@ -48567,17 +47685,11 @@ bool js_cocos2dx_TransitionSceneOriented_create(JSContext *cx, uint32_t argc, js } while (0); ok &= jsval_to_int32(cx, args.get(2), (int32_t *)&arg2); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_TransitionSceneOriented_create : Error processing arguments"); - cocos2d::TransitionSceneOriented* ret = cocos2d::TransitionSceneOriented::create(arg0, arg1, arg2); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::TransitionSceneOriented*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::TransitionSceneOriented::create(arg0, arg1, arg2); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::TransitionSceneOriented")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_TransitionSceneOriented_create : wrong number of arguments"); @@ -48684,17 +47796,11 @@ bool js_cocos2dx_TransitionRotoZoom_create(JSContext *cx, uint32_t argc, jsval * JSB_PRECONDITION2( arg1, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_TransitionRotoZoom_create : Error processing arguments"); - cocos2d::TransitionRotoZoom* ret = cocos2d::TransitionRotoZoom::create(arg0, arg1); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::TransitionRotoZoom*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::TransitionRotoZoom::create(arg0, arg1); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::TransitionRotoZoom")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_TransitionRotoZoom_create : wrong number of arguments"); @@ -48800,17 +47906,11 @@ bool js_cocos2dx_TransitionJumpZoom_create(JSContext *cx, uint32_t argc, jsval * JSB_PRECONDITION2( arg1, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_TransitionJumpZoom_create : Error processing arguments"); - cocos2d::TransitionJumpZoom* ret = cocos2d::TransitionJumpZoom::create(arg0, arg1); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::TransitionJumpZoom*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::TransitionJumpZoom::create(arg0, arg1); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::TransitionJumpZoom")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_TransitionJumpZoom_create : wrong number of arguments"); @@ -48978,17 +48078,11 @@ bool js_cocos2dx_TransitionMoveInL_create(JSContext *cx, uint32_t argc, jsval *v JSB_PRECONDITION2( arg1, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_TransitionMoveInL_create : Error processing arguments"); - cocos2d::TransitionMoveInL* ret = cocos2d::TransitionMoveInL::create(arg0, arg1); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::TransitionMoveInL*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::TransitionMoveInL::create(arg0, arg1); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::TransitionMoveInL")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_TransitionMoveInL_create : wrong number of arguments"); @@ -49096,17 +48190,11 @@ bool js_cocos2dx_TransitionMoveInR_create(JSContext *cx, uint32_t argc, jsval *v JSB_PRECONDITION2( arg1, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_TransitionMoveInR_create : Error processing arguments"); - cocos2d::TransitionMoveInR* ret = cocos2d::TransitionMoveInR::create(arg0, arg1); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::TransitionMoveInR*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::TransitionMoveInR::create(arg0, arg1); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::TransitionMoveInR")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_TransitionMoveInR_create : wrong number of arguments"); @@ -49212,17 +48300,11 @@ bool js_cocos2dx_TransitionMoveInT_create(JSContext *cx, uint32_t argc, jsval *v JSB_PRECONDITION2( arg1, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_TransitionMoveInT_create : Error processing arguments"); - cocos2d::TransitionMoveInT* ret = cocos2d::TransitionMoveInT::create(arg0, arg1); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::TransitionMoveInT*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::TransitionMoveInT::create(arg0, arg1); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::TransitionMoveInT")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_TransitionMoveInT_create : wrong number of arguments"); @@ -49328,17 +48410,11 @@ bool js_cocos2dx_TransitionMoveInB_create(JSContext *cx, uint32_t argc, jsval *v JSB_PRECONDITION2( arg1, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_TransitionMoveInB_create : Error processing arguments"); - cocos2d::TransitionMoveInB* ret = cocos2d::TransitionMoveInB::create(arg0, arg1); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::TransitionMoveInB*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::TransitionMoveInB::create(arg0, arg1); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::TransitionMoveInB")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_TransitionMoveInB_create : wrong number of arguments"); @@ -49506,17 +48582,11 @@ bool js_cocos2dx_TransitionSlideInL_create(JSContext *cx, uint32_t argc, jsval * JSB_PRECONDITION2( arg1, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_TransitionSlideInL_create : Error processing arguments"); - cocos2d::TransitionSlideInL* ret = cocos2d::TransitionSlideInL::create(arg0, arg1); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::TransitionSlideInL*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::TransitionSlideInL::create(arg0, arg1); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::TransitionSlideInL")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_TransitionSlideInL_create : wrong number of arguments"); @@ -49624,17 +48694,11 @@ bool js_cocos2dx_TransitionSlideInR_create(JSContext *cx, uint32_t argc, jsval * JSB_PRECONDITION2( arg1, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_TransitionSlideInR_create : Error processing arguments"); - cocos2d::TransitionSlideInR* ret = cocos2d::TransitionSlideInR::create(arg0, arg1); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::TransitionSlideInR*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::TransitionSlideInR::create(arg0, arg1); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::TransitionSlideInR")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_TransitionSlideInR_create : wrong number of arguments"); @@ -49740,17 +48804,11 @@ bool js_cocos2dx_TransitionSlideInB_create(JSContext *cx, uint32_t argc, jsval * JSB_PRECONDITION2( arg1, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_TransitionSlideInB_create : Error processing arguments"); - cocos2d::TransitionSlideInB* ret = cocos2d::TransitionSlideInB::create(arg0, arg1); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::TransitionSlideInB*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::TransitionSlideInB::create(arg0, arg1); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::TransitionSlideInB")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_TransitionSlideInB_create : wrong number of arguments"); @@ -49856,17 +48914,11 @@ bool js_cocos2dx_TransitionSlideInT_create(JSContext *cx, uint32_t argc, jsval * JSB_PRECONDITION2( arg1, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_TransitionSlideInT_create : Error processing arguments"); - cocos2d::TransitionSlideInT* ret = cocos2d::TransitionSlideInT::create(arg0, arg1); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::TransitionSlideInT*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::TransitionSlideInT::create(arg0, arg1); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::TransitionSlideInT")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_TransitionSlideInT_create : wrong number of arguments"); @@ -50009,17 +49061,11 @@ bool js_cocos2dx_TransitionShrinkGrow_create(JSContext *cx, uint32_t argc, jsval JSB_PRECONDITION2( arg1, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_TransitionShrinkGrow_create : Error processing arguments"); - cocos2d::TransitionShrinkGrow* ret = cocos2d::TransitionShrinkGrow::create(arg0, arg1); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::TransitionShrinkGrow*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::TransitionShrinkGrow::create(arg0, arg1); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::TransitionShrinkGrow")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_TransitionShrinkGrow_create : wrong number of arguments"); @@ -51263,17 +50309,11 @@ bool js_cocos2dx_TransitionCrossFade_create(JSContext *cx, uint32_t argc, jsval JSB_PRECONDITION2( arg1, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_TransitionCrossFade_create : Error processing arguments"); - cocos2d::TransitionCrossFade* ret = cocos2d::TransitionCrossFade::create(arg0, arg1); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::TransitionCrossFade*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::TransitionCrossFade::create(arg0, arg1); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::TransitionCrossFade")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_TransitionCrossFade_create : wrong number of arguments"); @@ -51416,17 +50456,11 @@ bool js_cocos2dx_TransitionTurnOffTiles_create(JSContext *cx, uint32_t argc, jsv JSB_PRECONDITION2( arg1, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_TransitionTurnOffTiles_create : Error processing arguments"); - cocos2d::TransitionTurnOffTiles* ret = cocos2d::TransitionTurnOffTiles::create(arg0, arg1); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::TransitionTurnOffTiles*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::TransitionTurnOffTiles::create(arg0, arg1); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::TransitionTurnOffTiles")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_TransitionTurnOffTiles_create : wrong number of arguments"); @@ -51595,17 +50629,11 @@ bool js_cocos2dx_TransitionSplitCols_create(JSContext *cx, uint32_t argc, jsval JSB_PRECONDITION2( arg1, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_TransitionSplitCols_create : Error processing arguments"); - cocos2d::TransitionSplitCols* ret = cocos2d::TransitionSplitCols::create(arg0, arg1); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::TransitionSplitCols*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::TransitionSplitCols::create(arg0, arg1); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::TransitionSplitCols")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_TransitionSplitCols_create : wrong number of arguments"); @@ -51713,17 +50741,11 @@ bool js_cocos2dx_TransitionSplitRows_create(JSContext *cx, uint32_t argc, jsval JSB_PRECONDITION2( arg1, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_TransitionSplitRows_create : Error processing arguments"); - cocos2d::TransitionSplitRows* ret = cocos2d::TransitionSplitRows::create(arg0, arg1); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::TransitionSplitRows*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::TransitionSplitRows::create(arg0, arg1); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::TransitionSplitRows")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_TransitionSplitRows_create : wrong number of arguments"); @@ -51895,17 +50917,11 @@ bool js_cocos2dx_TransitionFadeTR_create(JSContext *cx, uint32_t argc, jsval *vp JSB_PRECONDITION2( arg1, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_TransitionFadeTR_create : Error processing arguments"); - cocos2d::TransitionFadeTR* ret = cocos2d::TransitionFadeTR::create(arg0, arg1); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::TransitionFadeTR*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::TransitionFadeTR::create(arg0, arg1); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::TransitionFadeTR")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_TransitionFadeTR_create : wrong number of arguments"); @@ -52013,17 +51029,11 @@ bool js_cocos2dx_TransitionFadeBL_create(JSContext *cx, uint32_t argc, jsval *vp JSB_PRECONDITION2( arg1, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_TransitionFadeBL_create : Error processing arguments"); - cocos2d::TransitionFadeBL* ret = cocos2d::TransitionFadeBL::create(arg0, arg1); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::TransitionFadeBL*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::TransitionFadeBL::create(arg0, arg1); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::TransitionFadeBL")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_TransitionFadeBL_create : wrong number of arguments"); @@ -52129,17 +51139,11 @@ bool js_cocos2dx_TransitionFadeUp_create(JSContext *cx, uint32_t argc, jsval *vp JSB_PRECONDITION2( arg1, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_TransitionFadeUp_create : Error processing arguments"); - cocos2d::TransitionFadeUp* ret = cocos2d::TransitionFadeUp::create(arg0, arg1); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::TransitionFadeUp*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::TransitionFadeUp::create(arg0, arg1); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::TransitionFadeUp")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_TransitionFadeUp_create : wrong number of arguments"); @@ -52245,17 +51249,11 @@ bool js_cocos2dx_TransitionFadeDown_create(JSContext *cx, uint32_t argc, jsval * JSB_PRECONDITION2( arg1, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_TransitionFadeDown_create : Error processing arguments"); - cocos2d::TransitionFadeDown* ret = cocos2d::TransitionFadeDown::create(arg0, arg1); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::TransitionFadeDown*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::TransitionFadeDown::create(arg0, arg1); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::TransitionFadeDown")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_TransitionFadeDown_create : wrong number of arguments"); @@ -52426,17 +51424,11 @@ bool js_cocos2dx_TransitionPageTurn_create(JSContext *cx, uint32_t argc, jsval * } while (0); arg2 = JS::ToBoolean(args.get(2)); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_TransitionPageTurn_create : Error processing arguments"); - cocos2d::TransitionPageTurn* ret = cocos2d::TransitionPageTurn::create(arg0, arg1, arg2); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::TransitionPageTurn*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::TransitionPageTurn::create(arg0, arg1, arg2); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::TransitionPageTurn")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_TransitionPageTurn_create : wrong number of arguments"); @@ -52544,17 +51536,11 @@ bool js_cocos2dx_TransitionProgress_create(JSContext *cx, uint32_t argc, jsval * JSB_PRECONDITION2( arg1, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_TransitionProgress_create : Error processing arguments"); - cocos2d::TransitionProgress* ret = cocos2d::TransitionProgress::create(arg0, arg1); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::TransitionProgress*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::TransitionProgress::create(arg0, arg1); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::TransitionProgress")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_TransitionProgress_create : wrong number of arguments"); @@ -52660,17 +51646,11 @@ bool js_cocos2dx_TransitionProgressRadialCCW_create(JSContext *cx, uint32_t argc JSB_PRECONDITION2( arg1, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_TransitionProgressRadialCCW_create : Error processing arguments"); - cocos2d::TransitionProgressRadialCCW* ret = cocos2d::TransitionProgressRadialCCW::create(arg0, arg1); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::TransitionProgressRadialCCW*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::TransitionProgressRadialCCW::create(arg0, arg1); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::TransitionProgressRadialCCW")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_TransitionProgressRadialCCW_create : wrong number of arguments"); @@ -52776,17 +51756,11 @@ bool js_cocos2dx_TransitionProgressRadialCW_create(JSContext *cx, uint32_t argc, JSB_PRECONDITION2( arg1, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_TransitionProgressRadialCW_create : Error processing arguments"); - cocos2d::TransitionProgressRadialCW* ret = cocos2d::TransitionProgressRadialCW::create(arg0, arg1); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::TransitionProgressRadialCW*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::TransitionProgressRadialCW::create(arg0, arg1); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::TransitionProgressRadialCW")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_TransitionProgressRadialCW_create : wrong number of arguments"); @@ -52892,17 +51866,11 @@ bool js_cocos2dx_TransitionProgressHorizontal_create(JSContext *cx, uint32_t arg JSB_PRECONDITION2( arg1, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_TransitionProgressHorizontal_create : Error processing arguments"); - cocos2d::TransitionProgressHorizontal* ret = cocos2d::TransitionProgressHorizontal::create(arg0, arg1); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::TransitionProgressHorizontal*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::TransitionProgressHorizontal::create(arg0, arg1); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::TransitionProgressHorizontal")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_TransitionProgressHorizontal_create : wrong number of arguments"); @@ -53008,17 +51976,11 @@ bool js_cocos2dx_TransitionProgressVertical_create(JSContext *cx, uint32_t argc, JSB_PRECONDITION2( arg1, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_TransitionProgressVertical_create : Error processing arguments"); - cocos2d::TransitionProgressVertical* ret = cocos2d::TransitionProgressVertical::create(arg0, arg1); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::TransitionProgressVertical*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::TransitionProgressVertical::create(arg0, arg1); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::TransitionProgressVertical")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_TransitionProgressVertical_create : wrong number of arguments"); @@ -53124,17 +52086,11 @@ bool js_cocos2dx_TransitionProgressInOut_create(JSContext *cx, uint32_t argc, js JSB_PRECONDITION2( arg1, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_TransitionProgressInOut_create : Error processing arguments"); - cocos2d::TransitionProgressInOut* ret = cocos2d::TransitionProgressInOut::create(arg0, arg1); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::TransitionProgressInOut*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::TransitionProgressInOut::create(arg0, arg1); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::TransitionProgressInOut")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_TransitionProgressInOut_create : wrong number of arguments"); @@ -53240,17 +52196,11 @@ bool js_cocos2dx_TransitionProgressOutIn_create(JSContext *cx, uint32_t argc, js JSB_PRECONDITION2( arg1, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_TransitionProgressOutIn_create : Error processing arguments"); - cocos2d::TransitionProgressOutIn* ret = cocos2d::TransitionProgressOutIn::create(arg0, arg1); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::TransitionProgressOutIn*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::TransitionProgressOutIn::create(arg0, arg1); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::TransitionProgressOutIn")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_TransitionProgressOutIn_create : wrong number of arguments"); @@ -53507,6 +52457,24 @@ bool js_cocos2dx_Camera_getProjectionMatrix(JSContext *cx, uint32_t argc, jsval JS_ReportError(cx, "js_cocos2dx_Camera_getProjectionMatrix : wrong number of arguments: %d, was expecting %d", argc, 0); return false; } +bool js_cocos2dx_Camera_isBrushValid(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::Camera* cobj = (cocos2d::Camera *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_Camera_isBrushValid : Invalid Native Object"); + if (argc == 0) { + bool ret = cobj->isBrushValid(); + jsval jsret = JSVAL_NULL; + jsret = BOOLEAN_TO_JSVAL(ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_Camera_isBrushValid : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} bool js_cocos2dx_Camera_getDepthInView(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); @@ -53956,17 +52924,11 @@ bool js_cocos2dx_Camera_createOrthographic(JSContext *cx, uint32_t argc, jsval * ok &= JS::ToNumber( cx, args.get(2), &arg2) && !isnan(arg2); ok &= JS::ToNumber( cx, args.get(3), &arg3) && !isnan(arg3); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Camera_createOrthographic : Error processing arguments"); - cocos2d::Camera* ret = cocos2d::Camera::createOrthographic(arg0, arg1, arg2, arg3); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Camera*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::Camera::createOrthographic(arg0, arg1, arg2, arg3); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::Camera")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_Camera_createOrthographic : wrong number of arguments"); @@ -53977,6 +52939,7 @@ bool js_cocos2dx_Camera_getVisitingCamera(JSContext *cx, uint32_t argc, jsval *v { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { + const cocos2d::Camera* ret = cocos2d::Camera::getVisitingCamera(); jsval jsret = JSVAL_NULL; do { @@ -53998,17 +52961,11 @@ bool js_cocos2dx_Camera_create(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocos2d::Camera* ret = cocos2d::Camera::create(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Camera*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::Camera::create(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::Camera")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_Camera_create : wrong number of arguments"); @@ -54029,17 +52986,11 @@ bool js_cocos2dx_Camera_createPerspective(JSContext *cx, uint32_t argc, jsval *v ok &= JS::ToNumber( cx, args.get(2), &arg2) && !isnan(arg2); ok &= JS::ToNumber( cx, args.get(3), &arg3) && !isnan(arg3); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Camera_createPerspective : Error processing arguments"); - cocos2d::Camera* ret = cocos2d::Camera::createPerspective(arg0, arg1, arg2, arg3); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Camera*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::Camera::createPerspective(arg0, arg1, arg2, arg3); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::Camera")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_Camera_createPerspective : wrong number of arguments"); @@ -54050,6 +53001,7 @@ bool js_cocos2dx_Camera_getDefaultViewport(JSContext *cx, uint32_t argc, jsval * { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { + const cocos2d::experimental::Viewport& ret = cocos2d::Camera::getDefaultViewport(); jsval jsret = JSVAL_NULL; #pragma warning NO CONVERSION FROM NATIVE FOR Viewport; @@ -54081,6 +53033,7 @@ bool js_cocos2dx_Camera_getDefaultCamera(JSContext *cx, uint32_t argc, jsval *vp { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { + cocos2d::Camera* ret = cocos2d::Camera::getDefaultCamera(); jsval jsret = JSVAL_NULL; do { @@ -54144,6 +53097,7 @@ void js_register_cocos2dx_Camera(JSContext *cx, JS::HandleObject global) { JS_FN("apply", js_cocos2dx_Camera_apply, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("getBackgroundBrush", js_cocos2dx_Camera_getBackgroundBrush, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("getProjectionMatrix", js_cocos2dx_Camera_getProjectionMatrix, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("isBrushValid", js_cocos2dx_Camera_isBrushValid, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("getDepthInView", js_cocos2dx_Camera_getDepthInView, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("clearBackground", js_cocos2dx_Camera_clearBackground, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("setAdditionalProjection", js_cocos2dx_Camera_setAdditionalProjection, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), @@ -54262,6 +53216,24 @@ bool js_cocos2dx_CameraBackgroundBrush_init(JSContext *cx, uint32_t argc, jsval JS_ReportError(cx, "js_cocos2dx_CameraBackgroundBrush_init : wrong number of arguments: %d, was expecting %d", argc, 0); return false; } +bool js_cocos2dx_CameraBackgroundBrush_isValid(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::CameraBackgroundBrush* cobj = (cocos2d::CameraBackgroundBrush *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_CameraBackgroundBrush_isValid : Invalid Native Object"); + if (argc == 0) { + bool ret = cobj->isValid(); + jsval jsret = JSVAL_NULL; + jsret = BOOLEAN_TO_JSVAL(ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_CameraBackgroundBrush_isValid : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} bool js_cocos2dx_CameraBackgroundBrush_createSkyboxBrush(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); @@ -54280,17 +53252,11 @@ bool js_cocos2dx_CameraBackgroundBrush_createSkyboxBrush(JSContext *cx, uint32_t ok &= jsval_to_std_string(cx, args.get(4), &arg4); ok &= jsval_to_std_string(cx, args.get(5), &arg5); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_CameraBackgroundBrush_createSkyboxBrush : Error processing arguments"); - cocos2d::CameraBackgroundSkyBoxBrush* ret = cocos2d::CameraBackgroundBrush::createSkyboxBrush(arg0, arg1, arg2, arg3, arg4, arg5); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::CameraBackgroundSkyBoxBrush*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::CameraBackgroundBrush::createSkyboxBrush(arg0, arg1, arg2, arg3, arg4, arg5); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::CameraBackgroundBrush")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_CameraBackgroundBrush_createSkyboxBrush : wrong number of arguments"); @@ -54307,17 +53273,11 @@ bool js_cocos2dx_CameraBackgroundBrush_createColorBrush(JSContext *cx, uint32_t ok &= jsval_to_cccolor4f(cx, args.get(0), &arg0); ok &= JS::ToNumber( cx, args.get(1), &arg1) && !isnan(arg1); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_CameraBackgroundBrush_createColorBrush : Error processing arguments"); - cocos2d::CameraBackgroundColorBrush* ret = cocos2d::CameraBackgroundBrush::createColorBrush(arg0, arg1); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::CameraBackgroundColorBrush*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::CameraBackgroundBrush::createColorBrush(arg0, arg1); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::CameraBackgroundBrush")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_CameraBackgroundBrush_createColorBrush : wrong number of arguments"); @@ -54328,17 +53288,11 @@ bool js_cocos2dx_CameraBackgroundBrush_createNoneBrush(JSContext *cx, uint32_t a { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocos2d::CameraBackgroundBrush* ret = cocos2d::CameraBackgroundBrush::createNoneBrush(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::CameraBackgroundBrush*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::CameraBackgroundBrush::createNoneBrush(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::CameraBackgroundBrush")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_CameraBackgroundBrush_createNoneBrush : wrong number of arguments"); @@ -54350,34 +53304,22 @@ bool js_cocos2dx_CameraBackgroundBrush_createDepthBrush(JSContext *cx, uint32_t JS::CallArgs args = JS::CallArgsFromVp(argc, vp); bool ok = true; if (argc == 0) { - cocos2d::CameraBackgroundDepthBrush* ret = cocos2d::CameraBackgroundBrush::createDepthBrush(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::CameraBackgroundDepthBrush*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::CameraBackgroundBrush::createDepthBrush(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::CameraBackgroundBrush")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } if (argc == 1) { double arg0 = 0; ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_CameraBackgroundBrush_createDepthBrush : Error processing arguments"); - cocos2d::CameraBackgroundDepthBrush* ret = cocos2d::CameraBackgroundBrush::createDepthBrush(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::CameraBackgroundDepthBrush*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::CameraBackgroundBrush::createDepthBrush(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::CameraBackgroundBrush")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_CameraBackgroundBrush_createDepthBrush : wrong number of arguments"); @@ -54423,6 +53365,7 @@ void js_register_cocos2dx_CameraBackgroundBrush(JSContext *cx, JS::HandleObject JS_FN("getBrushType", js_cocos2dx_CameraBackgroundBrush_getBrushType, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("drawBackground", js_cocos2dx_CameraBackgroundBrush_drawBackground, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("init", js_cocos2dx_CameraBackgroundBrush_init, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("isValid", js_cocos2dx_CameraBackgroundBrush_isValid, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FS_END }; @@ -54480,17 +53423,11 @@ bool js_cocos2dx_CameraBackgroundDepthBrush_create(JSContext *cx, uint32_t argc, double arg0 = 0; ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_CameraBackgroundDepthBrush_create : Error processing arguments"); - cocos2d::CameraBackgroundDepthBrush* ret = cocos2d::CameraBackgroundDepthBrush::create(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::CameraBackgroundDepthBrush*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::CameraBackgroundDepthBrush::create(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::CameraBackgroundDepthBrush")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_CameraBackgroundDepthBrush_create : wrong number of arguments"); @@ -54593,17 +53530,11 @@ bool js_cocos2dx_CameraBackgroundColorBrush_create(JSContext *cx, uint32_t argc, ok &= jsval_to_cccolor4f(cx, args.get(0), &arg0); ok &= JS::ToNumber( cx, args.get(1), &arg1) && !isnan(arg1); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_CameraBackgroundColorBrush_create : Error processing arguments"); - cocos2d::CameraBackgroundColorBrush* ret = cocos2d::CameraBackgroundColorBrush::create(arg0, arg1); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::CameraBackgroundColorBrush*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::CameraBackgroundColorBrush::create(arg0, arg1); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::CameraBackgroundColorBrush")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_CameraBackgroundColorBrush_create : wrong number of arguments"); @@ -54676,6 +53607,26 @@ void js_register_cocos2dx_CameraBackgroundColorBrush(JSContext *cx, JS::HandleOb JSClass *jsb_cocos2d_CameraBackgroundSkyBoxBrush_class; JSObject *jsb_cocos2d_CameraBackgroundSkyBoxBrush_prototype; +bool js_cocos2dx_CameraBackgroundSkyBoxBrush_setTextureValid(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::CameraBackgroundSkyBoxBrush* cobj = (cocos2d::CameraBackgroundSkyBoxBrush *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_CameraBackgroundSkyBoxBrush_setTextureValid : Invalid Native Object"); + if (argc == 1) { + bool arg0; + arg0 = JS::ToBoolean(args.get(0)); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_CameraBackgroundSkyBoxBrush_setTextureValid : Error processing arguments"); + cobj->setTextureValid(arg0); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_CameraBackgroundSkyBoxBrush_setTextureValid : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} bool js_cocos2dx_CameraBackgroundSkyBoxBrush_setTexture(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); @@ -54704,6 +53655,44 @@ bool js_cocos2dx_CameraBackgroundSkyBoxBrush_setTexture(JSContext *cx, uint32_t JS_ReportError(cx, "js_cocos2dx_CameraBackgroundSkyBoxBrush_setTexture : wrong number of arguments: %d, was expecting %d", argc, 1); return false; } +bool js_cocos2dx_CameraBackgroundSkyBoxBrush_setActived(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::CameraBackgroundSkyBoxBrush* cobj = (cocos2d::CameraBackgroundSkyBoxBrush *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_CameraBackgroundSkyBoxBrush_setActived : Invalid Native Object"); + if (argc == 1) { + bool arg0; + arg0 = JS::ToBoolean(args.get(0)); + JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_CameraBackgroundSkyBoxBrush_setActived : Error processing arguments"); + cobj->setActived(arg0); + args.rval().setUndefined(); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_CameraBackgroundSkyBoxBrush_setActived : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} +bool js_cocos2dx_CameraBackgroundSkyBoxBrush_isActived(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::CameraBackgroundSkyBoxBrush* cobj = (cocos2d::CameraBackgroundSkyBoxBrush *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_CameraBackgroundSkyBoxBrush_isActived : Invalid Native Object"); + if (argc == 0) { + bool ret = cobj->isActived(); + jsval jsret = JSVAL_NULL; + jsret = BOOLEAN_TO_JSVAL(ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_CameraBackgroundSkyBoxBrush_isActived : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} bool js_cocos2dx_CameraBackgroundSkyBoxBrush_create(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); @@ -54801,7 +53790,10 @@ void js_register_cocos2dx_CameraBackgroundSkyBoxBrush(JSContext *cx, JS::HandleO }; static JSFunctionSpec funcs[] = { + JS_FN("setTextureValid", js_cocos2dx_CameraBackgroundSkyBoxBrush_setTextureValid, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("setTexture", js_cocos2dx_CameraBackgroundSkyBoxBrush_setTexture, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("setActived", js_cocos2dx_CameraBackgroundSkyBoxBrush_setActived, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("isActived", js_cocos2dx_CameraBackgroundSkyBoxBrush_isActived, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FS_END }; @@ -56119,17 +55111,11 @@ bool js_cocos2dx_DirectionLight_create(JSContext *cx, uint32_t argc, jsval *vp) ok &= jsval_to_vector3(cx, args.get(0), &arg0); ok &= jsval_to_cccolor3b(cx, args.get(1), &arg1); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_DirectionLight_create : Error processing arguments"); - cocos2d::DirectionLight* ret = cocos2d::DirectionLight::create(arg0, arg1); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::DirectionLight*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::DirectionLight::create(arg0, arg1); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::DirectionLight")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_DirectionLight_create : wrong number of arguments"); @@ -56254,17 +55240,11 @@ bool js_cocos2dx_PointLight_create(JSContext *cx, uint32_t argc, jsval *vp) ok &= jsval_to_cccolor3b(cx, args.get(1), &arg1); ok &= JS::ToNumber( cx, args.get(2), &arg2) && !isnan(arg2); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_PointLight_create : Error processing arguments"); - cocos2d::PointLight* ret = cocos2d::PointLight::create(arg0, arg1, arg2); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::PointLight*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::PointLight::create(arg0, arg1, arg2); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::PointLight")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_PointLight_create : wrong number of arguments"); @@ -56562,17 +55542,11 @@ bool js_cocos2dx_SpotLight_create(JSContext *cx, uint32_t argc, jsval *vp) ok &= JS::ToNumber( cx, args.get(4), &arg4) && !isnan(arg4); ok &= JS::ToNumber( cx, args.get(5), &arg5) && !isnan(arg5); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_SpotLight_create : Error processing arguments"); - cocos2d::SpotLight* ret = cocos2d::SpotLight::create(arg0, arg1, arg2, arg3, arg4, arg5); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::SpotLight*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::SpotLight::create(arg0, arg1, arg2, arg3, arg4, arg5); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::SpotLight")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_SpotLight_create : wrong number of arguments"); @@ -56663,17 +55637,11 @@ bool js_cocos2dx_AmbientLight_create(JSContext *cx, uint32_t argc, jsval *vp) cocos2d::Color3B arg0; ok &= jsval_to_cccolor3b(cx, args.get(0), &arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_AmbientLight_create : Error processing arguments"); - cocos2d::AmbientLight* ret = cocos2d::AmbientLight::create(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::AmbientLight*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::AmbientLight::create(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::AmbientLight")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_AmbientLight_create : wrong number of arguments"); @@ -57647,6 +56615,7 @@ bool js_cocos2dx_GLProgramCache_getInstance(JSContext *cx, uint32_t argc, jsval { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { + cocos2d::GLProgramCache* ret = cocos2d::GLProgramCache::getInstance(); jsval jsret = JSVAL_NULL; do { @@ -58190,17 +57159,11 @@ bool js_cocos2dx_Pass_create(JSContext *cx, uint32_t argc, jsval *vp) JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Pass_create : Error processing arguments"); - cocos2d::Pass* ret = cocos2d::Pass::create(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Pass*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::Pass::create(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::Pass")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_Pass_create : wrong number of arguments"); @@ -58233,17 +57196,11 @@ bool js_cocos2dx_Pass_createWithGLProgramState(JSContext *cx, uint32_t argc, jsv JSB_PRECONDITION2( arg1, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Pass_createWithGLProgramState : Error processing arguments"); - cocos2d::Pass* ret = cocos2d::Pass::createWithGLProgramState(arg0, arg1); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Pass*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::Pass::createWithGLProgramState(arg0, arg1); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::Pass")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_Pass_createWithGLProgramState : wrong number of arguments"); @@ -58459,17 +57416,11 @@ bool js_cocos2dx_Technique_create(JSContext *cx, uint32_t argc, jsval *vp) JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Technique_create : Error processing arguments"); - cocos2d::Technique* ret = cocos2d::Technique::create(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Technique*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::Technique::create(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::Technique")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_Technique_create : wrong number of arguments"); @@ -58502,17 +57453,11 @@ bool js_cocos2dx_Technique_createWithGLProgramState(JSContext *cx, uint32_t argc JSB_PRECONDITION2( arg1, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Technique_createWithGLProgramState : Error processing arguments"); - cocos2d::Technique* ret = cocos2d::Technique::createWithGLProgramState(arg0, arg1); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Technique*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::Technique::createWithGLProgramState(arg0, arg1); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::Technique")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_Technique_createWithGLProgramState : wrong number of arguments"); @@ -58813,17 +57758,11 @@ bool js_cocos2dx_Material_createWithFilename(JSContext *cx, uint32_t argc, jsval std::string arg0; ok &= jsval_to_std_string(cx, args.get(0), &arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Material_createWithFilename : Error processing arguments"); - cocos2d::Material* ret = cocos2d::Material::createWithFilename(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Material*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::Material::createWithFilename(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::Material")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_Material_createWithFilename : wrong number of arguments"); @@ -58846,17 +57785,11 @@ bool js_cocos2dx_Material_createWithGLStateProgram(JSContext *cx, uint32_t argc, JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Material_createWithGLStateProgram : Error processing arguments"); - cocos2d::Material* ret = cocos2d::Material::createWithGLStateProgram(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Material*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::Material::createWithGLStateProgram(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::Material")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_Material_createWithGLStateProgram : wrong number of arguments"); @@ -58879,17 +57812,11 @@ bool js_cocos2dx_Material_createWithProperties(JSContext *cx, uint32_t argc, jsv JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_Material_createWithProperties : Error processing arguments"); - cocos2d::Material* ret = cocos2d::Material::createWithProperties(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Material*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::Material::createWithProperties(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::Material")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_Material_createWithProperties : wrong number of arguments"); @@ -59526,6 +58453,7 @@ bool js_cocos2dx_Device_getDPI(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { + int ret = cocos2d::Device::getDPI(); jsval jsret = JSVAL_NULL; jsret = int32_to_jsval(cx, ret); @@ -59732,6 +58660,7 @@ bool js_cocos2dx_Application_getInstance(JSContext *cx, uint32_t argc, jsval *vp { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { + cocos2d::Application* ret = cocos2d::Application::getInstance(); jsval jsret = JSVAL_NULL; do { @@ -59954,6 +58883,7 @@ bool js_cocos2dx_AnimationCache_getInstance(JSContext *cx, uint32_t argc, jsval { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { + cocos2d::AnimationCache* ret = cocos2d::AnimationCache::getInstance(); jsval jsret = JSVAL_NULL; do { @@ -60601,17 +59531,11 @@ bool js_cocos2dx_SpriteBatchNode_create(JSContext *cx, uint32_t argc, jsval *vp) std::string arg0; ok &= jsval_to_std_string(cx, args.get(0), &arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_SpriteBatchNode_create : Error processing arguments"); - cocos2d::SpriteBatchNode* ret = cocos2d::SpriteBatchNode::create(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::SpriteBatchNode*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::SpriteBatchNode::create(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::SpriteBatchNode")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } if (argc == 2) { @@ -60620,17 +59544,11 @@ bool js_cocos2dx_SpriteBatchNode_create(JSContext *cx, uint32_t argc, jsval *vp) ok &= jsval_to_std_string(cx, args.get(0), &arg0); ok &= jsval_to_ssize(cx, args.get(1), &arg1); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_SpriteBatchNode_create : Error processing arguments"); - cocos2d::SpriteBatchNode* ret = cocos2d::SpriteBatchNode::create(arg0, arg1); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::SpriteBatchNode*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::SpriteBatchNode::create(arg0, arg1); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::SpriteBatchNode")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_SpriteBatchNode_create : wrong number of arguments"); @@ -60653,17 +59571,11 @@ bool js_cocos2dx_SpriteBatchNode_createWithTexture(JSContext *cx, uint32_t argc, JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_SpriteBatchNode_createWithTexture : Error processing arguments"); - cocos2d::SpriteBatchNode* ret = cocos2d::SpriteBatchNode::createWithTexture(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::SpriteBatchNode*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::SpriteBatchNode::createWithTexture(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::SpriteBatchNode")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } if (argc == 2) { @@ -60680,17 +59592,11 @@ bool js_cocos2dx_SpriteBatchNode_createWithTexture(JSContext *cx, uint32_t argc, } while (0); ok &= jsval_to_ssize(cx, args.get(1), &arg1); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_SpriteBatchNode_createWithTexture : Error processing arguments"); - cocos2d::SpriteBatchNode* ret = cocos2d::SpriteBatchNode::createWithTexture(arg0, arg1); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::SpriteBatchNode*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::SpriteBatchNode::createWithTexture(arg0, arg1); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::SpriteBatchNode")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_SpriteBatchNode_createWithTexture : wrong number of arguments"); @@ -60798,6 +59704,28 @@ void js_register_cocos2dx_SpriteBatchNode(JSContext *cx, JS::HandleObject global JSClass *jsb_cocos2d_SpriteFrameCache_class; JSObject *jsb_cocos2d_SpriteFrameCache_prototype; +bool js_cocos2dx_SpriteFrameCache_reloadTexture(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::SpriteFrameCache* cobj = (cocos2d::SpriteFrameCache *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_SpriteFrameCache_reloadTexture : 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_SpriteFrameCache_reloadTexture : Error processing arguments"); + bool ret = cobj->reloadTexture(arg0); + jsval jsret = JSVAL_NULL; + jsret = BOOLEAN_TO_JSVAL(ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_SpriteFrameCache_reloadTexture : wrong number of arguments: %d, was expecting %d", argc, 1); + return false; +} bool js_cocos2dx_SpriteFrameCache_addSpriteFramesWithFileContent(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); @@ -61124,6 +60052,7 @@ bool js_cocos2dx_SpriteFrameCache_getInstance(JSContext *cx, uint32_t argc, jsva { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { + cocos2d::SpriteFrameCache* ret = cocos2d::SpriteFrameCache::getInstance(); jsval jsret = JSVAL_NULL; do { @@ -61161,6 +60090,7 @@ void js_register_cocos2dx_SpriteFrameCache(JSContext *cx, JS::HandleObject globa }; static JSFunctionSpec funcs[] = { + JS_FN("reloadTexture", js_cocos2dx_SpriteFrameCache_reloadTexture, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("addSpriteFramesWithFileContent", js_cocos2dx_SpriteFrameCache_addSpriteFramesWithFileContent, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("addSpriteFrame", js_cocos2dx_SpriteFrameCache_addSpriteFrame, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("addSpriteFrames", js_cocos2dx_SpriteFrameCache_addSpriteFramesWithFile, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), @@ -61711,17 +60641,11 @@ bool js_cocos2dx_ParallaxNode_create(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocos2d::ParallaxNode* ret = cocos2d::ParallaxNode::create(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ParallaxNode*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::ParallaxNode::create(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::ParallaxNode")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_ParallaxNode_create : wrong number of arguments"); @@ -62695,6 +61619,24 @@ bool js_cocos2dx_TMXMapInfo_getTileProperties(JSContext *cx, uint32_t argc, jsva JS_ReportError(cx, "js_cocos2dx_TMXMapInfo_getTileProperties : wrong number of arguments: %d, was expecting %d", argc, 0); return false; } +bool js_cocos2dx_TMXMapInfo_getExternalTilesetFileName(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::TMXMapInfo* cobj = (cocos2d::TMXMapInfo *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_TMXMapInfo_getExternalTilesetFileName : Invalid Native Object"); + if (argc == 0) { + const std::string& ret = cobj->getExternalTilesetFileName(); + jsval jsret = JSVAL_NULL; + jsret = std_string_to_jsval(cx, ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_TMXMapInfo_getExternalTilesetFileName : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} bool js_cocos2dx_TMXMapInfo_getObjectGroups(JSContext *cx, uint32_t argc, jsval *vp) { bool ok = true; @@ -62985,17 +61927,11 @@ bool js_cocos2dx_TMXMapInfo_create(JSContext *cx, uint32_t argc, jsval *vp) std::string arg0; ok &= jsval_to_std_string(cx, args.get(0), &arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_TMXMapInfo_create : Error processing arguments"); - cocos2d::TMXMapInfo* ret = cocos2d::TMXMapInfo::create(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::TMXMapInfo*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::TMXMapInfo::create(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::TMXMapInfo")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_TMXMapInfo_create : wrong number of arguments"); @@ -63012,17 +61948,11 @@ bool js_cocos2dx_TMXMapInfo_createWithXML(JSContext *cx, uint32_t argc, jsval *v 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_TMXMapInfo_createWithXML : Error processing arguments"); - cocos2d::TMXMapInfo* ret = cocos2d::TMXMapInfo::createWithXML(arg0, arg1); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::TMXMapInfo*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::TMXMapInfo::createWithXML(arg0, arg1); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::TMXMapInfo")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_TMXMapInfo_createWithXML : wrong number of arguments"); @@ -63098,6 +62028,7 @@ void js_register_cocos2dx_TMXMapInfo(JSContext *cx, JS::HandleObject global) { JS_FN("getLayerAttribs", js_cocos2dx_TMXMapInfo_getLayerAttribs, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("getTileSize", js_cocos2dx_TMXMapInfo_getTileSize, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("getTileProperties", js_cocos2dx_TMXMapInfo_getTileProperties, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getExternalTilesetFileName", js_cocos2dx_TMXMapInfo_getExternalTilesetFileName, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("getObjectGroups", js_cocos2dx_TMXMapInfo_getObjectGroups, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("getTMXFileName", js_cocos2dx_TMXMapInfo_getTMXFileName, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("setCurrentString", js_cocos2dx_TMXMapInfo_setCurrentString, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), @@ -63710,17 +62641,11 @@ bool js_cocos2dx_TMXLayer_create(JSContext *cx, uint32_t argc, jsval *vp) JSB_PRECONDITION2( arg2, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_TMXLayer_create : Error processing arguments"); - cocos2d::TMXLayer* ret = cocos2d::TMXLayer::create(arg0, arg1, arg2); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::TMXLayer*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::TMXLayer::create(arg0, arg1, arg2); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::TMXLayer")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_TMXLayer_create : wrong number of arguments"); @@ -63872,6 +62797,24 @@ bool js_cocos2dx_TMXTiledMap_getProperty(JSContext *cx, uint32_t argc, jsval *vp JS_ReportError(cx, "js_cocos2dx_TMXTiledMap_getProperty : wrong number of arguments: %d, was expecting %d", argc, 1); return false; } +bool js_cocos2dx_TMXTiledMap_getLayerNum(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::TMXTiledMap* cobj = (cocos2d::TMXTiledMap *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_TMXTiledMap_getLayerNum : Invalid Native Object"); + if (argc == 0) { + int ret = cobj->getLayerNum(); + jsval jsret = JSVAL_NULL; + jsret = int32_to_jsval(cx, ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_TMXTiledMap_getLayerNum : wrong number of arguments: %d, was expecting %d", argc, 0); + return false; +} bool js_cocos2dx_TMXTiledMap_setMapSize(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); @@ -63955,28 +62898,22 @@ bool js_cocos2dx_TMXTiledMap_getObjectGroups(JSContext *cx, uint32_t argc, jsval JS_ReportError(cx, "js_cocos2dx_TMXTiledMap_getObjectGroups : wrong number of arguments"); return false; } -bool js_cocos2dx_TMXTiledMap_initWithXML(JSContext *cx, uint32_t argc, jsval *vp) +bool js_cocos2dx_TMXTiledMap_getResourceFile(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::TMXTiledMap* cobj = (cocos2d::TMXTiledMap *)(proxy ? proxy->ptr : NULL); - JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_TMXTiledMap_initWithXML : 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_TMXTiledMap_initWithXML : Error processing arguments"); - bool ret = cobj->initWithXML(arg0, arg1); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_TMXTiledMap_getResourceFile : Invalid Native Object"); + if (argc == 0) { + const std::string ret = cobj->getResourceFile(); jsval jsret = JSVAL_NULL; - jsret = BOOLEAN_TO_JSVAL(ret); + jsret = std_string_to_jsval(cx, ret); args.rval().set(jsret); return true; } - JS_ReportError(cx, "js_cocos2dx_TMXTiledMap_initWithXML : wrong number of arguments: %d, was expecting %d", argc, 2); + JS_ReportError(cx, "js_cocos2dx_TMXTiledMap_getResourceFile : wrong number of arguments: %d, was expecting %d", argc, 0); return false; } bool js_cocos2dx_TMXTiledMap_initWithTMXFile(JSContext *cx, uint32_t argc, jsval *vp) @@ -64037,6 +62974,30 @@ bool js_cocos2dx_TMXTiledMap_getMapSize(JSContext *cx, uint32_t argc, jsval *vp) JS_ReportError(cx, "js_cocos2dx_TMXTiledMap_getMapSize : wrong number of arguments: %d, was expecting %d", argc, 0); return false; } +bool js_cocos2dx_TMXTiledMap_initWithXML(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::TMXTiledMap* cobj = (cocos2d::TMXTiledMap *)(proxy ? proxy->ptr : NULL); + JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_TMXTiledMap_initWithXML : 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_TMXTiledMap_initWithXML : Error processing arguments"); + bool ret = cobj->initWithXML(arg0, arg1); + jsval jsret = JSVAL_NULL; + jsret = BOOLEAN_TO_JSVAL(ret); + args.rval().set(jsret); + return true; + } + + JS_ReportError(cx, "js_cocos2dx_TMXTiledMap_initWithXML : wrong number of arguments: %d, was expecting %d", argc, 2); + return false; +} bool js_cocos2dx_TMXTiledMap_getProperties(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); @@ -64221,17 +63182,11 @@ bool js_cocos2dx_TMXTiledMap_create(JSContext *cx, uint32_t argc, jsval *vp) std::string arg0; ok &= jsval_to_std_string(cx, args.get(0), &arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_TMXTiledMap_create : Error processing arguments"); - cocos2d::TMXTiledMap* ret = cocos2d::TMXTiledMap::create(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::TMXTiledMap*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::TMXTiledMap::create(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::TMXTiledMap")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_TMXTiledMap_create : wrong number of arguments"); @@ -64248,17 +63203,11 @@ bool js_cocos2dx_TMXTiledMap_createWithXML(JSContext *cx, uint32_t argc, jsval * 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_TMXTiledMap_createWithXML : Error processing arguments"); - cocos2d::TMXTiledMap* ret = cocos2d::TMXTiledMap::createWithXML(arg0, arg1); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::TMXTiledMap*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::TMXTiledMap::createWithXML(arg0, arg1); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::TMXTiledMap")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_TMXTiledMap_createWithXML : wrong number of arguments"); @@ -64319,13 +63268,15 @@ void js_register_cocos2dx_TMXTiledMap(JSContext *cx, JS::HandleObject global) { static JSFunctionSpec funcs[] = { JS_FN("setObjectGroups", js_cocos2dx_TMXTiledMap_setObjectGroups, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("getProperty", js_cocos2dx_TMXTiledMap_getProperty, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getLayerNum", js_cocos2dx_TMXTiledMap_getLayerNum, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("setMapSize", js_cocos2dx_TMXTiledMap_setMapSize, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("getObjectGroup", js_cocos2dx_TMXTiledMap_getObjectGroup, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("getObjectGroups", js_cocos2dx_TMXTiledMap_getObjectGroups, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), - JS_FN("initWithXML", js_cocos2dx_TMXTiledMap_initWithXML, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("getResourceFile", js_cocos2dx_TMXTiledMap_getResourceFile, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("initWithTMXFile", js_cocos2dx_TMXTiledMap_initWithTMXFile, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("getTileSize", js_cocos2dx_TMXTiledMap_getTileSize, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("getMapSize", js_cocos2dx_TMXTiledMap_getMapSize, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), + JS_FN("initWithXML", js_cocos2dx_TMXTiledMap_initWithXML, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("getProperties", js_cocos2dx_TMXTiledMap_getProperties, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("getPropertiesForGID", js_cocos2dx_TMXTiledMap_getPropertiesForGID, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FN("setTileSize", js_cocos2dx_TMXTiledMap_setTileSize, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE), @@ -64504,17 +63455,11 @@ bool js_cocos2dx_TileMapAtlas_create(JSContext *cx, uint32_t argc, jsval *vp) ok &= jsval_to_int32(cx, args.get(2), (int32_t *)&arg2); ok &= jsval_to_int32(cx, args.get(3), (int32_t *)&arg3); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_TileMapAtlas_create : Error processing arguments"); - cocos2d::TileMapAtlas* ret = cocos2d::TileMapAtlas::create(arg0, arg1, arg2, arg3); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::TileMapAtlas*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::TileMapAtlas::create(arg0, arg1, arg2, arg3); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::TileMapAtlas")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_TileMapAtlas_create : wrong number of arguments"); @@ -65089,6 +64034,7 @@ bool js_cocos2dx_SimpleAudioEngine_getInstance(JSContext *cx, uint32_t argc, jsv { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { + CocosDenshion::SimpleAudioEngine* ret = CocosDenshion::SimpleAudioEngine::getInstance(); jsval jsret = JSVAL_NULL; do { @@ -65182,17 +64128,11 @@ bool js_cocos2dx_ComponentJS_create(JSContext *cx, uint32_t argc, jsval *vp) std::string arg0; ok &= jsval_to_std_string(cx, args.get(0), &arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ComponentJS_create : Error processing arguments"); - cocos2d::ComponentJS* ret = cocos2d::ComponentJS::create(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ComponentJS*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::ComponentJS::create(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::ComponentJS")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_ComponentJS_create : wrong number of arguments"); diff --git a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_auto.hpp b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_auto.hpp index d70487a0ca..0055f1c107 100644 --- a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_auto.hpp +++ b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_auto.hpp @@ -648,8 +648,6 @@ bool js_cocos2dx_Sequence_constructor(JSContext *cx, uint32_t argc, jsval *vp); void js_cocos2dx_Sequence_finalize(JSContext *cx, JSObject *obj); void js_register_cocos2dx_Sequence(JSContext *cx, JS::HandleObject global); void register_all_cocos2dx(JSContext* cx, JS::HandleObject obj); -bool js_cocos2dx_Sequence_init(JSContext *cx, uint32_t argc, jsval *vp); -bool js_cocos2dx_Sequence_initWithTwoActions(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_Sequence_Sequence(JSContext *cx, uint32_t argc, jsval *vp); extern JSClass *jsb_cocos2d_Repeat_class; @@ -685,8 +683,6 @@ bool js_cocos2dx_Spawn_constructor(JSContext *cx, uint32_t argc, jsval *vp); void js_cocos2dx_Spawn_finalize(JSContext *cx, JSObject *obj); void js_register_cocos2dx_Spawn(JSContext *cx, JS::HandleObject global); void register_all_cocos2dx(JSContext* cx, JS::HandleObject obj); -bool js_cocos2dx_Spawn_init(JSContext *cx, uint32_t argc, jsval *vp); -bool js_cocos2dx_Spawn_initWithTwoActions(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_Spawn_Spawn(JSContext *cx, uint32_t argc, jsval *vp); extern JSClass *jsb_cocos2d_RotateTo_class; @@ -2209,6 +2205,7 @@ bool js_cocos2dx_DrawNode_setBlendFunc(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_DrawNode_clear(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_DrawNode_drawCardinalSpline(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_DrawNode_drawSolidRect(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_DrawNode_getLineWidth(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_DrawNode_drawPoint(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_DrawNode_drawCubicBezier(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_DrawNode_create(JSContext *cx, uint32_t argc, jsval *vp); @@ -2678,6 +2675,7 @@ bool js_cocos2dx_ParticleSystem_setRadialAccelVar(JSContext *cx, uint32_t argc, bool js_cocos2dx_ParticleSystem_setStartSize(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_ParticleSystem_setSpeed(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_ParticleSystem_getStartSpin(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_ParticleSystem_getResourceFile(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_ParticleSystem_getRotatePerSecond(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_ParticleSystem_setEmitterMode(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_ParticleSystem_getDuration(JSContext *cx, uint32_t argc, jsval *vp); @@ -2941,6 +2939,7 @@ bool js_cocos2dx_Sprite_setFlippedY(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_Sprite_setFlippedX(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_Sprite_setRotationSkewX(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_Sprite_setRotationSkewY(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_Sprite_getResourceType(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_Sprite_initWithTexture(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_Sprite_getBatchNode(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_Sprite_getOffsetPosition(JSContext *cx, uint32_t argc, jsval *vp); @@ -2954,6 +2953,7 @@ bool js_cocos2dx_Sprite_getBlendFunc(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_Sprite_setDisplayFrameWithAnimationName(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_Sprite_setTextureAtlas(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_Sprite_getSpriteFrame(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_Sprite_getResourceName(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_Sprite_isDirty(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_Sprite_setAtlasIndex(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_Sprite_setDirty(JSContext *cx, uint32_t argc, jsval *vp); @@ -3404,6 +3404,7 @@ bool js_cocos2dx_Camera_lookAt(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_Camera_apply(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_Camera_getBackgroundBrush(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_Camera_getProjectionMatrix(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_Camera_isBrushValid(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_Camera_getDepthInView(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_Camera_clearBackground(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_Camera_setAdditionalProjection(JSContext *cx, uint32_t argc, jsval *vp); @@ -3444,6 +3445,7 @@ void register_all_cocos2dx(JSContext* cx, JS::HandleObject obj); bool js_cocos2dx_CameraBackgroundBrush_getBrushType(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_CameraBackgroundBrush_drawBackground(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_CameraBackgroundBrush_init(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_CameraBackgroundBrush_isValid(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_CameraBackgroundBrush_createSkyboxBrush(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_CameraBackgroundBrush_createColorBrush(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_CameraBackgroundBrush_createNoneBrush(JSContext *cx, uint32_t argc, jsval *vp); @@ -3479,7 +3481,10 @@ bool js_cocos2dx_CameraBackgroundSkyBoxBrush_constructor(JSContext *cx, uint32_t void js_cocos2dx_CameraBackgroundSkyBoxBrush_finalize(JSContext *cx, JSObject *obj); void js_register_cocos2dx_CameraBackgroundSkyBoxBrush(JSContext *cx, JS::HandleObject global); void register_all_cocos2dx(JSContext* cx, JS::HandleObject obj); +bool js_cocos2dx_CameraBackgroundSkyBoxBrush_setTextureValid(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_CameraBackgroundSkyBoxBrush_setTexture(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_CameraBackgroundSkyBoxBrush_setActived(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_CameraBackgroundSkyBoxBrush_isActived(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_CameraBackgroundSkyBoxBrush_create(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_CameraBackgroundSkyBoxBrush_CameraBackgroundSkyBoxBrush(JSContext *cx, uint32_t argc, jsval *vp); @@ -3842,6 +3847,7 @@ bool js_cocos2dx_SpriteFrameCache_constructor(JSContext *cx, uint32_t argc, jsva void js_cocos2dx_SpriteFrameCache_finalize(JSContext *cx, JSObject *obj); void js_register_cocos2dx_SpriteFrameCache(JSContext *cx, JS::HandleObject global); void register_all_cocos2dx(JSContext* cx, JS::HandleObject obj); +bool js_cocos2dx_SpriteFrameCache_reloadTexture(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_SpriteFrameCache_addSpriteFramesWithFileContent(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_SpriteFrameCache_addSpriteFrame(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_SpriteFrameCache_addSpriteFramesWithFile(JSContext *cx, uint32_t argc, jsval *vp); @@ -3957,6 +3963,7 @@ bool js_cocos2dx_TMXMapInfo_setParentGID(JSContext *cx, uint32_t argc, jsval *vp bool js_cocos2dx_TMXMapInfo_getLayerAttribs(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_TMXMapInfo_getTileSize(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_TMXMapInfo_getTileProperties(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_TMXMapInfo_getExternalTilesetFileName(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_TMXMapInfo_getObjectGroups(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_TMXMapInfo_getTMXFileName(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_TMXMapInfo_setCurrentString(JSContext *cx, uint32_t argc, jsval *vp); @@ -4015,13 +4022,15 @@ void js_register_cocos2dx_TMXTiledMap(JSContext *cx, JS::HandleObject global); void register_all_cocos2dx(JSContext* cx, JS::HandleObject obj); bool js_cocos2dx_TMXTiledMap_setObjectGroups(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_TMXTiledMap_getProperty(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_TMXTiledMap_getLayerNum(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_TMXTiledMap_setMapSize(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_TMXTiledMap_getObjectGroup(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_TMXTiledMap_getObjectGroups(JSContext *cx, uint32_t argc, jsval *vp); -bool js_cocos2dx_TMXTiledMap_initWithXML(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_TMXTiledMap_getResourceFile(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_TMXTiledMap_initWithTMXFile(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_TMXTiledMap_getTileSize(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_TMXTiledMap_getMapSize(JSContext *cx, uint32_t argc, jsval *vp); +bool js_cocos2dx_TMXTiledMap_initWithXML(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_TMXTiledMap_getProperties(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_TMXTiledMap_getPropertiesForGID(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_TMXTiledMap_setTileSize(JSContext *cx, uint32_t argc, jsval *vp); diff --git a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_experimental_video_auto.cpp b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_experimental_video_auto.cpp index 2d87a26e5f..1535421b80 100644 --- a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_experimental_video_auto.cpp +++ b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_experimental_video_auto.cpp @@ -269,17 +269,11 @@ bool js_cocos2dx_experimental_video_VideoPlayer_create(JSContext *cx, uint32_t a { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocos2d::experimental::ui::VideoPlayer* ret = cocos2d::experimental::ui::VideoPlayer::create(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::experimental::ui::VideoPlayer*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::experimental::ui::VideoPlayer::create(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::experimental::ui::VideoPlayer")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_experimental_video_VideoPlayer_create : wrong number of arguments"); diff --git a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_experimental_webView_auto.cpp b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_experimental_webView_auto.cpp index ade5c7a40f..70a5486074 100644 --- a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_experimental_webView_auto.cpp +++ b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_experimental_webView_auto.cpp @@ -329,17 +329,11 @@ bool js_cocos2dx_experimental_webView_WebView_create(JSContext *cx, uint32_t arg { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocos2d::experimental::ui::WebView* ret = cocos2d::experimental::ui::WebView::create(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::experimental::ui::WebView*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::experimental::ui::WebView::create(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::experimental::ui::WebView")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_experimental_webView_WebView_create : wrong number of arguments"); diff --git a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_extension_auto.cpp b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_extension_auto.cpp index e43c4c1b5f..bd5c6891b3 100644 --- a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_extension_auto.cpp +++ b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_extension_auto.cpp @@ -272,17 +272,11 @@ bool js_cocos2dx_extension_Control_create(JSContext *cx, uint32_t argc, jsval *v { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocos2d::extension::Control* ret = cocos2d::extension::Control::create(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::extension::Control*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::extension::Control::create(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::extension::Control")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_extension_Control_create : wrong number of arguments"); @@ -1740,17 +1734,11 @@ bool js_cocos2dx_extension_ControlHuePicker_create(JSContext *cx, uint32_t argc, } while (0); ok &= jsval_to_vector2(cx, args.get(1), &arg1); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_extension_ControlHuePicker_create : Error processing arguments"); - cocos2d::extension::ControlHuePicker* ret = cocos2d::extension::ControlHuePicker::create(arg0, arg1); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::extension::ControlHuePicker*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::extension::ControlHuePicker::create(arg0, arg1); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::extension::ControlHuePicker")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_extension_ControlHuePicker_create : wrong number of arguments"); @@ -2036,17 +2024,11 @@ bool js_cocos2dx_extension_ControlSaturationBrightnessPicker_create(JSContext *c } while (0); ok &= jsval_to_vector2(cx, args.get(1), &arg1); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_extension_ControlSaturationBrightnessPicker_create : Error processing arguments"); - cocos2d::extension::ControlSaturationBrightnessPicker* ret = cocos2d::extension::ControlSaturationBrightnessPicker::create(arg0, arg1); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::extension::ControlSaturationBrightnessPicker*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::extension::ControlSaturationBrightnessPicker::create(arg0, arg1); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::extension::ControlSaturationBrightnessPicker")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_extension_ControlSaturationBrightnessPicker_create : wrong number of arguments"); @@ -2349,17 +2331,11 @@ bool js_cocos2dx_extension_ControlColourPicker_create(JSContext *cx, uint32_t ar { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocos2d::extension::ControlColourPicker* ret = cocos2d::extension::ControlColourPicker::create(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::extension::ControlColourPicker*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::extension::ControlColourPicker::create(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::extension::ControlColourPicker")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_extension_ControlColourPicker_create : wrong number of arguments"); @@ -2887,17 +2863,11 @@ bool js_cocos2dx_extension_ControlPotentiometer_create(JSContext *cx, uint32_t a std::string arg1_tmp; ok &= jsval_to_std_string(cx, args.get(1), &arg1_tmp); arg1 = arg1_tmp.c_str(); std::string arg2_tmp; ok &= jsval_to_std_string(cx, args.get(2), &arg2_tmp); arg2 = arg2_tmp.c_str(); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_extension_ControlPotentiometer_create : Error processing arguments"); - cocos2d::extension::ControlPotentiometer* ret = cocos2d::extension::ControlPotentiometer::create(arg0, arg1, arg2); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::extension::ControlPotentiometer*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::extension::ControlPotentiometer::create(arg0, arg1, arg2); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::extension::ControlPotentiometer")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_extension_ControlPotentiometer_create : wrong number of arguments"); @@ -4308,17 +4278,11 @@ bool js_cocos2dx_extension_ControlStepper_create(JSContext *cx, uint32_t argc, j JSB_PRECONDITION2( arg1, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_extension_ControlStepper_create : Error processing arguments"); - cocos2d::extension::ControlStepper* ret = cocos2d::extension::ControlStepper::create(arg0, arg1); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::extension::ControlStepper*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::extension::ControlStepper::create(arg0, arg1); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::extension::ControlStepper")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_extension_ControlStepper_create : wrong number of arguments"); @@ -5840,17 +5804,11 @@ bool js_cocos2dx_extension_TableViewCell_create(JSContext *cx, uint32_t argc, js { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocos2d::extension::TableViewCell* ret = cocos2d::extension::TableViewCell::create(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::extension::TableViewCell*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::extension::TableViewCell::create(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::extension::TableViewCell")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_extension_TableViewCell_create : wrong number of arguments"); @@ -6869,17 +6827,11 @@ bool js_cocos2dx_extension_AssetsManagerEx_create(JSContext *cx, uint32_t argc, 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_extension_AssetsManagerEx_create : Error processing arguments"); - cocos2d::extension::AssetsManagerEx* ret = cocos2d::extension::AssetsManagerEx::create(arg0, arg1); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::extension::AssetsManagerEx*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::extension::AssetsManagerEx::create(arg0, arg1); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::extension::AssetsManagerEx")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_extension_AssetsManagerEx_create : wrong number of arguments"); @@ -7068,17 +7020,11 @@ bool js_cocos2dx_extension_EventListenerAssetsManagerEx_create(JSContext *cx, ui } while(0) ; JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_extension_EventListenerAssetsManagerEx_create : Error processing arguments"); - cocos2d::extension::EventListenerAssetsManagerEx* ret = cocos2d::extension::EventListenerAssetsManagerEx::create(arg0, arg1); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::extension::EventListenerAssetsManagerEx*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::extension::EventListenerAssetsManagerEx::create(arg0, arg1); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::extension::EventListenerAssetsManagerEx")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_extension_EventListenerAssetsManagerEx_create : wrong number of arguments"); diff --git a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_navmesh_auto.cpp b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_navmesh_auto.cpp index 2fa401c859..eec046debb 100644 --- a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_navmesh_auto.cpp +++ b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_navmesh_auto.cpp @@ -522,6 +522,7 @@ bool js_cocos2dx_navmesh_NavMeshAgent_getNavMeshAgentComponentName(JSContext *cx { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { + const std::string& ret = cocos2d::NavMeshAgent::getNavMeshAgentComponentName(); jsval jsret = JSVAL_NULL; jsret = std_string_to_jsval(cx, ret); @@ -540,17 +541,11 @@ bool js_cocos2dx_navmesh_NavMeshAgent_create(JSContext *cx, uint32_t argc, jsval cocos2d::NavMeshAgentParam arg0; ok &= jsval_to_NavMeshAgentParam(cx, args.get(0), &arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_navmesh_NavMeshAgent_create : Error processing arguments"); - cocos2d::NavMeshAgent* ret = cocos2d::NavMeshAgent::create(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::NavMeshAgent*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::NavMeshAgent::create(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::NavMeshAgent")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_navmesh_NavMeshAgent_create : wrong number of arguments"); @@ -790,17 +785,11 @@ bool js_cocos2dx_navmesh_NavMeshObstacle_create(JSContext *cx, uint32_t argc, js ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); ok &= JS::ToNumber( cx, args.get(1), &arg1) && !isnan(arg1); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_navmesh_NavMeshObstacle_create : Error processing arguments"); - cocos2d::NavMeshObstacle* ret = cocos2d::NavMeshObstacle::create(arg0, arg1); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::NavMeshObstacle*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::NavMeshObstacle::create(arg0, arg1); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::NavMeshObstacle")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_navmesh_NavMeshObstacle_create : wrong number of arguments"); @@ -811,6 +800,7 @@ bool js_cocos2dx_navmesh_NavMeshObstacle_getNavMeshObstacleComponentName(JSConte { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { + const std::string& ret = cocos2d::NavMeshObstacle::getNavMeshObstacleComponentName(); jsval jsret = JSVAL_NULL; jsret = std_string_to_jsval(cx, ret); @@ -1102,17 +1092,11 @@ bool js_cocos2dx_navmesh_NavMesh_create(JSContext *cx, uint32_t argc, jsval *vp) 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_navmesh_NavMesh_create : Error processing arguments"); - cocos2d::NavMesh* ret = cocos2d::NavMesh::create(arg0, arg1); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::NavMesh*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::NavMesh::create(arg0, arg1); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::NavMesh")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_navmesh_NavMesh_create : wrong number of arguments"); diff --git a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_physics3d_auto.cpp b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_physics3d_auto.cpp index 5df53260ed..49a58325e4 100644 --- a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_physics3d_auto.cpp +++ b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_physics3d_auto.cpp @@ -199,17 +199,11 @@ bool js_cocos2dx_physics3d_Physics3DShape_createBox(JSContext *cx, uint32_t argc cocos2d::Vec3 arg0; ok &= jsval_to_vector3(cx, args.get(0), &arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DShape_createBox : Error processing arguments"); - cocos2d::Physics3DShape* ret = cocos2d::Physics3DShape::createBox(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Physics3DShape*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::Physics3DShape::createBox(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::Physics3DShape")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DShape_createBox : wrong number of arguments"); @@ -226,17 +220,11 @@ bool js_cocos2dx_physics3d_Physics3DShape_createCylinder(JSContext *cx, uint32_t ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); ok &= JS::ToNumber( cx, args.get(1), &arg1) && !isnan(arg1); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DShape_createCylinder : Error processing arguments"); - cocos2d::Physics3DShape* ret = cocos2d::Physics3DShape::createCylinder(arg0, arg1); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Physics3DShape*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::Physics3DShape::createCylinder(arg0, arg1); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::Physics3DShape")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DShape_createCylinder : wrong number of arguments"); @@ -261,17 +249,11 @@ bool js_cocos2dx_physics3d_Physics3DShape_createConvexHull(JSContext *cx, uint32 } while (0); ok &= jsval_to_int32(cx, args.get(1), (int32_t *)&arg1); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DShape_createConvexHull : Error processing arguments"); - cocos2d::Physics3DShape* ret = cocos2d::Physics3DShape::createConvexHull(arg0, arg1); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Physics3DShape*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::Physics3DShape::createConvexHull(arg0, arg1); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::Physics3DShape")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DShape_createConvexHull : wrong number of arguments"); @@ -288,17 +270,11 @@ bool js_cocos2dx_physics3d_Physics3DShape_createCapsule(JSContext *cx, uint32_t ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); ok &= JS::ToNumber( cx, args.get(1), &arg1) && !isnan(arg1); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DShape_createCapsule : Error processing arguments"); - cocos2d::Physics3DShape* ret = cocos2d::Physics3DShape::createCapsule(arg0, arg1); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Physics3DShape*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::Physics3DShape::createCapsule(arg0, arg1); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::Physics3DShape")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DShape_createCapsule : wrong number of arguments"); @@ -313,17 +289,11 @@ bool js_cocos2dx_physics3d_Physics3DShape_createSphere(JSContext *cx, uint32_t a double arg0 = 0; ok &= JS::ToNumber( cx, args.get(0), &arg0) && !isnan(arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DShape_createSphere : Error processing arguments"); - cocos2d::Physics3DShape* ret = cocos2d::Physics3DShape::createSphere(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Physics3DShape*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::Physics3DShape::createSphere(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::Physics3DShape")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DShape_createSphere : wrong number of arguments"); @@ -2055,6 +2025,7 @@ bool js_cocos2dx_physics3d_Physics3DComponent_getPhysics3DComponentName(JSContex { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { + std::string& ret = cocos2d::Physics3DComponent::getPhysics3DComponentName(); jsval jsret = JSVAL_NULL; jsret = std_string_to_jsval(cx, ret); @@ -2723,17 +2694,11 @@ bool js_cocos2dx_physics3d_Physics3DWorld_create(JSContext *cx, uint32_t argc, j #pragma warning NO CONVERSION TO NATIVE FOR Physics3DWorldDes* ok = false; JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DWorld_create : Error processing arguments"); - cocos2d::Physics3DWorld* ret = cocos2d::Physics3DWorld::create(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Physics3DWorld*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::Physics3DWorld::create(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::Physics3DWorld")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DWorld_create : wrong number of arguments"); @@ -5585,17 +5550,11 @@ bool js_cocos2dx_physics3d_Physics3DSliderConstraint_create(JSContext *cx, uint3 ok &= jsval_to_matrix(cx, args.get(3), &arg3); arg4 = JS::ToBoolean(args.get(4)); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_physics3d_Physics3DSliderConstraint_create : Error processing arguments"); - cocos2d::Physics3DSliderConstraint* ret = cocos2d::Physics3DSliderConstraint::create(arg0, arg1, arg2, arg3, arg4); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Physics3DSliderConstraint*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::Physics3DSliderConstraint::create(arg0, arg1, arg2, arg3, arg4); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::Physics3DSliderConstraint")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_physics3d_Physics3DSliderConstraint_create : wrong number of arguments"); diff --git a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_studio_auto.cpp b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_studio_auto.cpp index 68b41c8d20..7ca25e49fe 100644 --- a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_studio_auto.cpp +++ b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_studio_auto.cpp @@ -707,6 +707,7 @@ bool js_cocos2dx_studio_ActionManagerEx_getInstance(JSContext *cx, uint32_t argc { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { + cocostudio::ActionManagerEx* ret = cocostudio::ActionManagerEx::getInstance(); jsval jsret = JSVAL_NULL; do { @@ -818,17 +819,11 @@ bool js_cocos2dx_studio_BaseData_create(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocostudio::BaseData* ret = cocostudio::BaseData::create(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocostudio::BaseData*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocostudio::BaseData::create(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocostudio::BaseData")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_studio_BaseData_create : wrong number of arguments"); @@ -960,17 +955,11 @@ bool js_cocos2dx_studio_MovementData_create(JSContext *cx, uint32_t argc, jsval { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocostudio::MovementData* ret = cocostudio::MovementData::create(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocostudio::MovementData*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocostudio::MovementData::create(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocostudio::MovementData")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_studio_MovementData_create : wrong number of arguments"); @@ -1120,17 +1109,11 @@ bool js_cocos2dx_studio_AnimationData_create(JSContext *cx, uint32_t argc, jsval { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocostudio::AnimationData* ret = cocostudio::AnimationData::create(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocostudio::AnimationData*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocostudio::AnimationData::create(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocostudio::AnimationData")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_studio_AnimationData_create : wrong number of arguments"); @@ -1244,17 +1227,11 @@ bool js_cocos2dx_studio_ContourData_create(JSContext *cx, uint32_t argc, jsval * { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocostudio::ContourData* ret = cocostudio::ContourData::create(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocostudio::ContourData*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocostudio::ContourData::create(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocostudio::ContourData")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_studio_ContourData_create : wrong number of arguments"); @@ -1404,17 +1381,11 @@ bool js_cocos2dx_studio_TextureData_create(JSContext *cx, uint32_t argc, jsval * { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocostudio::TextureData* ret = cocostudio::TextureData::create(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocostudio::TextureData*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocostudio::TextureData::create(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocostudio::TextureData")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_studio_TextureData_create : wrong number of arguments"); @@ -2036,17 +2007,11 @@ bool js_cocos2dx_studio_Tween_create(JSContext *cx, uint32_t argc, jsval *vp) JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_studio_Tween_create : Error processing arguments"); - cocostudio::Tween* ret = cocostudio::Tween::create(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocostudio::Tween*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocostudio::Tween::create(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocostudio::Tween")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_studio_Tween_create : wrong number of arguments"); @@ -2687,17 +2652,11 @@ bool js_cocos2dx_studio_DecorativeDisplay_create(JSContext *cx, uint32_t argc, j { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocostudio::DecorativeDisplay* ret = cocostudio::DecorativeDisplay::create(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocostudio::DecorativeDisplay*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocostudio::DecorativeDisplay::create(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocostudio::DecorativeDisplay")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_studio_DecorativeDisplay_create : wrong number of arguments"); @@ -3305,17 +3264,11 @@ bool js_cocos2dx_studio_DisplayManager_create(JSContext *cx, uint32_t argc, jsva JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_studio_DisplayManager_create : Error processing arguments"); - cocostudio::DisplayManager* ret = cocostudio::DisplayManager::create(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocostudio::DisplayManager*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocostudio::DisplayManager::create(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocostudio::DisplayManager")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_studio_DisplayManager_create : wrong number of arguments"); @@ -4305,17 +4258,11 @@ bool js_cocos2dx_studio_BatchNode_create(JSContext *cx, uint32_t argc, jsval *vp { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocostudio::BatchNode* ret = cocostudio::BatchNode::create(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocostudio::BatchNode*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocostudio::BatchNode::create(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocostudio::BatchNode")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_studio_BatchNode_create : wrong number of arguments"); @@ -4752,17 +4699,11 @@ bool js_cocos2dx_studio_ArmatureAnimation_create(JSContext *cx, uint32_t argc, j JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_studio_ArmatureAnimation_create : Error processing arguments"); - cocostudio::ArmatureAnimation* ret = cocostudio::ArmatureAnimation::create(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocostudio::ArmatureAnimation*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocostudio::ArmatureAnimation::create(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocostudio::ArmatureAnimation")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_studio_ArmatureAnimation_create : wrong number of arguments"); @@ -5328,6 +5269,7 @@ bool js_cocos2dx_studio_ArmatureDataManager_getInstance(JSContext *cx, uint32_t { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { + cocostudio::ArmatureDataManager* ret = cocostudio::ArmatureDataManager::getInstance(); jsval jsret = JSVAL_NULL; do { @@ -6321,17 +6263,11 @@ bool js_cocos2dx_studio_Skin_createWithSpriteFrameName(JSContext *cx, uint32_t a std::string arg0; ok &= jsval_to_std_string(cx, args.get(0), &arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_studio_Skin_createWithSpriteFrameName : Error processing arguments"); - cocostudio::Skin* ret = cocostudio::Skin::createWithSpriteFrameName(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocostudio::Skin*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocostudio::Skin::createWithSpriteFrameName(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocostudio::Skin")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_studio_Skin_createWithSpriteFrameName : wrong number of arguments"); @@ -6659,17 +6595,11 @@ bool js_cocos2dx_studio_ComAttribute_create(JSContext *cx, uint32_t argc, jsval { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocostudio::ComAttribute* ret = cocostudio::ComAttribute::create(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocostudio::ComAttribute*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocostudio::ComAttribute::create(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocostudio::ComAttribute")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_studio_ComAttribute_create : wrong number of arguments"); @@ -7304,17 +7234,11 @@ bool js_cocos2dx_studio_ComAudio_create(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocostudio::ComAudio* ret = cocostudio::ComAudio::create(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocostudio::ComAudio*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocostudio::ComAudio::create(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocostudio::ComAudio")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_studio_ComAudio_create : wrong number of arguments"); @@ -7659,17 +7583,11 @@ bool js_cocos2dx_studio_ComController_create(JSContext *cx, uint32_t argc, jsval { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocostudio::ComController* ret = cocostudio::ComController::create(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocostudio::ComController*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocostudio::ComController::create(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocostudio::ComController")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_studio_ComController_create : wrong number of arguments"); @@ -8357,17 +8275,11 @@ bool js_cocos2dx_studio_VisibleFrame_create(JSContext *cx, uint32_t argc, jsval { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocostudio::timeline::VisibleFrame* ret = cocostudio::timeline::VisibleFrame::create(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocostudio::timeline::VisibleFrame*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocostudio::timeline::VisibleFrame::create(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocostudio::timeline::VisibleFrame")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_studio_VisibleFrame_create : wrong number of arguments"); @@ -8483,17 +8395,11 @@ bool js_cocos2dx_studio_TextureFrame_create(JSContext *cx, uint32_t argc, jsval { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocostudio::timeline::TextureFrame* ret = cocostudio::timeline::TextureFrame::create(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocostudio::timeline::TextureFrame*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocostudio::timeline::TextureFrame::create(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocostudio::timeline::TextureFrame")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_studio_TextureFrame_create : wrong number of arguments"); @@ -8609,17 +8515,11 @@ bool js_cocos2dx_studio_RotationFrame_create(JSContext *cx, uint32_t argc, jsval { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocostudio::timeline::RotationFrame* ret = cocostudio::timeline::RotationFrame::create(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocostudio::timeline::RotationFrame*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocostudio::timeline::RotationFrame::create(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocostudio::timeline::RotationFrame")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_studio_RotationFrame_create : wrong number of arguments"); @@ -8773,17 +8673,11 @@ bool js_cocos2dx_studio_SkewFrame_create(JSContext *cx, uint32_t argc, jsval *vp { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocostudio::timeline::SkewFrame* ret = cocostudio::timeline::SkewFrame::create(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocostudio::timeline::SkewFrame*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocostudio::timeline::SkewFrame::create(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocostudio::timeline::SkewFrame")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_studio_SkewFrame_create : wrong number of arguments"); @@ -8863,17 +8757,11 @@ bool js_cocos2dx_studio_RotationSkewFrame_create(JSContext *cx, uint32_t argc, j { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocostudio::timeline::RotationSkewFrame* ret = cocostudio::timeline::RotationSkewFrame::create(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocostudio::timeline::RotationSkewFrame*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocostudio::timeline::RotationSkewFrame::create(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocostudio::timeline::RotationSkewFrame")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_studio_RotationSkewFrame_create : wrong number of arguments"); @@ -9063,17 +8951,11 @@ bool js_cocos2dx_studio_PositionFrame_create(JSContext *cx, uint32_t argc, jsval { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocostudio::timeline::PositionFrame* ret = cocostudio::timeline::PositionFrame::create(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocostudio::timeline::PositionFrame*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocostudio::timeline::PositionFrame::create(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocostudio::timeline::PositionFrame")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_studio_PositionFrame_create : wrong number of arguments"); @@ -9251,17 +9133,11 @@ bool js_cocos2dx_studio_ScaleFrame_create(JSContext *cx, uint32_t argc, jsval *v { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocostudio::timeline::ScaleFrame* ret = cocostudio::timeline::ScaleFrame::create(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocostudio::timeline::ScaleFrame*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocostudio::timeline::ScaleFrame::create(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocostudio::timeline::ScaleFrame")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_studio_ScaleFrame_create : wrong number of arguments"); @@ -9380,17 +9256,11 @@ bool js_cocos2dx_studio_AnchorPointFrame_create(JSContext *cx, uint32_t argc, js { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocostudio::timeline::AnchorPointFrame* ret = cocostudio::timeline::AnchorPointFrame::create(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocostudio::timeline::AnchorPointFrame*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocostudio::timeline::AnchorPointFrame::create(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocostudio::timeline::AnchorPointFrame")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_studio_AnchorPointFrame_create : wrong number of arguments"); @@ -9660,17 +9530,11 @@ bool js_cocos2dx_studio_InnerActionFrame_create(JSContext *cx, uint32_t argc, js { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocostudio::timeline::InnerActionFrame* ret = cocostudio::timeline::InnerActionFrame::create(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocostudio::timeline::InnerActionFrame*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocostudio::timeline::InnerActionFrame::create(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocostudio::timeline::InnerActionFrame")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_studio_InnerActionFrame_create : wrong number of arguments"); @@ -9794,17 +9658,11 @@ bool js_cocos2dx_studio_ColorFrame_create(JSContext *cx, uint32_t argc, jsval *v { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocostudio::timeline::ColorFrame* ret = cocostudio::timeline::ColorFrame::create(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocostudio::timeline::ColorFrame*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocostudio::timeline::ColorFrame::create(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocostudio::timeline::ColorFrame")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_studio_ColorFrame_create : wrong number of arguments"); @@ -9920,17 +9778,11 @@ bool js_cocos2dx_studio_AlphaFrame_create(JSContext *cx, uint32_t argc, jsval *v { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocostudio::timeline::AlphaFrame* ret = cocostudio::timeline::AlphaFrame::create(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocostudio::timeline::AlphaFrame*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocostudio::timeline::AlphaFrame::create(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocostudio::timeline::AlphaFrame")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_studio_AlphaFrame_create : wrong number of arguments"); @@ -10062,17 +9914,11 @@ bool js_cocos2dx_studio_EventFrame_create(JSContext *cx, uint32_t argc, jsval *v { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocostudio::timeline::EventFrame* ret = cocostudio::timeline::EventFrame::create(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocostudio::timeline::EventFrame*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocostudio::timeline::EventFrame::create(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocostudio::timeline::EventFrame")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_studio_EventFrame_create : wrong number of arguments"); @@ -10189,17 +10035,11 @@ bool js_cocos2dx_studio_ZOrderFrame_create(JSContext *cx, uint32_t argc, jsval * { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocostudio::timeline::ZOrderFrame* ret = cocostudio::timeline::ZOrderFrame::create(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocostudio::timeline::ZOrderFrame*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocostudio::timeline::ZOrderFrame::create(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocostudio::timeline::ZOrderFrame")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_studio_ZOrderFrame_create : wrong number of arguments"); @@ -10315,17 +10155,11 @@ bool js_cocos2dx_studio_BlendFuncFrame_create(JSContext *cx, uint32_t argc, jsva { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocostudio::timeline::BlendFuncFrame* ret = cocostudio::timeline::BlendFuncFrame::create(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocostudio::timeline::BlendFuncFrame*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocostudio::timeline::BlendFuncFrame::create(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocostudio::timeline::BlendFuncFrame")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_studio_BlendFuncFrame_create : wrong number of arguments"); @@ -10716,17 +10550,11 @@ bool js_cocos2dx_studio_Timeline_create(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocostudio::timeline::Timeline* ret = cocostudio::timeline::Timeline::create(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocostudio::timeline::Timeline*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocostudio::timeline::Timeline::create(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocostudio::timeline::Timeline")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_studio_Timeline_create : wrong number of arguments"); @@ -10876,17 +10704,11 @@ bool js_cocos2dx_studio_ActionTimelineData_create(JSContext *cx, uint32_t argc, int arg0 = 0; ok &= jsval_to_int32(cx, args.get(0), (int32_t *)&arg0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_studio_ActionTimelineData_create : Error processing arguments"); - cocostudio::timeline::ActionTimelineData* ret = cocostudio::timeline::ActionTimelineData::create(arg0); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocostudio::timeline::ActionTimelineData*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocostudio::timeline::ActionTimelineData::create(arg0); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocostudio::timeline::ActionTimelineData")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_studio_ActionTimelineData_create : wrong number of arguments"); @@ -11718,17 +11540,11 @@ bool js_cocos2dx_studio_ActionTimeline_create(JSContext *cx, uint32_t argc, jsva { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocostudio::timeline::ActionTimeline* ret = cocostudio::timeline::ActionTimeline::create(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocostudio::timeline::ActionTimeline*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocostudio::timeline::ActionTimeline::create(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocostudio::timeline::ActionTimeline")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_studio_ActionTimeline_create : wrong number of arguments"); @@ -12545,17 +12361,11 @@ bool js_cocos2dx_studio_SkeletonNode_create(JSContext *cx, uint32_t argc, jsval { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocostudio::timeline::SkeletonNode* ret = cocostudio::timeline::SkeletonNode::create(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocostudio::timeline::SkeletonNode*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocostudio::timeline::SkeletonNode::create(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocostudio::timeline::SkeletonNode")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_studio_SkeletonNode_create : wrong number of arguments"); @@ -12727,17 +12537,11 @@ bool js_cocos2dx_studio_ComExtensionData_create(JSContext *cx, uint32_t argc, js { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocostudio::ComExtensionData* ret = cocostudio::ComExtensionData::create(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocostudio::ComExtensionData*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocostudio::ComExtensionData::create(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocostudio::ComExtensionData")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_studio_ComExtensionData_create : wrong number of arguments"); diff --git a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_ui_auto.cpp b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_ui_auto.cpp index 8152e8d146..89e0498c8c 100644 --- a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_ui_auto.cpp +++ b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_ui_auto.cpp @@ -123,17 +123,11 @@ bool js_cocos2dx_ui_LayoutParameter_create(JSContext *cx, uint32_t argc, jsval * { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocos2d::ui::LayoutParameter* ret = cocos2d::ui::LayoutParameter::create(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ui::LayoutParameter*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::ui::LayoutParameter::create(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::ui::LayoutParameter")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_ui_LayoutParameter_create : wrong number of arguments"); @@ -248,17 +242,11 @@ bool js_cocos2dx_ui_LinearLayoutParameter_create(JSContext *cx, uint32_t argc, j { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocos2d::ui::LinearLayoutParameter* ret = cocos2d::ui::LinearLayoutParameter::create(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ui::LinearLayoutParameter*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::ui::LinearLayoutParameter::create(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::ui::LinearLayoutParameter")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_ui_LinearLayoutParameter_create : wrong number of arguments"); @@ -450,17 +438,11 @@ bool js_cocos2dx_ui_RelativeLayoutParameter_create(JSContext *cx, uint32_t argc, { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocos2d::ui::RelativeLayoutParameter* ret = cocos2d::ui::RelativeLayoutParameter::create(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ui::RelativeLayoutParameter*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::ui::RelativeLayoutParameter::create(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::ui::RelativeLayoutParameter")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_ui_RelativeLayoutParameter_create : wrong number of arguments"); @@ -2114,6 +2096,7 @@ bool js_cocos2dx_ui_Widget_getCurrentFocusedWidget(JSContext *cx, uint32_t argc, { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { + cocos2d::ui::Widget* ret = cocos2d::ui::Widget::getCurrentFocusedWidget(); jsval jsret = JSVAL_NULL; do { @@ -2135,17 +2118,11 @@ bool js_cocos2dx_ui_Widget_create(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocos2d::ui::Widget* ret = cocos2d::ui::Widget::create(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ui::Widget*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::ui::Widget::create(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::ui::Widget")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_ui_Widget_create : wrong number of arguments"); @@ -2971,44 +2948,17 @@ bool js_cocos2dx_ui_Layout_create(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocos2d::ui::Layout* ret = cocos2d::ui::Layout::create(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ui::Layout*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::ui::Layout::create(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::ui::Layout")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_ui_Layout_create : wrong number of arguments"); return false; } -bool js_cocos2dx_ui_Layout_createInstance(JSContext *cx, uint32_t argc, jsval *vp) -{ - JS::CallArgs args = JS::CallArgsFromVp(argc, vp); - if (argc == 0) { - cocos2d::Ref* ret = cocos2d::ui::Layout::createInstance(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Ref*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); - return true; - } - JS_ReportError(cx, "js_cocos2dx_ui_Layout_createInstance : wrong number of arguments"); - return false; -} - bool js_cocos2dx_ui_Layout_constructor(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); @@ -3101,7 +3051,6 @@ void js_register_cocos2dx_ui_Layout(JSContext *cx, JS::HandleObject global) { static JSFunctionSpec st_funcs[] = { JS_FN("create", js_cocos2dx_ui_Layout_create, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), - JS_FN("createInstance", js_cocos2dx_ui_Layout_createInstance, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FS_END }; @@ -4087,27 +4036,6 @@ bool js_cocos2dx_ui_Button_create(JSContext *cx, uint32_t argc, jsval *vp) JS_ReportError(cx, "js_cocos2dx_ui_Button_create : wrong number of arguments"); return false; } -bool js_cocos2dx_ui_Button_createInstance(JSContext *cx, uint32_t argc, jsval *vp) -{ - JS::CallArgs args = JS::CallArgsFromVp(argc, vp); - if (argc == 0) { - cocos2d::Ref* ret = cocos2d::ui::Button::createInstance(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Ref*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); - return true; - } - JS_ReportError(cx, "js_cocos2dx_ui_Button_createInstance : wrong number of arguments"); - return false; -} - bool js_cocos2dx_ui_Button_constructor(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); @@ -4203,7 +4131,6 @@ void js_register_cocos2dx_ui_Button(JSContext *cx, JS::HandleObject global) { static JSFunctionSpec st_funcs[] = { JS_FN("create", js_cocos2dx_ui_Button_create, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), - JS_FN("createInstance", js_cocos2dx_ui_Button_createInstance, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FS_END }; @@ -5019,27 +4946,6 @@ bool js_cocos2dx_ui_CheckBox_create(JSContext *cx, uint32_t argc, jsval *vp) JS_ReportError(cx, "js_cocos2dx_ui_CheckBox_create : wrong number of arguments"); return false; } -bool js_cocos2dx_ui_CheckBox_createInstance(JSContext *cx, uint32_t argc, jsval *vp) -{ - JS::CallArgs args = JS::CallArgsFromVp(argc, vp); - if (argc == 0) { - cocos2d::Ref* ret = cocos2d::ui::CheckBox::createInstance(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Ref*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); - return true; - } - JS_ReportError(cx, "js_cocos2dx_ui_CheckBox_createInstance : wrong number of arguments"); - return false; -} - bool js_cocos2dx_ui_CheckBox_constructor(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); @@ -5099,7 +5005,6 @@ void js_register_cocos2dx_ui_CheckBox(JSContext *cx, JS::HandleObject global) { static JSFunctionSpec st_funcs[] = { JS_FN("create", js_cocos2dx_ui_CheckBox_create, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), - JS_FN("createInstance", js_cocos2dx_ui_CheckBox_createInstance, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FS_END }; @@ -5311,27 +5216,6 @@ bool js_cocos2dx_ui_RadioButton_create(JSContext *cx, uint32_t argc, jsval *vp) JS_ReportError(cx, "js_cocos2dx_ui_RadioButton_create : wrong number of arguments"); return false; } -bool js_cocos2dx_ui_RadioButton_createInstance(JSContext *cx, uint32_t argc, jsval *vp) -{ - JS::CallArgs args = JS::CallArgsFromVp(argc, vp); - if (argc == 0) { - cocos2d::Ref* ret = cocos2d::ui::RadioButton::createInstance(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Ref*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); - return true; - } - JS_ReportError(cx, "js_cocos2dx_ui_RadioButton_createInstance : wrong number of arguments"); - return false; -} - bool js_cocos2dx_ui_RadioButton_constructor(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); @@ -5391,7 +5275,6 @@ void js_register_cocos2dx_ui_RadioButton(JSContext *cx, JS::HandleObject global) static JSFunctionSpec st_funcs[] = { JS_FN("create", js_cocos2dx_ui_RadioButton_create, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), - JS_FN("createInstance", js_cocos2dx_ui_RadioButton_createInstance, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FS_END }; @@ -5733,17 +5616,11 @@ bool js_cocos2dx_ui_RadioButtonGroup_create(JSContext *cx, uint32_t argc, jsval { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocos2d::ui::RadioButtonGroup* ret = cocos2d::ui::RadioButtonGroup::create(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ui::RadioButtonGroup*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::ui::RadioButtonGroup::create(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::ui::RadioButtonGroup")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_ui_RadioButtonGroup_create : wrong number of arguments"); @@ -6086,27 +5963,6 @@ bool js_cocos2dx_ui_ImageView_create(JSContext *cx, uint32_t argc, jsval *vp) JS_ReportError(cx, "js_cocos2dx_ui_ImageView_create : wrong number of arguments"); return false; } -bool js_cocos2dx_ui_ImageView_createInstance(JSContext *cx, uint32_t argc, jsval *vp) -{ - JS::CallArgs args = JS::CallArgsFromVp(argc, vp); - if (argc == 0) { - cocos2d::Ref* ret = cocos2d::ui::ImageView::createInstance(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Ref*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); - return true; - } - JS_ReportError(cx, "js_cocos2dx_ui_ImageView_createInstance : wrong number of arguments"); - return false; -} - bool js_cocos2dx_ui_ImageView_constructor(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); @@ -6173,7 +6029,6 @@ void js_register_cocos2dx_ui_ImageView(JSContext *cx, JS::HandleObject global) { static JSFunctionSpec st_funcs[] = { JS_FN("create", js_cocos2dx_ui_ImageView_create, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), - JS_FN("createInstance", js_cocos2dx_ui_ImageView_createInstance, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FS_END }; @@ -6761,27 +6616,6 @@ bool js_cocos2dx_ui_Text_create(JSContext *cx, uint32_t argc, jsval *vp) JS_ReportError(cx, "js_cocos2dx_ui_Text_create : wrong number of arguments"); return false; } -bool js_cocos2dx_ui_Text_createInstance(JSContext *cx, uint32_t argc, jsval *vp) -{ - JS::CallArgs args = JS::CallArgsFromVp(argc, vp); - if (argc == 0) { - cocos2d::Ref* ret = cocos2d::ui::Text::createInstance(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Ref*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); - return true; - } - JS_ReportError(cx, "js_cocos2dx_ui_Text_createInstance : wrong number of arguments"); - return false; -} - bool js_cocos2dx_ui_Text_constructor(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); @@ -6864,7 +6698,6 @@ void js_register_cocos2dx_ui_Text(JSContext *cx, JS::HandleObject global) { static JSFunctionSpec st_funcs[] = { JS_FN("create", js_cocos2dx_ui_Text_create, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), - JS_FN("createInstance", js_cocos2dx_ui_Text_createInstance, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FS_END }; @@ -7062,27 +6895,6 @@ bool js_cocos2dx_ui_TextAtlas_create(JSContext *cx, uint32_t argc, jsval *vp) JS_ReportError(cx, "js_cocos2dx_ui_TextAtlas_create : wrong number of arguments"); return false; } -bool js_cocos2dx_ui_TextAtlas_createInstance(JSContext *cx, uint32_t argc, jsval *vp) -{ - JS::CallArgs args = JS::CallArgsFromVp(argc, vp); - if (argc == 0) { - cocos2d::Ref* ret = cocos2d::ui::TextAtlas::createInstance(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Ref*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); - return true; - } - JS_ReportError(cx, "js_cocos2dx_ui_TextAtlas_createInstance : wrong number of arguments"); - return false; -} - bool js_cocos2dx_ui_TextAtlas_constructor(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); @@ -7147,7 +6959,6 @@ void js_register_cocos2dx_ui_TextAtlas(JSContext *cx, JS::HandleObject global) { static JSFunctionSpec st_funcs[] = { JS_FN("create", js_cocos2dx_ui_TextAtlas_create, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), - JS_FN("createInstance", js_cocos2dx_ui_TextAtlas_createInstance, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FS_END }; @@ -7485,27 +7296,6 @@ bool js_cocos2dx_ui_LoadingBar_create(JSContext *cx, uint32_t argc, jsval *vp) JS_ReportError(cx, "js_cocos2dx_ui_LoadingBar_create : wrong number of arguments"); return false; } -bool js_cocos2dx_ui_LoadingBar_createInstance(JSContext *cx, uint32_t argc, jsval *vp) -{ - JS::CallArgs args = JS::CallArgsFromVp(argc, vp); - if (argc == 0) { - cocos2d::Ref* ret = cocos2d::ui::LoadingBar::createInstance(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Ref*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); - return true; - } - JS_ReportError(cx, "js_cocos2dx_ui_LoadingBar_createInstance : wrong number of arguments"); - return false; -} - bool js_cocos2dx_ui_LoadingBar_constructor(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); @@ -7574,7 +7364,6 @@ void js_register_cocos2dx_ui_LoadingBar(JSContext *cx, JS::HandleObject global) static JSFunctionSpec st_funcs[] = { JS_FN("create", js_cocos2dx_ui_LoadingBar_create, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), - JS_FN("createInstance", js_cocos2dx_ui_LoadingBar_createInstance, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FS_END }; @@ -8627,44 +8416,17 @@ bool js_cocos2dx_ui_ScrollView_create(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocos2d::ui::ScrollView* ret = cocos2d::ui::ScrollView::create(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ui::ScrollView*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::ui::ScrollView::create(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::ui::ScrollView")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_ui_ScrollView_create : wrong number of arguments"); return false; } -bool js_cocos2dx_ui_ScrollView_createInstance(JSContext *cx, uint32_t argc, jsval *vp) -{ - JS::CallArgs args = JS::CallArgsFromVp(argc, vp); - if (argc == 0) { - cocos2d::Ref* ret = cocos2d::ui::ScrollView::createInstance(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Ref*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); - return true; - } - JS_ReportError(cx, "js_cocos2dx_ui_ScrollView_createInstance : wrong number of arguments"); - return false; -} - bool js_cocos2dx_ui_ScrollView_constructor(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); @@ -8774,7 +8536,6 @@ void js_register_cocos2dx_ui_ScrollView(JSContext *cx, JS::HandleObject global) static JSFunctionSpec st_funcs[] = { JS_FN("create", js_cocos2dx_ui_ScrollView_create, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), - JS_FN("createInstance", js_cocos2dx_ui_ScrollView_createInstance, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FS_END }; @@ -9533,44 +9294,17 @@ bool js_cocos2dx_ui_ListView_create(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocos2d::ui::ListView* ret = cocos2d::ui::ListView::create(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ui::ListView*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::ui::ListView::create(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::ui::ListView")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_ui_ListView_create : wrong number of arguments"); return false; } -bool js_cocos2dx_ui_ListView_createInstance(JSContext *cx, uint32_t argc, jsval *vp) -{ - JS::CallArgs args = JS::CallArgsFromVp(argc, vp); - if (argc == 0) { - cocos2d::Ref* ret = cocos2d::ui::ListView::createInstance(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Ref*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); - return true; - } - JS_ReportError(cx, "js_cocos2dx_ui_ListView_createInstance : wrong number of arguments"); - return false; -} - bool js_cocos2dx_ui_ListView_constructor(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); @@ -9659,7 +9393,6 @@ void js_register_cocos2dx_ui_ListView(JSContext *cx, JS::HandleObject global) { static JSFunctionSpec st_funcs[] = { JS_FN("create", js_cocos2dx_ui_ListView_create, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), - JS_FN("createInstance", js_cocos2dx_ui_ListView_createInstance, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FS_END }; @@ -10349,27 +10082,6 @@ bool js_cocos2dx_ui_Slider_create(JSContext *cx, uint32_t argc, jsval *vp) JS_ReportError(cx, "js_cocos2dx_ui_Slider_create : wrong number of arguments"); return false; } -bool js_cocos2dx_ui_Slider_createInstance(JSContext *cx, uint32_t argc, jsval *vp) -{ - JS::CallArgs args = JS::CallArgsFromVp(argc, vp); - if (argc == 0) { - cocos2d::Ref* ret = cocos2d::ui::Slider::createInstance(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Ref*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); - return true; - } - JS_ReportError(cx, "js_cocos2dx_ui_Slider_createInstance : wrong number of arguments"); - return false; -} - bool js_cocos2dx_ui_Slider_constructor(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); @@ -10453,7 +10165,6 @@ void js_register_cocos2dx_ui_Slider(JSContext *cx, JS::HandleObject global) { static JSFunctionSpec st_funcs[] = { JS_FN("create", js_cocos2dx_ui_Slider_create, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), - JS_FN("createInstance", js_cocos2dx_ui_Slider_createInstance, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FS_END }; @@ -11011,17 +10722,11 @@ bool js_cocos2dx_ui_UICCTextField_create(JSContext *cx, uint32_t argc, jsval *vp ok &= jsval_to_std_string(cx, args.get(1), &arg1); ok &= JS::ToNumber( cx, args.get(2), &arg2) && !isnan(arg2); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ui_UICCTextField_create : Error processing arguments"); - cocos2d::ui::UICCTextField* ret = cocos2d::ui::UICCTextField::create(arg0, arg1, arg2); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ui::UICCTextField*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::ui::UICCTextField::create(arg0, arg1, arg2); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::ui::UICCTextField")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_ui_UICCTextField_create : wrong number of arguments"); @@ -11988,27 +11693,6 @@ bool js_cocos2dx_ui_TextField_create(JSContext *cx, uint32_t argc, jsval *vp) JS_ReportError(cx, "js_cocos2dx_ui_TextField_create : wrong number of arguments"); return false; } -bool js_cocos2dx_ui_TextField_createInstance(JSContext *cx, uint32_t argc, jsval *vp) -{ - JS::CallArgs args = JS::CallArgsFromVp(argc, vp); - if (argc == 0) { - cocos2d::Ref* ret = cocos2d::ui::TextField::createInstance(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Ref*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); - return true; - } - JS_ReportError(cx, "js_cocos2dx_ui_TextField_createInstance : wrong number of arguments"); - return false; -} - bool js_cocos2dx_ui_TextField_constructor(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); @@ -12108,7 +11792,6 @@ void js_register_cocos2dx_ui_TextField(JSContext *cx, JS::HandleObject global) { static JSFunctionSpec st_funcs[] = { JS_FN("create", js_cocos2dx_ui_TextField_create, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), - JS_FN("createInstance", js_cocos2dx_ui_TextField_createInstance, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FS_END }; @@ -12273,27 +11956,6 @@ bool js_cocos2dx_ui_TextBMFont_create(JSContext *cx, uint32_t argc, jsval *vp) JS_ReportError(cx, "js_cocos2dx_ui_TextBMFont_create : wrong number of arguments"); return false; } -bool js_cocos2dx_ui_TextBMFont_createInstance(JSContext *cx, uint32_t argc, jsval *vp) -{ - JS::CallArgs args = JS::CallArgsFromVp(argc, vp); - if (argc == 0) { - cocos2d::Ref* ret = cocos2d::ui::TextBMFont::createInstance(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Ref*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); - return true; - } - JS_ReportError(cx, "js_cocos2dx_ui_TextBMFont_createInstance : wrong number of arguments"); - return false; -} - bool js_cocos2dx_ui_TextBMFont_constructor(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); @@ -12357,7 +12019,6 @@ void js_register_cocos2dx_ui_TextBMFont(JSContext *cx, JS::HandleObject global) static JSFunctionSpec st_funcs[] = { JS_FN("create", js_cocos2dx_ui_TextBMFont_create, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), - JS_FN("createInstance", js_cocos2dx_ui_TextBMFont_createInstance, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FS_END }; @@ -12825,44 +12486,17 @@ bool js_cocos2dx_ui_PageView_create(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocos2d::ui::PageView* ret = cocos2d::ui::PageView::create(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ui::PageView*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::ui::PageView::create(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::ui::PageView")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_ui_PageView_create : wrong number of arguments"); return false; } -bool js_cocos2dx_ui_PageView_createInstance(JSContext *cx, uint32_t argc, jsval *vp) -{ - JS::CallArgs args = JS::CallArgsFromVp(argc, vp); - if (argc == 0) { - cocos2d::Ref* ret = cocos2d::ui::PageView::createInstance(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::Ref*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); - return true; - } - JS_ReportError(cx, "js_cocos2dx_ui_PageView_createInstance : wrong number of arguments"); - return false; -} - bool js_cocos2dx_ui_PageView_constructor(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); @@ -12941,7 +12575,6 @@ void js_register_cocos2dx_ui_PageView(JSContext *cx, JS::HandleObject global) { static JSFunctionSpec st_funcs[] = { JS_FN("create", js_cocos2dx_ui_PageView_create, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), - JS_FN("createInstance", js_cocos2dx_ui_PageView_createInstance, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE), JS_FS_END }; @@ -12977,6 +12610,7 @@ bool js_cocos2dx_ui_Helper_getSubStringOfUTF8String(JSContext *cx, uint32_t argc ok &= jsval_to_ulong(cx, args.get(1), &arg1); ok &= jsval_to_ulong(cx, args.get(2), &arg2); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ui_Helper_getSubStringOfUTF8String : Error processing arguments"); + std::string ret = cocos2d::ui::Helper::getSubStringOfUTF8String(arg0, arg1, arg2); jsval jsret = JSVAL_NULL; jsret = std_string_to_jsval(cx, ret); @@ -13003,6 +12637,7 @@ bool js_cocos2dx_ui_Helper_convertBoundingBoxToScreen(JSContext *cx, uint32_t ar JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ui_Helper_convertBoundingBoxToScreen : Error processing arguments"); + cocos2d::Rect ret = cocos2d::ui::Helper::convertBoundingBoxToScreen(arg0); jsval jsret = JSVAL_NULL; jsret = ccrect_to_jsval(cx, ret); @@ -13047,6 +12682,7 @@ bool js_cocos2dx_ui_Helper_seekActionWidgetByActionTag(JSContext *cx, uint32_t a } while (0); ok &= jsval_to_int32(cx, args.get(1), (int32_t *)&arg1); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ui_Helper_seekActionWidgetByActionTag : Error processing arguments"); + cocos2d::ui::Widget* ret = cocos2d::ui::Helper::seekActionWidgetByActionTag(arg0, arg1); jsval jsret = JSVAL_NULL; do { @@ -13082,6 +12718,7 @@ bool js_cocos2dx_ui_Helper_seekWidgetByName(JSContext *cx, uint32_t argc, jsval } while (0); ok &= jsval_to_std_string(cx, args.get(1), &arg1); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ui_Helper_seekWidgetByName : Error processing arguments"); + cocos2d::ui::Widget* ret = cocos2d::ui::Helper::seekWidgetByName(arg0, arg1); jsval jsret = JSVAL_NULL; do { @@ -13117,6 +12754,7 @@ bool js_cocos2dx_ui_Helper_seekWidgetByTag(JSContext *cx, uint32_t argc, jsval * } while (0); ok &= jsval_to_int32(cx, args.get(1), (int32_t *)&arg1); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ui_Helper_seekWidgetByTag : Error processing arguments"); + cocos2d::ui::Widget* ret = cocos2d::ui::Helper::seekWidgetByTag(arg0, arg1); jsval jsret = JSVAL_NULL; do { @@ -13144,6 +12782,7 @@ bool js_cocos2dx_ui_Helper_restrictCapInsetRect(JSContext *cx, uint32_t argc, js ok &= jsval_to_ccrect(cx, args.get(0), &arg0); ok &= jsval_to_ccsize(cx, args.get(1), &arg1); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ui_Helper_restrictCapInsetRect : Error processing arguments"); + cocos2d::Rect ret = cocos2d::ui::Helper::restrictCapInsetRect(arg0, arg1); jsval jsret = JSVAL_NULL; jsret = ccrect_to_jsval(cx, ret); @@ -13383,17 +13022,11 @@ bool js_cocos2dx_ui_RichElementText_create(JSContext *cx, uint32_t argc, jsval * ok &= jsval_to_std_string(cx, args.get(4), &arg4); ok &= JS::ToNumber( cx, args.get(5), &arg5) && !isnan(arg5); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ui_RichElementText_create : Error processing arguments"); - cocos2d::ui::RichElementText* ret = cocos2d::ui::RichElementText::create(arg0, arg1, arg2, arg3, arg4, arg5); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ui::RichElementText*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::ui::RichElementText::create(arg0, arg1, arg2, arg3, arg4, arg5); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::ui::RichElementText")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_ui_RichElementText_create : wrong number of arguments"); @@ -13524,17 +13157,11 @@ bool js_cocos2dx_ui_RichElementImage_create(JSContext *cx, uint32_t argc, jsval ok &= jsval_to_uint16(cx, args.get(2), &arg2); ok &= jsval_to_std_string(cx, args.get(3), &arg3); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ui_RichElementImage_create : Error processing arguments"); - cocos2d::ui::RichElementImage* ret = cocos2d::ui::RichElementImage::create(arg0, arg1, arg2, arg3); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ui::RichElementImage*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::ui::RichElementImage::create(arg0, arg1, arg2, arg3); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::ui::RichElementImage")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_ui_RichElementImage_create : wrong number of arguments"); @@ -13681,17 +13308,11 @@ bool js_cocos2dx_ui_RichElementCustomNode_create(JSContext *cx, uint32_t argc, j JSB_PRECONDITION2( arg3, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ui_RichElementCustomNode_create : Error processing arguments"); - cocos2d::ui::RichElementCustomNode* ret = cocos2d::ui::RichElementCustomNode::create(arg0, arg1, arg2, arg3); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ui::RichElementCustomNode*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::ui::RichElementCustomNode::create(arg0, arg1, arg2, arg3); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::ui::RichElementCustomNode")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_ui_RichElementCustomNode_create : wrong number of arguments"); @@ -13922,17 +13543,11 @@ bool js_cocos2dx_ui_RichText_create(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocos2d::ui::RichText* ret = cocos2d::ui::RichText::create(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ui::RichText*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::ui::RichText::create(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::ui::RichText")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_ui_RichText_create : wrong number of arguments"); @@ -17460,17 +17075,11 @@ bool js_cocos2dx_ui_LayoutComponent_create(JSContext *cx, uint32_t argc, jsval * { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { - cocos2d::ui::LayoutComponent* ret = cocos2d::ui::LayoutComponent::create(); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ui::LayoutComponent*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::ui::LayoutComponent::create(); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::ui::LayoutComponent")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_ui_LayoutComponent_create : wrong number of arguments"); @@ -17493,6 +17102,7 @@ bool js_cocos2dx_ui_LayoutComponent_bindLayoutComponent(JSContext *cx, uint32_t JSB_PRECONDITION2( arg0, cx, false, "Invalid Native Object"); } while (0); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ui_LayoutComponent_bindLayoutComponent : Error processing arguments"); + cocos2d::ui::LayoutComponent* ret = cocos2d::ui::LayoutComponent::bindLayoutComponent(arg0); jsval jsret = JSVAL_NULL; do { @@ -17831,17 +17441,11 @@ bool js_cocos2dx_ui_ScrollViewBar_create(JSContext *cx, uint32_t argc, jsval *vp } while (0); ok &= jsval_to_int32(cx, args.get(1), (int32_t *)&arg1); JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_ui_ScrollViewBar_create : Error processing arguments"); - cocos2d::ui::ScrollViewBar* ret = cocos2d::ui::ScrollViewBar::create(arg0, arg1); - jsval jsret = JSVAL_NULL; - do { - if (ret) { - js_proxy_t *jsProxy = js_get_or_create_proxy(cx, (cocos2d::ui::ScrollViewBar*)ret); - jsret = OBJECT_TO_JSVAL(jsProxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + + auto ret = cocos2d::ui::ScrollViewBar::create(arg0, arg1); + js_type_class_t *typeClass = js_get_type_from_native(ret); + JS::RootedObject jsret(cx, jsb_ref_autoreleased_create_jsobject(cx, ret, typeClass, "cocos2d::ui::ScrollViewBar")); + args.rval().set(OBJECT_TO_JSVAL(jsret)); return true; } JS_ReportError(cx, "js_cocos2dx_ui_ScrollViewBar_create : wrong number of arguments"); diff --git a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_ui_auto.hpp b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_ui_auto.hpp index 4d6f753354..914fa5e2f9 100644 --- a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_ui_auto.hpp +++ b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_ui_auto.hpp @@ -170,7 +170,6 @@ bool js_cocos2dx_ui_Layout_getBackGroundStartColor(JSContext *cx, uint32_t argc, bool js_cocos2dx_ui_Layout_setBackGroundImageScale9Enabled(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_ui_Layout_setLayoutType(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_ui_Layout_create(JSContext *cx, uint32_t argc, jsval *vp); -bool js_cocos2dx_ui_Layout_createInstance(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_ui_Layout_Layout(JSContext *cx, uint32_t argc, jsval *vp); extern JSClass *jsb_cocos2d_ui_Button_class; @@ -218,7 +217,6 @@ bool js_cocos2dx_ui_Button_getTitleColor(JSContext *cx, uint32_t argc, jsval *vp bool js_cocos2dx_ui_Button_setPressedActionEnabled(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_ui_Button_setZoomScale(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_ui_Button_create(JSContext *cx, uint32_t argc, jsval *vp); -bool js_cocos2dx_ui_Button_createInstance(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_ui_Button_Button(JSContext *cx, uint32_t argc, jsval *vp); extern JSClass *jsb_cocos2d_ui_AbstractCheckButton_class; @@ -259,7 +257,6 @@ void js_register_cocos2dx_ui_CheckBox(JSContext *cx, JS::HandleObject global); void register_all_cocos2dx_ui(JSContext* cx, JS::HandleObject obj); bool js_cocos2dx_ui_CheckBox_addEventListener(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_ui_CheckBox_create(JSContext *cx, uint32_t argc, jsval *vp); -bool js_cocos2dx_ui_CheckBox_createInstance(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_ui_CheckBox_CheckBox(JSContext *cx, uint32_t argc, jsval *vp); extern JSClass *jsb_cocos2d_ui_RadioButton_class; @@ -271,7 +268,6 @@ void js_register_cocos2dx_ui_RadioButton(JSContext *cx, JS::HandleObject global) void register_all_cocos2dx_ui(JSContext* cx, JS::HandleObject obj); bool js_cocos2dx_ui_RadioButton_addEventListener(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_ui_RadioButton_create(JSContext *cx, uint32_t argc, jsval *vp); -bool js_cocos2dx_ui_RadioButton_createInstance(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_ui_RadioButton_RadioButton(JSContext *cx, uint32_t argc, jsval *vp); extern JSClass *jsb_cocos2d_ui_RadioButtonGroup_class; @@ -311,7 +307,6 @@ bool js_cocos2dx_ui_ImageView_getRenderFile(JSContext *cx, uint32_t argc, jsval bool js_cocos2dx_ui_ImageView_getCapInsets(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_ui_ImageView_isScale9Enabled(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_ui_ImageView_create(JSContext *cx, uint32_t argc, jsval *vp); -bool js_cocos2dx_ui_ImageView_createInstance(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_ui_ImageView_ImageView(JSContext *cx, uint32_t argc, jsval *vp); extern JSClass *jsb_cocos2d_ui_Text_class; @@ -346,7 +341,6 @@ bool js_cocos2dx_ui_Text_getTextVerticalAlignment(JSContext *cx, uint32_t argc, bool js_cocos2dx_ui_Text_getTextAreaSize(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_ui_Text_setTextHorizontalAlignment(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_ui_Text_create(JSContext *cx, uint32_t argc, jsval *vp); -bool js_cocos2dx_ui_Text_createInstance(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_ui_Text_Text(JSContext *cx, uint32_t argc, jsval *vp); extern JSClass *jsb_cocos2d_ui_TextAtlas_class; @@ -363,7 +357,6 @@ bool js_cocos2dx_ui_TextAtlas_getRenderFile(JSContext *cx, uint32_t argc, jsval bool js_cocos2dx_ui_TextAtlas_setProperty(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_ui_TextAtlas_adaptRenderers(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_ui_TextAtlas_create(JSContext *cx, uint32_t argc, jsval *vp); -bool js_cocos2dx_ui_TextAtlas_createInstance(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_ui_TextAtlas_TextAtlas(JSContext *cx, uint32_t argc, jsval *vp); extern JSClass *jsb_cocos2d_ui_LoadingBar_class; @@ -384,7 +377,6 @@ bool js_cocos2dx_ui_LoadingBar_getCapInsets(JSContext *cx, uint32_t argc, jsval bool js_cocos2dx_ui_LoadingBar_isScale9Enabled(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_ui_LoadingBar_getPercent(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_ui_LoadingBar_create(JSContext *cx, uint32_t argc, jsval *vp); -bool js_cocos2dx_ui_LoadingBar_createInstance(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_ui_LoadingBar_LoadingBar(JSContext *cx, uint32_t argc, jsval *vp); extern JSClass *jsb_cocos2d_ui_ScrollView_class; @@ -446,7 +438,6 @@ bool js_cocos2dx_ui_ScrollView_isScrollBarAutoHideEnabled(JSContext *cx, uint32_ bool js_cocos2dx_ui_ScrollView_jumpToRight(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_ui_ScrollView_scrollToTopRight(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_ui_ScrollView_create(JSContext *cx, uint32_t argc, jsval *vp); -bool js_cocos2dx_ui_ScrollView_createInstance(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_ui_ScrollView_ScrollView(JSContext *cx, uint32_t argc, jsval *vp); extern JSClass *jsb_cocos2d_ui_ListView_class; @@ -487,7 +478,6 @@ bool js_cocos2dx_ui_ListView_getClosestItemToPositionInCurrentView(JSContext *cx bool js_cocos2dx_ui_ListView_setItemModel(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_ui_ListView_insertCustomItem(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_ui_ListView_create(JSContext *cx, uint32_t argc, jsval *vp); -bool js_cocos2dx_ui_ListView_createInstance(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_ui_ListView_ListView(JSContext *cx, uint32_t argc, jsval *vp); extern JSClass *jsb_cocos2d_ui_Slider_class; @@ -523,7 +513,6 @@ bool js_cocos2dx_ui_Slider_setCapInsets(JSContext *cx, uint32_t argc, jsval *vp) bool js_cocos2dx_ui_Slider_loadSlidBallTextureDisabled(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_ui_Slider_setZoomScale(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_ui_Slider_create(JSContext *cx, uint32_t argc, jsval *vp); -bool js_cocos2dx_ui_Slider_createInstance(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_ui_Slider_Slider(JSContext *cx, uint32_t argc, jsval *vp); extern JSClass *jsb_cocos2d_ui_UICCTextField_class; @@ -610,7 +599,6 @@ bool js_cocos2dx_ui_TextField_setMaxLength(JSContext *cx, uint32_t argc, jsval * bool js_cocos2dx_ui_TextField_setTouchSize(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_ui_TextField_getTouchSize(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_ui_TextField_create(JSContext *cx, uint32_t argc, jsval *vp); -bool js_cocos2dx_ui_TextField_createInstance(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_ui_TextField_TextField(JSContext *cx, uint32_t argc, jsval *vp); extern JSClass *jsb_cocos2d_ui_TextBMFont_class; @@ -626,7 +614,6 @@ bool js_cocos2dx_ui_TextBMFont_setString(JSContext *cx, uint32_t argc, jsval *vp bool js_cocos2dx_ui_TextBMFont_getRenderFile(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_ui_TextBMFont_setFntFile(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_ui_TextBMFont_create(JSContext *cx, uint32_t argc, jsval *vp); -bool js_cocos2dx_ui_TextBMFont_createInstance(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_ui_TextBMFont_TextBMFont(JSContext *cx, uint32_t argc, jsval *vp); extern JSClass *jsb_cocos2d_ui_PageView_class; @@ -657,7 +644,6 @@ bool js_cocos2dx_ui_PageView_getIndicatorSpaceBetweenIndexNodes(JSContext *cx, u bool js_cocos2dx_ui_PageView_removeAllPages(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_ui_PageView_removePageAtIndex(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_ui_PageView_create(JSContext *cx, uint32_t argc, jsval *vp); -bool js_cocos2dx_ui_PageView_createInstance(JSContext *cx, uint32_t argc, jsval *vp); bool js_cocos2dx_ui_PageView_PageView(JSContext *cx, uint32_t argc, jsval *vp); extern JSClass *jsb_cocos2d_ui_Helper_class; diff --git a/cocos/scripting/js-bindings/manual/ScriptingCore.cpp b/cocos/scripting/js-bindings/manual/ScriptingCore.cpp index af4dd130af..d02b23901f 100644 --- a/cocos/scripting/js-bindings/manual/ScriptingCore.cpp +++ b/cocos/scripting/js-bindings/manual/ScriptingCore.cpp @@ -1589,32 +1589,40 @@ bool ScriptingCore::isObjectValid(JSContext *cx, uint32_t argc, jsval *vp) void ScriptingCore::rootObject(Ref* ref) { -// js_proxy_t* nproxy; -// js_proxy_t* jsproxy; -// void *ptr = (void*)ref; -// nproxy = jsb_get_native_proxy(ptr); -// if (nproxy) { -// JSContext *cx = getGlobalContext(); -// jsproxy = jsb_get_js_proxy(nproxy->obj); -// AddObjectRoot(cx, &jsproxy->obj); -// -// CCLOG("Rooting %p - %p: %s", ref, &jsproxy->obj, typeid(*ref).name()); -// } + js_proxy_t* nproxy; + js_proxy_t* jsproxy; + void *ptr = (void*)ref; + nproxy = jsb_get_native_proxy(ptr); + if (nproxy) { + JSContext *cx = getGlobalContext(); + // FIXME: Creating a RootedObject here is not needed. + // it is being created only because jsb_get_js_proxy() requires one + // but only the raw pointer is used in jsb_get_js_proxy() + JS::RootedObject handle(cx, nproxy->obj.get()); + jsproxy = jsb_get_js_proxy(handle); + AddObjectRoot(cx, &jsproxy->obj); + + CCLOG("Rooting %p - %p: %s", ref, &jsproxy->obj, typeid(*ref).name()); + } } void ScriptingCore::unrootObject(Ref* ref) { -// js_proxy_t* nproxy; -// js_proxy_t* jsproxy; -// void *ptr = (void*)ref; -// nproxy = jsb_get_native_proxy(ptr); -// if (nproxy) { -// JSContext *cx = getGlobalContext(); -// jsproxy = jsb_get_js_proxy(nproxy->obj); -// RemoveObjectRoot(cx, &jsproxy->obj); -// -// CCLOG("Unrooting %p - %p: %s", ref, &jsproxy->obj, typeid(*ref).name()); -// } + js_proxy_t* nproxy; + js_proxy_t* jsproxy; + void *ptr = (void*)ref; + nproxy = jsb_get_native_proxy(ptr); + if (nproxy) { + JSContext *cx = getGlobalContext(); + // FIXME: Creating a RootedObject here is not needed. + // it is being created only because jsb_get_js_proxy() requires one + // but only the raw pointer is used in jsb_get_js_proxy() + JS::RootedObject handle(cx, nproxy->obj.get()); + jsproxy = jsb_get_js_proxy(handle); + RemoveObjectRoot(cx, &jsproxy->obj); + + CCLOG("Unrooting %p - %p: %s", ref, &jsproxy->obj, typeid(*ref).name()); + } } #pragma mark - Debug @@ -1999,6 +2007,26 @@ JSObject* jsb_ref_create_jsobject(JSContext *cx, cocos2d::Ref *ref, js_type_clas return js_obj; } +JSObject* jsb_ref_autoreleased_create_jsobject(JSContext *cx, cocos2d::Ref *ref, js_type_class_t *typeClass, const char* debug) +{ + // JSB_AUTOCOMPARTMENT_WITH_GLOBAL_OBJCET + JS::RootedObject proto(cx, typeClass->proto.ref()); + JS::RootedObject parent(cx, typeClass->parentProto.ref()); + JS::RootedObject js_obj(cx, JS_NewObject(cx, typeClass->jsclass, proto, parent)); + js_proxy_t* newproxy = jsb_new_proxy(ref, js_obj); + jsb_ref_autoreleased_init(cx, &newproxy->obj, ref, debug); + return js_obj; +} + +JSObject* jsb_ref_get_or_create_jsobject(JSContext *cx, cocos2d::Ref *ref, js_type_class_t *typeClass, const char* debug) +{ + auto proxy = jsb_get_native_proxy(ref); + if (proxy) + return proxy->obj; + // else + return jsb_ref_create_jsobject(cx, ref, typeClass, debug); +} + void jsb_ref_init(JSContext* cx, JS::Heap *obj, Ref* ref, const char* debug) { // CCLOG("jsb_ref_init: JSObject address = %p. %s", obj->get(), debug); @@ -2012,6 +2040,21 @@ void jsb_ref_init(JSContext* cx, JS::Heap *obj, Ref* ref, const char* #endif } +void jsb_ref_autoreleased_init(JSContext* cx, JS::Heap *obj, Ref* ref, const char* debug) +{ + // CCLOG("jsb_ref_init: JSObject address = %p. %s", obj->get(), debug); +#if CC_ENABLE_GC_FOR_NATIVE_OBJECTS + (void)cx; + (void)obj; + ref->_scriptOwned = true; + // retain it, since the object is autoreleased + ret->retain(); +#else + // don't autorelease it, since it is already autoreleased + JS::AddNamedObjectRoot(cx, obj, debug); +#endif +} + void jsb_ref_finalize(JSFreeOp* fop, JSObject* obj) { #if CC_ENABLE_GC_FOR_NATIVE_OBJECTS diff --git a/cocos/scripting/js-bindings/manual/ScriptingCore.h b/cocos/scripting/js-bindings/manual/ScriptingCore.h index 7bdd13cdc7..2fb74be310 100644 --- a/cocos/scripting/js-bindings/manual/ScriptingCore.h +++ b/cocos/scripting/js-bindings/manual/ScriptingCore.h @@ -557,6 +557,14 @@ void jsb_remove_proxy(js_proxy_t* nativeProxy, js_proxy_t* jsProxy); */ void jsb_ref_init(JSContext* cx, JS::Heap *obj, cocos2d::Ref* ref, const char* debug); +/** + * Generic initialization function for subclasses of Ref. + * Similar to jsb_ref_init(), but call it if you know that Ref has been autoreleased + * This function should never be called. It is only added as way to fix + * an issue with the static auto-bindings with the "create" function + */ +void jsb_ref_autoreleased_init(JSContext* cx, JS::Heap *obj, cocos2d::Ref* ref, const char* debug); + /** * Generic finalize used by objects that are subclass of Ref */ @@ -573,6 +581,22 @@ void jsb_ref_rebind(JSContext* cx, JS::HandleObject jsobj, js_proxy_t *js2native */ JSObject* jsb_ref_create_jsobject(JSContext *cx, cocos2d::Ref *ref, js_type_class_t *typeClass, const char* debug); +/** + * Creates a new JSObject of a certain type (typeClass) and creates a proxy associated with and the Ref + * Similar to jsb_ref_create_jsobject(), but call it if you know that Ref has been autoreleased + * This function should never be called. It is only added as way to fix + * an issue with the static auto-bindings with the "create" function + */ +JSObject* jsb_ref_autoreleased_create_jsobject(JSContext *cx, cocos2d::Ref *ref, js_type_class_t *typeClass, const char* debug); + + +/** + It will try to get the associated JSObjct for ref. + If it can't find it, it will create a new one associating it to Ref + */ +JSObject* jsb_ref_get_or_create_jsobject(JSContext *cx, cocos2d::Ref *ref, js_type_class_t *typeClass, const char* debug); + + template jsval getJSObject(JSContext* cx, T* nativeObj) { diff --git a/cocos/scripting/js-bindings/manual/cocos2d_specifics.cpp b/cocos/scripting/js-bindings/manual/cocos2d_specifics.cpp index 2b2f87c8cd..0c7db4750f 100644 --- a/cocos/scripting/js-bindings/manual/cocos2d_specifics.cpp +++ b/cocos/scripting/js-bindings/manual/cocos2d_specifics.cpp @@ -338,24 +338,17 @@ bool js_cocos2dx_CCSequence_create(JSContext *cx, uint32_t argc, jsval *vp) i++; } } - cocos2d::FiniteTimeAction* ret = cocos2d::Sequence::create(array); - jsval jsret; - do { - if (ret) { - js_proxy_t *p = jsb_get_native_proxy(ret); - if (p) { - jsret = OBJECT_TO_JSVAL(p->obj); - } else { - // create a new js obj of that class - js_proxy_t *proxy = js_get_or_create_proxy(cx, ret); - jsret = OBJECT_TO_JSVAL(proxy->obj); - } - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); - return true; + auto ret = new (std::nothrow) cocos2d::Sequence; + auto ok = ret->init(array); + + if (ok) + { + js_type_class_t *typeClass = js_get_type_from_native(ret); + // link the native object with the javascript object + JS::RootedObject jsobj(cx, jsb_ref_create_jsobject(cx, ret, typeClass, "cocos2d::Sequence")); + args.rval().set(OBJECT_TO_JSVAL(jsobj)); + return true; + } } JS_ReportError(cx, "wrong number of arguments"); return false; @@ -383,67 +376,55 @@ bool js_cocos2dx_CCSpawn_create(JSContext *cx, uint32_t argc, jsval *vp) i++; } } - cocos2d::FiniteTimeAction* ret = cocos2d::Spawn::create(array); - jsval jsret; - do { - if (ret) { - js_proxy_t *p = jsb_get_native_proxy(ret); - if (p) { - jsret = OBJECT_TO_JSVAL(p->obj); - } else { - // create a new js obj of that class - js_proxy_t *proxy = js_get_or_create_proxy(cx, ret); - jsret = OBJECT_TO_JSVAL(proxy->obj); - } - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); - return true; + auto ret = new (std::nothrow) cocos2d::Spawn; + auto ok = ret->init(array); + if (ok) + { + js_type_class_t *typeClass = js_get_type_from_native(ret); + // link the native object with the javascript object + JS::RootedObject jsobj(cx, jsb_ref_create_jsobject(cx, ret, typeClass, "cocos2d::Spawn")); + args.rval().set(OBJECT_TO_JSVAL(jsobj)); + return true; + } } JS_ReportError(cx, "wrong number of arguments"); return false; } +// TODO: This function is deprecated. The new API is "new MenuItemToggle" instead of "MenuItemToggle.create" +// There are not js tests for this function. Impossible to know weather it works Ok. bool js_cocos2dx_CCMenuItemToggle_create(JSContext *cx, uint32_t argc, jsval *vp) { if (argc >= 1) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); - cocos2d::MenuItemToggle* ret = cocos2d::MenuItemToggle::create(); + cocos2d::MenuItemToggle* ret = new (std::nothrow) cocos2d::MenuItemToggle; + if (ret->initWithItem(nullptr)) + { - for (uint32_t i=0; i < argc; i++) { - js_proxy_t *proxy; - JS::RootedObject tmpObj(cx, args.get(i).toObjectOrNull()); - proxy = jsb_get_js_proxy(tmpObj); - cocos2d::MenuItem* item = (cocos2d::MenuItem*)(proxy ? proxy->ptr : NULL); - TEST_NATIVE_OBJECT(cx, item) - ret->addSubItem(item); - } - - ret->setSelectedIndex(0); - - jsval jsret; - if (ret) { - js_proxy_t *proxy = jsb_get_native_proxy(ret); - if (proxy) { - jsret = OBJECT_TO_JSVAL(proxy->obj); - } else { - // create a new js obj of that class - proxy = js_get_or_create_proxy(cx, ret); - jsret = OBJECT_TO_JSVAL(proxy->obj); + for (uint32_t i=0; i < argc; i++) { + js_proxy_t *proxy; + JS::RootedObject tmpObj(cx, args.get(i).toObjectOrNull()); + proxy = jsb_get_js_proxy(tmpObj); + cocos2d::MenuItem* item = (cocos2d::MenuItem*)(proxy ? proxy->ptr : NULL); + TEST_NATIVE_OBJECT(cx, item) + ret->addSubItem(item); } - } else { - jsret = JSVAL_NULL; + + ret->setSelectedIndex(0); + + js_type_class_t *typeClass = js_get_type_from_native(ret); + // link the native object with the javascript object + JS::RootedObject jsobj(cx, jsb_ref_create_jsobject(cx, ret, typeClass, "cocos2d::MenuItemToggle")); + args.rval().set(OBJECT_TO_JSVAL(jsobj)); + return true; } - - args.rval().set(jsret); - return true; } JS_ReportError(cx, "wrong number of arguments"); return false; } +// TODO: This function is deprecated. The new API is "new Animation" instead of "Animation.create" +// There are not js tests for this function. Impossible to know weather it works Ok. bool js_cocos2dx_CCAnimation_create(JSContext *cx, uint32_t argc, jsval *vp) { bool ok = true; @@ -451,7 +432,8 @@ bool js_cocos2dx_CCAnimation_create(JSContext *cx, uint32_t argc, jsval *vp) if (argc <= 3) { cocos2d::Animation* ret = nullptr; double arg1 = 0.0f; - if (argc == 2) { + if (argc == 2) + { Vector arg0; if (argc > 0) { ok &= jsval_to_ccvector(cx, args.get(0), &arg0); @@ -460,8 +442,11 @@ bool js_cocos2dx_CCAnimation_create(JSContext *cx, uint32_t argc, jsval *vp) JS::RootedValue jsarg1(cx, args.get(1)); ok &= JS::ToNumber(cx, jsarg1, &arg1); JSB_PRECONDITION2(ok, cx, false, "Error processing arguments"); - ret = cocos2d::Animation::createWithSpriteFrames(arg0, arg1); - } else if (argc == 3) { + ret = new (std::nothrow) cocos2d::Animation; + ok &= ret->initWithSpriteFrames(arg0, arg1); + } + else if (argc == 3) + { Vector arg0; if (argc > 0) { ok &= jsval_to_ccvector(cx, args.get(0), &arg0); @@ -472,32 +457,33 @@ bool js_cocos2dx_CCAnimation_create(JSContext *cx, uint32_t argc, jsval *vp) ok &= JS::ToNumber(cx, jsarg1, &arg1); ok &= jsval_to_uint32(cx, args.get(2), &loops); JSB_PRECONDITION2(ok, cx, false, "Error processing arguments"); - ret = cocos2d::Animation::create(arg0, arg1, loops); - } else if (argc == 1) { + ret = new (std::nothrow) cocos2d::Animation; + ok &= ret->initWithAnimationFrames(arg0, arg1, loops); + } + else if (argc == 1) + { Vector arg0; if (argc > 0) { ok &= jsval_to_ccvector(cx, args.get(0), &arg0); JSB_PRECONDITION2(ok, cx, false, "Error processing arguments"); } - ret = cocos2d::Animation::createWithSpriteFrames(arg0); - } else if (argc == 0) { - ret = cocos2d::Animation::create(); + ret = new (std::nothrow) cocos2d::Animation; + ok &= ret->initWithSpriteFrames(arg0); } - jsval jsret; - if (ret) { - js_proxy_t *proxy = jsb_get_native_proxy(ret); - if (proxy) { - jsret = OBJECT_TO_JSVAL(proxy->obj); - } else { - // create a new js obj of that class - proxy = js_get_or_create_proxy(cx, ret); - jsret = OBJECT_TO_JSVAL(proxy->obj); - } - } else { - jsret = JSVAL_NULL; + else if (argc == 0) + { + ret = new (std::nothrow) cocos2d::Animation; + ok = ret->init(); + } + + if (ok) + { + js_type_class_t *typeClass = js_get_type_from_native(ret); + // link the native object with the javascript object + JS::RootedObject jsobj(cx, jsb_ref_create_jsobject(cx, ret, typeClass, "cocos2d::Animation")); + args.rval().set(OBJECT_TO_JSVAL(jsobj)); + return true; } - args.rval().set(jsret); - return true; } JS_ReportError(cx, "wrong number of arguments"); return false; @@ -522,6 +508,8 @@ bool js_cocos2dx_CCScene_init(JSContext *cx, uint32_t argc, jsval *vp) return false; } +// TODO: This function is deprecated. The new API is "new LayerMultiplex" instead of "LayerMultiplex.create" +// There are not js tests for this function. Impossible to know weather it works Ok. bool js_cocos2dx_CCLayerMultiplex_create(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); @@ -530,18 +518,18 @@ bool js_cocos2dx_CCLayerMultiplex_create(JSContext *cx, uint32_t argc, jsval *vp ok &= jsvals_variadic_to_ccvector(cx, args, &arg0); JSB_PRECONDITION2(ok, cx, false, "Error processing arguments"); - cocos2d::LayerMultiplex* ret = cocos2d::LayerMultiplex::createWithArray(arg0); - jsval jsret; - do { - if (ret) { - js_proxy_t *proxy = js_get_or_create_proxy(cx, ret); - jsret = OBJECT_TO_JSVAL(proxy->obj); - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); - return true; + cocos2d::LayerMultiplex* ret = new (std::nothrow) cocos2d::LayerMultiplex; + ok &= ret->initWithArray(arg0); + if (ok) + { + js_type_class_t *typeClass = js_get_type_from_native(ret); + // link the native object with the javascript object + JS::RootedObject jsobj(cx, jsb_ref_create_jsobject(cx, ret, typeClass, "cocos2d::LayerMultiplex")); + args.rval().set(OBJECT_TO_JSVAL(jsobj)); + return true; + } + JS_ReportError(cx, "Error creating LayerMultiplex"); + return false; } bool js_cocos2dx_JSTouchDelegate_registerStandardDelegate(JSContext *cx, uint32_t argc, jsval *vp) @@ -690,8 +678,9 @@ static bool js_callFunc(JSContext *cx, uint32_t argc, jsval *vp) JS::RootedValue data(cx, args.get(2)); tmpCobj->setJSExtraData(data); } - - CallFuncN *ret = CallFuncN::create([=](Node* sender){ + + cocos2d::CallFuncN *ret = new (std::nothrow) cocos2d::CallFuncN; + bool ok = ret->initWithFunction([=](Node* sender){ JSB_AUTOCOMPARTMENT_WITH_GLOBAL_OBJCET JS::RootedValue jsvalThis(cx, tmpCobj->getJSCallbackThis()); @@ -702,8 +691,9 @@ static bool js_callFunc(JSContext *cx, uint32_t argc, jsval *vp) JS::RootedValue senderVal(cx); if (sender) { - js_proxy_t *proxy = js_get_or_create_proxy(cx, sender); - senderVal.set(OBJECT_TO_JSVAL(proxy->obj)); + js_type_class_t *typeClass = js_get_type_from_native(sender); + auto jsobj = jsb_ref_get_or_create_jsobject(cx, sender, typeClass, "cocos2d::Node"); + senderVal.set(OBJECT_TO_JSVAL(jsobj)); } else { @@ -723,12 +713,17 @@ static bool js_callFunc(JSContext *cx, uint32_t argc, jsval *vp) } }); - js_proxy_t *proxy = js_get_or_create_proxy(cx, ret); - args.rval().set(OBJECT_TO_JSVAL(proxy->obj)); - + if (ok) + { + js_type_class_t *typeClass = js_get_type_from_native(ret); + // link the native object with the javascript object + JS::RootedObject jsobj(cx, jsb_ref_create_jsobject(cx, ret, typeClass, "cocos2d::CallFuncN")); + args.rval().set(OBJECT_TO_JSVAL(jsobj)); + return true; + } return true; } - JS_ReportError(cx, "Invalid number of arguments"); + JS_ReportError(cx, "js_callFunc: Invalid number of arguments"); return false; } @@ -767,8 +762,9 @@ bool js_cocos2dx_CallFunc_initWithFunction(JSContext *cx, uint32_t argc, jsval * JS::RootedValue senderVal(cx); if (sender) { - js_proxy_t *senderProxy = js_get_or_create_proxy(cx, sender); - senderVal.set(OBJECT_TO_JSVAL(senderProxy->obj)); + js_type_class_t *typeClass = js_get_type_from_native(sender); + auto jsobj = jsb_ref_get_or_create_jsobject(cx, sender, typeClass, "cocos2d::Node"); + senderVal.set(OBJECT_TO_JSVAL(jsobj)); } else { @@ -4258,8 +4254,6 @@ bool js_cocos2dx_CCGLProgram_setUniformLocationWith4f(JSContext *cx, uint32_t ar args.rval().setUndefined(); return true; - JS_ReportError(cx, "wrong number of arguments: %d, was expecting %d", argc, 5); - return false; } bool js_cocos2dx_CCGLProgram_setUniformLocationWithMatrixfvUnion(JSContext *cx, uint32_t argc, jsval *vp) @@ -4318,32 +4312,23 @@ bool js_cocos2dx_CCGLProgram_create(JSContext *cx, uint32_t argc, jsval *vp) std::string arg0_tmp; ok &= jsval_to_std_string(cx, args.get(0), &arg0_tmp); arg0 = arg0_tmp.c_str(); std::string arg1_tmp; ok &= jsval_to_std_string(cx, args.get(1), &arg1_tmp); arg1 = arg1_tmp.c_str(); - GLProgram* ret = new GLProgram(); - ret->autorelease(); + GLProgram* ret = new (std::nothrow) cocos2d::GLProgram; + ok = ret->initWithFilenames(arg0, arg1); - ret->initWithFilenames(arg0, arg1); - - jsval jsret; - do { - if (ret) { - js_proxy_t *p = jsb_get_native_proxy(ret); - if (p) { - jsret = OBJECT_TO_JSVAL(p->obj); - } else { - // create a new js obj of that class - js_proxy_t *proxy = js_get_or_create_proxy(cx, ret); - jsret = OBJECT_TO_JSVAL(proxy->obj); - } - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); - return true; + if (ok) + { + js_type_class_t *typeClass = js_get_type_from_native(ret); + // link the native object with the javascript object + JS::RootedObject jsobj(cx, jsb_ref_create_jsobject(cx, ret, typeClass, "cocos2d::GLProgram")); + args.rval().set(OBJECT_TO_JSVAL(jsobj)); + return true; + } + JS_ReportError(cx, "Error creating GLProgram"); + return false; } - +// TODO: This function doesn't have test. I was impossible to test it bool js_cocos2dx_CCGLProgram_createWithString(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); @@ -4357,25 +4342,17 @@ bool js_cocos2dx_CCGLProgram_createWithString(JSContext *cx, uint32_t argc, jsva std::string arg0_tmp; ok &= jsval_to_std_string(cx, args.get(0), &arg0_tmp); arg0 = arg0_tmp.c_str(); std::string arg1_tmp; ok &= jsval_to_std_string(cx, args.get(1), &arg1_tmp); arg1 = arg1_tmp.c_str(); - GLProgram* ret = new GLProgram(); - ret->initWithByteArrays(arg0, arg1); + GLProgram* ret = new (std::nothrow) GLProgram; + ok = ret->initWithByteArrays(arg0, arg1); - jsval jsret; - do { - if (ret) { - js_proxy_t *p = jsb_get_native_proxy(ret); - if (p) { - jsret = OBJECT_TO_JSVAL(p->obj); - } else { - // create a new js obj of that class - js_proxy_t *proxy = js_get_or_create_proxy(cx, ret); - jsret = OBJECT_TO_JSVAL(proxy->obj); - } - } else { - jsret = JSVAL_NULL; - } - } while (0); - args.rval().set(jsret); + if (ok) + { + js_type_class_t *typeClass = js_get_type_from_native(ret); + // link the native object with the javascript object + JS::RootedObject jsobj(cx, jsb_ref_create_jsobject(cx, ret, typeClass, "cocos2d::GLProgram")); + args.rval().set(OBJECT_TO_JSVAL(jsobj)); + return true; + } return true; } diff --git a/cocos/scripting/js-bindings/manual/js_manual_conversions.cpp b/cocos/scripting/js-bindings/manual/js_manual_conversions.cpp index d47a1699de..d5a1b12abe 100644 --- a/cocos/scripting/js-bindings/manual/js_manual_conversions.cpp +++ b/cocos/scripting/js-bindings/manual/js_manual_conversions.cpp @@ -27,7 +27,7 @@ #include "js_manual_conversions.h" #include "cocos2d_specifics.hpp" #include "math/TransformUtils.h" -#include "2d/CocosStudioExtension.h" +#include "editor-support/cocostudio/CocosStudioExtension.h" USING_NS_CC; diff --git a/cocos/scripting/lua-bindings/auto/api/Camera.lua b/cocos/scripting/lua-bindings/auto/api/Camera.lua index 6ea9a0a87c..e407891539 100644 --- a/cocos/scripting/lua-bindings/auto/api/Camera.lua +++ b/cocos/scripting/lua-bindings/auto/api/Camera.lua @@ -59,6 +59,12 @@ -- @param self -- @return mat4_table#mat4_table ret (return value: mat4_table) +-------------------------------- +-- +-- @function [parent=#Camera] isBrushValid +-- @param self +-- @return bool#bool ret (return value: bool) + -------------------------------- -- Get object depth towards camera -- @function [parent=#Camera] getDepthInView diff --git a/cocos/scripting/lua-bindings/auto/api/CameraBackgroundBrush.lua b/cocos/scripting/lua-bindings/auto/api/CameraBackgroundBrush.lua index bce2bc8585..e9a2bb3d95 100644 --- a/cocos/scripting/lua-bindings/auto/api/CameraBackgroundBrush.lua +++ b/cocos/scripting/lua-bindings/auto/api/CameraBackgroundBrush.lua @@ -24,6 +24,12 @@ -- @param self -- @return bool#bool ret (return value: bool) +-------------------------------- +-- +-- @function [parent=#CameraBackgroundBrush] isValid +-- @param self +-- @return bool#bool ret (return value: bool) + -------------------------------- -- Creates a Skybox brush with 6 textures.
-- param positive_x texture for the right side of the texture cube face.
diff --git a/cocos/scripting/lua-bindings/auto/api/CameraBackgroundSkyBoxBrush.lua b/cocos/scripting/lua-bindings/auto/api/CameraBackgroundSkyBoxBrush.lua index 71543103ad..453a5ce584 100644 --- a/cocos/scripting/lua-bindings/auto/api/CameraBackgroundSkyBoxBrush.lua +++ b/cocos/scripting/lua-bindings/auto/api/CameraBackgroundSkyBoxBrush.lua @@ -4,6 +4,13 @@ -- @extend CameraBackgroundBrush -- @parent_module cc +-------------------------------- +-- +-- @function [parent=#CameraBackgroundSkyBoxBrush] setTextureValid +-- @param self +-- @param #bool valid +-- @return CameraBackgroundSkyBoxBrush#CameraBackgroundSkyBoxBrush self (return value: cc.CameraBackgroundSkyBoxBrush) + -------------------------------- -- Set skybox texture
-- param texture Skybox texture @@ -12,6 +19,19 @@ -- @param #cc.TextureCube texture -- @return CameraBackgroundSkyBoxBrush#CameraBackgroundSkyBoxBrush self (return value: cc.CameraBackgroundSkyBoxBrush) +-------------------------------- +-- +-- @function [parent=#CameraBackgroundSkyBoxBrush] setActived +-- @param self +-- @param #bool actived +-- @return CameraBackgroundSkyBoxBrush#CameraBackgroundSkyBoxBrush self (return value: cc.CameraBackgroundSkyBoxBrush) + +-------------------------------- +-- +-- @function [parent=#CameraBackgroundSkyBoxBrush] isActived +-- @param self +-- @return bool#bool ret (return value: bool) + -------------------------------- -- @overload self -- @overload self, string, string, string, string, string, string @@ -45,6 +65,12 @@ -- @param self -- @return bool#bool ret (return value: bool) +-------------------------------- +-- +-- @function [parent=#CameraBackgroundSkyBoxBrush] isValid +-- @param self +-- @return bool#bool ret (return value: bool) + -------------------------------- -- -- @function [parent=#CameraBackgroundSkyBoxBrush] CameraBackgroundSkyBoxBrush diff --git a/cocos/scripting/lua-bindings/auto/api/DrawNode.lua b/cocos/scripting/lua-bindings/auto/api/DrawNode.lua index 6dd834759e..f8df2f2417 100644 --- a/cocos/scripting/lua-bindings/auto/api/DrawNode.lua +++ b/cocos/scripting/lua-bindings/auto/api/DrawNode.lua @@ -185,6 +185,12 @@ -- @param #color4f_table color -- @return DrawNode#DrawNode self (return value: cc.DrawNode) +-------------------------------- +-- +-- @function [parent=#DrawNode] getLineWidth +-- @param self +-- @return float#float ret (return value: float) + -------------------------------- -- Draw a point.
-- param point A Vec2 used to point.
diff --git a/cocos/scripting/lua-bindings/auto/api/ParticleSystem.lua b/cocos/scripting/lua-bindings/auto/api/ParticleSystem.lua index 66c3d7b3ab..d9e5de1645 100644 --- a/cocos/scripting/lua-bindings/auto/api/ParticleSystem.lua +++ b/cocos/scripting/lua-bindings/auto/api/ParticleSystem.lua @@ -380,6 +380,12 @@ -- @param self -- @return float#float ret (return value: float) +-------------------------------- +-- +-- @function [parent=#ParticleSystem] getResourceFile +-- @param self +-- @return string#string ret (return value: string) + -------------------------------- -- Gets the number of degrees to rotate a particle around the source pos per second.
-- return The number of degrees to rotate a particle around the source pos per second. diff --git a/cocos/scripting/lua-bindings/auto/api/Sprite.lua b/cocos/scripting/lua-bindings/auto/api/Sprite.lua index 8ec4c7c92d..d433a671ea 100644 --- a/cocos/scripting/lua-bindings/auto/api/Sprite.lua +++ b/cocos/scripting/lua-bindings/auto/api/Sprite.lua @@ -42,6 +42,12 @@ -- @param #bool flippedX -- @return Sprite#Sprite self (return value: cc.Sprite) +-------------------------------- +-- / @} +-- @function [parent=#Sprite] getResourceType +-- @param self +-- @return int#int ret (return value: int) + -------------------------------- -- @overload self, cc.Texture2D, rect_table -- @overload self, cc.Texture2D @@ -152,6 +158,12 @@ -- @param self -- @return SpriteFrame#SpriteFrame ret (return value: cc.SpriteFrame) +-------------------------------- +-- +-- @function [parent=#Sprite] getResourceName +-- @param self +-- @return string#string ret (return value: string) + -------------------------------- -- Whether or not the Sprite needs to be updated in the Atlas.
-- return True if the sprite needs to be updated in the Atlas, false otherwise. diff --git a/cocos/scripting/lua-bindings/auto/api/SpriteFrameCache.lua b/cocos/scripting/lua-bindings/auto/api/SpriteFrameCache.lua index e546699c01..06953737c6 100644 --- a/cocos/scripting/lua-bindings/auto/api/SpriteFrameCache.lua +++ b/cocos/scripting/lua-bindings/auto/api/SpriteFrameCache.lua @@ -4,6 +4,13 @@ -- @extend Ref -- @parent_module cc +-------------------------------- +-- +-- @function [parent=#SpriteFrameCache] reloadTexture +-- @param self +-- @param #string plist +-- @return bool#bool ret (return value: bool) + -------------------------------- -- Adds multiple Sprite Frames from a plist file content. The texture will be associated with the created sprite frames.
-- js NA
diff --git a/cocos/scripting/lua-bindings/auto/api/TMXMapInfo.lua b/cocos/scripting/lua-bindings/auto/api/TMXMapInfo.lua index 619877b1d6..122a11c6f5 100644 --- a/cocos/scripting/lua-bindings/auto/api/TMXMapInfo.lua +++ b/cocos/scripting/lua-bindings/auto/api/TMXMapInfo.lua @@ -130,6 +130,12 @@ -- @param self -- @return map_table#map_table ret (return value: map_table) +-------------------------------- +-- +-- @function [parent=#TMXMapInfo] getExternalTilesetFileName +-- @param self +-- @return string#string ret (return value: string) + -------------------------------- -- @overload self -- @overload self diff --git a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.cpp b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.cpp index 9a9c637444..1e4ee24c1c 100644 --- a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.cpp +++ b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.cpp @@ -50736,6 +50736,53 @@ int lua_cocos2dx_DrawNode_drawSolidRect(lua_State* tolua_S) return 0; } +int lua_cocos2dx_DrawNode_getLineWidth(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::DrawNode* 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.DrawNode",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::DrawNode*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_DrawNode_getLineWidth'", 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_DrawNode_getLineWidth'", nullptr); + return 0; + } + double ret = cobj->getLineWidth(); + 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.DrawNode:getLineWidth",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_DrawNode_getLineWidth'.",&tolua_err); +#endif + + return 0; +} int lua_cocos2dx_DrawNode_drawPoint(lua_State* tolua_S) { int argc = 0; @@ -50883,6 +50930,19 @@ int lua_cocos2dx_DrawNode_create(lua_State* tolua_S) object_to_luaval(tolua_S, "cc.DrawNode",(cocos2d::DrawNode*)ret); return 1; } + if (argc == 1) + { + int arg0; + ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "cc.DrawNode:create"); + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_DrawNode_create'", nullptr); + return 0; + } + cocos2d::DrawNode* ret = cocos2d::DrawNode::create(arg0); + object_to_luaval(tolua_S, "cc.DrawNode",(cocos2d::DrawNode*)ret); + return 1; + } luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d\n ", "cc.DrawNode:create",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 @@ -50918,6 +50978,23 @@ int lua_cocos2dx_DrawNode_constructor(lua_State* tolua_S) toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)cobj,"cc.DrawNode"); return 1; } + if (argc == 1) + { + int arg0; + + ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "cc.DrawNode:DrawNode"); + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_DrawNode_constructor'", nullptr); + return 0; + } + cobj = new cocos2d::DrawNode(arg0); + cobj->autorelease(); + int ID = (int)cobj->_ID ; + int* luaID = &cobj->_luaID ; + toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)cobj,"cc.DrawNode"); + return 1; + } luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.DrawNode:DrawNode",argc, 0); return 0; @@ -50957,6 +51034,7 @@ int lua_register_cocos2dx_DrawNode(lua_State* tolua_S) tolua_function(tolua_S,"setBlendFunc",lua_cocos2dx_DrawNode_setBlendFunc); tolua_function(tolua_S,"clear",lua_cocos2dx_DrawNode_clear); tolua_function(tolua_S,"drawSolidRect",lua_cocos2dx_DrawNode_drawSolidRect); + tolua_function(tolua_S,"getLineWidth",lua_cocos2dx_DrawNode_getLineWidth); tolua_function(tolua_S,"drawPoint",lua_cocos2dx_DrawNode_drawPoint); tolua_function(tolua_S,"drawCubicBezier",lua_cocos2dx_DrawNode_drawCubicBezier); tolua_function(tolua_S,"create", lua_cocos2dx_DrawNode_create); @@ -63953,6 +64031,53 @@ int lua_cocos2dx_ParticleSystem_getStartSpin(lua_State* tolua_S) return 0; } +int lua_cocos2dx_ParticleSystem_getResourceFile(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::ParticleSystem* 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.ParticleSystem",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::ParticleSystem*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ParticleSystem_getResourceFile'", 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_ParticleSystem_getResourceFile'", nullptr); + return 0; + } + const std::string ret = cobj->getResourceFile(); + tolua_pushcppstring(tolua_S,ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.ParticleSystem:getResourceFile",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ParticleSystem_getResourceFile'.",&tolua_err); +#endif + + return 0; +} int lua_cocos2dx_ParticleSystem_getRotatePerSecond(lua_State* tolua_S) { int argc = 0; @@ -66413,6 +66538,7 @@ int lua_register_cocos2dx_ParticleSystem(lua_State* tolua_S) tolua_function(tolua_S,"setStartSize",lua_cocos2dx_ParticleSystem_setStartSize); tolua_function(tolua_S,"setSpeed",lua_cocos2dx_ParticleSystem_setSpeed); tolua_function(tolua_S,"getStartSpin",lua_cocos2dx_ParticleSystem_getStartSpin); + tolua_function(tolua_S,"getResourceFile",lua_cocos2dx_ParticleSystem_getResourceFile); tolua_function(tolua_S,"getRotatePerSecond",lua_cocos2dx_ParticleSystem_getRotatePerSecond); tolua_function(tolua_S,"setEmitterMode",lua_cocos2dx_ParticleSystem_setEmitterMode); tolua_function(tolua_S,"getDuration",lua_cocos2dx_ParticleSystem_getDuration); @@ -70844,6 +70970,53 @@ int lua_cocos2dx_Sprite_setFlippedX(lua_State* tolua_S) return 0; } +int lua_cocos2dx_Sprite_getResourceType(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Sprite* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.Sprite",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_getResourceType'", 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_Sprite_getResourceType'", nullptr); + return 0; + } + const int ret = cobj->getResourceType(); + 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.Sprite:getResourceType",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_getResourceType'.",&tolua_err); +#endif + + return 0; +} int lua_cocos2dx_Sprite_initWithTexture(lua_State* tolua_S) { int argc = 0; @@ -71524,6 +71697,53 @@ int lua_cocos2dx_Sprite_getSpriteFrame(lua_State* tolua_S) return 0; } +int lua_cocos2dx_Sprite_getResourceName(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Sprite* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.Sprite",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_getResourceName'", 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_Sprite_getResourceName'", nullptr); + return 0; + } + const std::string ret = cobj->getResourceName(); + tolua_pushcppstring(tolua_S,ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite:getResourceName",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_getResourceName'.",&tolua_err); +#endif + + return 0; +} int lua_cocos2dx_Sprite_isDirty(lua_State* tolua_S) { int argc = 0; @@ -72312,6 +72532,7 @@ int lua_register_cocos2dx_Sprite(lua_State* tolua_S) tolua_function(tolua_S,"getTexture",lua_cocos2dx_Sprite_getTexture); tolua_function(tolua_S,"setFlippedY",lua_cocos2dx_Sprite_setFlippedY); tolua_function(tolua_S,"setFlippedX",lua_cocos2dx_Sprite_setFlippedX); + tolua_function(tolua_S,"getResourceType",lua_cocos2dx_Sprite_getResourceType); tolua_function(tolua_S,"initWithTexture",lua_cocos2dx_Sprite_initWithTexture); tolua_function(tolua_S,"getBatchNode",lua_cocos2dx_Sprite_getBatchNode); tolua_function(tolua_S,"getOffsetPosition",lua_cocos2dx_Sprite_getOffsetPosition); @@ -72325,6 +72546,7 @@ int lua_register_cocos2dx_Sprite(lua_State* tolua_S) tolua_function(tolua_S,"setDisplayFrameWithAnimationName",lua_cocos2dx_Sprite_setDisplayFrameWithAnimationName); tolua_function(tolua_S,"setTextureAtlas",lua_cocos2dx_Sprite_setTextureAtlas); tolua_function(tolua_S,"getSpriteFrame",lua_cocos2dx_Sprite_getSpriteFrame); + tolua_function(tolua_S,"getResourceName",lua_cocos2dx_Sprite_getResourceName); tolua_function(tolua_S,"isDirty",lua_cocos2dx_Sprite_isDirty); tolua_function(tolua_S,"setAtlasIndex",lua_cocos2dx_Sprite_setAtlasIndex); tolua_function(tolua_S,"setDirty",lua_cocos2dx_Sprite_setDirty); @@ -78936,6 +79158,53 @@ int lua_cocos2dx_Camera_getProjectionMatrix(lua_State* tolua_S) return 0; } +int lua_cocos2dx_Camera_isBrushValid(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Camera* 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.Camera",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Camera*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Camera_isBrushValid'", 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_Camera_isBrushValid'", nullptr); + return 0; + } + bool ret = cobj->isBrushValid(); + tolua_pushboolean(tolua_S,(bool)ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Camera:isBrushValid",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Camera_isBrushValid'.",&tolua_err); +#endif + + return 0; +} int lua_cocos2dx_Camera_getDepthInView(lua_State* tolua_S) { int argc = 0; @@ -80340,6 +80609,7 @@ int lua_register_cocos2dx_Camera(lua_State* tolua_S) tolua_function(tolua_S,"apply",lua_cocos2dx_Camera_apply); tolua_function(tolua_S,"getBackgroundBrush",lua_cocos2dx_Camera_getBackgroundBrush); tolua_function(tolua_S,"getProjectionMatrix",lua_cocos2dx_Camera_getProjectionMatrix); + tolua_function(tolua_S,"isBrushValid",lua_cocos2dx_Camera_isBrushValid); tolua_function(tolua_S,"getDepthInView",lua_cocos2dx_Camera_getDepthInView); tolua_function(tolua_S,"clearBackground",lua_cocos2dx_Camera_clearBackground); tolua_function(tolua_S,"setAdditionalProjection",lua_cocos2dx_Camera_setAdditionalProjection); @@ -80520,6 +80790,53 @@ int lua_cocos2dx_CameraBackgroundBrush_init(lua_State* tolua_S) return 0; } +int lua_cocos2dx_CameraBackgroundBrush_isValid(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::CameraBackgroundBrush* 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.CameraBackgroundBrush",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::CameraBackgroundBrush*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_CameraBackgroundBrush_isValid'", 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_CameraBackgroundBrush_isValid'", nullptr); + return 0; + } + bool ret = cobj->isValid(); + tolua_pushboolean(tolua_S,(bool)ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.CameraBackgroundBrush:isValid",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_CameraBackgroundBrush_isValid'.",&tolua_err); +#endif + + return 0; +} int lua_cocos2dx_CameraBackgroundBrush_createSkyboxBrush(lua_State* tolua_S) { int argc = 0; @@ -80738,6 +81055,7 @@ int lua_register_cocos2dx_CameraBackgroundBrush(lua_State* tolua_S) tolua_function(tolua_S,"getBrushType",lua_cocos2dx_CameraBackgroundBrush_getBrushType); tolua_function(tolua_S,"drawBackground",lua_cocos2dx_CameraBackgroundBrush_drawBackground); tolua_function(tolua_S,"init",lua_cocos2dx_CameraBackgroundBrush_init); + tolua_function(tolua_S,"isValid",lua_cocos2dx_CameraBackgroundBrush_isValid); tolua_function(tolua_S,"createSkyboxBrush", lua_cocos2dx_CameraBackgroundBrush_createSkyboxBrush); tolua_function(tolua_S,"createColorBrush", lua_cocos2dx_CameraBackgroundBrush_createColorBrush); tolua_function(tolua_S,"createNoneBrush", lua_cocos2dx_CameraBackgroundBrush_createNoneBrush); @@ -81041,6 +81359,56 @@ int lua_register_cocos2dx_CameraBackgroundColorBrush(lua_State* tolua_S) return 1; } +int lua_cocos2dx_CameraBackgroundSkyBoxBrush_setTextureValid(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::CameraBackgroundSkyBoxBrush* 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.CameraBackgroundSkyBoxBrush",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::CameraBackgroundSkyBoxBrush*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_CameraBackgroundSkyBoxBrush_setTextureValid'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + bool arg0; + + ok &= luaval_to_boolean(tolua_S, 2,&arg0, "cc.CameraBackgroundSkyBoxBrush:setTextureValid"); + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_CameraBackgroundSkyBoxBrush_setTextureValid'", nullptr); + return 0; + } + cobj->setTextureValid(arg0); + lua_settop(tolua_S, 1); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.CameraBackgroundSkyBoxBrush:setTextureValid",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_CameraBackgroundSkyBoxBrush_setTextureValid'.",&tolua_err); +#endif + + return 0; +} int lua_cocos2dx_CameraBackgroundSkyBoxBrush_setTexture(lua_State* tolua_S) { int argc = 0; @@ -81091,6 +81459,103 @@ int lua_cocos2dx_CameraBackgroundSkyBoxBrush_setTexture(lua_State* tolua_S) return 0; } +int lua_cocos2dx_CameraBackgroundSkyBoxBrush_setActived(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::CameraBackgroundSkyBoxBrush* 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.CameraBackgroundSkyBoxBrush",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::CameraBackgroundSkyBoxBrush*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_CameraBackgroundSkyBoxBrush_setActived'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + bool arg0; + + ok &= luaval_to_boolean(tolua_S, 2,&arg0, "cc.CameraBackgroundSkyBoxBrush:setActived"); + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_CameraBackgroundSkyBoxBrush_setActived'", nullptr); + return 0; + } + cobj->setActived(arg0); + lua_settop(tolua_S, 1); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.CameraBackgroundSkyBoxBrush:setActived",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_CameraBackgroundSkyBoxBrush_setActived'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_CameraBackgroundSkyBoxBrush_isActived(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::CameraBackgroundSkyBoxBrush* 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.CameraBackgroundSkyBoxBrush",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::CameraBackgroundSkyBoxBrush*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_CameraBackgroundSkyBoxBrush_isActived'", 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_CameraBackgroundSkyBoxBrush_isActived'", nullptr); + return 0; + } + bool ret = cobj->isActived(); + tolua_pushboolean(tolua_S,(bool)ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.CameraBackgroundSkyBoxBrush:isActived",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_CameraBackgroundSkyBoxBrush_isActived'.",&tolua_err); +#endif + + return 0; +} int lua_cocos2dx_CameraBackgroundSkyBoxBrush_create(lua_State* tolua_S) { int argc = 0; @@ -81201,7 +81666,10 @@ int lua_register_cocos2dx_CameraBackgroundSkyBoxBrush(lua_State* tolua_S) tolua_beginmodule(tolua_S,"CameraBackgroundSkyBoxBrush"); tolua_function(tolua_S,"new",lua_cocos2dx_CameraBackgroundSkyBoxBrush_constructor); + tolua_function(tolua_S,"setTextureValid",lua_cocos2dx_CameraBackgroundSkyBoxBrush_setTextureValid); tolua_function(tolua_S,"setTexture",lua_cocos2dx_CameraBackgroundSkyBoxBrush_setTexture); + tolua_function(tolua_S,"setActived",lua_cocos2dx_CameraBackgroundSkyBoxBrush_setActived); + tolua_function(tolua_S,"isActived",lua_cocos2dx_CameraBackgroundSkyBoxBrush_isActived); tolua_function(tolua_S,"create", lua_cocos2dx_CameraBackgroundSkyBoxBrush_create); tolua_endmodule(tolua_S); std::string typeName = typeid(cocos2d::CameraBackgroundSkyBoxBrush).name(); @@ -90576,6 +91044,56 @@ int lua_register_cocos2dx_SpriteBatchNode(lua_State* tolua_S) return 1; } +int lua_cocos2dx_SpriteFrameCache_reloadTexture(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::SpriteFrameCache* 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.SpriteFrameCache",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::SpriteFrameCache*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_SpriteFrameCache_reloadTexture'", 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.SpriteFrameCache:reloadTexture"); + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_SpriteFrameCache_reloadTexture'", nullptr); + return 0; + } + bool ret = cobj->reloadTexture(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.SpriteFrameCache:reloadTexture",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_SpriteFrameCache_reloadTexture'.",&tolua_err); +#endif + + return 0; +} int lua_cocos2dx_SpriteFrameCache_addSpriteFramesWithFileContent(lua_State* tolua_S) { int argc = 0; @@ -91278,6 +91796,7 @@ int lua_register_cocos2dx_SpriteFrameCache(lua_State* tolua_S) tolua_cclass(tolua_S,"SpriteFrameCache","cc.SpriteFrameCache","cc.Ref",nullptr); tolua_beginmodule(tolua_S,"SpriteFrameCache"); + tolua_function(tolua_S,"reloadTexture",lua_cocos2dx_SpriteFrameCache_reloadTexture); tolua_function(tolua_S,"addSpriteFramesWithFileContent",lua_cocos2dx_SpriteFrameCache_addSpriteFramesWithFileContent); tolua_function(tolua_S,"addSpriteFrame",lua_cocos2dx_SpriteFrameCache_addSpriteFrame); tolua_function(tolua_S,"addSpriteFrames",lua_cocos2dx_SpriteFrameCache_addSpriteFramesWithFile); @@ -93247,6 +93766,53 @@ int lua_cocos2dx_TMXMapInfo_getTileProperties(lua_State* tolua_S) return 0; } +int lua_cocos2dx_TMXMapInfo_getExternalTilesetFileName(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::TMXMapInfo* 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.TMXMapInfo",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::TMXMapInfo*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_TMXMapInfo_getExternalTilesetFileName'", 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_TMXMapInfo_getExternalTilesetFileName'", nullptr); + return 0; + } + const std::string& ret = cobj->getExternalTilesetFileName(); + tolua_pushcppstring(tolua_S,ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.TMXMapInfo:getExternalTilesetFileName",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_TMXMapInfo_getExternalTilesetFileName'.",&tolua_err); +#endif + + return 0; +} int lua_cocos2dx_TMXMapInfo_getObjectGroups(lua_State* tolua_S) { int argc = 0; @@ -94025,6 +94591,7 @@ int lua_register_cocos2dx_TMXMapInfo(lua_State* tolua_S) tolua_function(tolua_S,"getLayerAttribs",lua_cocos2dx_TMXMapInfo_getLayerAttribs); tolua_function(tolua_S,"getTileSize",lua_cocos2dx_TMXMapInfo_getTileSize); tolua_function(tolua_S,"getTileProperties",lua_cocos2dx_TMXMapInfo_getTileProperties); + tolua_function(tolua_S,"getExternalTilesetFileName",lua_cocos2dx_TMXMapInfo_getExternalTilesetFileName); tolua_function(tolua_S,"getObjectGroups",lua_cocos2dx_TMXMapInfo_getObjectGroups); tolua_function(tolua_S,"getTMXFileName",lua_cocos2dx_TMXMapInfo_getTMXFileName); tolua_function(tolua_S,"setCurrentString",lua_cocos2dx_TMXMapInfo_setCurrentString); @@ -95264,6 +95831,53 @@ int lua_cocos2dx_TMXTiledMap_getProperty(lua_State* tolua_S) return 0; } +int lua_cocos2dx_TMXTiledMap_getLayerNum(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::TMXTiledMap* 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.TMXTiledMap",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::TMXTiledMap*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_TMXTiledMap_getLayerNum'", 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_TMXTiledMap_getLayerNum'", nullptr); + return 0; + } + int ret = cobj->getLayerNum(); + 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.TMXTiledMap:getLayerNum",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_TMXTiledMap_getLayerNum'.",&tolua_err); +#endif + + return 0; +} int lua_cocos2dx_TMXTiledMap_setMapSize(lua_State* tolua_S) { int argc = 0; @@ -95411,7 +96025,7 @@ int lua_cocos2dx_TMXTiledMap_getObjectGroups(lua_State* tolua_S) return 0; } -int lua_cocos2dx_TMXTiledMap_initWithXML(lua_State* tolua_S) +int lua_cocos2dx_TMXTiledMap_getResourceFile(lua_State* tolua_S) { int argc = 0; cocos2d::TMXTiledMap* cobj = nullptr; @@ -95431,35 +96045,29 @@ int lua_cocos2dx_TMXTiledMap_initWithXML(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_TMXTiledMap_initWithXML'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_TMXTiledMap_getResourceFile'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 2) + if (argc == 0) { - std::string arg0; - std::string arg1; - - ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.TMXTiledMap:initWithXML"); - - ok &= luaval_to_std_string(tolua_S, 3,&arg1, "cc.TMXTiledMap:initWithXML"); if(!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_TMXTiledMap_initWithXML'", nullptr); + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_TMXTiledMap_getResourceFile'", nullptr); return 0; } - bool ret = cobj->initWithXML(arg0, arg1); - tolua_pushboolean(tolua_S,(bool)ret); + const std::string ret = cobj->getResourceFile(); + tolua_pushcppstring(tolua_S,ret); return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.TMXTiledMap:initWithXML",argc, 2); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.TMXTiledMap:getResourceFile",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_TMXTiledMap_initWithXML'.",&tolua_err); + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_TMXTiledMap_getResourceFile'.",&tolua_err); #endif return 0; @@ -95608,6 +96216,59 @@ int lua_cocos2dx_TMXTiledMap_getMapSize(lua_State* tolua_S) return 0; } +int lua_cocos2dx_TMXTiledMap_initWithXML(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::TMXTiledMap* 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.TMXTiledMap",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::TMXTiledMap*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_TMXTiledMap_initWithXML'", 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.TMXTiledMap:initWithXML"); + + ok &= luaval_to_std_string(tolua_S, 3,&arg1, "cc.TMXTiledMap:initWithXML"); + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_TMXTiledMap_initWithXML'", nullptr); + return 0; + } + bool ret = cobj->initWithXML(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.TMXTiledMap:initWithXML",argc, 2); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_TMXTiledMap_initWithXML'.",&tolua_err); +#endif + + return 0; +} int lua_cocos2dx_TMXTiledMap_getProperties(lua_State* tolua_S) { int argc = 0; @@ -96028,13 +96689,15 @@ int lua_register_cocos2dx_TMXTiledMap(lua_State* tolua_S) tolua_function(tolua_S,"new",lua_cocos2dx_TMXTiledMap_constructor); tolua_function(tolua_S,"setObjectGroups",lua_cocos2dx_TMXTiledMap_setObjectGroups); tolua_function(tolua_S,"getProperty",lua_cocos2dx_TMXTiledMap_getProperty); + tolua_function(tolua_S,"getLayerNum",lua_cocos2dx_TMXTiledMap_getLayerNum); tolua_function(tolua_S,"setMapSize",lua_cocos2dx_TMXTiledMap_setMapSize); tolua_function(tolua_S,"getObjectGroup",lua_cocos2dx_TMXTiledMap_getObjectGroup); tolua_function(tolua_S,"getObjectGroups",lua_cocos2dx_TMXTiledMap_getObjectGroups); - tolua_function(tolua_S,"initWithXML",lua_cocos2dx_TMXTiledMap_initWithXML); + tolua_function(tolua_S,"getResourceFile",lua_cocos2dx_TMXTiledMap_getResourceFile); tolua_function(tolua_S,"initWithTMXFile",lua_cocos2dx_TMXTiledMap_initWithTMXFile); tolua_function(tolua_S,"getTileSize",lua_cocos2dx_TMXTiledMap_getTileSize); tolua_function(tolua_S,"getMapSize",lua_cocos2dx_TMXTiledMap_getMapSize); + tolua_function(tolua_S,"initWithXML",lua_cocos2dx_TMXTiledMap_initWithXML); tolua_function(tolua_S,"getProperties",lua_cocos2dx_TMXTiledMap_getProperties); tolua_function(tolua_S,"setTileSize",lua_cocos2dx_TMXTiledMap_setTileSize); tolua_function(tolua_S,"setProperties",lua_cocos2dx_TMXTiledMap_setProperties); diff --git a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.hpp b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.hpp index fc6f461e6d..f1b53ac43b 100644 --- a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.hpp +++ b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.hpp @@ -2150,6 +2150,19 @@ int register_all_cocos2dx(lua_State* tolua_S); + + + + + + + + + + + + + diff --git a/cocos/scripting/lua-bindings/manual/LuaBasicConversions.h b/cocos/scripting/lua-bindings/manual/LuaBasicConversions.h index 2ef1bc8385..e9acb967e7 100644 --- a/cocos/scripting/lua-bindings/manual/LuaBasicConversions.h +++ b/cocos/scripting/lua-bindings/manual/LuaBasicConversions.h @@ -31,6 +31,7 @@ extern "C" { #include "tolua_fix.h" #include "cocos2d.h" #include "Lua-BindingsExport.h" +#include "editor-support/cocostudio/CocosStudioExtension.h" using namespace cocos2d; diff --git a/cocos/ui/CocosGUI.h b/cocos/ui/CocosGUI.h index 856b6fed28..c229afef98 100644 --- a/cocos/ui/CocosGUI.h +++ b/cocos/ui/CocosGUI.h @@ -57,7 +57,7 @@ THE SOFTWARE. #include "ui/UIScale9Sprite.h" #include "ui/UIEditBox/UIEditBox.h" #include "ui/UILayoutComponent.h" -#include "2d/CocosStudioExtension.h" +#include "editor-support/cocostudio/CocosStudioExtension.h" /** * @addtogroup ui diff --git a/cocos/ui/UIAbstractCheckButton.cpp b/cocos/ui/UIAbstractCheckButton.cpp index cfff50539f..fa80d68e09 100644 --- a/cocos/ui/UIAbstractCheckButton.cpp +++ b/cocos/ui/UIAbstractCheckButton.cpp @@ -24,7 +24,7 @@ THE SOFTWARE. #include "ui/UIAbstractCheckButton.h" #include "2d/CCSprite.h" -#include "2d/CocosStudioExtension.h" +#include "editor-support/cocostudio/CocosStudioExtension.h" NS_CC_BEGIN diff --git a/cocos/ui/UIButton.cpp b/cocos/ui/UIButton.cpp index bfdd983805..960d8eee35 100644 --- a/cocos/ui/UIButton.cpp +++ b/cocos/ui/UIButton.cpp @@ -30,7 +30,7 @@ THE SOFTWARE. #include "platform/CCFileUtils.h" #include "ui/UIHelper.h" #include -#include "2d/CocosStudioExtension.h" +#include "editor-support/cocostudio/CocosStudioExtension.h" NS_CC_BEGIN diff --git a/cocos/ui/UIImageView.cpp b/cocos/ui/UIImageView.cpp index 9eb5619dda..44105340f8 100644 --- a/cocos/ui/UIImageView.cpp +++ b/cocos/ui/UIImageView.cpp @@ -26,7 +26,7 @@ THE SOFTWARE. #include "ui/UIScale9Sprite.h" #include "ui/UIHelper.h" #include "2d/CCSprite.h" -#include "2d/CocosStudioExtension.h" +#include "editor-support/cocostudio/CocosStudioExtension.h" NS_CC_BEGIN diff --git a/cocos/ui/UILayout.cpp b/cocos/ui/UILayout.cpp index 6603846d9b..c620077966 100644 --- a/cocos/ui/UILayout.cpp +++ b/cocos/ui/UILayout.cpp @@ -38,7 +38,7 @@ THE SOFTWARE. #include "2d/CCSprite.h" #include "base/CCEventFocus.h" #include "base/CCStencilStateManager.hpp" -#include "2d/CocosStudioExtension.h" +#include "editor-support/cocostudio/CocosStudioExtension.h" NS_CC_BEGIN diff --git a/cocos/ui/UILoadingBar.cpp b/cocos/ui/UILoadingBar.cpp index ab403122a7..8daeb67e9e 100644 --- a/cocos/ui/UILoadingBar.cpp +++ b/cocos/ui/UILoadingBar.cpp @@ -26,7 +26,7 @@ THE SOFTWARE. #include "ui/UIHelper.h" #include "ui/UIScale9Sprite.h" #include "2d/CCSprite.h" -#include "2d/CocosStudioExtension.h" +#include "editor-support/cocostudio/CocosStudioExtension.h" NS_CC_BEGIN diff --git a/cocos/ui/UISlider.cpp b/cocos/ui/UISlider.cpp index 62a291e06e..18c85ba024 100644 --- a/cocos/ui/UISlider.cpp +++ b/cocos/ui/UISlider.cpp @@ -27,7 +27,7 @@ THE SOFTWARE. #include "ui/UIHelper.h" #include "2d/CCSprite.h" #include "2d/CCCamera.h" -#include "2d/CocosStudioExtension.h" +#include "editor-support/cocostudio/CocosStudioExtension.h" NS_CC_BEGIN diff --git a/cocos/ui/UITextAtlas.cpp b/cocos/ui/UITextAtlas.cpp index c448791f2e..a8406224db 100644 --- a/cocos/ui/UITextAtlas.cpp +++ b/cocos/ui/UITextAtlas.cpp @@ -24,7 +24,7 @@ THE SOFTWARE. #include "ui/UITextAtlas.h" #include "2d/CCLabel.h" -#include "2d/CocosStudioExtension.h" +#include "editor-support/cocostudio/CocosStudioExtension.h" NS_CC_BEGIN diff --git a/cocos/ui/UITextBMFont.cpp b/cocos/ui/UITextBMFont.cpp index 6ac518cb98..b9987ea3cb 100644 --- a/cocos/ui/UITextBMFont.cpp +++ b/cocos/ui/UITextBMFont.cpp @@ -24,7 +24,7 @@ THE SOFTWARE. #include "ui/UITextBMFont.h" #include "2d/CCLabel.h" -#include "2d/CocosStudioExtension.h" +#include "editor-support/cocostudio/CocosStudioExtension.h" NS_CC_BEGIN diff --git a/plugin b/plugin index ad539b56c5..4b68a78781 160000 --- a/plugin +++ b/plugin @@ -1 +1 @@ -Subproject commit ad539b56c5354c1083f479d4c8d275ae8c7fdfa7 +Subproject commit 4b68a78781f57c3cda70fcebb2a9066914d28efb diff --git a/templates/cocos2dx_files.json b/templates/cocos2dx_files.json index 6dee9551d0..29dcda80a1 100644 --- a/templates/cocos2dx_files.json +++ b/templates/cocos2dx_files.json @@ -187,7 +187,6 @@ "cocos/2d/CCTweenFunction.cpp", "cocos/2d/CCTweenFunction.h", "cocos/2d/CMakeLists.txt", - "cocos/2d/CocosStudioExtension.h", "cocos/2d/cocos2d.def", "cocos/2d/cocos2d_headers.props", "cocos/2d/cocos2dx.props", @@ -620,6 +619,8 @@ "cocos/editor-support/cocostudio/CocoStudio.cpp", "cocos/editor-support/cocostudio/CocoStudio.h", "cocos/editor-support/cocostudio/CocosStudioExport.h", + "cocos/editor-support/cocostudio/CocosStudioExtension.cpp", + "cocos/editor-support/cocostudio/CocosStudioExtension.h", "cocos/editor-support/cocostudio/DictionaryHelper.cpp", "cocos/editor-support/cocostudio/DictionaryHelper.h", "cocos/editor-support/cocostudio/FlatBuffersSerialize.cpp", diff --git a/tests/cpp-tests/Classes/CocosStudio3DTest/CocosStudio3DTest.cpp b/tests/cpp-tests/Classes/CocosStudio3DTest/CocosStudio3DTest.cpp index 2c21f9fabe..79f2414784 100644 --- a/tests/cpp-tests/Classes/CocosStudio3DTest/CocosStudio3DTest.cpp +++ b/tests/cpp-tests/Classes/CocosStudio3DTest/CocosStudio3DTest.cpp @@ -170,6 +170,12 @@ CSSceneSkyBoxTest::CSSceneSkyBoxTest() addChild(node); _camera = static_cast(node->getChildByName("UserCamera_0")); + CameraBackgroundSkyBoxBrush * brush = dynamic_cast(_camera->getBackgroundBrush()); + if (nullptr != brush) + { + CCLOG("CameraBackgroundSkyBoxBrush active value is : %s", brush->isActived() ? "true" : "false"); + CCLOG("CameraBackgroundSkyBoxBrush valid value is : %s", brush->isValid() ? "true" : "false"); + } auto listener = EventListenerTouchAllAtOnce::create(); listener->onTouchesMoved = CC_CALLBACK_2(CSSceneSkyBoxTest::onTouchesMoved, this); diff --git a/tests/cpp-tests/Classes/DrawPrimitivesTest/DrawPrimitivesTest.cpp b/tests/cpp-tests/Classes/DrawPrimitivesTest/DrawPrimitivesTest.cpp index 4e50aa2e24..f3048c5408 100644 --- a/tests/cpp-tests/Classes/DrawPrimitivesTest/DrawPrimitivesTest.cpp +++ b/tests/cpp-tests/Classes/DrawPrimitivesTest/DrawPrimitivesTest.cpp @@ -291,6 +291,12 @@ DrawNodeTest::DrawNodeTest() for (int i = 0; i < 100; i++) { draw->drawPoint(Vec2(i*7, 5), (float)i/5+1, Color4F(CCRANDOM_0_1(), CCRANDOM_0_1(), CCRANDOM_0_1(), 1)); } + + auto draw1 = DrawNode::create(); + this->addChild(draw1, 10); + draw1->setLineWidth(4); + draw1->drawLine(Vec2(0, s.height), Vec2(s.width, s.height - 20), Color4F::YELLOW); + draw1->drawLine(Vec2(0, 0), Vec2(s.width, s.height - 20), Color4F::YELLOW); } string DrawNodeTest::title() const diff --git a/tests/cpp-tests/Classes/LabelTest/LabelTestNew.cpp b/tests/cpp-tests/Classes/LabelTest/LabelTestNew.cpp index 71147954cc..2a3674f00b 100644 --- a/tests/cpp-tests/Classes/LabelTest/LabelTestNew.cpp +++ b/tests/cpp-tests/Classes/LabelTest/LabelTestNew.cpp @@ -497,6 +497,10 @@ LabelFNTGlyphDesigner::LabelFNTGlyphDesigner() addChild(layer, -10); auto label1 = Label::createWithBMFont("fonts/futura-48.fnt", "Testing Glyph Designer"); + // Demo for reloadFontAtlasFNT function, after it been called, all UI widget + // use the special font must reset font, because the old one is invalid. + FontAtlasCache::reloadFontAtlasFNT("fonts/futura-48.fnt"); + label1->setBMFontFilePath("fonts/futura-48.fnt"); addChild(label1); label1->setPosition(Vec2(winSize.width / 2, winSize.height * 0.4f)); @@ -933,6 +937,10 @@ LabelTTFCJKWrappingTest::LabelTTFCJKWrappingTest() label1->setPosition(Vec2(size.width * 0.1, size.height * 0.6)); label1->setAnchorPoint(Vec2(0, 0.5)); this->addChild(label1); + // Demo for unloadFontAtlasTTF function, after it been called, all UI widget + // use the special font must reset font, because the old one is invalid. + FontAtlasCache::unloadFontAtlasTTF("fonts/HKYuanMini.ttf"); + label1->setTTFConfig(ttfConfig); } auto label2 = Label::createWithTTF(ttfConfig, diff --git a/tests/cpp-tests/Classes/ParticleTest/ParticleTest.cpp b/tests/cpp-tests/Classes/ParticleTest/ParticleTest.cpp index d43e3ad46c..104b8e1c4b 100644 --- a/tests/cpp-tests/Classes/ParticleTest/ParticleTest.cpp +++ b/tests/cpp-tests/Classes/ParticleTest/ParticleTest.cpp @@ -1,5 +1,6 @@ #include "ParticleTest.h" #include "../testResource.h" +#include "editor-support/cocostudio/CocosStudioExtension.h" USING_NS_CC; diff --git a/tests/cpp-tests/Classes/ShaderTest/ShaderTest.cpp b/tests/cpp-tests/Classes/ShaderTest/ShaderTest.cpp index c3854e8992..97bd3e4235 100644 --- a/tests/cpp-tests/Classes/ShaderTest/ShaderTest.cpp +++ b/tests/cpp-tests/Classes/ShaderTest/ShaderTest.cpp @@ -361,6 +361,12 @@ SpriteBlur::~SpriteBlur() SpriteBlur* SpriteBlur::create(const char *pszFileName) { SpriteBlur* pRet = new (std::nothrow) SpriteBlur(); + if (pRet) + { + bool result = pRet->initWithFile(""); + CCLOG("Test call Sprite::initWithFile with bad file name result is : %s", result ? "true" : "false"); + } + if (pRet && pRet->initWithFile(pszFileName)) { pRet->autorelease(); diff --git a/tests/cpp-tests/Classes/Sprite3DTest/Sprite3DTest.cpp b/tests/cpp-tests/Classes/Sprite3DTest/Sprite3DTest.cpp index 6c2310d031..5c6da55cce 100644 --- a/tests/cpp-tests/Classes/Sprite3DTest/Sprite3DTest.cpp +++ b/tests/cpp-tests/Classes/Sprite3DTest/Sprite3DTest.cpp @@ -2443,6 +2443,8 @@ void CameraBackgroundClearTest::switch_CameraClearMode(cocos2d::Ref* sender) { _camera->setBackgroundBrush(CameraBackgroundBrush::createDepthBrush(1.f)); _label->setString("Depth Clear Brush"); + // Test brush valid when set by user scene setting + CCLOG("Background brush valid status is : %s", _camera->isBrushValid() ? "true" : "false"); } else if (type == CameraBackgroundBrush::BrushType::DEPTH) { diff --git a/tests/cpp-tests/Classes/SpriteTest/SpriteTest.cpp b/tests/cpp-tests/Classes/SpriteTest/SpriteTest.cpp index fdf792ea8f..3a1d31ec0d 100644 --- a/tests/cpp-tests/Classes/SpriteTest/SpriteTest.cpp +++ b/tests/cpp-tests/Classes/SpriteTest/SpriteTest.cpp @@ -27,6 +27,7 @@ #include #include "../testResource.h" +#include "editor-support/cocostudio/CocosStudioExtension.h" USING_NS_CC; @@ -1775,6 +1776,8 @@ void SpriteFrameAliasNameTest::onEnter() auto animation = Animation::createWithSpriteFrames(animFrames, 0.3f); // 14 frames * 1sec = 14 seconds sprite->runAction(RepeatForever::create(Animate::create(animation))); + + cache->reloadTexture("animations/grossini-aliases.plist"); } void SpriteFrameAliasNameTest::onExit() diff --git a/tests/cpp-tests/Classes/TileMapTest/TileMapTest.cpp b/tests/cpp-tests/Classes/TileMapTest/TileMapTest.cpp index 676df1d2f9..4d5e5fe512 100644 --- a/tests/cpp-tests/Classes/TileMapTest/TileMapTest.cpp +++ b/tests/cpp-tests/Classes/TileMapTest/TileMapTest.cpp @@ -1,6 +1,7 @@ #include "TileMapTest.h" #include "../testResource.h" + USING_NS_CC; enum diff --git a/tools/bindings-generator b/tools/bindings-generator index 76c1ae80aa..1054d94db6 160000 --- a/tools/bindings-generator +++ b/tools/bindings-generator @@ -1 +1 @@ -Subproject commit 76c1ae80aa78df9f35ad2cccd8fab9aa60cf68a6 +Subproject commit 1054d94db6d97d99d67bac22baa1d3345e2d9d0f diff --git a/tools/tojs/cocos2dx.ini b/tools/tojs/cocos2dx.ini index 411003cd71..fb01f08d91 100644 --- a/tools/tojs/cocos2dx.ini +++ b/tools/tojs/cocos2dx.ini @@ -87,8 +87,8 @@ skip = Node::[^setPosition$ setGLServerState description getUserObject .*UserDat Range::[*], NotificationObserver::[*], Image::[initWithString initWithImageData], - Sequence::[create], - Spawn::[create], + Sequence::[create init], + Spawn::[create init], RotateTo::[calculateAngles], GLProgram::[getProgram setUniformLocationWith(1|2|3|4)fv setUniformLocationWith(2|3|4)iv setUniformLocationWithMatrix(2|3|4)fv], GLProgramState::[setUniformVec4 setVertexAttribPointer], diff --git a/tools/tojs/cocos2dx_ui.ini b/tools/tojs/cocos2dx_ui.ini index 7fbfc2b67d..3b4b543fab 100644 --- a/tools/tojs/cocos2dx_ui.ini +++ b/tools/tojs/cocos2dx_ui.ini @@ -41,7 +41,7 @@ classes_need_extend = Layout Widget Button CheckBox ImageView Text TextAtlas Tex # will apply to all class names. This is a convenience wildcard to be able to skip similar named # functions from all classes. -skip = *::[^visit$ copyWith.* onEnter.* onExit.* ^description$ getObjectType .*HSV onTouch.* onAcc.* onKey.* onRegisterTouchListener ccTouch.*], +skip = *::[^visit$ copyWith.* onEnter.* onExit.* ^description$ getObjectType .*HSV onTouch.* onAcc.* onKey.* onRegisterTouchListener ccTouch.* createInstance], Widget::[(s|g)etUserObject], Layer::[getInputManager], LayoutParameter::[(s|g)etMargin], diff --git a/tools/tojs/genbindings.py b/tools/tojs/genbindings.py index 098311fbc3..22d871bcb0 100755 --- a/tools/tojs/genbindings.py +++ b/tools/tojs/genbindings.py @@ -139,19 +139,19 @@ def main(): tojs_root = '%s/tools/tojs' % project_root output_dir = '%s/cocos/scripting/js-bindings/auto' % project_root - cmd_args = {'cocos2dx.ini' : ('cocos2d-x', 'jsb_cocos2dx_auto'), \ - 'cocos2dx_audioengine.ini' : ('cocos2dx_audioengine', 'jsb_cocos2dx_audioengine_auto'), \ - 'cocos2dx_extension.ini' : ('cocos2dx_extension', 'jsb_cocos2dx_extension_auto'), \ - 'cocos2dx_builder.ini' : ('cocos2dx_builder', 'jsb_cocos2dx_builder_auto'), \ - 'cocos2dx_ui.ini' : ('cocos2dx_ui', 'jsb_cocos2dx_ui_auto'), \ - 'cocos2dx_studio.ini' : ('cocos2dx_studio', 'jsb_cocos2dx_studio_auto'), \ - 'cocos2dx_spine.ini' : ('cocos2dx_spine', 'jsb_cocos2dx_spine_auto'), \ - 'cocos2dx_3d.ini' : ('cocos2dx_3d', 'jsb_cocos2dx_3d_auto'), \ - 'cocos2dx_3d_ext.ini' : ('cocos2dx_3d_extension', 'jsb_cocos2dx_3d_extension_auto'), \ - 'cocos2dx_experimental_webView.ini' : ('cocos2dx_experimental_webView', 'jsb_cocos2dx_experimental_webView_auto'), \ - 'cocos2dx_experimental_video.ini' : ('cocos2dx_experimental_video', 'jsb_cocos2dx_experimental_video_auto'), \ - 'cocos2dx_physics3d.ini' : ('cocos2dx_physics3d', 'jsb_cocos2dx_physics3d_auto'), \ - 'cocos2dx_navmesh.ini' : ('cocos2dx_navmesh', 'jsb_cocos2dx_navmesh_auto'), + cmd_args = {'cocos2dx.ini': ('cocos2d-x', 'jsb_cocos2dx_auto'), + 'cocos2dx_audioengine.ini': ('cocos2dx_audioengine', 'jsb_cocos2dx_audioengine_auto'), + 'cocos2dx_extension.ini': ('cocos2dx_extension', 'jsb_cocos2dx_extension_auto'), + 'cocos2dx_builder.ini': ('cocos2dx_builder', 'jsb_cocos2dx_builder_auto'), + 'cocos2dx_ui.ini': ('cocos2dx_ui', 'jsb_cocos2dx_ui_auto'), + 'cocos2dx_studio.ini': ('cocos2dx_studio', 'jsb_cocos2dx_studio_auto'), + 'cocos2dx_spine.ini': ('cocos2dx_spine', 'jsb_cocos2dx_spine_auto'), + 'cocos2dx_3d.ini': ('cocos2dx_3d', 'jsb_cocos2dx_3d_auto'), + 'cocos2dx_3d_ext.ini': ('cocos2dx_3d_extension', 'jsb_cocos2dx_3d_extension_auto'), + 'cocos2dx_experimental_webView.ini': ('cocos2dx_experimental_webView', 'jsb_cocos2dx_experimental_webView_auto'), + 'cocos2dx_experimental_video.ini': ('cocos2dx_experimental_video', 'jsb_cocos2dx_experimental_video_auto'), + 'cocos2dx_physics3d.ini': ('cocos2dx_physics3d', 'jsb_cocos2dx_physics3d_auto'), + 'cocos2dx_navmesh.ini': ('cocos2dx_navmesh', 'jsb_cocos2dx_navmesh_auto'), } target = 'spidermonkey' generator_py = '%s/generator.py' % cxx_generator_root