From c40a2a33016b0321d356d88e1c5be33e6b6217c4 Mon Sep 17 00:00:00 2001 From: XiaoFeng Date: Thu, 12 Nov 2015 09:49:49 +0800 Subject: [PATCH 01/30] Combine Studio change for 2d components --- cocos/2d/CCCamera.cpp | 7 + cocos/2d/CCCamera.h | 12 +- cocos/2d/CCCameraBackgroundBrush.cpp | 30 +++++ cocos/2d/CCCameraBackgroundBrush.h | 25 +++- cocos/2d/CCClippingRectangleNode.cpp | 7 + cocos/2d/CCDrawNode.cpp | 40 +++++- cocos/2d/CCDrawNode.h | 14 +- cocos/2d/CCFontAtlasCache.cpp | 40 ++++++ cocos/2d/CCFontAtlasCache.h | 7 +- cocos/2d/CCFontFNT.cpp | 22 ++++ cocos/2d/CCFontFNT.h | 6 +- cocos/2d/CCFontFreeType.cpp | 14 ++ cocos/2d/CCFontFreeType.h | 5 + cocos/2d/CCNode.h | 4 + cocos/2d/CCParticleSystem.cpp | 9 ++ cocos/2d/CCParticleSystem.h | 6 +- cocos/2d/CCScene.h | 4 + cocos/2d/CCSprite.cpp | 33 +++++ cocos/2d/CCSprite.h | 13 +- cocos/2d/CCSpriteFrameCache.cpp | 186 ++++++++++++++++++++++++++- cocos/2d/CCSpriteFrameCache.h | 8 ++ cocos/2d/CCTMXTiledMap.cpp | 48 +++++-- cocos/2d/CCTMXTiledMap.h | 13 +- cocos/2d/CCTMXXMLParser.cpp | 7 +- cocos/2d/CCTMXXMLParser.h | 10 ++ cocos/2d/CocosStudioExtension.cpp | 13 ++ cocos/2d/CocosStudioExtension.h | 44 +++++++ 27 files changed, 605 insertions(+), 22 deletions(-) create mode 100644 cocos/2d/CocosStudioExtension.cpp create mode 100644 cocos/2d/CocosStudioExtension.h diff --git a/cocos/2d/CCCamera.cpp b/cocos/2d/CCCamera.cpp index bf6ffc9b8f..5f81778007 100644 --- a/cocos/2d/CCCamera.cpp +++ b/cocos/2d/CCCamera.cpp @@ -481,4 +481,11 @@ void Camera::setBackgroundBrush(CameraBackgroundBrush* clearBrush) _clearBrush = clearBrush; } +#ifdef CC_STUDIO_ENABLED_VIEW // for cocostudio only +bool Camera::isBrushValid() +{ + return _clearBrush != nullptr && _clearBrush->isValid(); +} +#endif + NS_CC_END diff --git a/cocos/2d/CCCamera.h b/cocos/2d/CCCamera.h index 8aa01a7c52..2a2bcf9a19 100644 --- a/cocos/2d/CCCamera.h +++ b/cocos/2d/CCCamera.h @@ -58,6 +58,12 @@ enum class CameraFlag USER6 = 1 << 6, USER7 = 1 << 7, USER8 = 1 << 8, +#ifdef CC_STUDIO_ENABLED_VIEW // for cocostudio only + SkyBox = 1 << 10, + DEFAULTCAMERA = DEFAULT | SkyBox, + PIXEL = 1 << 13, + FRONT = 1 << 14, +#endif }; /** * Defines a camera . @@ -271,7 +277,11 @@ public: CameraBackgroundBrush* getBackgroundBrush() const { return _clearBrush; } virtual void visit(Renderer* renderer, const Mat4 &parentTransform, uint32_t parentFlags) override; - + +#ifdef CC_STUDIO_ENABLED_VIEW // for cocostudio only + bool isBrushValid(); +#endif + CC_CONSTRUCTOR_ACCESS: Camera(); ~Camera(); diff --git a/cocos/2d/CCCameraBackgroundBrush.cpp b/cocos/2d/CCCameraBackgroundBrush.cpp index 756d773324..815a34f030 100644 --- a/cocos/2d/CCCameraBackgroundBrush.cpp +++ b/cocos/2d/CCCameraBackgroundBrush.cpp @@ -232,6 +232,10 @@ CameraBackgroundSkyBoxBrush::CameraBackgroundSkyBoxBrush() , _vertexBuffer(0) , _indexBuffer(0) , _texture(nullptr) +#ifdef CC_STUDIO_ENABLED_VIEW // for cocostudio only +, _actived(false) +, _textureValid(false) +#endif { #if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_WINRT) _backToForegroundListener = EventListenerCustom::create(EVENT_RENDERER_RECREATED, @@ -296,6 +300,11 @@ CameraBackgroundSkyBoxBrush* CameraBackgroundSkyBoxBrush::create() void CameraBackgroundSkyBoxBrush::drawBackground(Camera* camera) { +#ifdef CC_STUDIO_ENABLED_VIEW // for cocostudio only + if (!_actived) + return; +#endif + Mat4 cameraModelMat = camera->getNodeToWorldTransform(); Vec4 color(1.f, 1.f, 1.f, 1.f); @@ -427,4 +436,25 @@ void CameraBackgroundSkyBoxBrush::setTexture(TextureCube* texture) _glProgramState->setUniformTexture("u_Env", _texture); } +#ifdef CC_STUDIO_ENABLED_VIEW // for cocostudio only +bool CameraBackgroundSkyBoxBrush::isActived() +{ + return _actived; +} +void CameraBackgroundSkyBoxBrush::setActived(bool actived) +{ + _actived = actived; +} + +void CameraBackgroundSkyBoxBrush::setTextureValid(bool valid) +{ + _textureValid = valid; +} + +bool CameraBackgroundSkyBoxBrush::isValid() +{ + return _actived; +} +#endif + NS_CC_END diff --git a/cocos/2d/CCCameraBackgroundBrush.h b/cocos/2d/CCCameraBackgroundBrush.h index 74a461c03f..2eb4d6d782 100644 --- a/cocos/2d/CCCameraBackgroundBrush.h +++ b/cocos/2d/CCCameraBackgroundBrush.h @@ -103,8 +103,12 @@ public: * draw the background */ virtual void drawBackground(Camera* camera) {} - -CC_CONSTRUCTOR_ACCESS: + +#ifdef CC_STUDIO_ENABLED_VIEW // for cocostudio only + virtual bool isValid() { return true; } +#endif + +CC_CONSTRUCTOR_ACCESS : CameraBackgroundBrush(); virtual ~CameraBackgroundBrush(); @@ -236,8 +240,15 @@ public: * Draw background */ virtual void drawBackground(Camera* camera) override; - -CC_CONSTRUCTOR_ACCESS: + +#ifdef CC_STUDIO_ENABLED_VIEW // for cocostudio only + bool isActived(); + void setActived(bool actived); + virtual void setTextureValid(bool valid); + virtual bool isValid()override; +#endif + +CC_CONSTRUCTOR_ACCESS : CameraBackgroundSkyBoxBrush(); virtual ~CameraBackgroundSkyBoxBrush(); @@ -258,6 +269,12 @@ protected: #if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_WINRT) EventListenerCustom* _backToForegroundListener; #endif + +#ifdef CC_STUDIO_ENABLED_VIEW // for cocostudio only +private: + bool _actived; + bool _textureValid; +#endif }; NS_CC_END diff --git a/cocos/2d/CCClippingRectangleNode.cpp b/cocos/2d/CCClippingRectangleNode.cpp index eb3476858b..eb418db97a 100644 --- a/cocos/2d/CCClippingRectangleNode.cpp +++ b/cocos/2d/CCClippingRectangleNode.cpp @@ -53,10 +53,17 @@ void ClippingRectangleNode::onBeforeVisitScissor() const Point pos = convertToWorldSpace(Point(_clippingRegion.origin.x, _clippingRegion.origin.y)); GLView* glView = Director::getInstance()->getOpenGLView(); +#ifdef CC_STUDIO_ENABLED_VIEW // for cocostudio only + glView->setScissorInPoints(pos.x * scaleX, + pos.y * scaleY, + _clippingRegion.size.width * scaleX, + _clippingRegion.size.height * scaleY); +#else glView->setScissorInPoints(pos.x, pos.y, _clippingRegion.size.width * scaleX, _clippingRegion.size.height * scaleY); +#endif } } diff --git a/cocos/2d/CCDrawNode.cpp b/cocos/2d/CCDrawNode.cpp index 1fb58dd323..7330d34249 100644 --- a/cocos/2d/CCDrawNode.cpp +++ b/cocos/2d/CCDrawNode.cpp @@ -104,7 +104,11 @@ static inline Tex2F __t(const Vec2 &v) // implementation of DrawNode +#ifdef CC_STUDIO_ENABLED_VIEW // for cocostudio only +static const int DEFAULT_LINE_WIDTH = 1; +#else static const int DEFAULT_LINE_WIDTH = 2; +#endif DrawNode::DrawNode() : _vao(0) @@ -126,6 +130,9 @@ DrawNode::DrawNode() , _dirtyGLPoint(false) , _dirtyGLLine(false) , _lineWidth(DEFAULT_LINE_WIDTH) +#ifdef CC_STUDIO_ENABLED_VIEW // for cocostudio only +, _lineSmoothEnable(false) +#endif { _blendFunc = BlendFunc::ALPHA_PREMULTIPLIED; } @@ -398,6 +405,14 @@ 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)); } +#ifdef CC_STUDIO_ENABLED_VIEW // for cocostudio only + //如果开启线抗锯齿,如参考线绘制, 则先关闭多重采样 + if (this->_lineSmoothEnable == false) + { + glDisable(GL_MULTISAMPLE); + glDisable(GL_LINE_SMOOTH); + } +#endif glLineWidth(_lineWidth); glDrawArrays(GL_LINES, 0, _bufferCountGLLine); @@ -407,8 +422,14 @@ void DrawNode::onDrawGLLine(const Mat4 &transform, uint32_t flags) } glBindBuffer(GL_ARRAY_BUFFER, 0); - CC_INCREMENT_GL_DRAWN_BATCHES_AND_VERTICES(1,_bufferCountGLLine); + +#ifdef CC_STUDIO_ENABLED_VIEW // for cocostudio only + //如果开启线抗锯齿, 如参考线绘制, 绘制完成开启多重采样 + if (this->_lineSmoothEnable == true) + glEnable(GL_MULTISAMPLE); +#endif + CHECK_GL_ERROR_DEBUG(); } @@ -946,4 +967,21 @@ void DrawNode::setLineWidth(int lineWidth) _lineWidth = lineWidth; } +#ifdef CC_STUDIO_ENABLED_VIEW // for cocostudio only +void DrawNode::csSetLineSmooth(bool enable) +{ + this->_lineSmoothEnable = enable; +} + +bool DrawNode::csIsLineSmooth() +{ + return this->_lineSmoothEnable; +} + +float DrawNode::csGetLineWidth() +{ + return this->_lineWidth; +} +#endif + NS_CC_END diff --git a/cocos/2d/CCDrawNode.h b/cocos/2d/CCDrawNode.h index 0ea1c29eac..a6a259e4a4 100644 --- a/cocos/2d/CCDrawNode.h +++ b/cocos/2d/CCDrawNode.h @@ -312,7 +312,15 @@ public: virtual void draw(Renderer *renderer, const Mat4 &transform, uint32_t flags) override; void setLineWidth(int lineWidth); - + +#ifdef CC_STUDIO_ENABLED_VIEW // for cocostudio only + void csSetLineSmooth(bool enable); + + bool csIsLineSmooth(); + + float csGetLineWidth(); +#endif + CC_CONSTRUCTOR_ACCESS: DrawNode(); virtual ~DrawNode(); @@ -355,6 +363,10 @@ protected: int _lineWidth; +#ifdef CC_STUDIO_ENABLED_VIEW // for cocostudio only + bool _lineSmoothEnable; +#endif + private: CC_DISALLOW_COPY_AND_ASSIGN(DrawNode); }; diff --git a/cocos/2d/CCFontAtlasCache.cpp b/cocos/2d/CCFontAtlasCache.cpp index 95609ea12e..b181f7782f 100644 --- a/cocos/2d/CCFontAtlasCache.cpp +++ b/cocos/2d/CCFontAtlasCache.cpp @@ -238,4 +238,44 @@ bool FontAtlasCache::releaseFontAtlas(FontAtlas *atlas) return false; } +#ifdef CC_STUDIO_ENABLED_VIEW // for cocostudio only +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++; + } +} +#endif + NS_CC_END diff --git a/cocos/2d/CCFontAtlasCache.h b/cocos/2d/CCFontAtlasCache.h index e197a9812f..2f61231379 100644 --- a/cocos/2d/CCFontAtlasCache.h +++ b/cocos/2d/CCFontAtlasCache.h @@ -53,7 +53,12 @@ public: It will purge the textures atlas and if multiple texture exist in one FontAtlas. */ static void purgeCachedData(); - + +#ifdef CC_STUDIO_ENABLED_VIEW // for cocostudio only + static void reloadFontAtlasFNT(const std::string& fontFileName, const Vec2& imageOffset = Vec2::ZERO); + static void unloadFontAtlasTTF(const std::string& fontFileName); +#endif + 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 1a2ea333e9..ed14ea9886 100644 --- a/cocos/2d/CCFontFNT.cpp +++ b/cocos/2d/CCFontFNT.cpp @@ -783,5 +783,27 @@ FontAtlas * FontFNT::createFontAtlas() return tempAtlas; } +#ifdef CC_STUDIO_ENABLED_VIEW // for cocostudio only +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()); + + } +} +#endif NS_CC_END diff --git a/cocos/2d/CCFontFNT.h b/cocos/2d/CCFontFNT.h index d2b83e9886..f8a23978cf 100644 --- a/cocos/2d/CCFontFNT.h +++ b/cocos/2d/CCFontFNT.h @@ -46,7 +46,11 @@ public: static void purgeCachedData(); virtual int* getHorizontalKerningForTextUTF16(const std::u16string& text, int &outNumLetters) const override; virtual FontAtlas *createFontAtlas() override; - + +#ifdef CC_STUDIO_ENABLED_VIEW // for cocostudio only + static void reloadBMFontResource(const std::string& fntFilePath); +#endif + protected: FontFNT(BMFontConfiguration *theContfig, const Vec2& imageOffset = Vec2::ZERO); diff --git a/cocos/2d/CCFontFreeType.cpp b/cocos/2d/CCFontFreeType.cpp index 9076f23aca..49ff8d434e 100644 --- a/cocos/2d/CCFontFreeType.cpp +++ b/cocos/2d/CCFontFreeType.cpp @@ -634,4 +634,18 @@ const char* FontFreeType::getGlyphCollection() const return glyphCollection; } +#ifdef CC_STUDIO_ENABLED_VIEW // for cocostudio only +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++; + } +} +#endif + NS_CC_END diff --git a/cocos/2d/CCFontFreeType.h b/cocos/2d/CCFontFreeType.h index 57eda9ddbb..59f31e6cf0 100644 --- a/cocos/2d/CCFontFreeType.h +++ b/cocos/2d/CCFontFreeType.h @@ -74,6 +74,11 @@ public: virtual FontAtlas* createFontAtlas() override; virtual int getFontMaxHeight() const override { return _lineHeight; } + +#ifdef CC_STUDIO_ENABLED_VIEW // for cocostudio only + static void releaseFont(const std::string &fontName); +#endif + private: static const char* _glyphASCII; static const char* _glyphNEHE; diff --git a/cocos/2d/CCNode.h b/cocos/2d/CCNode.h index 4a521f81c7..bffd731c39 100644 --- a/cocos/2d/CCNode.h +++ b/cocos/2d/CCNode.h @@ -38,6 +38,10 @@ #include "2d/CCComponentContainer.h" #include "2d/CCComponent.h" +#ifdef CC_STUDIO_ENABLED_VIEW // for cocostudio only +#include "CocosStudioExtension.h" +#endif + NS_CC_BEGIN class GridBase; diff --git a/cocos/2d/CCParticleSystem.cpp b/cocos/2d/CCParticleSystem.cpp index 169a7f854b..d8dbc956fa 100644 --- a/cocos/2d/CCParticleSystem.cpp +++ b/cocos/2d/CCParticleSystem.cpp @@ -1332,5 +1332,14 @@ void ParticleSystem::setScaleY(float newScaleY) Node::setScaleY(newScaleY); } +#ifdef CC_STUDIO_ENABLED_VIEW // for cocostudio only +ResouceData ParticleSystem::csGetRenderFile() +{ + ResouceData rData; + rData.type = 0; + rData.file = _plistFile; + return rData; +} +#endif NS_CC_END diff --git a/cocos/2d/CCParticleSystem.h b/cocos/2d/CCParticleSystem.h index a4c3ba4b24..860cf4bbdf 100644 --- a/cocos/2d/CCParticleSystem.h +++ b/cocos/2d/CCParticleSystem.h @@ -760,7 +760,11 @@ public: * @lua NA */ virtual const BlendFunc &getBlendFunc() const override; - + +#ifdef CC_STUDIO_ENABLED_VIEW // for cocostudio only + ResouceData csGetRenderFile(); +#endif + CC_CONSTRUCTOR_ACCESS: /** * @js ctor diff --git a/cocos/2d/CCScene.h b/cocos/2d/CCScene.h index 7ff478c835..82b9e9a417 100644 --- a/cocos/2d/CCScene.h +++ b/cocos/2d/CCScene.h @@ -109,7 +109,11 @@ public: * @param renderer The renderer use to render the scene. * @js NA */ +#ifdef CC_STUDIO_ENABLED_VIEW // for cocostudio only + virtual void render(Renderer* renderer); +#else void render(Renderer* renderer); +#endif /** override function */ virtual void removeAllChildren() override; diff --git a/cocos/2d/CCSprite.cpp b/cocos/2d/CCSprite.cpp index 04366bd4d1..e6e42a7bee 100644 --- a/cocos/2d/CCSprite.cpp +++ b/cocos/2d/CCSprite.cpp @@ -164,7 +164,15 @@ bool Sprite::initWithTexture(Texture2D *texture, const Rect& rect) bool Sprite::initWithFile(const std::string& filename) { +#ifdef CC_STUDIO_ENABLED_VIEW // for cocostudio only + if (filename.empty()) + return false; + + _fileName = filename; + _fileType = 0; +#else CCASSERT(filename.size()>0, "Invalid filename for sprite"); +#endif Texture2D *texture = Director::getInstance()->getTextureCache()->addImage(filename); if (texture) @@ -184,6 +192,11 @@ bool Sprite::initWithFile(const std::string &filename, const Rect& rect) { CCASSERT(filename.size()>0, "Invalid filename"); +#ifdef CC_STUDIO_ENABLED_VIEW // for cocostudio only + _fileName = filename; + _fileType = 0; +#endif + Texture2D *texture = Director::getInstance()->getTextureCache()->addImage(filename); if (texture) { @@ -200,6 +213,11 @@ bool Sprite::initWithSpriteFrameName(const std::string& spriteFrameName) { CCASSERT(spriteFrameName.size() > 0, "Invalid spriteFrameName"); +#ifdef CC_STUDIO_ENABLED_VIEW // for cocostudio only + _fileName = spriteFrameName; + _fileType = 1; +#endif + SpriteFrame *frame = SpriteFrameCache::getInstance()->getSpriteFrameByName(spriteFrameName); return initWithSpriteFrame(frame); } @@ -1145,4 +1163,19 @@ void Sprite::setPolygonInfo(const PolygonInfo& info) _polyInfo = info; } +#ifdef CC_STUDIO_ENABLED_VIEW // for cocostudio only +void Sprite::setOffsetPosFromCenter(Vec2 offsetFromCenter) +{ + _unflippedOffsetPositionFromCenter = offsetFromCenter; +} + +ResouceData Sprite::csGetRenderFile() +{ + ResouceData rData; + rData.type = (int)_fileType; + rData.file = _fileName; + return rData; +} +#endif + NS_CC_END diff --git a/cocos/2d/CCSprite.h b/cocos/2d/CCSprite.h index 555fb0a5e3..8e85e0d19d 100644 --- a/cocos/2d/CCSprite.h +++ b/cocos/2d/CCSprite.h @@ -461,7 +461,12 @@ public: virtual bool isOpacityModifyRGB() const override; /// @} -CC_CONSTRUCTOR_ACCESS: +#ifdef CC_STUDIO_ENABLED_VIEW // for cocostudio only + ResouceData csGetRenderFile(); + void setOffsetPosFromCenter(Vec2 offsetFromCenter); +#endif + +CC_CONSTRUCTOR_ACCESS : /** * @js ctor */ @@ -634,6 +639,12 @@ protected: bool _flippedY; /// Whether the sprite is flipped vertically or not bool _insideBounds; /// whether or not the sprite was inside bounds the previous frame + +#ifdef CC_STUDIO_ENABLED_VIEW // for cocostudio only + std::string _fileName; + int _fileType; +#endif + private: CC_DISALLOW_COPY_AND_ASSIGN(Sprite); }; diff --git a/cocos/2d/CCSpriteFrameCache.cpp b/cocos/2d/CCSpriteFrameCache.cpp index c029b895c3..5da33a2590 100644 --- a/cocos/2d/CCSpriteFrameCache.cpp +++ b/cocos/2d/CCSpriteFrameCache.cpp @@ -150,7 +150,11 @@ void SpriteFrameCache::addSpriteFramesWithDictionary(ValueMap& dictionary, Textu Version 3 with TexturePacker 4.0 polygon mesh packing */ - +#ifdef CC_STUDIO_ENABLED_VIEW // for cocostudio only + if (dictionary["frames"].getType() != cocos2d::Value::Type::MAP) + return; +#endif + ValueMap& framesDict = dictionary["frames"].asValueMap(); int format = 0; @@ -493,6 +497,11 @@ void SpriteFrameCache::removeSpriteFramesFromFileContent(const std::string& plis void SpriteFrameCache::removeSpriteFramesFromDictionary(ValueMap& dictionary) { +#ifdef CC_STUDIO_ENABLED_VIEW // for cocostudio only + if (dictionary["frames"].getType() != cocos2d::Value::Type::MAP) + return; +#endif + ValueMap framesDict = dictionary["frames"].asValueMap(); std::vector keysToRemove; @@ -543,4 +552,179 @@ SpriteFrame* SpriteFrameCache::getSpriteFrameByName(const std::string& name) return frame; } +#ifdef CC_STUDIO_ENABLED_VIEW // for cocostudio only +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"); + + CCLOG("cocos2d: SpriteFrameCache: Trying to use file %s as texture", texturePath.c_str()); + } + + 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; +} +#endif + NS_CC_END diff --git a/cocos/2d/CCSpriteFrameCache.h b/cocos/2d/CCSpriteFrameCache.h index 0a2873687f..e5557706b8 100644 --- a/cocos/2d/CCSpriteFrameCache.h +++ b/cocos/2d/CCSpriteFrameCache.h @@ -236,6 +236,10 @@ public: /** @deprecated use getSpriteFrameByName() instead */ CC_DEPRECATED_ATTRIBUTE SpriteFrame* spriteFrameByName(const std::string&name) { return getSpriteFrameByName(name); } +#ifdef CC_STUDIO_ENABLED_VIEW // for cocostudio only + bool reloadTexture(const std::string& plist); +#endif + protected: // MARMALADE: Made this protected not private, as deriving from this class is pretty useful SpriteFrameCache(){} @@ -260,6 +264,10 @@ protected: const std::vector &triangleIndices, PolygonInfo &polygonInfo); +#ifdef CC_STUDIO_ENABLED_VIEW // for cocostudio only + void reloadSpriteFramesWithDictionary(ValueMap& dictionary, Texture2D *texture); +#endif + Map _spriteFrames; ValueMap _spriteFramesAliases; std::set* _loadedFileNames; diff --git a/cocos/2d/CCTMXTiledMap.cpp b/cocos/2d/CCTMXTiledMap.cpp index 4f7913fad8..8dc3395065 100644 --- a/cocos/2d/CCTMXTiledMap.cpp +++ b/cocos/2d/CCTMXTiledMap.cpp @@ -61,7 +61,11 @@ 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"); - + +#ifdef CC_STUDIO_ENABLED_VIEW // for cocostudio only + _tmxFile = tmxFile; +#endif + setContentSize(Size::ZERO); TMXMapInfo *mapInfo = TMXMapInfo::create(tmxFile); @@ -78,6 +82,10 @@ bool TMXTiledMap::initWithTMXFile(const std::string& tmxFile) bool TMXTiledMap::initWithXML(const std::string& tmxString, const std::string& resourcePath) { +#ifdef CC_STUDIO_ENABLED_VIEW // for cocostudio only + _tmxFile = tmxString; +#endif + setContentSize(Size::ZERO); TMXMapInfo *mapInfo = TMXMapInfo::createWithXML(tmxString, resourcePath); @@ -91,6 +99,10 @@ bool TMXTiledMap::initWithXML(const std::string& tmxString, const std::string& r TMXTiledMap::TMXTiledMap() :_mapSize(Size::ZERO) ,_tileSize(Size::ZERO) +#ifdef CC_STUDIO_ENABLED_VIEW // for cocostudio only + ,_tmxFile("") + , _tmxLayerNum(0) +#endif { } @@ -173,28 +185,34 @@ 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); + //为编辑器修改,节省一次循环 + //addChild(child, idx, idx); 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++; } } +#ifdef CC_STUDIO_ENABLED_VIEW // for cocostudio only + _tmxLayerNum = idx; +#endif } // public @@ -270,5 +288,19 @@ std::string TMXTiledMap::getDescription() const return StringUtils::format("(_children.size())); } +#ifdef CC_STUDIO_ENABLED_VIEW // for cocostudio only +int TMXTiledMap::getLayerNum() +{ + return _tmxLayerNum; +} + +ResouceData TMXTiledMap::csGetRenderFile() +{ + ResouceData rData; + rData.type = 0; + rData.file = _tmxFile; + return rData; +} +#endif NS_CC_END diff --git a/cocos/2d/CCTMXTiledMap.h b/cocos/2d/CCTMXTiledMap.h index 0e196c9ff0..8f9f53df94 100644 --- a/cocos/2d/CCTMXTiledMap.h +++ b/cocos/2d/CCTMXTiledMap.h @@ -251,7 +251,12 @@ public: * @js NA */ virtual std::string getDescription() const override; - + +#ifdef CC_STUDIO_ENABLED_VIEW // for cocostudio only + ResouceData csGetRenderFile(); + int getLayerNum(); +#endif + CC_CONSTRUCTOR_ACCESS: /** * @js ctor @@ -288,6 +293,12 @@ protected: //! tile properties ValueMapIntKey _tileProperties; +#ifdef CC_STUDIO_ENABLED_VIEW // for cocostudio only + std::string _tmxFile; + int _tmxLayerNum; + static const int TMXLayerTag = 32768; +#endif + private: CC_DISALLOW_COPY_AND_ASSIGN(TMXTiledMap); diff --git a/cocos/2d/CCTMXXMLParser.cpp b/cocos/2d/CCTMXXMLParser.cpp index 2a7425bb10..c8f0082739 100644 --- a/cocos/2d/CCTMXXMLParser.cpp +++ b/cocos/2d/CCTMXXMLParser.cpp @@ -266,6 +266,9 @@ void TMXMapInfo::startElement(void *ctx, const char *name, const char **atts) std::string externalTilesetFilename = attributeDict["source"].asString(); if (externalTilesetFilename != "") { +#ifdef CC_STUDIO_ENABLED_VIEW // for cocostudio only + _externalTilesetFilename = externalTilesetFilename; +#endif // 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,7 +391,9 @@ void TMXMapInfo::startElement(void *ctx, const char *name, const char **atts) // build full path std::string imagename = attributeDict["source"].asString(); - +#ifdef CC_STUDIO_ENABLED_VIEW // for cocostudio only + tileset->_originSourceImage = imagename; +#endif if (_TMXFileName.find_last_of("/") != string::npos) { string dir = _TMXFileName.substr(0, _TMXFileName.find_last_of("/") + 1); diff --git a/cocos/2d/CCTMXXMLParser.h b/cocos/2d/CCTMXXMLParser.h index 83009f2da7..5ca6e5473d 100644 --- a/cocos/2d/CCTMXXMLParser.h +++ b/cocos/2d/CCTMXXMLParser.h @@ -139,6 +139,10 @@ public: std::string _sourceImage; //! size in pixels of the image Size _imageSize; +#ifdef CC_STUDIO_ENABLED_VIEW // for cocostudio only + std::string _sourceImage; + std::string _originSourceImage; +#endif public: /** * @js ctor @@ -279,6 +283,9 @@ 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; } +#ifdef CC_STUDIO_ENABLED_VIEW // for cocostudio only + inline const std::string& getExternalTilesetFileName(){ return _externalTilesetFilename; } +#endif protected: void internalInit(const std::string& tmxFileName, const std::string& resourcePath); @@ -318,6 +325,9 @@ protected: ValueMapIntKey _tileProperties; int _currentFirstGID; bool _recordFirstGID; +#ifdef CC_STUDIO_ENABLED_VIEW // for cocostudio only + std::string _externalTilesetFilename; +#endif }; // end of tilemap_parallax_nodes group diff --git a/cocos/2d/CocosStudioExtension.cpp b/cocos/2d/CocosStudioExtension.cpp new file mode 100644 index 0000000000..6daa9a8cd8 --- /dev/null +++ b/cocos/2d/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/2d/CocosStudioExtension.h new file mode 100644 index 0000000000..aa8ad9b4a5 --- /dev/null +++ b/cocos/2d/CocosStudioExtension.h @@ -0,0 +1,44 @@ + +#ifndef __COCOSSTUDIOEXTENSION_H__ +#define __COCOSSTUDIOEXTENSION_H__ + +#include "math/CCAffineTransform.h" + +NS_CC_BEGIN + +struct CC_DLL ResouceData +{ + int type; + std::string file; + std::string plist; + + ResouceData() + { + type = 0; + file = ""; + plist = ""; + } + + ResouceData(int iType, std::string sFile, std::string sPlist) + { + type = iType; + file = sFile; + plist = sPlist; + } +}; + +class CC_DLL NodeExtension +{ +public: + NodeExtension(); + ~NodeExtension(); + +private: + +}; + + +NS_CC_END + + +#endif \ No newline at end of file From 1546a062a1761898f077d437f7a150cfd30db0b7 Mon Sep 17 00:00:00 2001 From: XiaoFeng Date: Thu, 12 Nov 2015 10:57:22 +0800 Subject: [PATCH 02/30] Update --- cocos/2d/CCCameraBackgroundBrush.cpp | 2 +- cocos/2d/CCCameraBackgroundBrush.h | 2 +- cocos/2d/CCDrawNode.cpp | 1 - cocos/2d/CCTMXTiledMap.cpp | 2 -- cocos/2d/CCTMXTiledMap.h | 3 ++- 5 files changed, 4 insertions(+), 6 deletions(-) diff --git a/cocos/2d/CCCameraBackgroundBrush.cpp b/cocos/2d/CCCameraBackgroundBrush.cpp index 815a34f030..b197a2e516 100644 --- a/cocos/2d/CCCameraBackgroundBrush.cpp +++ b/cocos/2d/CCCameraBackgroundBrush.cpp @@ -437,7 +437,7 @@ void CameraBackgroundSkyBoxBrush::setTexture(TextureCube* texture) } #ifdef CC_STUDIO_ENABLED_VIEW // for cocostudio only -bool CameraBackgroundSkyBoxBrush::isActived() +bool CameraBackgroundSkyBoxBrush::isActived() const { return _actived; } diff --git a/cocos/2d/CCCameraBackgroundBrush.h b/cocos/2d/CCCameraBackgroundBrush.h index 2eb4d6d782..1eb361eab8 100644 --- a/cocos/2d/CCCameraBackgroundBrush.h +++ b/cocos/2d/CCCameraBackgroundBrush.h @@ -242,7 +242,7 @@ public: virtual void drawBackground(Camera* camera) override; #ifdef CC_STUDIO_ENABLED_VIEW // for cocostudio only - bool isActived(); + bool isActived() const; void setActived(bool actived); virtual void setTextureValid(bool valid); virtual bool isValid()override; diff --git a/cocos/2d/CCDrawNode.cpp b/cocos/2d/CCDrawNode.cpp index 7330d34249..6faddf46b2 100644 --- a/cocos/2d/CCDrawNode.cpp +++ b/cocos/2d/CCDrawNode.cpp @@ -406,7 +406,6 @@ void DrawNode::onDrawGLLine(const Mat4 &transform, uint32_t flags) glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_TEX_COORD, 2, GL_FLOAT, GL_FALSE, sizeof(V2F_C4B_T2F), (GLvoid *)offsetof(V2F_C4B_T2F, texCoords)); } #ifdef CC_STUDIO_ENABLED_VIEW // for cocostudio only - //如果开启线抗锯齿,如参考线绘制, 则先关闭多重采样 if (this->_lineSmoothEnable == false) { glDisable(GL_MULTISAMPLE); diff --git a/cocos/2d/CCTMXTiledMap.cpp b/cocos/2d/CCTMXTiledMap.cpp index 8dc3395065..75b955e5d2 100644 --- a/cocos/2d/CCTMXTiledMap.cpp +++ b/cocos/2d/CCTMXTiledMap.cpp @@ -191,8 +191,6 @@ void TMXTiledMap::buildWithMapInfo(TMXMapInfo* mapInfo) for (const auto &layerInfo : layers) { if (layerInfo->_visible) { TMXLayer *child = parseLayer(layerInfo, mapInfo); - //为编辑器修改,节省一次循环 - //addChild(child, idx, idx); if (child == nullptr) { idx++; continue; diff --git a/cocos/2d/CCTMXTiledMap.h b/cocos/2d/CCTMXTiledMap.h index 8f9f53df94..985cd16659 100644 --- a/cocos/2d/CCTMXTiledMap.h +++ b/cocos/2d/CCTMXTiledMap.h @@ -296,9 +296,10 @@ protected: #ifdef CC_STUDIO_ENABLED_VIEW // for cocostudio only std::string _tmxFile; int _tmxLayerNum; - static const int TMXLayerTag = 32768; #endif + static const int TMXLayerTag = 32768; + private: CC_DISALLOW_COPY_AND_ASSIGN(TMXTiledMap); From 4c8066e39f8435bab3145b508cc7b7d24681b8e4 Mon Sep 17 00:00:00 2001 From: XiaoFeng Date: Thu, 12 Nov 2015 18:23:56 +0800 Subject: [PATCH 03/30] Normalize function names. --- cocos/2d/CCDrawNode.cpp | 1 - cocos/2d/CCDrawNode.h | 9 ++++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/cocos/2d/CCDrawNode.cpp b/cocos/2d/CCDrawNode.cpp index 6faddf46b2..197e8ffb30 100644 --- a/cocos/2d/CCDrawNode.cpp +++ b/cocos/2d/CCDrawNode.cpp @@ -424,7 +424,6 @@ void DrawNode::onDrawGLLine(const Mat4 &transform, uint32_t flags) CC_INCREMENT_GL_DRAWN_BATCHES_AND_VERTICES(1,_bufferCountGLLine); #ifdef CC_STUDIO_ENABLED_VIEW // for cocostudio only - //如果开启线抗锯齿, 如参考线绘制, 绘制完成开启多重采样 if (this->_lineSmoothEnable == true) glEnable(GL_MULTISAMPLE); #endif diff --git a/cocos/2d/CCDrawNode.h b/cocos/2d/CCDrawNode.h index a6a259e4a4..50bbd2cbbb 100644 --- a/cocos/2d/CCDrawNode.h +++ b/cocos/2d/CCDrawNode.h @@ -314,11 +314,14 @@ public: void setLineWidth(int lineWidth); #ifdef CC_STUDIO_ENABLED_VIEW // for cocostudio only - void csSetLineSmooth(bool enable); + // Set enable or disable multisampling effect on CocosStudio guide lines. + void setLineSmooth(bool enable); - bool csIsLineSmooth(); + // Get multisampling effect on CocosStudio guide lines mode. + bool isLineSmooth(); - float csGetLineWidth(); + // Get CocosStudio guide lines width. + float getLineWidth(); #endif CC_CONSTRUCTOR_ACCESS: From 140eaf7b6c270e9de58a567077f5f27197dbc171 Mon Sep 17 00:00:00 2001 From: XiaoFeng Date: Fri, 13 Nov 2015 09:09:02 +0800 Subject: [PATCH 04/30] Fix function name in cpp file --- cocos/2d/CCDrawNode.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cocos/2d/CCDrawNode.cpp b/cocos/2d/CCDrawNode.cpp index 197e8ffb30..85f86796c5 100644 --- a/cocos/2d/CCDrawNode.cpp +++ b/cocos/2d/CCDrawNode.cpp @@ -966,17 +966,17 @@ void DrawNode::setLineWidth(int lineWidth) } #ifdef CC_STUDIO_ENABLED_VIEW // for cocostudio only -void DrawNode::csSetLineSmooth(bool enable) +void DrawNode::setLineSmooth(bool enable) { this->_lineSmoothEnable = enable; } -bool DrawNode::csIsLineSmooth() +bool DrawNode::isLineSmooth() { return this->_lineSmoothEnable; } -float DrawNode::csGetLineWidth() +float DrawNode::getLineWidth() { return this->_lineWidth; } From d47a79c0e49525e8557bb505d2a6a343279c2756 Mon Sep 17 00:00:00 2001 From: XiaoFeng Date: Mon, 16 Nov 2015 11:08:20 +0800 Subject: [PATCH 05/30] Remove cocos studio limitation for new functions --- cocos/2d/CCCamera.cpp | 2 -- cocos/2d/CCCamera.h | 6 ++---- cocos/2d/CCCameraBackgroundBrush.cpp | 6 ------ cocos/2d/CCCameraBackgroundBrush.h | 6 ------ cocos/2d/CCClippingRectangleNode.cpp | 7 ------- cocos/2d/CCDrawNode.cpp | 10 ++-------- cocos/2d/CCDrawNode.h | 4 ---- cocos/2d/CCFontAtlasCache.cpp | 2 -- cocos/2d/CCFontAtlasCache.h | 2 -- cocos/2d/CCFontFNT.cpp | 2 -- cocos/2d/CCFontFNT.h | 2 -- cocos/2d/CCFontFreeType.cpp | 2 -- cocos/2d/CCFontFreeType.h | 2 -- cocos/2d/CCNode.h | 4 ---- cocos/2d/CCParticleSystem.cpp | 5 ++--- cocos/2d/CCParticleSystem.h | 6 +++--- cocos/2d/CCScene.h | 4 ---- cocos/2d/CCSprite.cpp | 8 +++++--- cocos/2d/CCSprite.h | 7 ++----- cocos/2d/CCSpriteFrameCache.cpp | 6 ------ cocos/2d/CCSpriteFrameCache.h | 4 ---- cocos/2d/CCTMXTiledMap.cpp | 13 ++----------- cocos/2d/CCTMXTiledMap.h | 7 ++----- cocos/2d/CCTMXXMLParser.cpp | 6 ++---- cocos/2d/CCTMXXMLParser.h | 10 ++-------- 25 files changed, 24 insertions(+), 109 deletions(-) diff --git a/cocos/2d/CCCamera.cpp b/cocos/2d/CCCamera.cpp index 5f81778007..b44c20b24b 100644 --- a/cocos/2d/CCCamera.cpp +++ b/cocos/2d/CCCamera.cpp @@ -481,11 +481,9 @@ void Camera::setBackgroundBrush(CameraBackgroundBrush* clearBrush) _clearBrush = clearBrush; } -#ifdef CC_STUDIO_ENABLED_VIEW // for cocostudio only bool Camera::isBrushValid() { return _clearBrush != nullptr && _clearBrush->isValid(); } -#endif NS_CC_END diff --git a/cocos/2d/CCCamera.h b/cocos/2d/CCCamera.h index 2a2bcf9a19..e431e30c98 100644 --- a/cocos/2d/CCCamera.h +++ b/cocos/2d/CCCamera.h @@ -58,12 +58,12 @@ enum class CameraFlag USER6 = 1 << 6, USER7 = 1 << 7, USER8 = 1 << 8, -#ifdef CC_STUDIO_ENABLED_VIEW // for cocostudio only + + // Use in cocos studio for edit 3d relate component SkyBox = 1 << 10, DEFAULTCAMERA = DEFAULT | SkyBox, PIXEL = 1 << 13, FRONT = 1 << 14, -#endif }; /** * Defines a camera . @@ -278,9 +278,7 @@ public: virtual void visit(Renderer* renderer, const Mat4 &parentTransform, uint32_t parentFlags) override; -#ifdef CC_STUDIO_ENABLED_VIEW // for cocostudio only bool isBrushValid(); -#endif CC_CONSTRUCTOR_ACCESS: Camera(); diff --git a/cocos/2d/CCCameraBackgroundBrush.cpp b/cocos/2d/CCCameraBackgroundBrush.cpp index b197a2e516..8f52b2ea74 100644 --- a/cocos/2d/CCCameraBackgroundBrush.cpp +++ b/cocos/2d/CCCameraBackgroundBrush.cpp @@ -232,10 +232,8 @@ CameraBackgroundSkyBoxBrush::CameraBackgroundSkyBoxBrush() , _vertexBuffer(0) , _indexBuffer(0) , _texture(nullptr) -#ifdef CC_STUDIO_ENABLED_VIEW // for cocostudio only , _actived(false) , _textureValid(false) -#endif { #if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_WINRT) _backToForegroundListener = EventListenerCustom::create(EVENT_RENDERER_RECREATED, @@ -300,10 +298,8 @@ CameraBackgroundSkyBoxBrush* CameraBackgroundSkyBoxBrush::create() void CameraBackgroundSkyBoxBrush::drawBackground(Camera* camera) { -#ifdef CC_STUDIO_ENABLED_VIEW // for cocostudio only if (!_actived) return; -#endif Mat4 cameraModelMat = camera->getNodeToWorldTransform(); @@ -436,7 +432,6 @@ void CameraBackgroundSkyBoxBrush::setTexture(TextureCube* texture) _glProgramState->setUniformTexture("u_Env", _texture); } -#ifdef CC_STUDIO_ENABLED_VIEW // for cocostudio only bool CameraBackgroundSkyBoxBrush::isActived() const { return _actived; @@ -455,6 +450,5 @@ bool CameraBackgroundSkyBoxBrush::isValid() { return _actived; } -#endif NS_CC_END diff --git a/cocos/2d/CCCameraBackgroundBrush.h b/cocos/2d/CCCameraBackgroundBrush.h index 1eb361eab8..54cc98e011 100644 --- a/cocos/2d/CCCameraBackgroundBrush.h +++ b/cocos/2d/CCCameraBackgroundBrush.h @@ -104,9 +104,7 @@ public: */ virtual void drawBackground(Camera* camera) {} -#ifdef CC_STUDIO_ENABLED_VIEW // for cocostudio only virtual bool isValid() { return true; } -#endif CC_CONSTRUCTOR_ACCESS : CameraBackgroundBrush(); @@ -241,12 +239,10 @@ public: */ virtual void drawBackground(Camera* camera) override; -#ifdef CC_STUDIO_ENABLED_VIEW // for cocostudio only bool isActived() const; void setActived(bool actived); virtual void setTextureValid(bool valid); virtual bool isValid()override; -#endif CC_CONSTRUCTOR_ACCESS : CameraBackgroundSkyBoxBrush(); @@ -270,11 +266,9 @@ protected: EventListenerCustom* _backToForegroundListener; #endif -#ifdef CC_STUDIO_ENABLED_VIEW // for cocostudio only private: bool _actived; bool _textureValid; -#endif }; NS_CC_END diff --git a/cocos/2d/CCClippingRectangleNode.cpp b/cocos/2d/CCClippingRectangleNode.cpp index eb418db97a..eb3476858b 100644 --- a/cocos/2d/CCClippingRectangleNode.cpp +++ b/cocos/2d/CCClippingRectangleNode.cpp @@ -53,17 +53,10 @@ void ClippingRectangleNode::onBeforeVisitScissor() const Point pos = convertToWorldSpace(Point(_clippingRegion.origin.x, _clippingRegion.origin.y)); GLView* glView = Director::getInstance()->getOpenGLView(); -#ifdef CC_STUDIO_ENABLED_VIEW // for cocostudio only - glView->setScissorInPoints(pos.x * scaleX, - pos.y * scaleY, - _clippingRegion.size.width * scaleX, - _clippingRegion.size.height * scaleY); -#else glView->setScissorInPoints(pos.x, pos.y, _clippingRegion.size.width * scaleX, _clippingRegion.size.height * scaleY); -#endif } } diff --git a/cocos/2d/CCDrawNode.cpp b/cocos/2d/CCDrawNode.cpp index 85f86796c5..cc323cb1a9 100644 --- a/cocos/2d/CCDrawNode.cpp +++ b/cocos/2d/CCDrawNode.cpp @@ -130,9 +130,7 @@ DrawNode::DrawNode() , _dirtyGLPoint(false) , _dirtyGLLine(false) , _lineWidth(DEFAULT_LINE_WIDTH) -#ifdef CC_STUDIO_ENABLED_VIEW // for cocostudio only , _lineSmoothEnable(false) -#endif { _blendFunc = BlendFunc::ALPHA_PREMULTIPLIED; } @@ -405,13 +403,13 @@ 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)); } -#ifdef CC_STUDIO_ENABLED_VIEW // for cocostudio only + if (this->_lineSmoothEnable == false) { glDisable(GL_MULTISAMPLE); glDisable(GL_LINE_SMOOTH); } -#endif + glLineWidth(_lineWidth); glDrawArrays(GL_LINES, 0, _bufferCountGLLine); @@ -423,10 +421,8 @@ void DrawNode::onDrawGLLine(const Mat4 &transform, uint32_t flags) glBindBuffer(GL_ARRAY_BUFFER, 0); CC_INCREMENT_GL_DRAWN_BATCHES_AND_VERTICES(1,_bufferCountGLLine); -#ifdef CC_STUDIO_ENABLED_VIEW // for cocostudio only if (this->_lineSmoothEnable == true) glEnable(GL_MULTISAMPLE); -#endif CHECK_GL_ERROR_DEBUG(); } @@ -965,7 +961,6 @@ void DrawNode::setLineWidth(int lineWidth) _lineWidth = lineWidth; } -#ifdef CC_STUDIO_ENABLED_VIEW // for cocostudio only void DrawNode::setLineSmooth(bool enable) { this->_lineSmoothEnable = enable; @@ -980,6 +975,5 @@ float DrawNode::getLineWidth() { return this->_lineWidth; } -#endif NS_CC_END diff --git a/cocos/2d/CCDrawNode.h b/cocos/2d/CCDrawNode.h index 50bbd2cbbb..92c01d3dac 100644 --- a/cocos/2d/CCDrawNode.h +++ b/cocos/2d/CCDrawNode.h @@ -313,7 +313,6 @@ public: void setLineWidth(int lineWidth); -#ifdef CC_STUDIO_ENABLED_VIEW // for cocostudio only // Set enable or disable multisampling effect on CocosStudio guide lines. void setLineSmooth(bool enable); @@ -322,7 +321,6 @@ public: // Get CocosStudio guide lines width. float getLineWidth(); -#endif CC_CONSTRUCTOR_ACCESS: DrawNode(); @@ -366,9 +364,7 @@ protected: int _lineWidth; -#ifdef CC_STUDIO_ENABLED_VIEW // for cocostudio only bool _lineSmoothEnable; -#endif private: CC_DISALLOW_COPY_AND_ASSIGN(DrawNode); diff --git a/cocos/2d/CCFontAtlasCache.cpp b/cocos/2d/CCFontAtlasCache.cpp index b181f7782f..2fdc1f98f0 100644 --- a/cocos/2d/CCFontAtlasCache.cpp +++ b/cocos/2d/CCFontAtlasCache.cpp @@ -238,7 +238,6 @@ bool FontAtlasCache::releaseFontAtlas(FontAtlas *atlas) return false; } -#ifdef CC_STUDIO_ENABLED_VIEW // for cocostudio only void FontAtlasCache::reloadFontAtlasFNT(const std::string& fontFileName, const Vec2& imageOffset/* = Vec2::ZERO*/) { std::string atlasName = generateFontName(fontFileName, 0, false); @@ -276,6 +275,5 @@ void FontAtlasCache::unloadFontAtlasTTF(const std::string& fontFileName) item++; } } -#endif NS_CC_END diff --git a/cocos/2d/CCFontAtlasCache.h b/cocos/2d/CCFontAtlasCache.h index 2f61231379..fac242583f 100644 --- a/cocos/2d/CCFontAtlasCache.h +++ b/cocos/2d/CCFontAtlasCache.h @@ -54,10 +54,8 @@ public: */ static void purgeCachedData(); -#ifdef CC_STUDIO_ENABLED_VIEW // for cocostudio only static void reloadFontAtlasFNT(const std::string& fontFileName, const Vec2& imageOffset = Vec2::ZERO); static void unloadFontAtlasTTF(const std::string& fontFileName); -#endif private: static std::string generateFontName(const std::string& fontFileName, float size, bool useDistanceField); diff --git a/cocos/2d/CCFontFNT.cpp b/cocos/2d/CCFontFNT.cpp index ed14ea9886..83c301acbc 100644 --- a/cocos/2d/CCFontFNT.cpp +++ b/cocos/2d/CCFontFNT.cpp @@ -783,7 +783,6 @@ FontAtlas * FontFNT::createFontAtlas() return tempAtlas; } -#ifdef CC_STUDIO_ENABLED_VIEW // for cocostudio only void FontFNT::reloadBMFontResource(const std::string& fntFilePath) { if (s_configurations == nullptr) @@ -804,6 +803,5 @@ void FontFNT::reloadBMFontResource(const std::string& fntFilePath) } } -#endif NS_CC_END diff --git a/cocos/2d/CCFontFNT.h b/cocos/2d/CCFontFNT.h index f8a23978cf..0509b63a5d 100644 --- a/cocos/2d/CCFontFNT.h +++ b/cocos/2d/CCFontFNT.h @@ -47,9 +47,7 @@ public: virtual int* getHorizontalKerningForTextUTF16(const std::u16string& text, int &outNumLetters) const override; virtual FontAtlas *createFontAtlas() override; -#ifdef CC_STUDIO_ENABLED_VIEW // for cocostudio only static void reloadBMFontResource(const std::string& fntFilePath); -#endif protected: diff --git a/cocos/2d/CCFontFreeType.cpp b/cocos/2d/CCFontFreeType.cpp index 49ff8d434e..0bc9234b4f 100644 --- a/cocos/2d/CCFontFreeType.cpp +++ b/cocos/2d/CCFontFreeType.cpp @@ -634,7 +634,6 @@ const char* FontFreeType::getGlyphCollection() const return glyphCollection; } -#ifdef CC_STUDIO_ENABLED_VIEW // for cocostudio only void FontFreeType::releaseFont(const std::string &fontName) { auto item = s_cacheFontData.begin(); @@ -646,6 +645,5 @@ void FontFreeType::releaseFont(const std::string &fontName) item++; } } -#endif NS_CC_END diff --git a/cocos/2d/CCFontFreeType.h b/cocos/2d/CCFontFreeType.h index 59f31e6cf0..51600e1b30 100644 --- a/cocos/2d/CCFontFreeType.h +++ b/cocos/2d/CCFontFreeType.h @@ -75,9 +75,7 @@ public: virtual FontAtlas* createFontAtlas() override; virtual int getFontMaxHeight() const override { return _lineHeight; } -#ifdef CC_STUDIO_ENABLED_VIEW // for cocostudio only static void releaseFont(const std::string &fontName); -#endif private: static const char* _glyphASCII; diff --git a/cocos/2d/CCNode.h b/cocos/2d/CCNode.h index bffd731c39..4a521f81c7 100644 --- a/cocos/2d/CCNode.h +++ b/cocos/2d/CCNode.h @@ -38,10 +38,6 @@ #include "2d/CCComponentContainer.h" #include "2d/CCComponent.h" -#ifdef CC_STUDIO_ENABLED_VIEW // for cocostudio only -#include "CocosStudioExtension.h" -#endif - NS_CC_BEGIN class GridBase; diff --git a/cocos/2d/CCParticleSystem.cpp b/cocos/2d/CCParticleSystem.cpp index d8dbc956fa..59be604eb4 100644 --- a/cocos/2d/CCParticleSystem.cpp +++ b/cocos/2d/CCParticleSystem.cpp @@ -54,6 +54,7 @@ THE SOFTWARE. #include "renderer/CCTextureCache.h" #include "deprecated/CCString.h" #include "platform/CCFileUtils.h" +#include "2d/CocosStudioExtension.h" using namespace std; @@ -1332,14 +1333,12 @@ void ParticleSystem::setScaleY(float newScaleY) Node::setScaleY(newScaleY); } -#ifdef CC_STUDIO_ENABLED_VIEW // for cocostudio only -ResouceData ParticleSystem::csGetRenderFile() +ResouceData ParticleSystem::getRenderFile() { ResouceData rData; rData.type = 0; rData.file = _plistFile; return rData; } -#endif NS_CC_END diff --git a/cocos/2d/CCParticleSystem.h b/cocos/2d/CCParticleSystem.h index 860cf4bbdf..d662a8da4a 100644 --- a/cocos/2d/CCParticleSystem.h +++ b/cocos/2d/CCParticleSystem.h @@ -33,6 +33,8 @@ THE SOFTWARE. NS_CC_BEGIN +struct CC_DLL ResouceData; + /** * @addtogroup _2d * @{ @@ -761,9 +763,7 @@ public: */ virtual const BlendFunc &getBlendFunc() const override; -#ifdef CC_STUDIO_ENABLED_VIEW // for cocostudio only - ResouceData csGetRenderFile(); -#endif + ResouceData getRenderFile(); CC_CONSTRUCTOR_ACCESS: /** diff --git a/cocos/2d/CCScene.h b/cocos/2d/CCScene.h index 82b9e9a417..fc1735c8bd 100644 --- a/cocos/2d/CCScene.h +++ b/cocos/2d/CCScene.h @@ -109,11 +109,7 @@ public: * @param renderer The renderer use to render the scene. * @js NA */ -#ifdef CC_STUDIO_ENABLED_VIEW // for cocostudio only virtual void render(Renderer* renderer); -#else - void render(Renderer* renderer); -#endif /** override function */ virtual void removeAllChildren() override; diff --git a/cocos/2d/CCSprite.cpp b/cocos/2d/CCSprite.cpp index e6e42a7bee..9f13e4978a 100644 --- a/cocos/2d/CCSprite.cpp +++ b/cocos/2d/CCSprite.cpp @@ -38,6 +38,7 @@ THE SOFTWARE. #include "renderer/CCRenderer.h" #include "base/CCDirector.h" #include "2d/CCCamera.h" +#include "2d/CocosStudioExtension.h" #include "deprecated/CCString.h" @@ -166,7 +167,10 @@ bool Sprite::initWithFile(const std::string& filename) { #ifdef CC_STUDIO_ENABLED_VIEW // for cocostudio only if (filename.empty()) + { + CCLOG("Call Sprite::initWithFile with blank resource filename."); return false; + } _fileName = filename; _fileType = 0; @@ -1163,19 +1167,17 @@ void Sprite::setPolygonInfo(const PolygonInfo& info) _polyInfo = info; } -#ifdef CC_STUDIO_ENABLED_VIEW // for cocostudio only void Sprite::setOffsetPosFromCenter(Vec2 offsetFromCenter) { _unflippedOffsetPositionFromCenter = offsetFromCenter; } -ResouceData Sprite::csGetRenderFile() +ResouceData Sprite::getRenderFile() { ResouceData rData; rData.type = (int)_fileType; rData.file = _fileName; return rData; } -#endif NS_CC_END diff --git a/cocos/2d/CCSprite.h b/cocos/2d/CCSprite.h index 8e85e0d19d..0f67c5f6df 100644 --- a/cocos/2d/CCSprite.h +++ b/cocos/2d/CCSprite.h @@ -46,6 +46,7 @@ class Rect; class Size; class Texture2D; struct transformValues_; +struct CC_DLL ResouceData; #ifdef SPRITE_RENDER_IN_SUBPIXEL #undef SPRITE_RENDER_IN_SUBPIXEL @@ -461,10 +462,8 @@ public: virtual bool isOpacityModifyRGB() const override; /// @} -#ifdef CC_STUDIO_ENABLED_VIEW // for cocostudio only - ResouceData csGetRenderFile(); + ResouceData getRenderFile(); void setOffsetPosFromCenter(Vec2 offsetFromCenter); -#endif CC_CONSTRUCTOR_ACCESS : /** @@ -640,10 +639,8 @@ protected: bool _insideBounds; /// whether or not the sprite was inside bounds the previous frame -#ifdef CC_STUDIO_ENABLED_VIEW // for cocostudio only std::string _fileName; int _fileType; -#endif private: CC_DISALLOW_COPY_AND_ASSIGN(Sprite); diff --git a/cocos/2d/CCSpriteFrameCache.cpp b/cocos/2d/CCSpriteFrameCache.cpp index 5da33a2590..45180379be 100644 --- a/cocos/2d/CCSpriteFrameCache.cpp +++ b/cocos/2d/CCSpriteFrameCache.cpp @@ -150,10 +150,8 @@ void SpriteFrameCache::addSpriteFramesWithDictionary(ValueMap& dictionary, Textu Version 3 with TexturePacker 4.0 polygon mesh packing */ -#ifdef CC_STUDIO_ENABLED_VIEW // for cocostudio only if (dictionary["frames"].getType() != cocos2d::Value::Type::MAP) return; -#endif ValueMap& framesDict = dictionary["frames"].asValueMap(); int format = 0; @@ -497,10 +495,8 @@ void SpriteFrameCache::removeSpriteFramesFromFileContent(const std::string& plis void SpriteFrameCache::removeSpriteFramesFromDictionary(ValueMap& dictionary) { -#ifdef CC_STUDIO_ENABLED_VIEW // for cocostudio only if (dictionary["frames"].getType() != cocos2d::Value::Type::MAP) return; -#endif ValueMap framesDict = dictionary["frames"].asValueMap(); std::vector keysToRemove; @@ -552,7 +548,6 @@ SpriteFrame* SpriteFrameCache::getSpriteFrameByName(const std::string& name) return frame; } -#ifdef CC_STUDIO_ENABLED_VIEW // for cocostudio only void SpriteFrameCache::reloadSpriteFramesWithDictionary(ValueMap& dictionary, Texture2D *texture) { ValueMap& framesDict = dictionary["frames"].asValueMap(); @@ -725,6 +720,5 @@ bool SpriteFrameCache::reloadTexture(const std::string& plist) } return true; } -#endif NS_CC_END diff --git a/cocos/2d/CCSpriteFrameCache.h b/cocos/2d/CCSpriteFrameCache.h index e5557706b8..cb305ba20c 100644 --- a/cocos/2d/CCSpriteFrameCache.h +++ b/cocos/2d/CCSpriteFrameCache.h @@ -236,9 +236,7 @@ public: /** @deprecated use getSpriteFrameByName() instead */ CC_DEPRECATED_ATTRIBUTE SpriteFrame* spriteFrameByName(const std::string&name) { return getSpriteFrameByName(name); } -#ifdef CC_STUDIO_ENABLED_VIEW // for cocostudio only bool reloadTexture(const std::string& plist); -#endif protected: // MARMALADE: Made this protected not private, as deriving from this class is pretty useful @@ -264,9 +262,7 @@ protected: const std::vector &triangleIndices, PolygonInfo &polygonInfo); -#ifdef CC_STUDIO_ENABLED_VIEW // for cocostudio only void reloadSpriteFramesWithDictionary(ValueMap& dictionary, Texture2D *texture); -#endif Map _spriteFrames; ValueMap _spriteFramesAliases; diff --git a/cocos/2d/CCTMXTiledMap.cpp b/cocos/2d/CCTMXTiledMap.cpp index 75b955e5d2..9c33e29d7e 100644 --- a/cocos/2d/CCTMXTiledMap.cpp +++ b/cocos/2d/CCTMXTiledMap.cpp @@ -29,6 +29,7 @@ THE SOFTWARE. #include "2d/CCTMXLayer.h" #include "2d/CCSprite.h" #include "deprecated/CCString.h" // For StringUtils::format +#include "2d/CocosStudioExtension.h" NS_CC_BEGIN @@ -62,9 +63,7 @@ bool TMXTiledMap::initWithTMXFile(const std::string& tmxFile) { CCASSERT(tmxFile.size()>0, "TMXTiledMap: tmx file should not be empty"); -#ifdef CC_STUDIO_ENABLED_VIEW // for cocostudio only _tmxFile = tmxFile; -#endif setContentSize(Size::ZERO); @@ -82,9 +81,7 @@ bool TMXTiledMap::initWithTMXFile(const std::string& tmxFile) bool TMXTiledMap::initWithXML(const std::string& tmxString, const std::string& resourcePath) { -#ifdef CC_STUDIO_ENABLED_VIEW // for cocostudio only _tmxFile = tmxString; -#endif setContentSize(Size::ZERO); @@ -99,10 +96,8 @@ bool TMXTiledMap::initWithXML(const std::string& tmxString, const std::string& r TMXTiledMap::TMXTiledMap() :_mapSize(Size::ZERO) ,_tileSize(Size::ZERO) -#ifdef CC_STUDIO_ENABLED_VIEW // for cocostudio only ,_tmxFile("") , _tmxLayerNum(0) -#endif { } @@ -208,9 +203,7 @@ void TMXTiledMap::buildWithMapInfo(TMXMapInfo* mapInfo) idx++; } } -#ifdef CC_STUDIO_ENABLED_VIEW // for cocostudio only _tmxLayerNum = idx; -#endif } // public @@ -286,19 +279,17 @@ std::string TMXTiledMap::getDescription() const return StringUtils::format("(_children.size())); } -#ifdef CC_STUDIO_ENABLED_VIEW // for cocostudio only int TMXTiledMap::getLayerNum() { return _tmxLayerNum; } -ResouceData TMXTiledMap::csGetRenderFile() +ResouceData TMXTiledMap::getRenderFile() { ResouceData rData; rData.type = 0; rData.file = _tmxFile; return rData; } -#endif NS_CC_END diff --git a/cocos/2d/CCTMXTiledMap.h b/cocos/2d/CCTMXTiledMap.h index 985cd16659..5ff396f6c9 100644 --- a/cocos/2d/CCTMXTiledMap.h +++ b/cocos/2d/CCTMXTiledMap.h @@ -37,6 +37,7 @@ class TMXLayer; class TMXLayerInfo; class TMXTilesetInfo; class TMXMapInfo; +struct CC_DLL ResouceData; /** * @addtogroup _2d @@ -252,10 +253,8 @@ public: */ virtual std::string getDescription() const override; -#ifdef CC_STUDIO_ENABLED_VIEW // for cocostudio only - ResouceData csGetRenderFile(); + ResouceData getRenderFile(); int getLayerNum(); -#endif CC_CONSTRUCTOR_ACCESS: /** @@ -293,10 +292,8 @@ protected: //! tile properties ValueMapIntKey _tileProperties; -#ifdef CC_STUDIO_ENABLED_VIEW // for cocostudio only std::string _tmxFile; int _tmxLayerNum; -#endif static const int TMXLayerTag = 32768; diff --git a/cocos/2d/CCTMXXMLParser.cpp b/cocos/2d/CCTMXXMLParser.cpp index c8f0082739..ee1e557424 100644 --- a/cocos/2d/CCTMXXMLParser.cpp +++ b/cocos/2d/CCTMXXMLParser.cpp @@ -266,9 +266,8 @@ void TMXMapInfo::startElement(void *ctx, const char *name, const char **atts) std::string externalTilesetFilename = attributeDict["source"].asString(); if (externalTilesetFilename != "") { -#ifdef CC_STUDIO_ENABLED_VIEW // for cocostudio only _externalTilesetFilename = externalTilesetFilename; -#endif + // 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) { @@ -391,9 +390,8 @@ void TMXMapInfo::startElement(void *ctx, const char *name, const char **atts) // build full path std::string imagename = attributeDict["source"].asString(); -#ifdef CC_STUDIO_ENABLED_VIEW // for cocostudio only tileset->_originSourceImage = imagename; -#endif + if (_TMXFileName.find_last_of("/") != string::npos) { string dir = _TMXFileName.substr(0, _TMXFileName.find_last_of("/") + 1); diff --git a/cocos/2d/CCTMXXMLParser.h b/cocos/2d/CCTMXXMLParser.h index 5ca6e5473d..3531852628 100644 --- a/cocos/2d/CCTMXXMLParser.h +++ b/cocos/2d/CCTMXXMLParser.h @@ -139,10 +139,8 @@ public: std::string _sourceImage; //! size in pixels of the image Size _imageSize; -#ifdef CC_STUDIO_ENABLED_VIEW // for cocostudio only - std::string _sourceImage; std::string _originSourceImage; -#endif + public: /** * @js ctor @@ -283,9 +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; } -#ifdef CC_STUDIO_ENABLED_VIEW // for cocostudio only - inline const std::string& getExternalTilesetFileName(){ return _externalTilesetFilename; } -#endif + inline const std::string& getExternalTilesetFileName() const { return _externalTilesetFilename; } protected: void internalInit(const std::string& tmxFileName, const std::string& resourcePath); @@ -325,9 +321,7 @@ protected: ValueMapIntKey _tileProperties; int _currentFirstGID; bool _recordFirstGID; -#ifdef CC_STUDIO_ENABLED_VIEW // for cocostudio only std::string _externalTilesetFilename; -#endif }; // end of tilemap_parallax_nodes group From 9ec451ca311c594309611f76d179a178cae278b5 Mon Sep 17 00:00:00 2001 From: XiaoFeng Date: Wed, 25 Nov 2015 23:26:57 +0800 Subject: [PATCH 06/30] Update CCDrawNode, remove condition MACRO --- cocos/2d/CCDrawNode.cpp | 13 ++++--------- cocos/2d/CCDrawNode.h | 6 ++++-- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/cocos/2d/CCDrawNode.cpp b/cocos/2d/CCDrawNode.cpp index cc323cb1a9..bdaed9c4c4 100644 --- a/cocos/2d/CCDrawNode.cpp +++ b/cocos/2d/CCDrawNode.cpp @@ -104,13 +104,7 @@ static inline Tex2F __t(const Vec2 &v) // implementation of DrawNode -#ifdef CC_STUDIO_ENABLED_VIEW // for cocostudio only -static const int DEFAULT_LINE_WIDTH = 1; -#else -static const int DEFAULT_LINE_WIDTH = 2; -#endif - -DrawNode::DrawNode() +DrawNode::DrawNode(int lineWidth) : _vao(0) , _vbo(0) , _vaoGLPoint(0) @@ -129,7 +123,8 @@ DrawNode::DrawNode() , _dirty(false) , _dirtyGLPoint(false) , _dirtyGLLine(false) -, _lineWidth(DEFAULT_LINE_WIDTH) +, _lineWidth(lineWidth) +, _defaultLineWidth(lineWidth) , _lineSmoothEnable(false) { _blendFunc = BlendFunc::ALPHA_PREMULTIPLIED; @@ -943,7 +938,7 @@ void DrawNode::clear() _dirtyGLLine = true; _bufferCountGLPoint = 0; _dirtyGLPoint = true; - _lineWidth = DEFAULT_LINE_WIDTH; + _lineWidth = _defaultLineWidth; } const BlendFunc& DrawNode::getBlendFunc() const diff --git a/cocos/2d/CCDrawNode.h b/cocos/2d/CCDrawNode.h index 92c01d3dac..fc0ccff2de 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 @@ -323,7 +325,7 @@ public: float getLineWidth(); CC_CONSTRUCTOR_ACCESS: - DrawNode(); + DrawNode(int lineWidth = DEFAULT_LINE_WIDTH); virtual ~DrawNode(); virtual bool init() override; @@ -365,7 +367,7 @@ protected: int _lineWidth; bool _lineSmoothEnable; - + int _defaultLineWidth; private: CC_DISALLOW_COPY_AND_ASSIGN(DrawNode); }; From 397fa809dad923409515bfeef2825e7f4774df4d Mon Sep 17 00:00:00 2001 From: XiaoFeng Date: Thu, 26 Nov 2015 09:32:57 +0800 Subject: [PATCH 07/30] Add default line width to create function --- cocos/2d/CCDrawNode.cpp | 4 ++-- cocos/2d/CCDrawNode.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cocos/2d/CCDrawNode.cpp b/cocos/2d/CCDrawNode.cpp index bdaed9c4c4..26ea573a48 100644 --- a/cocos/2d/CCDrawNode.cpp +++ b/cocos/2d/CCDrawNode.cpp @@ -156,9 +156,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(); diff --git a/cocos/2d/CCDrawNode.h b/cocos/2d/CCDrawNode.h index fc0ccff2de..ea06adf33a 100644 --- a/cocos/2d/CCDrawNode.h +++ b/cocos/2d/CCDrawNode.h @@ -58,7 +58,7 @@ public: * * @return Return an autorelease object. */ - static DrawNode* create(); + static DrawNode* create(int defaultLineWidth = DEFAULT_LINE_WIDTH); /** Draw a point. * From 52f696945d99c86d743ca2b225562199893fffe9 Mon Sep 17 00:00:00 2001 From: XiaoFeng Date: Thu, 26 Nov 2015 14:47:37 +0800 Subject: [PATCH 08/30] Remove condition MACRO and remove ASSERT in Sprite::initWithFile function Remove CameraFlag define for Cocos Studio only --- cocos/2d/CCCamera.h | 6 ------ cocos/2d/CCSprite.cpp | 8 -------- 2 files changed, 14 deletions(-) diff --git a/cocos/2d/CCCamera.h b/cocos/2d/CCCamera.h index e431e30c98..7f030c6602 100644 --- a/cocos/2d/CCCamera.h +++ b/cocos/2d/CCCamera.h @@ -58,12 +58,6 @@ enum class CameraFlag USER6 = 1 << 6, USER7 = 1 << 7, USER8 = 1 << 8, - - // Use in cocos studio for edit 3d relate component - SkyBox = 1 << 10, - DEFAULTCAMERA = DEFAULT | SkyBox, - PIXEL = 1 << 13, - FRONT = 1 << 14, }; /** * Defines a camera . diff --git a/cocos/2d/CCSprite.cpp b/cocos/2d/CCSprite.cpp index 9f13e4978a..7c19b22561 100644 --- a/cocos/2d/CCSprite.cpp +++ b/cocos/2d/CCSprite.cpp @@ -165,7 +165,6 @@ bool Sprite::initWithTexture(Texture2D *texture, const Rect& rect) bool Sprite::initWithFile(const std::string& filename) { -#ifdef CC_STUDIO_ENABLED_VIEW // for cocostudio only if (filename.empty()) { CCLOG("Call Sprite::initWithFile with blank resource filename."); @@ -174,9 +173,6 @@ bool Sprite::initWithFile(const std::string& filename) _fileName = filename; _fileType = 0; -#else - CCASSERT(filename.size()>0, "Invalid filename for sprite"); -#endif Texture2D *texture = Director::getInstance()->getTextureCache()->addImage(filename); if (texture) @@ -196,10 +192,8 @@ bool Sprite::initWithFile(const std::string &filename, const Rect& rect) { CCASSERT(filename.size()>0, "Invalid filename"); -#ifdef CC_STUDIO_ENABLED_VIEW // for cocostudio only _fileName = filename; _fileType = 0; -#endif Texture2D *texture = Director::getInstance()->getTextureCache()->addImage(filename); if (texture) @@ -217,10 +211,8 @@ bool Sprite::initWithSpriteFrameName(const std::string& spriteFrameName) { CCASSERT(spriteFrameName.size() > 0, "Invalid spriteFrameName"); -#ifdef CC_STUDIO_ENABLED_VIEW // for cocostudio only _fileName = spriteFrameName; _fileType = 1; -#endif SpriteFrame *frame = SpriteFrameCache::getInstance()->getSpriteFrameByName(spriteFrameName); return initWithSpriteFrame(frame); From ec1d76b15ec74cb813b214be427f4f7680f57150 Mon Sep 17 00:00:00 2001 From: XiaoFeng Date: Fri, 27 Nov 2015 10:28:38 +0800 Subject: [PATCH 09/30] Fix compile error --- cocos/scripting/lua-bindings/manual/LuaBasicConversions.h | 1 + 1 file changed, 1 insertion(+) diff --git a/cocos/scripting/lua-bindings/manual/LuaBasicConversions.h b/cocos/scripting/lua-bindings/manual/LuaBasicConversions.h index cf46e70d6f..5c1acd7408 100644 --- a/cocos/scripting/lua-bindings/manual/LuaBasicConversions.h +++ b/cocos/scripting/lua-bindings/manual/LuaBasicConversions.h @@ -30,6 +30,7 @@ extern "C" { } #include "tolua_fix.h" #include "cocos2d.h" +#include "2d/CocosStudioExtension.h" using namespace cocos2d; From 8b631f5c9f798ad1a92964c6f400716b42b9cac8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=82=96=E5=B3=B0?= Date: Fri, 27 Nov 2015 15:19:50 +0800 Subject: [PATCH 10/30] Fix compile failed on mobile platform --- cocos/2d/CCDrawNode.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cocos/2d/CCDrawNode.cpp b/cocos/2d/CCDrawNode.cpp index 26ea573a48..4df39d3c74 100644 --- a/cocos/2d/CCDrawNode.cpp +++ b/cocos/2d/CCDrawNode.cpp @@ -399,11 +399,14 @@ void DrawNode::onDrawGLLine(const Mat4 &transform, uint32_t flags) glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_TEX_COORD, 2, GL_FLOAT, GL_FALSE, sizeof(V2F_C4B_T2F), (GLvoid *)offsetof(V2F_C4B_T2F, texCoords)); } +#if CC_TARGET_PLATFORM == CC_PLATFORM_MAC || CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 + // GL_MULTISAMPLE & GL_LINE_SMOOTH only work on PC platform if (this->_lineSmoothEnable == false) { glDisable(GL_MULTISAMPLE); glDisable(GL_LINE_SMOOTH); } +#endif glLineWidth(_lineWidth); glDrawArrays(GL_LINES, 0, _bufferCountGLLine); @@ -416,8 +419,10 @@ void DrawNode::onDrawGLLine(const Mat4 &transform, uint32_t flags) glBindBuffer(GL_ARRAY_BUFFER, 0); CC_INCREMENT_GL_DRAWN_BATCHES_AND_VERTICES(1,_bufferCountGLLine); +#if CC_TARGET_PLATFORM == CC_PLATFORM_MAC || CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 if (this->_lineSmoothEnable == true) glEnable(GL_MULTISAMPLE); +#endif CHECK_GL_ERROR_DEBUG(); } From 32b81a69f56cf44f595c56021ac8787730b56ed7 Mon Sep 17 00:00:00 2001 From: XiaoFeng Date: Thu, 3 Dec 2015 14:21:00 +0800 Subject: [PATCH 11/30] Add test for new API remove Sprite::setOffsetPosFromCenter api add by cocos studio, and reset _unflippedOffsetPositionFromCenter to zero in Sprite::setTexture --- cocos/2d/CCDrawNode.cpp | 3 +++ cocos/2d/CCFontAtlasCache.h | 9 +++++++++ cocos/2d/CCSprite.cpp | 7 +------ cocos/2d/CCSprite.h | 1 - .../Classes/CocosStudio3DTest/CocosStudio3DTest.cpp | 9 +++++++++ .../Classes/DrawPrimitivesTest/DrawPrimitivesTest.cpp | 7 +++++++ tests/cpp-tests/Classes/LabelTest/LabelTestNew.cpp | 8 ++++++++ tests/cpp-tests/Classes/ParticleTest/ParticleTest.cpp | 3 +++ tests/cpp-tests/Classes/ShaderTest/ShaderTest.cpp | 6 ++++++ tests/cpp-tests/Classes/Sprite3DTest/Sprite3DTest.cpp | 2 ++ tests/cpp-tests/Classes/SpriteTest/SpriteTest.cpp | 6 ++++++ tests/cpp-tests/Classes/TileMapTest/TileMapTest.cpp | 5 +++++ 12 files changed, 59 insertions(+), 7 deletions(-) diff --git a/cocos/2d/CCDrawNode.cpp b/cocos/2d/CCDrawNode.cpp index 4df39d3c74..d2c2a23610 100644 --- a/cocos/2d/CCDrawNode.cpp +++ b/cocos/2d/CCDrawNode.cpp @@ -421,7 +421,10 @@ void DrawNode::onDrawGLLine(const Mat4 &transform, uint32_t flags) #if CC_TARGET_PLATFORM == CC_PLATFORM_MAC || CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 if (this->_lineSmoothEnable == true) + { glEnable(GL_MULTISAMPLE); + glEnable(GL_LINE_SMOOTH); + } #endif CHECK_GL_ERROR_DEBUG(); diff --git a/cocos/2d/CCFontAtlasCache.h b/cocos/2d/CCFontAtlasCache.h index fac242583f..b3ebd9bbf2 100644 --- a/cocos/2d/CCFontAtlasCache.h +++ b/cocos/2d/CCFontAtlasCache.h @@ -54,7 +54,16 @@ public: */ 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: diff --git a/cocos/2d/CCSprite.cpp b/cocos/2d/CCSprite.cpp index 3f81a9ee89..54bc8ff2d7 100644 --- a/cocos/2d/CCSprite.cpp +++ b/cocos/2d/CCSprite.cpp @@ -343,7 +343,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(); @@ -1159,11 +1159,6 @@ void Sprite::setPolygonInfo(const PolygonInfo& info) _polyInfo = info; } -void Sprite::setOffsetPosFromCenter(Vec2 offsetFromCenter) -{ - _unflippedOffsetPositionFromCenter = offsetFromCenter; -} - ResouceData Sprite::getRenderFile() { ResouceData rData; diff --git a/cocos/2d/CCSprite.h b/cocos/2d/CCSprite.h index cd59c2e62b..5bfff435eb 100644 --- a/cocos/2d/CCSprite.h +++ b/cocos/2d/CCSprite.h @@ -476,7 +476,6 @@ public: /// @} ResouceData getRenderFile(); - void setOffsetPosFromCenter(Vec2 offsetFromCenter); CC_CONSTRUCTOR_ACCESS : /** diff --git a/tests/cpp-tests/Classes/CocosStudio3DTest/CocosStudio3DTest.cpp b/tests/cpp-tests/Classes/CocosStudio3DTest/CocosStudio3DTest.cpp index 2c21f9fabe..fbbb78926d 100644 --- a/tests/cpp-tests/Classes/CocosStudio3DTest/CocosStudio3DTest.cpp +++ b/tests/cpp-tests/Classes/CocosStudio3DTest/CocosStudio3DTest.cpp @@ -170,6 +170,15 @@ CSSceneSkyBoxTest::CSSceneSkyBoxTest() addChild(node); _camera = static_cast(node->getChildByName("UserCamera_0")); + CameraBackgroundSkyBoxBrush * brush = dynamic_cast(_camera->getBackgroundBrush()); + if (nullptr != brush) + { + char buf[256] = { 0, }; + sprintf(buf, "CameraBackgroundSkyBoxBrush active value is : %s", brush->isActived() ? "true" : "false"); + CCLOG(buf); + sprintf(buf, "CameraBackgroundSkyBoxBrush valid value is : %s", brush->isValid() ? "true" : "false"); + CCLOG(buf); + } 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..8385df858b 100644 --- a/tests/cpp-tests/Classes/DrawPrimitivesTest/DrawPrimitivesTest.cpp +++ b/tests/cpp-tests/Classes/DrawPrimitivesTest/DrawPrimitivesTest.cpp @@ -291,6 +291,13 @@ 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(1); + draw1->setLineSmooth(true); + 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..b17dd30116 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 "2d/CocosStudioExtension.h" USING_NS_CC; @@ -1241,6 +1242,8 @@ void ParticleReorder::onEnter() auto parent1 = Node::create(); auto parent2 = ParticleBatchNode::createWithTexture(ignore->getTexture()); ignore->unscheduleUpdate(); + auto rd = ignore->getRenderFile(); + CCLOG("Get resource data from particle file type : %d, file name : %s", rd.type, 0 == rd.type ? rd.file.c_str() : rd.plist.c_str()); for( unsigned int i=0; i<2;i++) { 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..36717029f3 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 "2d/CocosStudioExtension.h" USING_NS_CC; @@ -167,6 +168,9 @@ void Sprite1::addNewSpriteWithCoords(Vec2 p) auto seq = Sequence::create( action, action_back, nullptr ); sprite->runAction( RepeatForever::create(seq) ); + + auto rd = sprite->getRenderFile(); + CCLOG("Test Sprite::getRenderFile function, texture type : %d, texture file : %s", rd.type, 0 == rd.type ? rd.file.c_str() : rd.plist.c_str()); } void Sprite1::onTouchesEnded(const std::vector& touches, Event* event) @@ -1775,6 +1779,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..c6a0dca3df 100644 --- a/tests/cpp-tests/Classes/TileMapTest/TileMapTest.cpp +++ b/tests/cpp-tests/Classes/TileMapTest/TileMapTest.cpp @@ -1,5 +1,6 @@ #include "TileMapTest.h" #include "../testResource.h" +#include "2d/CocosStudioExtension.h" USING_NS_CC; @@ -857,6 +858,10 @@ TMXIsoZorder::TMXIsoZorder() _tamara->runAction( RepeatForever::create(seq) ); schedule( CC_SCHEDULE_SELECTOR(TMXIsoZorder::repositionSprite) ); + + int layerCount = map->getLayerNum(); + auto rd = map->getRenderFile(); + CCLOG("There's %d layer in map. Resource type is : %d, file name : %s", layerCount, rd.type, 0 ==rd.type ? rd.file.c_str() : rd.plist.c_str()); } TMXIsoZorder::~TMXIsoZorder() From 30874d457f0648c69c7c6cc401ef244773efb2b5 Mon Sep 17 00:00:00 2001 From: XiaoFeng Date: Thu, 3 Dec 2015 15:04:08 +0800 Subject: [PATCH 12/30] Update sub module --- tests/cpp-tests/Resources/ccs-res | 2 +- tools/cocos2d-console | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/cpp-tests/Resources/ccs-res b/tests/cpp-tests/Resources/ccs-res index e82bd71212..636129882b 160000 --- a/tests/cpp-tests/Resources/ccs-res +++ b/tests/cpp-tests/Resources/ccs-res @@ -1 +1 @@ -Subproject commit e82bd71212e53e016bf5f262f8e4bc1c50b54203 +Subproject commit 636129882b612b5fe6d1d21be1eec136a2b1340b diff --git a/tools/cocos2d-console b/tools/cocos2d-console index 5089eb347b..be4cc39610 160000 --- a/tools/cocos2d-console +++ b/tools/cocos2d-console @@ -1 +1 @@ -Subproject commit 5089eb347b1d252c8f0a0d0c94c0e67d6bba723e +Subproject commit be4cc39610b447788cb60be470ed4122a314809c From bd943c54153deba64d639c21c5c3d1db5820cbef Mon Sep 17 00:00:00 2001 From: Ricardo Quesada Date: Thu, 3 Dec 2015 13:56:00 -0800 Subject: [PATCH 13/30] Sequence/Spawn converted to use new API --- .../js-bindings/manual/cocos2d_specifics.cpp | 57 +++++++------------ 1 file changed, 21 insertions(+), 36 deletions(-) diff --git a/cocos/scripting/js-bindings/manual/cocos2d_specifics.cpp b/cocos/scripting/js-bindings/manual/cocos2d_specifics.cpp index 2b2f87c8cd..b3327747b1 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,24 +376,16 @@ 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; From e5032dccc0447cfcf7867b9a9dcbe3c3c330e41a Mon Sep 17 00:00:00 2001 From: Ricardo Quesada Date: Thu, 3 Dec 2015 14:49:23 -0800 Subject: [PATCH 14/30] rootObject/unrootObject working again --- .../js-bindings/manual/ScriptingCore.cpp | 52 +++++++++++-------- 1 file changed, 30 insertions(+), 22 deletions(-) diff --git a/cocos/scripting/js-bindings/manual/ScriptingCore.cpp b/cocos/scripting/js-bindings/manual/ScriptingCore.cpp index af4dd130af..e4e0188086 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 From cc6e72fe7c1bed5f2f94179f6ef45829713d5791 Mon Sep 17 00:00:00 2001 From: Ricardo Quesada Date: Thu, 3 Dec 2015 14:54:38 -0800 Subject: [PATCH 15/30] MenuToggleItem converted --- .../js-bindings/manual/cocos2d_specifics.cpp | 26 +++++++------------ 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/cocos/scripting/js-bindings/manual/cocos2d_specifics.cpp b/cocos/scripting/js-bindings/manual/cocos2d_specifics.cpp index b3327747b1..44bf29265d 100644 --- a/cocos/scripting/js-bindings/manual/cocos2d_specifics.cpp +++ b/cocos/scripting/js-bindings/manual/cocos2d_specifics.cpp @@ -391,11 +391,14 @@ bool js_cocos2dx_CCSpawn_create(JSContext *cx, uint32_t argc, jsval *vp) return false; } +// TODO: This function is deprecated. The new API is "new Sprite" instead of "Sprite.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; + ret->initWithItem(nullptr); for (uint32_t i=0; i < argc; i++) { js_proxy_t *proxy; @@ -407,22 +410,11 @@ bool js_cocos2dx_CCMenuItemToggle_create(JSContext *cx, uint32_t argc, jsval *vp } 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); - } - } else { - jsret = JSVAL_NULL; - } - - args.rval().set(jsret); + + 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; } JS_ReportError(cx, "wrong number of arguments"); From 3100cba5a16a2c18f93cbcffb915cbae19aba207 Mon Sep 17 00:00:00 2001 From: Ricardo Quesada Date: Thu, 3 Dec 2015 15:02:39 -0800 Subject: [PATCH 16/30] Animation ported to JS --- cocos/2d/CCAnimation.cpp | 2 +- .../js-bindings/manual/cocos2d_specifics.cpp | 87 ++++++++++--------- 2 files changed, 49 insertions(+), 40 deletions(-) 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/scripting/js-bindings/manual/cocos2d_specifics.cpp b/cocos/scripting/js-bindings/manual/cocos2d_specifics.cpp index 44bf29265d..58299285eb 100644 --- a/cocos/scripting/js-bindings/manual/cocos2d_specifics.cpp +++ b/cocos/scripting/js-bindings/manual/cocos2d_specifics.cpp @@ -391,36 +391,40 @@ bool js_cocos2dx_CCSpawn_create(JSContext *cx, uint32_t argc, jsval *vp) return false; } -// TODO: This function is deprecated. The new API is "new Sprite" instead of "Sprite.create" +// 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 = new (std::nothrow) cocos2d::MenuItemToggle; - ret->initWithItem(nullptr); + 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); + 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); + + 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; } - - 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; } 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; @@ -428,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); @@ -437,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); @@ -449,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; From 013f5b8d3313c9b8d4cd71a1d38c39b91fc4be89 Mon Sep 17 00:00:00 2001 From: Ricardo Quesada Date: Thu, 3 Dec 2015 15:15:47 -0800 Subject: [PATCH 17/30] layerMultiplex converted to new JS API --- .../js-bindings/manual/cocos2d_specifics.cpp | 26 ++++++++++--------- 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/cocos/scripting/js-bindings/manual/cocos2d_specifics.cpp b/cocos/scripting/js-bindings/manual/cocos2d_specifics.cpp index 58299285eb..8b9ea8cb26 100644 --- a/cocos/scripting/js-bindings/manual/cocos2d_specifics.cpp +++ b/cocos/scripting/js-bindings/manual/cocos2d_specifics.cpp @@ -508,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); @@ -516,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) From 37b4c3fe6a9df44899344112d8fbdb1c53763a87 Mon Sep 17 00:00:00 2001 From: Ricardo Quesada Date: Thu, 3 Dec 2015 15:24:37 -0800 Subject: [PATCH 18/30] CallFuncN converted to new JS API --- .../js-bindings/manual/cocos2d_specifics.cpp | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/cocos/scripting/js-bindings/manual/cocos2d_specifics.cpp b/cocos/scripting/js-bindings/manual/cocos2d_specifics.cpp index 8b9ea8cb26..627c723663 100644 --- a/cocos/scripting/js-bindings/manual/cocos2d_specifics.cpp +++ b/cocos/scripting/js-bindings/manual/cocos2d_specifics.cpp @@ -678,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()); @@ -711,12 +712,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; } From 67948ff8c877d003df4ef7414c2d05534601475f Mon Sep 17 00:00:00 2001 From: Ricardo Quesada Date: Thu, 3 Dec 2015 15:40:52 -0800 Subject: [PATCH 19/30] adds jsb_ref_get_or_create_jsobject() kind of replaces js_get_or_create_jsobject for Ref objets. Benefits: friendly with the new JS API takes less space (no template) --- cocos/scripting/js-bindings/manual/ScriptingCore.cpp | 9 +++++++++ cocos/scripting/js-bindings/manual/ScriptingCore.h | 7 +++++++ cocos/scripting/js-bindings/manual/cocos2d_specifics.cpp | 5 +++-- 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/cocos/scripting/js-bindings/manual/ScriptingCore.cpp b/cocos/scripting/js-bindings/manual/ScriptingCore.cpp index e4e0188086..035ef39639 100644 --- a/cocos/scripting/js-bindings/manual/ScriptingCore.cpp +++ b/cocos/scripting/js-bindings/manual/ScriptingCore.cpp @@ -2007,6 +2007,15 @@ JSObject* jsb_ref_create_jsobject(JSContext *cx, cocos2d::Ref *ref, js_type_clas 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); diff --git a/cocos/scripting/js-bindings/manual/ScriptingCore.h b/cocos/scripting/js-bindings/manual/ScriptingCore.h index 7bdd13cdc7..a57b5ffce4 100644 --- a/cocos/scripting/js-bindings/manual/ScriptingCore.h +++ b/cocos/scripting/js-bindings/manual/ScriptingCore.h @@ -573,6 +573,13 @@ 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); +/** + 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 627c723663..ba83323426 100644 --- a/cocos/scripting/js-bindings/manual/cocos2d_specifics.cpp +++ b/cocos/scripting/js-bindings/manual/cocos2d_specifics.cpp @@ -691,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 { From b87975096ebbf32f20d092267f7ade54c3654845 Mon Sep 17 00:00:00 2001 From: Ricardo Quesada Date: Thu, 3 Dec 2015 15:47:39 -0800 Subject: [PATCH 20/30] GLProgram converted to new JSAPI --- .../js-bindings/manual/cocos2d_specifics.cpp | 40 +++++++------------ 1 file changed, 15 insertions(+), 25 deletions(-) diff --git a/cocos/scripting/js-bindings/manual/cocos2d_specifics.cpp b/cocos/scripting/js-bindings/manual/cocos2d_specifics.cpp index ba83323426..9133f01936 100644 --- a/cocos/scripting/js-bindings/manual/cocos2d_specifics.cpp +++ b/cocos/scripting/js-bindings/manual/cocos2d_specifics.cpp @@ -762,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 { @@ -4253,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) @@ -4313,29 +4312,20 @@ 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; } From 49882ed91c5dd794667d53604ed23b3b9a53db93 Mon Sep 17 00:00:00 2001 From: Ricardo Quesada Date: Thu, 3 Dec 2015 15:49:56 -0800 Subject: [PATCH 21/30] js_cocos2dx_CCGLProgram_createWithString converted to new JSAPI --- .../js-bindings/manual/cocos2d_specifics.cpp | 30 +++++++------------ 1 file changed, 11 insertions(+), 19 deletions(-) diff --git a/cocos/scripting/js-bindings/manual/cocos2d_specifics.cpp b/cocos/scripting/js-bindings/manual/cocos2d_specifics.cpp index 9133f01936..0c7db4750f 100644 --- a/cocos/scripting/js-bindings/manual/cocos2d_specifics.cpp +++ b/cocos/scripting/js-bindings/manual/cocos2d_specifics.cpp @@ -4328,7 +4328,7 @@ bool js_cocos2dx_CCGLProgram_create(JSContext *cx, uint32_t argc, jsval *vp) 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); @@ -4342,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; } From 2da192a1c2967241cf6c5fcf6973ce72964b0423 Mon Sep 17 00:00:00 2001 From: XiaoFeng Date: Fri, 4 Dec 2015 09:26:14 +0800 Subject: [PATCH 22/30] Remove cocostudio header file from sprite and particle, and adjust tests Fix compile error under iOS & Mac --- cocos/2d/CCParticleSystem.cpp | 9 --------- cocos/2d/CCParticleSystem.h | 4 +--- cocos/2d/CCSprite.cpp | 9 --------- cocos/2d/CCSprite.h | 4 ++-- .../Classes/CocosStudio3DTest/CocosStudio3DTest.cpp | 7 ++----- tests/cpp-tests/Classes/ParticleTest/ParticleTest.cpp | 2 -- tests/cpp-tests/Classes/SpriteTest/SpriteTest.cpp | 3 --- 7 files changed, 5 insertions(+), 33 deletions(-) diff --git a/cocos/2d/CCParticleSystem.cpp b/cocos/2d/CCParticleSystem.cpp index 59be604eb4..2459a79004 100644 --- a/cocos/2d/CCParticleSystem.cpp +++ b/cocos/2d/CCParticleSystem.cpp @@ -54,7 +54,6 @@ THE SOFTWARE. #include "renderer/CCTextureCache.h" #include "deprecated/CCString.h" #include "platform/CCFileUtils.h" -#include "2d/CocosStudioExtension.h" using namespace std; @@ -1333,12 +1332,4 @@ void ParticleSystem::setScaleY(float newScaleY) Node::setScaleY(newScaleY); } -ResouceData ParticleSystem::getRenderFile() -{ - ResouceData rData; - rData.type = 0; - rData.file = _plistFile; - return rData; -} - NS_CC_END diff --git a/cocos/2d/CCParticleSystem.h b/cocos/2d/CCParticleSystem.h index d662a8da4a..eb7ab4afa9 100644 --- a/cocos/2d/CCParticleSystem.h +++ b/cocos/2d/CCParticleSystem.h @@ -33,8 +33,6 @@ THE SOFTWARE. NS_CC_BEGIN -struct CC_DLL ResouceData; - /** * @addtogroup _2d * @{ @@ -763,7 +761,7 @@ public: */ virtual const BlendFunc &getBlendFunc() const override; - ResouceData getRenderFile(); + const std::string getResourceFile() const { return _plistFile; } CC_CONSTRUCTOR_ACCESS: /** diff --git a/cocos/2d/CCSprite.cpp b/cocos/2d/CCSprite.cpp index 54bc8ff2d7..e401be8d6b 100644 --- a/cocos/2d/CCSprite.cpp +++ b/cocos/2d/CCSprite.cpp @@ -38,7 +38,6 @@ THE SOFTWARE. #include "renderer/CCRenderer.h" #include "base/CCDirector.h" #include "2d/CCCamera.h" -#include "2d/CocosStudioExtension.h" #include "deprecated/CCString.h" @@ -1159,12 +1158,4 @@ void Sprite::setPolygonInfo(const PolygonInfo& info) _polyInfo = info; } -ResouceData Sprite::getRenderFile() -{ - ResouceData rData; - rData.type = (int)_fileType; - rData.file = _fileName; - return rData; -} - NS_CC_END diff --git a/cocos/2d/CCSprite.h b/cocos/2d/CCSprite.h index 5bfff435eb..737b77045e 100644 --- a/cocos/2d/CCSprite.h +++ b/cocos/2d/CCSprite.h @@ -46,7 +46,6 @@ class Rect; class Size; class Texture2D; struct transformValues_; -struct CC_DLL ResouceData; #ifdef SPRITE_RENDER_IN_SUBPIXEL #undef SPRITE_RENDER_IN_SUBPIXEL @@ -475,7 +474,8 @@ public: virtual bool isOpacityModifyRGB() const override; /// @} - ResouceData getRenderFile(); + const int getResourceType() const { return _fileType; } + const std::string getResourceName() const { return _fileName; } CC_CONSTRUCTOR_ACCESS : /** diff --git a/tests/cpp-tests/Classes/CocosStudio3DTest/CocosStudio3DTest.cpp b/tests/cpp-tests/Classes/CocosStudio3DTest/CocosStudio3DTest.cpp index fbbb78926d..79f2414784 100644 --- a/tests/cpp-tests/Classes/CocosStudio3DTest/CocosStudio3DTest.cpp +++ b/tests/cpp-tests/Classes/CocosStudio3DTest/CocosStudio3DTest.cpp @@ -173,11 +173,8 @@ CSSceneSkyBoxTest::CSSceneSkyBoxTest() CameraBackgroundSkyBoxBrush * brush = dynamic_cast(_camera->getBackgroundBrush()); if (nullptr != brush) { - char buf[256] = { 0, }; - sprintf(buf, "CameraBackgroundSkyBoxBrush active value is : %s", brush->isActived() ? "true" : "false"); - CCLOG(buf); - sprintf(buf, "CameraBackgroundSkyBoxBrush valid value is : %s", brush->isValid() ? "true" : "false"); - CCLOG(buf); + CCLOG("CameraBackgroundSkyBoxBrush active value is : %s", brush->isActived() ? "true" : "false"); + CCLOG("CameraBackgroundSkyBoxBrush valid value is : %s", brush->isValid() ? "true" : "false"); } auto listener = EventListenerTouchAllAtOnce::create(); diff --git a/tests/cpp-tests/Classes/ParticleTest/ParticleTest.cpp b/tests/cpp-tests/Classes/ParticleTest/ParticleTest.cpp index b17dd30116..dee27526fa 100644 --- a/tests/cpp-tests/Classes/ParticleTest/ParticleTest.cpp +++ b/tests/cpp-tests/Classes/ParticleTest/ParticleTest.cpp @@ -1242,8 +1242,6 @@ void ParticleReorder::onEnter() auto parent1 = Node::create(); auto parent2 = ParticleBatchNode::createWithTexture(ignore->getTexture()); ignore->unscheduleUpdate(); - auto rd = ignore->getRenderFile(); - CCLOG("Get resource data from particle file type : %d, file name : %s", rd.type, 0 == rd.type ? rd.file.c_str() : rd.plist.c_str()); for( unsigned int i=0; i<2;i++) { diff --git a/tests/cpp-tests/Classes/SpriteTest/SpriteTest.cpp b/tests/cpp-tests/Classes/SpriteTest/SpriteTest.cpp index 36717029f3..20ccae70c3 100644 --- a/tests/cpp-tests/Classes/SpriteTest/SpriteTest.cpp +++ b/tests/cpp-tests/Classes/SpriteTest/SpriteTest.cpp @@ -168,9 +168,6 @@ void Sprite1::addNewSpriteWithCoords(Vec2 p) auto seq = Sequence::create( action, action_back, nullptr ); sprite->runAction( RepeatForever::create(seq) ); - - auto rd = sprite->getRenderFile(); - CCLOG("Test Sprite::getRenderFile function, texture type : %d, texture file : %s", rd.type, 0 == rd.type ? rd.file.c_str() : rd.plist.c_str()); } void Sprite1::onTouchesEnded(const std::vector& touches, Event* event) From 6fb65b5610a650eed3c0982477a50e635c631dc4 Mon Sep 17 00:00:00 2001 From: XiaoFeng Date: Fri, 4 Dec 2015 10:43:39 +0800 Subject: [PATCH 23/30] Editing code as comment. Move CocosStudioExtension path and update related files. --- cocos/2d/CCDrawNode.cpp | 15 ++++++--------- cocos/2d/CCSpriteFrameCache.cpp | 2 -- cocos/2d/CCTMXTiledMap.cpp | 9 --------- cocos/2d/CCTMXTiledMap.h | 3 +-- .../cocostudio}/CocosStudioExtension.cpp | 0 .../cocostudio}/CocosStudioExtension.h | 0 .../js-bindings/manual/js_manual_conversions.cpp | 2 +- .../lua-bindings/manual/LuaBasicConversions.h | 2 +- cocos/ui/CocosGUI.h | 2 +- cocos/ui/UIAbstractCheckButton.cpp | 2 +- cocos/ui/UIButton.cpp | 2 +- cocos/ui/UIImageView.cpp | 2 +- cocos/ui/UILayout.cpp | 2 +- cocos/ui/UILoadingBar.cpp | 2 +- cocos/ui/UISlider.cpp | 2 +- cocos/ui/UITextAtlas.cpp | 2 +- cocos/ui/UITextBMFont.cpp | 2 +- .../Classes/ParticleTest/ParticleTest.cpp | 2 +- tests/cpp-tests/Classes/SpriteTest/SpriteTest.cpp | 2 +- .../cpp-tests/Classes/TileMapTest/TileMapTest.cpp | 6 +----- 20 files changed, 21 insertions(+), 40 deletions(-) rename cocos/{2d => editor-support/cocostudio}/CocosStudioExtension.cpp (100%) rename cocos/{2d => editor-support/cocostudio}/CocosStudioExtension.h (100%) diff --git a/cocos/2d/CCDrawNode.cpp b/cocos/2d/CCDrawNode.cpp index d2c2a23610..0223e9e62a 100644 --- a/cocos/2d/CCDrawNode.cpp +++ b/cocos/2d/CCDrawNode.cpp @@ -400,12 +400,17 @@ void DrawNode::onDrawGLLine(const Mat4 &transform, uint32_t flags) } #if CC_TARGET_PLATFORM == CC_PLATFORM_MAC || CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 - // GL_MULTISAMPLE & GL_LINE_SMOOTH only work on PC platform + // GL_MULTISAMPLE only work on PC platform, GL_LINE_SMOOTH will not support at GLES v3.0 if (this->_lineSmoothEnable == false) { glDisable(GL_MULTISAMPLE); glDisable(GL_LINE_SMOOTH); } + else + { + glEnable(GL_MULTISAMPLE); + glEnable(GL_LINE_SMOOTH); + } #endif glLineWidth(_lineWidth); @@ -419,14 +424,6 @@ void DrawNode::onDrawGLLine(const Mat4 &transform, uint32_t flags) glBindBuffer(GL_ARRAY_BUFFER, 0); CC_INCREMENT_GL_DRAWN_BATCHES_AND_VERTICES(1,_bufferCountGLLine); -#if CC_TARGET_PLATFORM == CC_PLATFORM_MAC || CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 - if (this->_lineSmoothEnable == true) - { - glEnable(GL_MULTISAMPLE); - glEnable(GL_LINE_SMOOTH); - } -#endif - CHECK_GL_ERROR_DEBUG(); } diff --git a/cocos/2d/CCSpriteFrameCache.cpp b/cocos/2d/CCSpriteFrameCache.cpp index 45180379be..dde20244e6 100644 --- a/cocos/2d/CCSpriteFrameCache.cpp +++ b/cocos/2d/CCSpriteFrameCache.cpp @@ -701,8 +701,6 @@ bool SpriteFrameCache::reloadTexture(const std::string& plist) // append .png texturePath = texturePath.append(".png"); - - CCLOG("cocos2d: SpriteFrameCache: Trying to use file %s as texture", texturePath.c_str()); } Texture2D *texture = nullptr; diff --git a/cocos/2d/CCTMXTiledMap.cpp b/cocos/2d/CCTMXTiledMap.cpp index 9c33e29d7e..93967c4504 100644 --- a/cocos/2d/CCTMXTiledMap.cpp +++ b/cocos/2d/CCTMXTiledMap.cpp @@ -29,7 +29,6 @@ THE SOFTWARE. #include "2d/CCTMXLayer.h" #include "2d/CCSprite.h" #include "deprecated/CCString.h" // For StringUtils::format -#include "2d/CocosStudioExtension.h" NS_CC_BEGIN @@ -284,12 +283,4 @@ int TMXTiledMap::getLayerNum() return _tmxLayerNum; } -ResouceData TMXTiledMap::getRenderFile() -{ - ResouceData rData; - rData.type = 0; - rData.file = _tmxFile; - return rData; -} - NS_CC_END diff --git a/cocos/2d/CCTMXTiledMap.h b/cocos/2d/CCTMXTiledMap.h index 5ff396f6c9..d9a35ef096 100644 --- a/cocos/2d/CCTMXTiledMap.h +++ b/cocos/2d/CCTMXTiledMap.h @@ -37,7 +37,6 @@ class TMXLayer; class TMXLayerInfo; class TMXTilesetInfo; class TMXMapInfo; -struct CC_DLL ResouceData; /** * @addtogroup _2d @@ -253,8 +252,8 @@ public: */ virtual std::string getDescription() const override; - ResouceData getRenderFile(); int getLayerNum(); + const std::string getResourceFile() const { return _tmxFile; } CC_CONSTRUCTOR_ACCESS: /** diff --git a/cocos/2d/CocosStudioExtension.cpp b/cocos/editor-support/cocostudio/CocosStudioExtension.cpp similarity index 100% rename from cocos/2d/CocosStudioExtension.cpp rename to cocos/editor-support/cocostudio/CocosStudioExtension.cpp 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/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/manual/LuaBasicConversions.h b/cocos/scripting/lua-bindings/manual/LuaBasicConversions.h index bdb327f1f2..e9acb967e7 100644 --- a/cocos/scripting/lua-bindings/manual/LuaBasicConversions.h +++ b/cocos/scripting/lua-bindings/manual/LuaBasicConversions.h @@ -31,7 +31,7 @@ extern "C" { #include "tolua_fix.h" #include "cocos2d.h" #include "Lua-BindingsExport.h" -#include "2d/CocosStudioExtension.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/tests/cpp-tests/Classes/ParticleTest/ParticleTest.cpp b/tests/cpp-tests/Classes/ParticleTest/ParticleTest.cpp index dee27526fa..104b8e1c4b 100644 --- a/tests/cpp-tests/Classes/ParticleTest/ParticleTest.cpp +++ b/tests/cpp-tests/Classes/ParticleTest/ParticleTest.cpp @@ -1,6 +1,6 @@ #include "ParticleTest.h" #include "../testResource.h" -#include "2d/CocosStudioExtension.h" +#include "editor-support/cocostudio/CocosStudioExtension.h" USING_NS_CC; diff --git a/tests/cpp-tests/Classes/SpriteTest/SpriteTest.cpp b/tests/cpp-tests/Classes/SpriteTest/SpriteTest.cpp index 20ccae70c3..3a1d31ec0d 100644 --- a/tests/cpp-tests/Classes/SpriteTest/SpriteTest.cpp +++ b/tests/cpp-tests/Classes/SpriteTest/SpriteTest.cpp @@ -27,7 +27,7 @@ #include #include "../testResource.h" -#include "2d/CocosStudioExtension.h" +#include "editor-support/cocostudio/CocosStudioExtension.h" USING_NS_CC; diff --git a/tests/cpp-tests/Classes/TileMapTest/TileMapTest.cpp b/tests/cpp-tests/Classes/TileMapTest/TileMapTest.cpp index c6a0dca3df..4d5e5fe512 100644 --- a/tests/cpp-tests/Classes/TileMapTest/TileMapTest.cpp +++ b/tests/cpp-tests/Classes/TileMapTest/TileMapTest.cpp @@ -1,6 +1,6 @@ #include "TileMapTest.h" #include "../testResource.h" -#include "2d/CocosStudioExtension.h" + USING_NS_CC; @@ -858,10 +858,6 @@ TMXIsoZorder::TMXIsoZorder() _tamara->runAction( RepeatForever::create(seq) ); schedule( CC_SCHEDULE_SELECTOR(TMXIsoZorder::repositionSprite) ); - - int layerCount = map->getLayerNum(); - auto rd = map->getRenderFile(); - CCLOG("There's %d layer in map. Resource type is : %d, file name : %s", layerCount, rd.type, 0 ==rd.type ? rd.file.c_str() : rd.plist.c_str()); } TMXIsoZorder::~TMXIsoZorder() From 8d546828f437dcfb37b97f55a746daee2ec9d9d4 Mon Sep 17 00:00:00 2001 From: yangxiao Date: Fri, 4 Dec 2015 10:54:43 +0800 Subject: [PATCH 24/30] fix Sprite3D::setMaterial --- cocos/3d/CCSprite3D.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 From 1171c6aaa179ffbaaca0b5d8829905c6acd05fee Mon Sep 17 00:00:00 2001 From: XiaoFeng Date: Fri, 4 Dec 2015 14:55:54 +0800 Subject: [PATCH 25/30] Remove desktop only function, set ondraw serial function in DrawNode override able. --- cocos/2d/CCDrawNode.cpp | 25 ------------------- cocos/2d/CCDrawNode.h | 13 +++------- .../DrawPrimitivesTest/DrawPrimitivesTest.cpp | 3 +-- 3 files changed, 4 insertions(+), 37 deletions(-) diff --git a/cocos/2d/CCDrawNode.cpp b/cocos/2d/CCDrawNode.cpp index 0223e9e62a..ee14525d29 100644 --- a/cocos/2d/CCDrawNode.cpp +++ b/cocos/2d/CCDrawNode.cpp @@ -125,7 +125,6 @@ DrawNode::DrawNode(int lineWidth) , _dirtyGLLine(false) , _lineWidth(lineWidth) , _defaultLineWidth(lineWidth) -, _lineSmoothEnable(false) { _blendFunc = BlendFunc::ALPHA_PREMULTIPLIED; } @@ -399,20 +398,6 @@ void DrawNode::onDrawGLLine(const Mat4 &transform, uint32_t flags) glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_TEX_COORD, 2, GL_FLOAT, GL_FALSE, sizeof(V2F_C4B_T2F), (GLvoid *)offsetof(V2F_C4B_T2F, texCoords)); } -#if CC_TARGET_PLATFORM == CC_PLATFORM_MAC || CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 - // GL_MULTISAMPLE only work on PC platform, GL_LINE_SMOOTH will not support at GLES v3.0 - if (this->_lineSmoothEnable == false) - { - glDisable(GL_MULTISAMPLE); - glDisable(GL_LINE_SMOOTH); - } - else - { - glEnable(GL_MULTISAMPLE); - glEnable(GL_LINE_SMOOTH); - } -#endif - glLineWidth(_lineWidth); glDrawArrays(GL_LINES, 0, _bufferCountGLLine); @@ -961,16 +946,6 @@ void DrawNode::setLineWidth(int lineWidth) _lineWidth = lineWidth; } -void DrawNode::setLineSmooth(bool enable) -{ - this->_lineSmoothEnable = enable; -} - -bool DrawNode::isLineSmooth() -{ - return this->_lineSmoothEnable; -} - float DrawNode::getLineWidth() { return this->_lineWidth; diff --git a/cocos/2d/CCDrawNode.h b/cocos/2d/CCDrawNode.h index ea06adf33a..972f7fe309 100644 --- a/cocos/2d/CCDrawNode.h +++ b/cocos/2d/CCDrawNode.h @@ -300,27 +300,21 @@ 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); - // Set enable or disable multisampling effect on CocosStudio guide lines. - void setLineSmooth(bool enable); - - // Get multisampling effect on CocosStudio guide lines mode. - bool isLineSmooth(); - // Get CocosStudio guide lines width. float getLineWidth(); @@ -366,7 +360,6 @@ protected: int _lineWidth; - bool _lineSmoothEnable; int _defaultLineWidth; private: CC_DISALLOW_COPY_AND_ASSIGN(DrawNode); diff --git a/tests/cpp-tests/Classes/DrawPrimitivesTest/DrawPrimitivesTest.cpp b/tests/cpp-tests/Classes/DrawPrimitivesTest/DrawPrimitivesTest.cpp index 8385df858b..f3048c5408 100644 --- a/tests/cpp-tests/Classes/DrawPrimitivesTest/DrawPrimitivesTest.cpp +++ b/tests/cpp-tests/Classes/DrawPrimitivesTest/DrawPrimitivesTest.cpp @@ -294,8 +294,7 @@ DrawNodeTest::DrawNodeTest() auto draw1 = DrawNode::create(); this->addChild(draw1, 10); - draw1->setLineWidth(1); - draw1->setLineSmooth(true); + 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); } From 71217fd39388b9e27959d88e28ee2b7deb3fd662 Mon Sep 17 00:00:00 2001 From: XiaoFeng Date: Fri, 4 Dec 2015 15:14:47 +0800 Subject: [PATCH 26/30] Fix indent --- cocos/2d/CCDrawNode.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cocos/2d/CCDrawNode.h b/cocos/2d/CCDrawNode.h index 972f7fe309..f296e0ac06 100644 --- a/cocos/2d/CCDrawNode.h +++ b/cocos/2d/CCDrawNode.h @@ -300,11 +300,11 @@ public: /** * @js NA */ - virtual void onDraw(const Mat4 &transform, uint32_t flags); + virtual void onDraw(const Mat4 &transform, uint32_t flags); /** * @js NA */ - virtual void onDrawGLLine(const Mat4 &transform, uint32_t flags); + virtual void onDrawGLLine(const Mat4 &transform, uint32_t flags); /** * @js NA */ From ddb0fc91b2a0c6427b4a24d27d8e1213f8fc7bcc Mon Sep 17 00:00:00 2001 From: CocosRobot Date: Fri, 4 Dec 2015 08:07:09 +0000 Subject: [PATCH 27/30] [AUTO][ci skip]: updating cocos2dx_files.json --- templates/cocos2dx_files.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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", From d5e54bdb8147d3f04d0ad1165d304c3acfb3bb72 Mon Sep 17 00:00:00 2001 From: CocosRobot Date: Fri, 4 Dec 2015 09:48:13 +0000 Subject: [PATCH 28/30] [ci skip][AUTO]: updating luabinding & jsbinding automatically --- .../auto/api/jsb_cocos2dx_auto_api.js | 148 +++- .../js-bindings/auto/jsb_cocos2dx_auto.cpp | 299 +++++++- .../js-bindings/auto/jsb_cocos2dx_auto.hpp | 15 +- .../lua-bindings/auto/api/Camera.lua | 6 + .../auto/api/CameraBackgroundBrush.lua | 6 + .../auto/api/CameraBackgroundSkyBoxBrush.lua | 26 + .../lua-bindings/auto/api/DrawNode.lua | 6 + .../lua-bindings/auto/api/ParticleSystem.lua | 6 + .../lua-bindings/auto/api/Sprite.lua | 12 + .../auto/api/SpriteFrameCache.lua | 7 + .../lua-bindings/auto/api/TMXMapInfo.lua | 6 + .../lua-bindings/auto/lua_cocos2dx_auto.cpp | 693 +++++++++++++++++- .../lua-bindings/auto/lua_cocos2dx_auto.hpp | 13 + 13 files changed, 1206 insertions(+), 37 deletions(-) diff --git a/cocos/scripting/js-bindings/auto/api/jsb_cocos2dx_auto_api.js b/cocos/scripting/js-bindings/auto/api/jsb_cocos2dx_auto_api.js index 79e864224d..626f1990b7 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 @@ -11911,6 +11911,16 @@ color4f { }, +/** + * @method getLineWidth + * @return {float} + */ +getLineWidth : function ( +) +{ + return 0; +}, + /** * @method drawPoint * @param {vec2_object} arg0 @@ -15223,6 +15233,16 @@ getStartSpin : function ( return 0; }, +/** + * @method getResourceFile + * @return {String} + */ +getResourceFile : function ( +) +{ + return ; +}, + /** * @method getRotatePerSecond * @return {float} @@ -16805,6 +16825,16 @@ float { }, +/** + * @method getResourceType + * @return {int} + */ +getResourceType : function ( +) +{ + return 0; +}, + /** * @method initWithTexture * @param {cc.Texture2D|cc.Texture2D|cc.Texture2D} texture2d @@ -16951,6 +16981,16 @@ getSpriteFrame : function ( return cc.SpriteFrame; }, +/** + * @method getResourceName + * @return {String} + */ +getResourceName : function ( +) +{ + return ; +}, + /** * @method isDirty * @return {bool} @@ -18798,6 +18838,16 @@ getProjectionMatrix : function ( return cc.Mat4; }, +/** + * @method isBrushValid + * @return {bool} + */ +isBrushValid : function ( +) +{ + return false; +}, + /** * @method getDepthInView * @param {mat4_object} arg0 @@ -19158,6 +19208,16 @@ init : function ( return false; }, +/** + * @method isValid + * @return {bool} + */ +isValid : function ( +) +{ + return false; +}, + /** * @method createSkyboxBrush * @param {String} arg0 @@ -19308,6 +19368,16 @@ CameraBackgroundColorBrush : function ( */ cc.CameraBackgroundSkyBoxBrush = { +/** + * @method setTextureValid + * @param {bool} arg0 + */ +setTextureValid : function ( +bool +) +{ +}, + /** * @method setTexture * @param {cc.TextureCube} arg0 @@ -19318,6 +19388,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 +21673,18 @@ SpriteBatchNode : function ( */ cc.SpriteFrameCache = { +/** + * @method reloadTexture + * @param {String} arg0 + * @return {bool} + */ +reloadTexture : function ( +str +) +{ + return false; +}, + /** * @method addSpriteFramesWithFileContent * @param {String} arg0 @@ -22336,6 +22438,16 @@ getTileProperties : function ( return map_object; }, +/** + * @method getExternalTilesetFileName + * @return {String} + */ +getExternalTilesetFileName : function ( +) +{ + return ; +}, + /** * @method getObjectGroups * @return {Array|Array} @@ -22798,6 +22910,16 @@ str return cc.Value; }, +/** + * @method getLayerNum + * @return {int} + */ +getLayerNum : function ( +) +{ + return 0; +}, + /** * @method setMapSize * @param {size_object} arg0 @@ -22831,17 +22953,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 +22994,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/jsb_cocos2dx_auto.cpp b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_auto.cpp index 017bc4a707..20f4ff810c 100644 --- a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_auto.cpp +++ b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_auto.cpp @@ -33496,6 +33496,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,6 +33571,7 @@ 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; @@ -33567,6 +33586,23 @@ bool js_cocos2dx_DrawNode_create(JSContext *cx, uint32_t argc, jsval *vp) args.rval().set(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"); + cocos2d::DrawNode* ret = cocos2d::DrawNode::create(arg0); + 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); + return true; + } JS_ReportError(cx, "js_cocos2dx_DrawNode_create : wrong number of arguments"); return false; } @@ -33644,6 +33680,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), @@ -42626,6 +42663,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); @@ -43700,6 +43755,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), @@ -46675,6 +46731,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 +47129,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 +47474,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 +47488,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), @@ -53507,6 +53601,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); @@ -54144,6 +54256,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 +54375,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); @@ -54423,6 +54554,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 }; @@ -54676,6 +54808,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 +54856,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 +54991,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 }; @@ -60798,6 +60991,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); @@ -61161,6 +61376,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), @@ -62695,6 +62911,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; @@ -63098,6 +63332,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), @@ -63872,6 +64107,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 +64208,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 +64284,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); @@ -64319,13 +64590,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), diff --git a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_auto.hpp b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_auto.hpp index d70487a0ca..fb22303582 100644 --- a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_auto.hpp +++ b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_auto.hpp @@ -2209,6 +2209,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 +2679,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 +2943,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 +2957,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 +3408,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 +3449,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 +3485,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 +3851,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 +3967,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 +4026,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/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); + + + + + + + + + + + + + From cd8631ef093a8e5524fbecd087f0d13500842d4e Mon Sep 17 00:00:00 2001 From: Ricardo Quesada Date: Fri, 4 Dec 2015 18:42:31 -0800 Subject: [PATCH 29/30] sfunction "create" uses new optimized code ...although this code should never be called --- cocos/renderer/CCGLProgramState.h | 2 +- .../auto/api/jsb_cocos2dx_auto_api.js | 28 - .../js-bindings/auto/jsb_cocos2dx_3d_auto.cpp | 73 +- .../auto/jsb_cocos2dx_audioengine_auto.cpp | 14 + .../js-bindings/auto/jsb_cocos2dx_auto.cpp | 2711 ++++++----------- .../js-bindings/auto/jsb_cocos2dx_auto.hpp | 2 - .../jsb_cocos2dx_experimental_video_auto.cpp | 16 +- ...jsb_cocos2dx_experimental_webView_auto.cpp | 16 +- .../auto/jsb_cocos2dx_extension_auto.cpp | 144 +- .../auto/jsb_cocos2dx_navmesh_auto.cpp | 50 +- .../auto/jsb_cocos2dx_physics3d_auto.cpp | 38 +- .../auto/jsb_cocos2dx_studio_auto.cpp | 515 +--- .../js-bindings/auto/jsb_cocos2dx_ui_auto.cpp | 278 +- .../js-bindings/manual/ScriptingCore.cpp | 26 + .../js-bindings/manual/ScriptingCore.h | 17 + tools/tojs/cocos2dx.ini | 4 +- tools/tojs/genbindings.py | 26 +- 17 files changed, 1324 insertions(+), 2636 deletions(-) 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 fd86408908..cb6def48a1 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 @@ -4879,20 +4879,6 @@ getElapsed : function ( */ cc.Sequence = { -/** - * @method initWithTwoActions - * @param {cc.FiniteTimeAction} arg0 - * @param {cc.FiniteTimeAction} arg1 - * @return {bool} - */ -initWithTwoActions : function ( -finitetimeaction, -finitetimeaction -) -{ - return false; -}, - /** * @method Sequence * @constructor @@ -5033,20 +5019,6 @@ RepeatForever : function ( */ cc.Spawn = { -/** - * @method initWithTwoActions - * @param {cc.FiniteTimeAction} arg0 - * @param {cc.FiniteTimeAction} arg1 - * @return {bool} - */ -initWithTwoActions : function ( -finitetimeaction, -finitetimeaction -) -{ - return false; -}, - /** * @method Spawn * @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..c9b90c6f4e 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,6 +608,7 @@ 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 { @@ -650,6 +640,7 @@ 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 { @@ -799,17 +790,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 +883,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,6 +1146,7 @@ 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 { @@ -1194,6 +1174,7 @@ 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 { @@ -3476,6 +3457,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 +4344,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 +4403,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 +4425,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 a2aedfa7b5..7ebd3791af 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); @@ -1710,17 +1711,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"); @@ -5164,17 +5159,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"); @@ -5620,6 +5609,7 @@ 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 { @@ -5641,17 +5631,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"); @@ -6307,6 +6291,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; @@ -7673,6 +7658,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 { @@ -8055,6 +8041,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 { @@ -8739,17 +8726,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"); @@ -8930,17 +8911,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) { @@ -8957,17 +8932,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"); @@ -10431,17 +10400,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"); @@ -10456,6 +10419,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 { @@ -10489,6 +10453,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 { @@ -10518,6 +10483,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 { @@ -11539,17 +11505,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"); @@ -12105,6 +12065,7 @@ 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 { @@ -12124,6 +12085,7 @@ 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 { @@ -12145,6 +12107,7 @@ 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 { @@ -12386,46 +12349,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_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); @@ -12478,7 +12401,6 @@ void js_register_cocos2dx_Sequence(JSContext *cx, JS::HandleObject global) { }; static JSFunctionSpec funcs[] = { - 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 }; @@ -12608,17 +12530,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"); @@ -12808,17 +12724,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"); @@ -12909,46 +12819,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_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); @@ -13001,7 +12871,6 @@ void js_register_cocos2dx_Spawn(JSContext *cx, JS::HandleObject global) { }; static JSFunctionSpec funcs[] = { - 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 }; @@ -13864,17 +13733,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"); @@ -14001,17 +13864,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"); @@ -14142,17 +13999,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"); @@ -14283,17 +14134,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"); @@ -14976,17 +14821,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"); @@ -15109,17 +14948,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"); @@ -15244,17 +15077,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"); @@ -15379,17 +15206,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"); @@ -15689,17 +15510,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"); @@ -15796,17 +15611,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"); @@ -15940,17 +15749,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"); @@ -16179,17 +15982,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"); @@ -16423,17 +16220,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"); @@ -16610,17 +16401,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"); @@ -17145,6 +16930,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 { @@ -18010,6 +17796,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); @@ -18038,6 +17825,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); @@ -18058,6 +17846,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); @@ -18076,6 +17865,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 { @@ -18111,6 +17901,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); @@ -18969,6 +18760,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 { @@ -20033,17 +19825,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"); @@ -20155,17 +19941,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"); @@ -21343,17 +21123,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"); @@ -21897,17 +21671,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"); @@ -21984,17 +21752,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"); @@ -22100,17 +21862,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"); @@ -22216,17 +21972,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"); @@ -22330,17 +22080,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"); @@ -22444,17 +22188,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"); @@ -22558,17 +22296,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"); @@ -22672,17 +22404,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"); @@ -22786,17 +22512,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"); @@ -22900,17 +22620,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"); @@ -23638,17 +23352,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"); @@ -23752,17 +23460,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"); @@ -23866,17 +23568,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"); @@ -23980,17 +23676,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"); @@ -24094,17 +23784,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"); @@ -24208,17 +23892,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"); @@ -24348,17 +24026,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"); @@ -24463,17 +24135,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"); @@ -24577,17 +24243,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"); @@ -24691,17 +24351,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"); @@ -24805,17 +24459,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"); @@ -24919,17 +24567,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"); @@ -25033,17 +24675,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"); @@ -25147,17 +24783,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"); @@ -25261,17 +24891,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"); @@ -25375,17 +24999,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"); @@ -25489,17 +25107,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"); @@ -25603,17 +25215,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"); @@ -25717,17 +25323,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"); @@ -25831,17 +25431,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"); @@ -25945,17 +25539,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"); @@ -26059,17 +25647,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"); @@ -26207,17 +25789,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"); @@ -26309,17 +25885,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"); @@ -26411,17 +25981,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"); @@ -26520,34 +26084,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"); @@ -26650,17 +26202,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"); @@ -26779,17 +26325,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"); @@ -26908,17 +26448,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"); @@ -27392,17 +26926,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"); @@ -27504,17 +27032,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"); @@ -27705,17 +27227,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"); @@ -27846,17 +27362,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"); @@ -27954,17 +27464,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"); @@ -28190,17 +27694,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"); @@ -28442,17 +27940,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"); @@ -28573,17 +28065,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"); @@ -28774,17 +28260,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"); @@ -28987,17 +28467,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"); @@ -29234,17 +28708,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"); @@ -29807,17 +29275,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"); @@ -29907,17 +29369,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"); @@ -30044,17 +29500,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"); @@ -30185,17 +29635,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"); @@ -30310,17 +29754,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"); @@ -30499,17 +29937,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"); @@ -30681,17 +30113,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"); @@ -30793,17 +30219,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"); @@ -30901,17 +30321,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"); @@ -31009,17 +30423,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"); @@ -31439,17 +30847,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"); @@ -31644,17 +31046,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"); @@ -31781,17 +31177,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"); @@ -31898,17 +31288,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"); @@ -32023,17 +31407,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"); @@ -32367,17 +31745,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"); @@ -33440,17 +32812,11 @@ bool js_cocos2dx_DrawNode_create(JSContext *cx, uint32_t argc, jsval *vp) { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); 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; } JS_ReportError(cx, "js_cocos2dx_DrawNode_create : wrong number of arguments"); @@ -34912,6 +34278,7 @@ 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 { @@ -34933,6 +34300,7 @@ 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 { @@ -34956,6 +34324,7 @@ 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 { @@ -34981,6 +34350,7 @@ 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 { @@ -35002,17 +34372,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"); @@ -35124,6 +34488,7 @@ 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 { @@ -35147,6 +34512,7 @@ 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 { @@ -35172,6 +34538,7 @@ 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 { @@ -35199,6 +34566,7 @@ 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 { @@ -36904,6 +36272,7 @@ 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 { @@ -37032,17 +36401,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"); @@ -37134,17 +36497,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"); @@ -38989,6 +38346,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); @@ -39003,6 +38361,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); @@ -41174,17 +40533,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) { @@ -41193,17 +40546,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"); @@ -41226,6 +40573,7 @@ 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 { @@ -41253,6 +40601,7 @@ 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 { @@ -43441,17 +42790,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"); @@ -43466,6 +42809,7 @@ 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 { @@ -43821,6 +43165,7 @@ 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 { @@ -43911,17 +43256,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"); @@ -43936,6 +43275,7 @@ 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 { @@ -44063,17 +43403,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"); @@ -44088,6 +43422,7 @@ 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 { @@ -44217,17 +43552,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"); @@ -44242,6 +43571,7 @@ 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 { @@ -44371,17 +43701,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"); @@ -44396,6 +43720,7 @@ 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 { @@ -44525,17 +43850,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"); @@ -44550,6 +43869,7 @@ 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 { @@ -44679,17 +43999,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"); @@ -44704,6 +44018,7 @@ 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 { @@ -44833,17 +44148,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"); @@ -44858,6 +44167,7 @@ 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 { @@ -44987,17 +44297,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"); @@ -45012,6 +44316,7 @@ 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 { @@ -45141,17 +44446,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"); @@ -45166,6 +44465,7 @@ 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 { @@ -45295,17 +44595,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"); @@ -45320,6 +44614,7 @@ 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 { @@ -45449,17 +44744,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"); @@ -45474,6 +44763,7 @@ 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 { @@ -45862,17 +45152,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"); @@ -46276,17 +45560,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"); @@ -48296,17 +47574,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"); @@ -48453,17 +47725,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"); @@ -48570,17 +47836,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"); @@ -48686,17 +47946,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"); @@ -48864,17 +48118,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"); @@ -48982,17 +48230,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"); @@ -49098,17 +48340,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"); @@ -49214,17 +48450,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"); @@ -49392,17 +48622,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"); @@ -49510,17 +48734,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"); @@ -49626,17 +48844,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"); @@ -49742,17 +48954,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"); @@ -49895,17 +49101,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"); @@ -51149,17 +50349,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"); @@ -51302,17 +50496,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"); @@ -51481,17 +50669,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"); @@ -51599,17 +50781,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"); @@ -51781,17 +50957,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"); @@ -51899,17 +51069,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"); @@ -52015,17 +51179,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"); @@ -52131,17 +51289,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"); @@ -52312,17 +51464,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"); @@ -52430,17 +51576,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"); @@ -52546,17 +51686,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"); @@ -52662,17 +51796,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"); @@ -52778,17 +51906,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"); @@ -52894,17 +52016,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"); @@ -53010,17 +52126,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"); @@ -53126,17 +52236,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"); @@ -53842,6 +52946,7 @@ 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 { @@ -53863,6 +52968,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 { @@ -53884,17 +52990,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"); @@ -53915,6 +53015,7 @@ 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 { @@ -53936,6 +53037,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; @@ -53967,6 +53069,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 { @@ -54166,6 +53269,7 @@ 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 { @@ -54193,6 +53297,7 @@ 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 { @@ -54214,6 +53319,7 @@ 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 { @@ -54236,6 +53342,7 @@ 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 { @@ -54253,6 +53360,7 @@ bool js_cocos2dx_CameraBackgroundBrush_createDepthBrush(JSContext *cx, uint32_t 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 { @@ -54366,17 +53474,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"); @@ -54479,17 +53581,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"); @@ -56005,17 +55101,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"); @@ -56140,17 +55230,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"); @@ -56448,17 +55532,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"); @@ -56549,17 +55627,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"); @@ -57533,6 +56605,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 { @@ -58076,17 +57149,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"); @@ -58119,6 +57186,7 @@ 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 { @@ -58345,17 +57413,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"); @@ -58388,6 +57450,7 @@ 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 { @@ -58699,6 +57762,7 @@ 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 { @@ -58732,6 +57796,7 @@ 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 { @@ -58765,6 +57830,7 @@ 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 { @@ -59412,6 +58478,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); @@ -59618,6 +58685,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 { @@ -59840,6 +58908,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 { @@ -60487,17 +59556,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) { @@ -60506,17 +59569,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"); @@ -60539,6 +59596,7 @@ 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 { @@ -60566,6 +59624,7 @@ 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 { @@ -61010,6 +60069,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 { @@ -61597,17 +60657,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"); @@ -62871,17 +61925,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"); @@ -62898,6 +61946,7 @@ 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 { @@ -63596,17 +62645,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"); @@ -64107,17 +63150,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"); @@ -64134,6 +63171,7 @@ 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 { @@ -64390,17 +63428,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"); @@ -64975,6 +64007,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 { @@ -65068,17 +64101,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 68fb107c0b..652fb03bc7 100644 --- a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_auto.hpp +++ b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_auto.hpp @@ -646,7 +646,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_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; @@ -682,7 +681,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_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; 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..7339244052 100644 --- a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_physics3d_auto.cpp +++ b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_physics3d_auto.cpp @@ -199,6 +199,7 @@ 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 { @@ -226,6 +227,7 @@ 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 { @@ -261,6 +263,7 @@ 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 { @@ -288,6 +291,7 @@ 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 { @@ -313,6 +317,7 @@ 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 { @@ -2055,6 +2060,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 +2729,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 +5585,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..60ee24db9d 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,6 +6263,7 @@ 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 { @@ -6659,17 +6602,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 +7241,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 +7590,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 +8282,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 +8402,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 +8522,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 +8680,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 +8764,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 +8958,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 +9140,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 +9263,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 +9537,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 +9665,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 +9785,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 +9921,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 +10042,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 +10162,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 +10557,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 +10711,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 +11547,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 +12368,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 +12544,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..9b07c0aa33 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,17 +2948,11 @@ 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"); @@ -2992,6 +2963,7 @@ bool js_cocos2dx_ui_Layout_createInstance(JSContext *cx, uint32_t argc, jsval *v { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { + cocos2d::Ref* ret = cocos2d::ui::Layout::createInstance(); jsval jsret = JSVAL_NULL; do { @@ -4091,6 +4063,7 @@ bool js_cocos2dx_ui_Button_createInstance(JSContext *cx, uint32_t argc, jsval *v { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { + cocos2d::Ref* ret = cocos2d::ui::Button::createInstance(); jsval jsret = JSVAL_NULL; do { @@ -5023,6 +4996,7 @@ bool js_cocos2dx_ui_CheckBox_createInstance(JSContext *cx, uint32_t argc, jsval { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { + cocos2d::Ref* ret = cocos2d::ui::CheckBox::createInstance(); jsval jsret = JSVAL_NULL; do { @@ -5315,6 +5289,7 @@ bool js_cocos2dx_ui_RadioButton_createInstance(JSContext *cx, uint32_t argc, jsv { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { + cocos2d::Ref* ret = cocos2d::ui::RadioButton::createInstance(); jsval jsret = JSVAL_NULL; do { @@ -5733,17 +5708,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"); @@ -6090,6 +6059,7 @@ bool js_cocos2dx_ui_ImageView_createInstance(JSContext *cx, uint32_t argc, jsval { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { + cocos2d::Ref* ret = cocos2d::ui::ImageView::createInstance(); jsval jsret = JSVAL_NULL; do { @@ -6765,6 +6735,7 @@ 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 { @@ -7066,6 +7037,7 @@ bool js_cocos2dx_ui_TextAtlas_createInstance(JSContext *cx, uint32_t argc, jsval { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { + cocos2d::Ref* ret = cocos2d::ui::TextAtlas::createInstance(); jsval jsret = JSVAL_NULL; do { @@ -7489,6 +7461,7 @@ bool js_cocos2dx_ui_LoadingBar_createInstance(JSContext *cx, uint32_t argc, jsva { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { + cocos2d::Ref* ret = cocos2d::ui::LoadingBar::createInstance(); jsval jsret = JSVAL_NULL; do { @@ -8627,17 +8600,11 @@ 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"); @@ -8648,6 +8615,7 @@ bool js_cocos2dx_ui_ScrollView_createInstance(JSContext *cx, uint32_t argc, jsva { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { + cocos2d::Ref* ret = cocos2d::ui::ScrollView::createInstance(); jsval jsret = JSVAL_NULL; do { @@ -9533,17 +9501,11 @@ 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"); @@ -9554,6 +9516,7 @@ bool js_cocos2dx_ui_ListView_createInstance(JSContext *cx, uint32_t argc, jsval { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { + cocos2d::Ref* ret = cocos2d::ui::ListView::createInstance(); jsval jsret = JSVAL_NULL; do { @@ -10353,6 +10316,7 @@ bool js_cocos2dx_ui_Slider_createInstance(JSContext *cx, uint32_t argc, jsval *v { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { + cocos2d::Ref* ret = cocos2d::ui::Slider::createInstance(); jsval jsret = JSVAL_NULL; do { @@ -11011,17 +10975,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"); @@ -11992,6 +11950,7 @@ bool js_cocos2dx_ui_TextField_createInstance(JSContext *cx, uint32_t argc, jsval { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { + cocos2d::Ref* ret = cocos2d::ui::TextField::createInstance(); jsval jsret = JSVAL_NULL; do { @@ -12277,6 +12236,7 @@ bool js_cocos2dx_ui_TextBMFont_createInstance(JSContext *cx, uint32_t argc, jsva { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { + cocos2d::Ref* ret = cocos2d::ui::TextBMFont::createInstance(); jsval jsret = JSVAL_NULL; do { @@ -12825,17 +12785,11 @@ 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"); @@ -12846,6 +12800,7 @@ bool js_cocos2dx_ui_PageView_createInstance(JSContext *cx, uint32_t argc, jsval { JS::CallArgs args = JS::CallArgsFromVp(argc, vp); if (argc == 0) { + cocos2d::Ref* ret = cocos2d::ui::PageView::createInstance(); jsval jsret = JSVAL_NULL; do { @@ -12977,6 +12932,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 +12959,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 +13004,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 +13040,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 +13076,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 +13104,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 +13344,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 +13479,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 +13630,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 +13865,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 +17397,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 +17424,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 +17763,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/manual/ScriptingCore.cpp b/cocos/scripting/js-bindings/manual/ScriptingCore.cpp index 035ef39639..d02b23901f 100644 --- a/cocos/scripting/js-bindings/manual/ScriptingCore.cpp +++ b/cocos/scripting/js-bindings/manual/ScriptingCore.cpp @@ -2007,6 +2007,17 @@ 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); @@ -2029,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 a57b5ffce4..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,15 @@ 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 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/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 From d02f4afd4a37a888b80160d1394bb4ded7e9f23e Mon Sep 17 00:00:00 2001 From: Ricardo Quesada Date: Sat, 5 Dec 2015 22:26:54 -0800 Subject: [PATCH 30/30] using new bindings templates ignores createInstance() from ui --- .../auto/api/jsb_cocos2dx_ui_auto_api.js | 140 ---- .../js-bindings/auto/jsb_cocos2dx_3d_auto.cpp | 60 +- .../js-bindings/auto/jsb_cocos2dx_auto.cpp | 676 +++++------------- .../auto/jsb_cocos2dx_physics3d_auto.cpp | 75 +- .../auto/jsb_cocos2dx_studio_auto.cpp | 15 +- .../js-bindings/auto/jsb_cocos2dx_ui_auto.cpp | 322 --------- .../js-bindings/auto/jsb_cocos2dx_ui_auto.hpp | 14 - tools/bindings-generator | 2 +- tools/tojs/cocos2dx_ui.ini | 2 +- 9 files changed, 223 insertions(+), 1083 deletions(-) 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 c9b90c6f4e..0c732036a9 100644 --- a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_3d_auto.cpp +++ b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_3d_auto.cpp @@ -609,17 +609,10 @@ bool js_cocos2dx_3d_Animate3D_createWithFrames(JSContext *cx, uint32_t argc, jsv 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) { @@ -641,17 +634,10 @@ bool js_cocos2dx_3d_Animate3D_createWithFrames(JSContext *cx, uint32_t argc, jsv 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"); @@ -1147,17 +1133,10 @@ bool js_cocos2dx_3d_BillBoard_createWithTexture(JSContext *cx, uint32_t argc, js } 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) { @@ -1175,17 +1154,10 @@ bool js_cocos2dx_3d_BillBoard_createWithTexture(JSContext *cx, uint32_t argc, js 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"); diff --git a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_auto.cpp b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_auto.cpp index c14c058d15..364f6ff6da 100644 --- a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_auto.cpp +++ b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_auto.cpp @@ -5678,17 +5678,10 @@ bool js_cocos2dx_Scene_createWithSize(JSContext *cx, uint32_t argc, jsval *vp) 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"); @@ -12134,17 +12127,10 @@ bool js_cocos2dx_Animation_createWithSpriteFrames(JSContext *cx, uint32_t argc, 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) { @@ -12154,17 +12140,10 @@ bool js_cocos2dx_Animation_createWithSpriteFrames(JSContext *cx, uint32_t argc, 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) { @@ -12176,17 +12155,10 @@ bool js_cocos2dx_Animation_createWithSpriteFrames(JSContext *cx, uint32_t argc, 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"); @@ -32910,17 +32882,11 @@ bool js_cocos2dx_DrawNode_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_DrawNode_create : Error processing arguments"); - cocos2d::DrawNode* ret = cocos2d::DrawNode::create(arg0); - 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(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"); @@ -34384,17 +34350,10 @@ bool js_cocos2dx_Label_createWithBMFont(JSContext *cx, uint32_t argc, jsval *vp) 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) { @@ -34406,17 +34365,10 @@ bool js_cocos2dx_Label_createWithBMFont(JSContext *cx, uint32_t argc, jsval *vp) 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) { @@ -34430,17 +34382,10 @@ bool js_cocos2dx_Label_createWithBMFont(JSContext *cx, uint32_t argc, jsval *vp) 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) { @@ -34456,17 +34401,10 @@ bool js_cocos2dx_Label_createWithBMFont(JSContext *cx, uint32_t argc, jsval *vp) 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"); @@ -34594,17 +34532,10 @@ bool js_cocos2dx_Label_createWithSystemFont(JSContext *cx, uint32_t argc, jsval 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) { @@ -34618,17 +34549,10 @@ bool js_cocos2dx_Label_createWithSystemFont(JSContext *cx, uint32_t argc, jsval 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) { @@ -34644,17 +34568,10 @@ bool js_cocos2dx_Label_createWithSystemFont(JSContext *cx, uint32_t argc, jsval 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) { @@ -34672,17 +34589,10 @@ bool js_cocos2dx_Label_createWithSystemFont(JSContext *cx, uint32_t argc, jsval 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"); @@ -36378,17 +36288,10 @@ bool js_cocos2dx_LabelTTF_createWithFontDefinition(JSContext *cx, uint32_t argc, 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"); @@ -40679,17 +40582,10 @@ bool js_cocos2dx_ParticleBatchNode_createWithTexture(JSContext *cx, uint32_t arg } 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) { @@ -40707,17 +40603,10 @@ bool js_cocos2dx_ParticleBatchNode_createWithTexture(JSContext *cx, uint32_t arg 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"); @@ -42933,17 +42822,10 @@ bool js_cocos2dx_ParticleSystem_createWithTotalParticles(JSContext *cx, uint32_t 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"); @@ -43290,17 +43172,10 @@ bool js_cocos2dx_ParticleSystemQuad_createWithTotalParticles(JSContext *cx, uint 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"); @@ -43400,17 +43275,10 @@ bool js_cocos2dx_ParticleFire_createWithTotalParticles(JSContext *cx, uint32_t a 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"); @@ -43547,17 +43415,10 @@ bool js_cocos2dx_ParticleFireworks_createWithTotalParticles(JSContext *cx, uint3 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"); @@ -43696,17 +43557,10 @@ bool js_cocos2dx_ParticleSun_createWithTotalParticles(JSContext *cx, uint32_t ar 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"); @@ -43845,17 +43699,10 @@ bool js_cocos2dx_ParticleGalaxy_createWithTotalParticles(JSContext *cx, uint32_t 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"); @@ -43994,17 +43841,10 @@ bool js_cocos2dx_ParticleFlower_createWithTotalParticles(JSContext *cx, uint32_t 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"); @@ -44143,17 +43983,10 @@ bool js_cocos2dx_ParticleMeteor_createWithTotalParticles(JSContext *cx, uint32_t 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"); @@ -44292,17 +44125,10 @@ bool js_cocos2dx_ParticleSpiral_createWithTotalParticles(JSContext *cx, uint32_t 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"); @@ -44441,17 +44267,10 @@ bool js_cocos2dx_ParticleExplosion_createWithTotalParticles(JSContext *cx, uint3 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"); @@ -44590,17 +44409,10 @@ bool js_cocos2dx_ParticleSmoke_createWithTotalParticles(JSContext *cx, uint32_t 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"); @@ -44739,17 +44551,10 @@ bool js_cocos2dx_ParticleSnow_createWithTotalParticles(JSContext *cx, uint32_t a 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"); @@ -44888,17 +44693,10 @@ bool js_cocos2dx_ParticleRain_createWithTotalParticles(JSContext *cx, uint32_t a 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"); @@ -53127,17 +52925,10 @@ bool js_cocos2dx_Camera_createOrthographic(JSContext *cx, uint32_t argc, jsval * 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"); @@ -53196,17 +52987,10 @@ bool js_cocos2dx_Camera_createPerspective(JSContext *cx, uint32_t argc, jsval *v 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"); @@ -53469,17 +53253,10 @@ bool js_cocos2dx_CameraBackgroundBrush_createSkyboxBrush(JSContext *cx, uint32_t 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"); @@ -53497,17 +53274,10 @@ bool js_cocos2dx_CameraBackgroundBrush_createColorBrush(JSContext *cx, uint32_t 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"); @@ -53519,17 +53289,10 @@ 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"); @@ -53542,17 +53305,10 @@ bool js_cocos2dx_CameraBackgroundBrush_createDepthBrush(JSContext *cx, uint32_t 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) { @@ -53560,17 +53316,10 @@ bool js_cocos2dx_CameraBackgroundBrush_createDepthBrush(JSContext *cx, uint32_t 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"); @@ -57448,17 +57197,10 @@ bool js_cocos2dx_Pass_createWithGLProgramState(JSContext *cx, uint32_t argc, jsv } 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"); @@ -57712,17 +57454,10 @@ bool js_cocos2dx_Technique_createWithGLProgramState(JSContext *cx, uint32_t argc } 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"); @@ -58024,17 +57759,10 @@ bool js_cocos2dx_Material_createWithFilename(JSContext *cx, uint32_t argc, jsval 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"); @@ -58058,17 +57786,10 @@ bool js_cocos2dx_Material_createWithGLStateProgram(JSContext *cx, uint32_t argc, } 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"); @@ -58092,17 +57813,10 @@ bool js_cocos2dx_Material_createWithProperties(JSContext *cx, uint32_t argc, jsv } 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"); @@ -59858,17 +59572,10 @@ bool js_cocos2dx_SpriteBatchNode_createWithTexture(JSContext *cx, uint32_t argc, } 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) { @@ -59886,17 +59593,10 @@ bool js_cocos2dx_SpriteBatchNode_createWithTexture(JSContext *cx, uint32_t argc, 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"); @@ -62249,17 +61949,10 @@ bool js_cocos2dx_TMXMapInfo_createWithXML(JSContext *cx, uint32_t argc, jsval *v 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"); @@ -63511,17 +63204,10 @@ bool js_cocos2dx_TMXTiledMap_createWithXML(JSContext *cx, uint32_t argc, jsval * 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"); 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 7339244052..49a58325e4 100644 --- a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_physics3d_auto.cpp +++ b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_physics3d_auto.cpp @@ -200,17 +200,10 @@ bool js_cocos2dx_physics3d_Physics3DShape_createBox(JSContext *cx, uint32_t argc 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"); @@ -228,17 +221,10 @@ bool js_cocos2dx_physics3d_Physics3DShape_createCylinder(JSContext *cx, uint32_t 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"); @@ -264,17 +250,10 @@ bool js_cocos2dx_physics3d_Physics3DShape_createConvexHull(JSContext *cx, uint32 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"); @@ -292,17 +271,10 @@ bool js_cocos2dx_physics3d_Physics3DShape_createCapsule(JSContext *cx, uint32_t 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"); @@ -318,17 +290,10 @@ bool js_cocos2dx_physics3d_Physics3DShape_createSphere(JSContext *cx, uint32_t a 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"); 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 60ee24db9d..7ca25e49fe 100644 --- a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_studio_auto.cpp +++ b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_studio_auto.cpp @@ -6264,17 +6264,10 @@ bool js_cocos2dx_studio_Skin_createWithSpriteFrameName(JSContext *cx, uint32_t a 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"); 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 9b07c0aa33..89e0498c8c 100644 --- a/cocos/scripting/js-bindings/auto/jsb_cocos2dx_ui_auto.cpp +++ b/cocos/scripting/js-bindings/auto/jsb_cocos2dx_ui_auto.cpp @@ -2959,28 +2959,6 @@ bool js_cocos2dx_ui_Layout_create(JSContext *cx, uint32_t argc, jsval *vp) 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); @@ -3073,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 }; @@ -4059,28 +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); @@ -4176,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 }; @@ -4992,28 +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); @@ -5073,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 }; @@ -5285,28 +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); @@ -5366,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 }; @@ -6055,28 +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); @@ -6143,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 }; @@ -6731,28 +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); @@ -6835,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 }; @@ -7033,28 +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); @@ -7119,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 }; @@ -7457,28 +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); @@ -7547,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 }; @@ -8611,28 +8427,6 @@ bool js_cocos2dx_ui_ScrollView_create(JSContext *cx, uint32_t argc, jsval *vp) 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); @@ -8742,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 }; @@ -9512,28 +9305,6 @@ bool js_cocos2dx_ui_ListView_create(JSContext *cx, uint32_t argc, jsval *vp) 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); @@ -9622,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 }; @@ -10312,28 +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); @@ -10417,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 }; @@ -11946,28 +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); @@ -12067,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 }; @@ -12232,28 +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); @@ -12317,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 }; @@ -12796,28 +12497,6 @@ bool js_cocos2dx_ui_PageView_create(JSContext *cx, uint32_t argc, jsval *vp) 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); @@ -12896,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 }; 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/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_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],