diff --git a/CHANGELOG b/CHANGELOG index ae0b7d74bc..78a3a19328 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -4,6 +4,8 @@ cocos2d-x-3.3?? ?? [NEW] UI: added `WebView` on iOS and Android [FIX] Node: create unneeded temple `Vec2` object in `setPosition(int, int)`, `setPositionX()` and `setPositionY()` + [FIX] Node: skew effect is wrong + [FIX] TextureAtlas: may crash if only drawing part of it cocos2d-x-3.3alpha0 Aug.28 2014 [NEW] 3D: Added Camera, AABB, OBB and Ray diff --git a/build/cocos2d_libs.xcodeproj/project.pbxproj b/build/cocos2d_libs.xcodeproj/project.pbxproj index d171951a40..c49581a417 100644 --- a/build/cocos2d_libs.xcodeproj/project.pbxproj +++ b/build/cocos2d_libs.xcodeproj/project.pbxproj @@ -3357,13 +3357,6 @@ name = "text-input-node"; sourceTree = ""; }; - 1A5702CC180BCE410088DEC7 /* textures */ = { - isa = PBXGroup; - children = ( - ); - name = textures; - sourceTree = ""; - }; 1A5702DF180BCE610088DEC7 /* tilemap-parallax-nodes */ = { isa = PBXGroup; children = ( @@ -4499,7 +4492,6 @@ 1A570275180BCC840088DEC7 /* sprite-nodes */, 1A57029A180BCD4F0088DEC7 /* support */, 1A5702BC180BCE0A0088DEC7 /* text-input-node */, - 1A5702CC180BCE410088DEC7 /* textures */, 1A5702DF180BCE610088DEC7 /* tilemap-parallax-nodes */, ); name = 2d; diff --git a/cocos/2d/CCActionCamera.cpp b/cocos/2d/CCActionCamera.cpp index 79e33e82dc..820de644e0 100644 --- a/cocos/2d/CCActionCamera.cpp +++ b/cocos/2d/CCActionCamera.cpp @@ -115,8 +115,7 @@ void ActionCamera::updateTransform() mv = mv * t; } - // XXX FIXME TODO - // Using the AdditionalTransform is a complete hack. + // FIXME: Using the AdditionalTransform is a complete hack. // This should be done by multipliying the lookup-Matrix with the Node's MV matrix // And then setting the result as the new MV matrix // But that operation needs to be done after all the 'updates'. diff --git a/cocos/2d/CCActionInstant.cpp b/cocos/2d/CCActionInstant.cpp index 627946bcaa..c5e0035808 100644 --- a/cocos/2d/CCActionInstant.cpp +++ b/cocos/2d/CCActionInstant.cpp @@ -424,7 +424,7 @@ CallFuncN * CallFuncN::create(const std::function &func) return nullptr; } -// XXX deprecated +// FIXME: deprecated CallFuncN * CallFuncN::create(Ref* selectorTarget, SEL_CallFuncN selector) { CallFuncN *ret = new (std::nothrow) CallFuncN(); diff --git a/cocos/2d/CCActionInterval.cpp b/cocos/2d/CCActionInterval.cpp index bdbefff6ae..e169d00f3a 100644 --- a/cocos/2d/CCActionInterval.cpp +++ b/cocos/2d/CCActionInterval.cpp @@ -335,7 +335,7 @@ void Sequence::update(float t) else if(found==0 && _last==1 ) { // Reverse mode ? - // XXX: Bug. this case doesn't contemplate when _last==-1, found=0 and in "reverse mode" + // FIXME: Bug. this case doesn't contemplate when _last==-1, found=0 and in "reverse mode" // since it will require a hack to know if an action is on reverse mode or not. // "step" should be overriden, and the "reverseMode" value propagated to inner Sequences. _actions[1]->update(0); @@ -981,7 +981,7 @@ void RotateBy::startWithTarget(Node *target) void RotateBy::update(float time) { - // XXX: shall I add % 360 + // FIXME: shall I add % 360 if (_target) { if(_is3D) @@ -2183,7 +2183,7 @@ void ReverseTime::update(float time) ReverseTime* ReverseTime::reverse() const { - // XXX: This looks like a bug + // FIXME: This looks like a bug return (ReverseTime*)_other->clone(); } diff --git a/cocos/2d/CCActionManager.cpp b/cocos/2d/CCActionManager.cpp index 7334463c7c..4739541b24 100644 --- a/cocos/2d/CCActionManager.cpp +++ b/cocos/2d/CCActionManager.cpp @@ -317,7 +317,7 @@ void ActionManager::removeAllActionsByTag(int tag, Node *target) // get -// XXX: Passing "const O *" instead of "const O&" because HASH_FIND_IT requries the address of a pointer +// FIXME: Passing "const O *" instead of "const O&" because HASH_FIND_IT requries the address of a pointer // and, it is not possible to get the address of a reference Action* ActionManager::getActionByTag(int tag, const Node *target) const { @@ -351,7 +351,7 @@ Action* ActionManager::getActionByTag(int tag, const Node *target) const return nullptr; } -// XXX: Passing "const O *" instead of "const O&" because HASH_FIND_IT requries the address of a pointer +// FIXME: Passing "const O *" instead of "const O&" because HASH_FIND_IT requries the address of a pointer // and, it is not possible to get the address of a reference ssize_t ActionManager::getNumberOfRunningActionsInTarget(const Node *target) const { diff --git a/cocos/2d/CCAnimation.cpp b/cocos/2d/CCAnimation.cpp index 69683e1fed..ba84b43024 100644 --- a/cocos/2d/CCAnimation.cpp +++ b/cocos/2d/CCAnimation.cpp @@ -25,10 +25,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ #include "2d/CCAnimation.h" -#include "2d/CCSpriteFrame.h" #include "renderer/CCTextureCache.h" #include "renderer/CCTexture2D.h" -#include "base/ccMacros.h" #include "base/CCDirector.h" NS_CC_BEGIN diff --git a/cocos/2d/CCAnimation.h b/cocos/2d/CCAnimation.h index 32e4cd56c4..39b35e8f63 100644 --- a/cocos/2d/CCAnimation.h +++ b/cocos/2d/CCAnimation.h @@ -30,9 +30,8 @@ THE SOFTWARE. #include "base/CCPlatformConfig.h" #include "base/CCRef.h" #include "base/CCValue.h" -#include "math/CCGeometry.h" -#include "2d/CCSpriteFrame.h" #include "base/CCVector.h" +#include "2d/CCSpriteFrame.h" #include diff --git a/cocos/2d/CCAnimationCache.cpp b/cocos/2d/CCAnimationCache.cpp index 04389ae3ff..613abe6f8b 100644 --- a/cocos/2d/CCAnimationCache.cpp +++ b/cocos/2d/CCAnimationCache.cpp @@ -25,12 +25,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ #include "2d/CCAnimationCache.h" -#include "base/ccMacros.h" -#include "2d/CCAnimation.h" -#include "2d/CCSpriteFrame.h" #include "2d/CCSpriteFrameCache.h" #include "platform/CCFileUtils.h" -#include "deprecated/CCString.h" using namespace std; diff --git a/cocos/2d/CCClippingNode.cpp b/cocos/2d/CCClippingNode.cpp index 653a70cacc..2557af5204 100644 --- a/cocos/2d/CCClippingNode.cpp +++ b/cocos/2d/CCClippingNode.cpp @@ -26,14 +26,11 @@ */ #include "2d/CCClippingNode.h" -#include "renderer/CCGLProgram.h" -#include "renderer/CCGLProgramCache.h" #include "2d/CCDrawingPrimitives.h" +#include "renderer/CCGLProgramCache.h" +#include "renderer/CCRenderer.h" #include "base/CCDirector.h" -#include "renderer/CCRenderer.h" -#include "renderer/CCGroupCommand.h" -#include "renderer/CCCustomCommand.h" NS_CC_BEGIN @@ -248,7 +245,7 @@ void ClippingNode::visit(Renderer *renderer, const Mat4 &parentTransform, uint32 program->use(); program->setUniformLocationWith1f(alphaValueLocation, _alphaThreshold); // we need to recursively apply this shader to all the nodes in the stencil node - // XXX: we should have a way to apply shader to all nodes without having to do this + // FIXME: we should have a way to apply shader to all nodes without having to do this setProgram(_stencil, program); #endif @@ -438,7 +435,7 @@ void ClippingNode::onAfterDrawStencil() glDisable(GL_ALPHA_TEST); } #else -// XXX: we need to find a way to restore the shaders of the stencil node and its childs +// FIXME: we need to find a way to restore the shaders of the stencil node and its childs #endif } diff --git a/cocos/2d/CCComponent.cpp b/cocos/2d/CCComponent.cpp index 4d629be8c1..34c0d19c01 100644 --- a/cocos/2d/CCComponent.cpp +++ b/cocos/2d/CCComponent.cpp @@ -23,7 +23,6 @@ THE SOFTWARE. ****************************************************************************/ #include "2d/CCComponent.h" -#include "base/CCScriptSupport.h" NS_CC_BEGIN diff --git a/cocos/2d/CCComponentContainer.cpp b/cocos/2d/CCComponentContainer.cpp index 95834c0f62..544b3d8077 100644 --- a/cocos/2d/CCComponentContainer.cpp +++ b/cocos/2d/CCComponentContainer.cpp @@ -25,7 +25,7 @@ THE SOFTWARE. #include "2d/CCComponentContainer.h" #include "2d/CCComponent.h" -#include "base/CCDirector.h" +#include "2d/CCNode.h" NS_CC_BEGIN diff --git a/cocos/2d/CCDrawNode.cpp b/cocos/2d/CCDrawNode.cpp index 48fbf65664..4d7f7d7924 100644 --- a/cocos/2d/CCDrawNode.cpp +++ b/cocos/2d/CCDrawNode.cpp @@ -27,6 +27,7 @@ #include "base/CCConfiguration.h" #include "renderer/CCRenderer.h" #include "renderer/ccGLStateCache.h" +#include "renderer/CCGLProgramState.h" #include "base/CCDirector.h" #include "base/CCEventListenerCustom.h" #include "base/CCEventDispatcher.h" diff --git a/cocos/2d/CCDrawingPrimitives.cpp b/cocos/2d/CCDrawingPrimitives.cpp index 2062b8fa5c..456a88a66e 100644 --- a/cocos/2d/CCDrawingPrimitives.cpp +++ b/cocos/2d/CCDrawingPrimitives.cpp @@ -157,7 +157,7 @@ void drawPoints( const Vec2 *points, unsigned int numberOfPoints ) s_shader->setUniformLocationWith4fv(s_colorLocation, (GLfloat*) &s_color.r, 1); s_shader->setUniformLocationWith1f(s_pointSizeLocation, s_pointSize); - // XXX: Mac OpenGL error. arrays can't go out of scope before draw is executed + // FIXME: Mac OpenGL error. arrays can't go out of scope before draw is executed Vec2* newPoints = new (std::nothrow) Vec2[numberOfPoints]; // iPhone and 32-bit machines optimization @@ -268,7 +268,7 @@ void drawPoly(const Vec2 *poli, unsigned int numberOfPoints, bool closePolygon) else { // Mac on 64-bit - // XXX: Mac OpenGL error. arrays can't go out of scope before draw is executed + // FIXME: Mac OpenGL error. arrays can't go out of scope before draw is executed Vec2* newPoli = new (std::nothrow) Vec2[numberOfPoints]; for( unsigned int i=0; i NS_CC_BEGIN namespace experimental { @@ -491,7 +487,7 @@ void TMXLayer::updateTotalQuads() if(tileGID & kTMXTileDiagonalFlag) { - // XXX: not working correcly + // FIXME: not working correcly quad.bl.vertices.x = left; quad.bl.vertices.y = bottom; quad.bl.vertices.z = z; diff --git a/cocos/2d/CCFastTMXLayer.h b/cocos/2d/CCFastTMXLayer.h index db1e0b7e3a..14a984d598 100644 --- a/cocos/2d/CCFastTMXLayer.h +++ b/cocos/2d/CCFastTMXLayer.h @@ -27,15 +27,12 @@ THE SOFTWARE. #ifndef __CC_FAST_TMX_LAYER_H__ #define __CC_FAST_TMX_LAYER_H__ -#include "CCTMXObjectGroup.h" -#include "CCTMXXMLParser.h" -#include "CCNode.h" -#include "renderer/CCCustomCommand.h" -#include "renderer/CCQuadCommand.h" -#include "renderer/CCPrimitiveCommand.h" - #include #include +#include "2d/CCNode.h" +#include "2d/CCTMXXMLParser.h" +#include "renderer/CCPrimitiveCommand.h" +#include "base/CCMap.h" NS_CC_BEGIN diff --git a/cocos/2d/CCFastTMXTiledMap.cpp b/cocos/2d/CCFastTMXTiledMap.cpp index 154bcdd5b8..e444276ce1 100644 --- a/cocos/2d/CCFastTMXTiledMap.cpp +++ b/cocos/2d/CCFastTMXTiledMap.cpp @@ -24,13 +24,8 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#include "CCFastTMXTiledMap.h" - -#include - -#include "CCTMXXMLParser.h" -#include "CCFastTMXLayer.h" -#include "CCSprite.h" +#include "2d/CCFastTMXTiledMap.h" +#include "2d/CCFastTMXLayer.h" #include "deprecated/CCString.h" NS_CC_BEGIN @@ -138,7 +133,7 @@ TMXTilesetInfo * TMXTiledMap::tilesetForLayer(TMXLayerInfo *layerInfo, TMXMapInf // gid = CFSwapInt32( gid ); /* We support little endian.*/ - // XXX: gid == 0 --> empty tile + // FIXME: gid == 0 --> empty tile if( gid != 0 ) { // Optimization: quick return diff --git a/cocos/2d/CCFastTMXTiledMap.h b/cocos/2d/CCFastTMXTiledMap.h index 07a544a775..4b3fe2a81b 100644 --- a/cocos/2d/CCFastTMXTiledMap.h +++ b/cocos/2d/CCFastTMXTiledMap.h @@ -32,7 +32,6 @@ THE SOFTWARE. NS_CC_BEGIN -class TMXObjectGroup; class TMXLayerInfo; class TMXTilesetInfo; class TMXMapInfo; diff --git a/cocos/2d/CCFontFNT.cpp b/cocos/2d/CCFontFNT.cpp index b35d31a11d..7acce56d48 100644 --- a/cocos/2d/CCFontFNT.cpp +++ b/cocos/2d/CCFontFNT.cpp @@ -24,6 +24,7 @@ ****************************************************************************/ #include "2d/CCFontFNT.h" +#include #include "base/uthash.h" #include "2d/CCFontAtlas.h" #include "platform/CCFileUtils.h" @@ -102,7 +103,7 @@ typedef struct _KerningHashElement */ class CC_DLL BMFontConfiguration : public Ref { - // XXX: Creating a public interface so that the bitmapFontArray[] is accessible + // FIXME: Creating a public interface so that the bitmapFontArray[] is accessible public://@public // BMFont definitions tFontDefHashElement *_fontDefDictionary; @@ -313,7 +314,7 @@ std::set* BMFontConfiguration::parseConfigFile(const std::string& if(line.substr(0,strlen("info face")) == "info face") { - // XXX: info parsing is incomplete + // FIXME: info parsing is incomplete // Not needed for the Hiero editors, but needed for the AngelCode editor // [self parseInfoArguments:line]; this->parseInfoArguments(line); diff --git a/cocos/2d/CCGrabber.cpp b/cocos/2d/CCGrabber.cpp index 6a4f68acd9..721e21b363 100644 --- a/cocos/2d/CCGrabber.cpp +++ b/cocos/2d/CCGrabber.cpp @@ -68,7 +68,7 @@ void Grabber::beforeRender(Texture2D *texture) // save clear color glGetFloatv(GL_COLOR_CLEAR_VALUE, _oldClearColor); - // BUG XXX: doesn't work with RGB565. + // FIXME: doesn't work with RGB565. glClearColor(0, 0, 0, 0); diff --git a/cocos/2d/CCGrid.cpp b/cocos/2d/CCGrid.cpp index 90c84545d4..db68c100ce 100644 --- a/cocos/2d/CCGrid.cpp +++ b/cocos/2d/CCGrid.cpp @@ -151,7 +151,7 @@ GridBase::~GridBase(void) { CCLOGINFO("deallocing GridBase: %p", this); -//TODO: ? why 2.0 comments this line setActive(false); + //TODO: ? why 2.0 comments this line: setActive(false); CC_SAFE_RELEASE(_texture); CC_SAFE_RELEASE(_grabber); } @@ -220,7 +220,7 @@ void GridBase::afterDraw(cocos2d::Node *target) // Vec2 offset = target->getAnchorPointInPoints(); // // // -// // XXX: Camera should be applied in the AnchorPoint +// // FIXME: Camera should be applied in the AnchorPoint // // // kmGLTranslatef(offset.x, offset.y, 0); // target->getCamera()->locate(); @@ -230,8 +230,8 @@ void GridBase::afterDraw(cocos2d::Node *target) GL::bindTexture2D(_texture->getName()); // restore projection for default FBO .fixed bug #543 #544 -//TODO: Director::getInstance()->setProjection(Director::getInstance()->getProjection()); -//TODO: Director::getInstance()->applyOrientation(); + //TODO: Director::getInstance()->setProjection(Director::getInstance()->getProjection()); + //TODO: Director::getInstance()->applyOrientation(); blit(); } diff --git a/cocos/2d/CCLabel.cpp b/cocos/2d/CCLabel.cpp index 7a9d956373..39aaa8860c 100644 --- a/cocos/2d/CCLabel.cpp +++ b/cocos/2d/CCLabel.cpp @@ -772,7 +772,7 @@ void Label::enableShadow(const Color4B& shadowColor /* = Color4B::BLACK */,const auto contentScaleFactor = CC_CONTENT_SCALE_FACTOR(); _shadowOffset.width = offset.width * contentScaleFactor; _shadowOffset.height = offset.height * contentScaleFactor; - //todo:support blur for shadow + //TODO: support blur for shadow _shadowBlurRadius = 0; if (_textSprite && _shadowNode) diff --git a/cocos/2d/CCLayer.cpp b/cocos/2d/CCLayer.cpp index 061eccf842..363230eb8e 100644 --- a/cocos/2d/CCLayer.cpp +++ b/cocos/2d/CCLayer.cpp @@ -31,6 +31,7 @@ THE SOFTWARE. #include "platform/CCDevice.h" #include "renderer/CCRenderer.h" #include "renderer/ccGLStateCache.h" +#include "renderer/CCGLProgramState.h" #include "base/CCDirector.h" #include "base/CCEventDispatcher.h" #include "base/CCEventListenerTouch.h" diff --git a/cocos/2d/CCMenuItem.cpp b/cocos/2d/CCMenuItem.cpp index db5ddccfc0..1ec76dda33 100644 --- a/cocos/2d/CCMenuItem.cpp +++ b/cocos/2d/CCMenuItem.cpp @@ -28,12 +28,10 @@ THE SOFTWARE. #include "2d/CCMenuItem.h" #include "2d/CCActionInterval.h" #include "2d/CCSprite.h" -#include "CCLabelAtlas.h" +#include "2d/CCLabelAtlas.h" #include "2d/CCLabel.h" -#include "base/CCScriptSupport.h" #include "deprecated/CCString.h" #include -#include #if defined(__GNUC__) && ((__GNUC__ >= 4) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1))) #pragma GCC diagnostic ignored "-Wdeprecated-declarations" @@ -63,7 +61,7 @@ MenuItem* MenuItem::create() return MenuItem::create((const ccMenuCallback&)nullptr); } -// XXX deprecated +// FIXME: deprecated MenuItem* MenuItem::create(Ref *target, SEL_MenuHandler selector) { MenuItem *ret = new (std::nothrow) MenuItem(); @@ -80,7 +78,7 @@ MenuItem* MenuItem::create( const ccMenuCallback& callback) return ret; } -// XXX deprecated +// FIXME: deprecated bool MenuItem::initWithTarget(cocos2d::Ref *target, SEL_MenuHandler selector ) { _target = target; @@ -153,7 +151,7 @@ bool MenuItem::isSelected() const return _selected; } -// XXX deprecated +// FIXME: deprecated void MenuItem::setTarget(Ref *target, SEL_MenuHandler selector) { _target = target; @@ -192,7 +190,7 @@ void MenuItemLabel::setLabel(Node* var) _label = var; } -// XXX: deprecated +// FIXME:: deprecated MenuItemLabel * MenuItemLabel::create(Node*label, Ref* target, SEL_MenuHandler selector) { MenuItemLabel *ret = new (std::nothrow) MenuItemLabel(); @@ -217,7 +215,7 @@ MenuItemLabel* MenuItemLabel::create(Node *label) return ret; } -// XXX: deprecated +// FIXME:: deprecated bool MenuItemLabel::initWithLabel(Node* label, Ref* target, SEL_MenuHandler selector) { _target = target; @@ -322,7 +320,7 @@ MenuItemAtlasFont * MenuItemAtlasFont::create(const std::string& value, const st return MenuItemAtlasFont::create(value, charMapFile, itemWidth, itemHeight, startCharMap, (const ccMenuCallback&)nullptr); } -// XXX: deprecated +// FIXME:: deprecated MenuItemAtlasFont * MenuItemAtlasFont::create(const std::string& value, const std::string& charMapFile, int itemWidth, int itemHeight, char startCharMap, Ref* target, SEL_MenuHandler selector) { MenuItemAtlasFont *ret = new (std::nothrow) MenuItemAtlasFont(); @@ -339,7 +337,7 @@ MenuItemAtlasFont * MenuItemAtlasFont::create(const std::string& value, const st return ret; } -// XXX: deprecated +// FIXME:: deprecated bool MenuItemAtlasFont::initWithString(const std::string& value, const std::string& charMapFile, int itemWidth, int itemHeight, char startCharMap, Ref* target, SEL_MenuHandler selector) { _target = target; @@ -388,7 +386,7 @@ const std::string& MenuItemFont::getFontName() return _globalFontName; } -// XXX: deprecated +// FIXME:: deprecated MenuItemFont * MenuItemFont::create(const std::string& value, Ref* target, SEL_MenuHandler selector) { MenuItemFont *ret = new (std::nothrow) MenuItemFont(); @@ -423,7 +421,7 @@ MenuItemFont::~MenuItemFont() CCLOGINFO("In the destructor of MenuItemFont (%p).", this); } -// XXX: deprecated +// FIXME:: deprecated bool MenuItemFont::initWithString(const std::string& value, Ref* target, SEL_MenuHandler selector) { CCASSERT( !value.empty(), "Value length must be greater than 0"); @@ -546,7 +544,7 @@ MenuItemSprite * MenuItemSprite::create(Node* normalSprite, Node* selectedSprite return MenuItemSprite::create(normalSprite, selectedSprite, disabledSprite, (const ccMenuCallback&)nullptr); } -// XXX deprecated +// FIXME: deprecated MenuItemSprite * MenuItemSprite::create(Node* normalSprite, Node* selectedSprite, Ref* target, SEL_MenuHandler selector) { return MenuItemSprite::create(normalSprite, selectedSprite, nullptr, target, selector); @@ -557,7 +555,7 @@ MenuItemSprite * MenuItemSprite::create(Node* normalSprite, Node* selectedSprite return MenuItemSprite::create(normalSprite, selectedSprite, nullptr, callback); } -// XXX deprecated +// FIXME: deprecated MenuItemSprite * MenuItemSprite::create(Node *normalSprite, Node *selectedSprite, Node *disabledSprite, Ref *target, SEL_MenuHandler selector) { MenuItemSprite *ret = new (std::nothrow) MenuItemSprite(); @@ -574,7 +572,7 @@ MenuItemSprite * MenuItemSprite::create(Node *normalSprite, Node *selectedSprite return ret; } -// XXX deprecated +// FIXME: deprecated bool MenuItemSprite::initWithNormalSprite(Node* normalSprite, Node* selectedSprite, Node* disabledSprite, Ref* target, SEL_MenuHandler selector) { _target = target; @@ -706,7 +704,7 @@ MenuItemImage * MenuItemImage::create(const std::string& normalImage, const std: return MenuItemImage::create(normalImage, selectedImage, "", (const ccMenuCallback&)nullptr); } -// XXX deprecated +// FIXME: deprecated MenuItemImage * MenuItemImage::create(const std::string& normalImage, const std::string& selectedImage, Ref* target, SEL_MenuHandler selector) { return MenuItemImage::create(normalImage, selectedImage, "", target, selector); @@ -717,7 +715,7 @@ MenuItemImage * MenuItemImage::create(const std::string& normalImage, const std: return MenuItemImage::create(normalImage, selectedImage, "", callback); } -// XXX deprecated +// FIXME: deprecated MenuItemImage * MenuItemImage::create(const std::string& normalImage, const std::string& selectedImage, const std::string& disabledImage, Ref* target, SEL_MenuHandler selector) { MenuItemImage *ret = new (std::nothrow) MenuItemImage(); @@ -754,7 +752,7 @@ MenuItemImage * MenuItemImage::create(const std::string& normalImage, const std: return nullptr; } -// XXX: deprecated +// FIXME:: deprecated bool MenuItemImage::initWithNormalImage(const std::string& normalImage, const std::string& selectedImage, const std::string& disabledImage, Ref* target, SEL_MenuHandler selector) { _target = target; @@ -806,7 +804,7 @@ void MenuItemImage::setDisabledSpriteFrame(SpriteFrame * frame) // MenuItemToggle // -// XXX: deprecated +// FIXME:: deprecated MenuItemToggle * MenuItemToggle::createWithTarget(Ref* target, SEL_MenuHandler selector, const Vector& menuItems) { MenuItemToggle *ret = new (std::nothrow) MenuItemToggle(); @@ -827,7 +825,7 @@ MenuItemToggle * MenuItemToggle::createWithCallback(const ccMenuCallback &callba return ret; } -// XXX: deprecated +// FIXME:: deprecated MenuItemToggle * MenuItemToggle::createWithTarget(Ref* target, SEL_MenuHandler selector, MenuItem* item, ...) { va_list args; @@ -871,7 +869,7 @@ MenuItemToggle * MenuItemToggle::create() return ret; } -// XXX: deprecated +// FIXME:: deprecated bool MenuItemToggle::initWithTarget(Ref* target, SEL_MenuHandler selector, MenuItem* item, va_list args) { _target = target; diff --git a/cocos/2d/CCMotionStreak.cpp b/cocos/2d/CCMotionStreak.cpp index a9a227e356..4c9138a131 100644 --- a/cocos/2d/CCMotionStreak.cpp +++ b/cocos/2d/CCMotionStreak.cpp @@ -26,14 +26,12 @@ THE SOFTWARE. #include "2d/CCMotionStreak.h" #include "math/CCVertex.h" -#include "base/ccMacros.h" #include "base/CCDirector.h" #include "renderer/CCTextureCache.h" #include "renderer/ccGLStateCache.h" -#include "renderer/CCGLProgram.h" -#include "renderer/CCGLProgramState.h" -#include "renderer/CCCustomCommand.h" +#include "renderer/CCTexture2D.h" #include "renderer/CCRenderer.h" +#include "renderer/CCGLProgramState.h" NS_CC_BEGIN diff --git a/cocos/2d/CCMotionStreak.h b/cocos/2d/CCMotionStreak.h index 951c4def21..97ab7c749f 100644 --- a/cocos/2d/CCMotionStreak.h +++ b/cocos/2d/CCMotionStreak.h @@ -27,16 +27,13 @@ THE SOFTWARE. #define __CCMOTION_STREAK_H__ #include "base/CCProtocols.h" -#include "renderer/CCTexture2D.h" -#include "base/ccTypes.h" #include "2d/CCNode.h" #include "renderer/CCCustomCommand.h" -#ifdef EMSCRIPTEN -#include "CCGLBufferedNode.h" -#endif // EMSCRIPTEN NS_CC_BEGIN +class Texture2D; + /** * @addtogroup misc_nodes * @{ @@ -46,9 +43,6 @@ NS_CC_BEGIN Creates a trailing path. */ class CC_DLL MotionStreak : public Node, public TextureProtocol -#ifdef EMSCRIPTEN -, public GLBufferedNode -#endif // EMSCRIPTEN { public: /** creates and initializes a motion streak with fade in seconds, minimum segments, stroke's width, color, texture filename */ diff --git a/cocos/2d/CCNode.cpp b/cocos/2d/CCNode.cpp index f220a57cb2..cbd4b97f31 100644 --- a/cocos/2d/CCNode.cpp +++ b/cocos/2d/CCNode.cpp @@ -43,6 +43,7 @@ THE SOFTWARE. #include "2d/CCComponent.h" #include "2d/CCComponentContainer.h" #include "renderer/CCGLProgram.h" +#include "renderer/CCGLProgramState.h" #include "math/TransformUtils.h" #include "deprecated/CCString.h" @@ -68,7 +69,7 @@ bool nodeComparisonLess(Node* n1, Node* n2) ); } -// XXX: Yes, nodes might have a sort problem once every 15 days if the game runs at 60 FPS and each frame sprites are reordered. +// FIXME:: Yes, nodes might have a sort problem once every 15 days if the game runs at 60 FPS and each frame sprites are reordered. int Node::s_globalOrderOfArrival = 1; // MARK: Constructor, Destructor, Init @@ -593,7 +594,7 @@ void Node::setPositionZ(float positionZ) _positionZ = positionZ; - // XXX BUG + // FIXME: BUG // Global Z Order should based on the modelViewTransform setGlobalZOrder(positionZ); } @@ -1670,7 +1671,7 @@ const Mat4& Node::getNodeToParentTransform() const _transform.translate(anchorPoint.x, anchorPoint.y, 0); } - // XXX + // FIXME: // FIX ME: Expensive operation. // FIX ME: It should be done together with the rotationZ if(_rotationY) { @@ -1689,22 +1690,26 @@ const Mat4& Node::getNodeToParentTransform() const _transform.translate(-anchorPoint.x, -anchorPoint.y, 0); } - // XXX: Try to inline skew + // FIXME:: Try to inline skew // If skew is needed, apply skew and then anchor point if (needsSkewMatrix) { - Mat4 skewMatrix(1, (float)tanf(CC_DEGREES_TO_RADIANS(_skewY)), 0, 0, - (float)tanf(CC_DEGREES_TO_RADIANS(_skewX)), 1, 0, 0, - 0, 0, 1, 0, - 0, 0, 0, 1); + float skewMatArray[16] = + { + 1, (float)tanf(CC_DEGREES_TO_RADIANS(_skewY)), 0, 0, + (float)tanf(CC_DEGREES_TO_RADIANS(_skewX)), 1, 0, 0, + 0, 0, 1, 0, + 0, 0, 0, 1 + }; + Mat4 skewMatrix(skewMatArray); _transform = _transform * skewMatrix; // adjust anchor point if (!_anchorPointInPoints.equals(Vec2::ZERO)) { - // XXX: Argh, Mat4 needs a "translate" method. - // XXX: Although this is faster than multiplying a vec4 * mat4 + // FIXME:: Argh, Mat4 needs a "translate" method. + // FIXME:: Although this is faster than multiplying a vec4 * mat4 _transform.m[12] += _transform.m[0] * -_anchorPointInPoints.x + _transform.m[4] * -_anchorPointInPoints.y; _transform.m[13] += _transform.m[1] * -_anchorPointInPoints.x + _transform.m[5] * -_anchorPointInPoints.y; } diff --git a/cocos/2d/CCNodeGrid.cpp b/cocos/2d/CCNodeGrid.cpp index 985b950ed2..eb42030199 100644 --- a/cocos/2d/CCNodeGrid.cpp +++ b/cocos/2d/CCNodeGrid.cpp @@ -24,11 +24,7 @@ #include "2d/CCNodeGrid.h" #include "2d/CCGrid.h" - -#include "renderer/CCGroupCommand.h" #include "renderer/CCRenderer.h" -#include "renderer/CCCustomCommand.h" - NS_CC_BEGIN diff --git a/cocos/2d/CCParallaxNode.cpp b/cocos/2d/CCParallaxNode.cpp index 3631453e60..b20b35d806 100644 --- a/cocos/2d/CCParallaxNode.cpp +++ b/cocos/2d/CCParallaxNode.cpp @@ -24,7 +24,7 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#include "CCParallaxNode.h" +#include "2d/CCParallaxNode.h" #include "base/ccCArray.h" NS_CC_BEGIN diff --git a/cocos/2d/CCParticleBatchNode.cpp b/cocos/2d/CCParticleBatchNode.cpp index dd27e08acb..58097d529d 100644 --- a/cocos/2d/CCParticleBatchNode.cpp +++ b/cocos/2d/CCParticleBatchNode.cpp @@ -30,22 +30,13 @@ #include "2d/CCParticleBatchNode.h" -#include "renderer/CCTextureAtlas.h" #include "2d/CCGrid.h" #include "2d/CCParticleSystem.h" -#include "platform/CCFileUtils.h" -#include "base/CCProfiling.h" -#include "base/ccConfig.h" -#include "base/ccMacros.h" -#include "base/base64.h" -#include "base/ZipUtils.h" #include "renderer/CCTextureCache.h" -#include "renderer/CCGLProgramState.h" -#include "renderer/CCGLProgram.h" -#include "renderer/ccGLStateCache.h" #include "renderer/CCQuadCommand.h" #include "renderer/CCRenderer.h" - +#include "renderer/CCTextureAtlas.h" +#include "deprecated/CCString.h" NS_CC_BEGIN @@ -207,8 +198,8 @@ void ParticleBatchNode::addChildByTagOrName(ParticleSystem* child, int zOrder, i } // don't use lazy sorting, reordering the particle systems quads afterwards would be too complex -// XXX research whether lazy sorting + freeing current quads and calloc a new block with size of capacity would be faster -// XXX or possibly using vertexZ for reordering, that would be fastest +// FIXME: research whether lazy sorting + freeing current quads and calloc a new block with size of capacity would be faster +// FIXME: or possibly using vertexZ for reordering, that would be fastest // this helper is almost equivalent to Node's addChild, but doesn't make use of the lazy sorting int ParticleBatchNode::addChildHelper(ParticleSystem* child, int z, int aTag, const std::string &name, bool setTag) { diff --git a/cocos/2d/CCParticleExamples.cpp b/cocos/2d/CCParticleExamples.cpp index 11f72ea467..a4387b9ef8 100644 --- a/cocos/2d/CCParticleExamples.cpp +++ b/cocos/2d/CCParticleExamples.cpp @@ -26,7 +26,6 @@ THE SOFTWARE. ****************************************************************************/ #include "2d/CCParticleExamples.h" -#include "platform/CCImage.h" #include "base/CCDirector.h" #include "base/firePngData.h" #include "renderer/CCTextureCache.h" diff --git a/cocos/2d/CCParticleSystem.cpp b/cocos/2d/CCParticleSystem.cpp index f18fcec6d8..ec66c12b03 100644 --- a/cocos/2d/CCParticleSystem.cpp +++ b/cocos/2d/CCParticleSystem.cpp @@ -48,16 +48,12 @@ THE SOFTWARE. #include "2d/CCParticleBatchNode.h" #include "renderer/CCTextureAtlas.h" -#include "platform/CCFileUtils.h" -#include "platform/CCImage.h" -#include "base/ccTypes.h" #include "base/base64.h" #include "base/ZipUtils.h" #include "base/CCDirector.h" -#include "base/CCProfiling.h" #include "renderer/CCTextureCache.h" - -#include "CCGL.h" +#include "deprecated/CCString.h" +#include "platform/CCFileUtils.h" using namespace std; @@ -174,7 +170,7 @@ bool ParticleSystem::initWithFile(const std::string& plistFile) CCASSERT( !dict.empty(), "Particles: file not found"); - // XXX compute path from a path, should define a function somewhere to do it + // FIXME: compute path from a path, should define a function somewhere to do it string listFilePath = plistFile; if (listFilePath.find('/') != string::npos) { @@ -465,7 +461,7 @@ bool ParticleSystem::initWithTotalParticles(int numberOfParticles) _emitterMode = Mode::GRAVITY; // default: modulate - // XXX: not used + // FIXME:: not used // colorModulate = YES; _isAutoRemoveOnFinish = false; diff --git a/cocos/2d/CCParticleSystem.h b/cocos/2d/CCParticleSystem.h index 55d85c3446..58627ee488 100644 --- a/cocos/2d/CCParticleSystem.h +++ b/cocos/2d/CCParticleSystem.h @@ -30,7 +30,6 @@ THE SOFTWARE. #include "base/CCProtocols.h" #include "2d/CCNode.h" #include "base/CCValue.h" -#include "deprecated/CCString.h" NS_CC_BEGIN diff --git a/cocos/2d/CCParticleSystemQuad.cpp b/cocos/2d/CCParticleSystemQuad.cpp index 392f3b6783..bac6027836 100644 --- a/cocos/2d/CCParticleSystemQuad.cpp +++ b/cocos/2d/CCParticleSystemQuad.cpp @@ -26,26 +26,21 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#include "CCGL.h" + #include "2d/CCParticleSystemQuad.h" #include "2d/CCSpriteFrame.h" #include "2d/CCParticleBatchNode.h" #include "renderer/CCTextureAtlas.h" +#include "renderer/ccGLStateCache.h" +#include "renderer/CCRenderer.h" #include "base/CCDirector.h" #include "base/CCEventType.h" #include "base/CCConfiguration.h" -#include "math/TransformUtils.h" -#include "renderer/CCGLProgramState.h" -#include "renderer/ccGLStateCache.h" -#include "renderer/CCGLProgram.h" -#include "renderer/CCRenderer.h" -#include "renderer/CCQuadCommand.h" -#include "renderer/CCCustomCommand.h" - -// extern #include "base/CCEventListenerCustom.h" #include "base/CCEventDispatcher.h" +#include "deprecated/CCString.h" + NS_CC_BEGIN ParticleSystemQuad::ParticleSystemQuad() diff --git a/cocos/2d/CCParticleSystemQuad.h b/cocos/2d/CCParticleSystemQuad.h index 73386f152d..918707cb9f 100644 --- a/cocos/2d/CCParticleSystemQuad.h +++ b/cocos/2d/CCParticleSystemQuad.h @@ -28,7 +28,7 @@ THE SOFTWARE. #ifndef __CC_PARTICLE_SYSTEM_QUAD_H__ #define __CC_PARTICLE_SYSTEM_QUAD_H__ -#include "CCParticleSystem.h" +#include "2d/CCParticleSystem.h" #include "renderer/CCQuadCommand.h" NS_CC_BEGIN diff --git a/cocos/2d/CCProgressTimer.cpp b/cocos/2d/CCProgressTimer.cpp index 498da87487..d0acb1ee5b 100644 --- a/cocos/2d/CCProgressTimer.cpp +++ b/cocos/2d/CCProgressTimer.cpp @@ -27,17 +27,9 @@ THE SOFTWARE. #include "base/ccMacros.h" #include "base/CCDirector.h" -#include "2d/CCDrawingPrimitives.h" -#include "renderer/CCTextureCache.h" -#include "renderer/CCGLProgram.h" -#include "renderer/CCGLProgramState.h" +#include "2d/CCSprite.h" #include "renderer/ccGLStateCache.h" #include "renderer/CCRenderer.h" -#include "renderer/CCCustomCommand.h" -#include "math/TransformUtils.h" - -// extern -#include NS_CC_BEGIN @@ -512,22 +504,9 @@ void ProgressTimer::onDraw(const Mat4 &transform, uint32_t flags) GL::bindTexture2D( _sprite->getTexture()->getName() ); -#ifdef EMSCRIPTEN - setGLBufferData((void*) _vertexData, (_vertexDataCount * sizeof(V2F_C4B_T2F)), 0); - - int offset = 0; - glVertexAttribPointer( GLProgram::VERTEX_ATTRIB_POSITION, 2, GL_FLOAT, GL_FALSE, sizeof(V2F_C4B_T2F), (GLvoid*)offset); - - offset += sizeof(Vec2); - glVertexAttribPointer( GLProgram::VERTEX_ATTRIB_COLOR, 4, GL_UNSIGNED_BYTE, GL_TRUE, sizeof(V2F_C4B_T2F), (GLvoid*)offset); - - offset += sizeof(Color4B); - glVertexAttribPointer( GLProgram::VERTEX_ATTRIB_TEX_COORD, 2, GL_FLOAT, GL_FALSE, sizeof(V2F_C4B_T2F), (GLvoid*)offset); -#else glVertexAttribPointer( GLProgram::VERTEX_ATTRIB_POSITION, 2, GL_FLOAT, GL_FALSE, sizeof(_vertexData[0]) , &_vertexData[0].vertices); glVertexAttribPointer( GLProgram::VERTEX_ATTRIB_TEX_COORD, 2, GL_FLOAT, GL_FALSE, sizeof(_vertexData[0]), &_vertexData[0].texCoords); glVertexAttribPointer( GLProgram::VERTEX_ATTRIB_COLOR, 4, GL_UNSIGNED_BYTE, GL_TRUE, sizeof(_vertexData[0]), &_vertexData[0].colors); -#endif // EMSCRIPTEN if(_type == Type::RADIAL) { diff --git a/cocos/2d/CCProgressTimer.h b/cocos/2d/CCProgressTimer.h index a687c396f8..061712efe3 100644 --- a/cocos/2d/CCProgressTimer.h +++ b/cocos/2d/CCProgressTimer.h @@ -26,14 +26,13 @@ THE SOFTWARE. #ifndef __MISC_NODE_CCPROGRESS_TIMER_H__ #define __MISC_NODE_CCPROGRESS_TIMER_H__ -#include "2d/CCSprite.h" #include "renderer/CCCustomCommand.h" -#ifdef EMSCRIPTEN -#include "CCGLBufferedNode.h" -#endif // EMSCRIPTEN +#include "2d/CCNode.h" NS_CC_BEGIN +class Sprite; + /** * @addtogroup misc_nodes * @{ @@ -46,9 +45,6 @@ NS_CC_BEGIN @since v0.99.1 */ class CC_DLL ProgressTimer : public Node -#ifdef EMSCRIPTEN -, public GLBufferedNode -#endif // EMSCRIPTEN { public: /** Types of progress diff --git a/cocos/2d/CCRenderTexture.cpp b/cocos/2d/CCRenderTexture.cpp index 1d4457bd7b..13fed5a85e 100644 --- a/cocos/2d/CCRenderTexture.cpp +++ b/cocos/2d/CCRenderTexture.cpp @@ -27,23 +27,13 @@ THE SOFTWARE. #include "2d/CCRenderTexture.h" #include "base/ccUtils.h" -#include "platform/CCImage.h" #include "platform/CCFileUtils.h" -#include "2d/CCGrid.h" #include "base/CCEventType.h" #include "base/CCConfiguration.h" -#include "base/CCConfiguration.h" #include "base/CCDirector.h" #include "base/CCEventListenerCustom.h" #include "base/CCEventDispatcher.h" -#include "renderer/CCGLProgram.h" -#include "renderer/ccGLStateCache.h" -#include "renderer/CCTextureCache.h" #include "renderer/CCRenderer.h" -#include "renderer/CCGroupCommand.h" -#include "renderer/CCCustomCommand.h" - -#include "CCGL.h" NS_CC_BEGIN @@ -356,7 +346,7 @@ void RenderTexture::beginWithClear(float r, float g, float b, float a, float dep Director::getInstance()->getRenderer()->addCommand(&_beginWithClearCommand); } -//TODO find a better way to clear the screen, there is no need to rebind render buffer there. +//TODO: find a better way to clear the screen, there is no need to rebind render buffer there. void RenderTexture::clear(float r, float g, float b, float a) { this->beginWithClear(r, g, b, a); @@ -504,7 +494,7 @@ Image* RenderTexture::newImage(bool fliimage) glGetIntegerv(GL_FRAMEBUFFER_BINDING, &_oldFBO); glBindFramebuffer(GL_FRAMEBUFFER, _FBO); - //TODO move this to configration, so we don't check it every time + // TODO: move this to configration, so we don't check it every time /* Certain Qualcomm Andreno gpu's will retain data in memory after a frame buffer switch which corrupts the render to the texture. The solution is to clear the frame buffer before rendering to the texture. However, calling glClear has the unintended result of clearing the current texture. Create a temporary texture to overcome this. At the end of RenderTexture::begin(), switch the attached texture to the second one, call glClear, and then switch back to the original texture. This solution is unnecessary for other devices as they don't have the same issue with switching frame buffers. */ if (Configuration::getInstance()->checkForGLExtension("GL_QCOM")) @@ -604,7 +594,7 @@ void RenderTexture::onBegin() glGetIntegerv(GL_FRAMEBUFFER_BINDING, &_oldFBO); glBindFramebuffer(GL_FRAMEBUFFER, _FBO); - //TODO move this to configration, so we don't check it every time + // TODO: move this to configration, so we don't check it every time /* Certain Qualcomm Andreno gpu's will retain data in memory after a frame buffer switch which corrupts the render to the texture. The solution is to clear the frame buffer before rendering to the texture. However, calling glClear has the unintended result of clearing the current texture. Create a temporary texture to overcome this. At the end of RenderTexture::begin(), switch the attached texture to the second one, call glClear, and then switch back to the original texture. This solution is unnecessary for other devices as they don't have the same issue with switching frame buffers. */ if (Configuration::getInstance()->checkForGLExtension("GL_QCOM")) diff --git a/cocos/2d/CCRenderTexture.h b/cocos/2d/CCRenderTexture.h index 384a466bb6..f6a83c0ef2 100644 --- a/cocos/2d/CCRenderTexture.h +++ b/cocos/2d/CCRenderTexture.h @@ -166,7 +166,7 @@ public: void setVirtualViewport(const Vec2& rtBegin, const Rect& fullRect, const Rect& fullViewport); public: - // XXX should be procted. + // FIXME: should be procted. // but due to a bug in PowerVR + Android, // the constructor is public again RenderTexture(); diff --git a/cocos/2d/CCSprite.cpp b/cocos/2d/CCSprite.cpp index 6bd4ff58e0..ba4b14ac6d 100644 --- a/cocos/2d/CCSprite.cpp +++ b/cocos/2d/CCSprite.cpp @@ -27,28 +27,14 @@ THE SOFTWARE. #include "2d/CCSprite.h" -#include -#include - #include "2d/CCSpriteBatchNode.h" -#include "2d/CCAnimation.h" #include "2d/CCAnimationCache.h" #include "2d/CCSpriteFrame.h" #include "2d/CCSpriteFrameCache.h" -#include "2d/CCDrawingPrimitives.h" #include "renderer/CCTextureCache.h" #include "renderer/CCTexture2D.h" -#include "renderer/CCGLProgramState.h" -#include "renderer/ccGLStateCache.h" -#include "renderer/CCGLProgram.h" #include "renderer/CCRenderer.h" -#include "base/CCProfiling.h" #include "base/CCDirector.h" -#include "base/CCDirector.h" -#include "base/ccConfig.h" -#include "math/CCGeometry.h" -#include "math/CCAffineTransform.h" -#include "math/TransformUtils.h" #include "deprecated/CCString.h" @@ -61,6 +47,7 @@ NS_CC_BEGIN #define RENDER_IN_SUBPIXEL(__ARGS__) (ceil(__ARGS__)) #endif +// MARK: create, init, dealloc Sprite* Sprite::createWithTexture(Texture2D *texture) { Sprite *sprite = new (std::nothrow) Sprite(); @@ -307,6 +294,7 @@ static unsigned char cc_2x2_white_image[] = { #define CC_2x2_WHITE_IMAGE_KEY "/cc_2x2_white_image" +// MARK: texture void Sprite::setTexture(const std::string &filename) { Texture2D *texture = Director::getInstance()->getTextureCache()->addImage(filename); @@ -497,6 +485,8 @@ void Sprite::setTextureCoords(Rect rect) } } +// MARK: visit, draw, transform + void Sprite::updateTransform(void) { CCASSERT(_batchNode, "updateTransform is only valid when Sprite is being rendered using an SpriteBatchNode"); @@ -622,7 +612,8 @@ void Sprite::drawDebugData() } #endif //CC_SPRITE_DEBUG_DRAW -// Node overrides +// MARK: visit, draw, transform + void Sprite::addChild(Node *child, int zOrder, int tag) { CCASSERT(child != nullptr, "Argument must be non-nullptr"); @@ -755,7 +746,7 @@ void Sprite::setDirtyRecursively(bool bValue) } } -// XXX HACK: optimization +// FIXME: HACK: optimization #define SET_DIRTY_RECURSIVELY() { \ if (! _recursiveDirty) { \ _recursiveDirty = true; \ @@ -885,7 +876,7 @@ bool Sprite::isFlippedY(void) const } // -// RGBA protocol +// MARK: RGBA protocol // void Sprite::updateColor(void) @@ -938,7 +929,7 @@ bool Sprite::isOpacityModifyRGB(void) const return _opacityModifyRGB; } -// Frames +// MARK: Frames void Sprite::setSpriteFrame(const std::string &spriteFrameName) { @@ -1032,7 +1023,7 @@ void Sprite::setBatchNode(SpriteBatchNode *spriteBatchNode) } } -// Texture protocol +// MARK: Texture protocol void Sprite::updateBlendFunc(void) { diff --git a/cocos/2d/CCSprite.h b/cocos/2d/CCSprite.h index b3006f4483..a4e75c334c 100644 --- a/cocos/2d/CCSprite.h +++ b/cocos/2d/CCSprite.h @@ -28,15 +28,10 @@ THE SOFTWARE. #ifndef __SPRITE_NODE_CCSPRITE_H__ #define __SPRITE_NODE_CCSPRITE_H__ +#include #include "2d/CCNode.h" #include "base/CCProtocols.h" #include "renderer/CCTextureAtlas.h" -#include "base/ccTypes.h" -#include -#ifdef EMSCRIPTEN -#include "CCGLBufferedNode.h" -#endif // EMSCRIPTEN -#include "physics/CCPhysicsBody.h" #include "renderer/CCQuadCommand.h" #include "renderer/CCCustomCommand.h" diff --git a/cocos/2d/CCSpriteBatchNode.cpp b/cocos/2d/CCSpriteBatchNode.cpp index 318b0ed7a6..5603faa5b8 100644 --- a/cocos/2d/CCSpriteBatchNode.cpp +++ b/cocos/2d/CCSpriteBatchNode.cpp @@ -27,24 +27,11 @@ THE SOFTWARE. ****************************************************************************/ #include "2d/CCSpriteBatchNode.h" - -#include - #include "2d/CCSprite.h" -#include "2d/CCGrid.h" -#include "2d/CCDrawingPrimitives.h" -#include "2d/CCLayer.h" -#include "2d/CCScene.h" -#include "base/ccConfig.h" #include "base/CCDirector.h" -#include "base/CCProfiling.h" #include "renderer/CCTextureCache.h" -#include "renderer/CCGLProgramState.h" -#include "renderer/CCGLProgram.h" -#include "renderer/ccGLStateCache.h" #include "renderer/CCRenderer.h" #include "renderer/CCQuadCommand.h" -#include "math/TransformUtils.h" #include "deprecated/CCString.h" // For StringUtils::format @@ -638,8 +625,8 @@ void SpriteBatchNode::insertQuadFromSprite(Sprite *sprite, ssize_t index) V3F_C4B_T2F_Quad quad = sprite->getQuad(); _textureAtlas->insertQuad(&quad, index); - // XXX: updateTransform will update the textureAtlas too, using updateQuad. - // XXX: so, it should be AFTER the insertQuad + // FIXME:: updateTransform will update the textureAtlas too, using updateQuad. + // FIXME:: so, it should be AFTER the insertQuad sprite->setDirty(true); sprite->updateTransform(); } @@ -675,7 +662,7 @@ SpriteBatchNode * SpriteBatchNode::addSpriteWithoutQuad(Sprite*child, int z, int // quad index is Z child->setAtlasIndex(z); - // XXX: optimize with a binary search + // FIXME:: optimize with a binary search auto it = _descendants.begin(); for (; it != _descendants.end(); ++it) { diff --git a/cocos/2d/CCSpriteBatchNode.h b/cocos/2d/CCSpriteBatchNode.h index d544d0472e..6e7af1664b 100644 --- a/cocos/2d/CCSpriteBatchNode.h +++ b/cocos/2d/CCSpriteBatchNode.h @@ -33,7 +33,6 @@ THE SOFTWARE. #include "2d/CCNode.h" #include "base/CCProtocols.h" -#include "base/ccMacros.h" #include "renderer/CCTextureAtlas.h" #include "renderer/CCBatchCommand.h" diff --git a/cocos/2d/CCSpriteFrame.h b/cocos/2d/CCSpriteFrame.h index bf214ff653..05cd279482 100644 --- a/cocos/2d/CCSpriteFrame.h +++ b/cocos/2d/CCSpriteFrame.h @@ -29,7 +29,6 @@ THE SOFTWARE. #define __SPRITE_CCSPRITE_FRAME_H__ #include "2d/CCNode.h" -#include "base/CCProtocols.h" #include "base/CCRef.h" #include "math/CCGeometry.h" diff --git a/cocos/2d/CCSpriteFrameCache.cpp b/cocos/2d/CCSpriteFrameCache.cpp index 85f06a36d3..2b876f0e67 100644 --- a/cocos/2d/CCSpriteFrameCache.cpp +++ b/cocos/2d/CCSpriteFrameCache.cpp @@ -31,14 +31,15 @@ THE SOFTWARE. #include -#include "2d/CCSpriteFrame.h" + #include "2d/CCSprite.h" #include "platform/CCFileUtils.h" #include "base/CCNS.h" #include "base/ccMacros.h" #include "base/CCDirector.h" +#include "renderer/CCTexture2D.h" #include "renderer/CCTextureCache.h" -#include "math/TransformUtils.h" + #include "deprecated/CCString.h" @@ -313,7 +314,7 @@ void SpriteFrameCache::removeUnusedSpriteFrames() _spriteFrames.erase(toRemoveFrames); - // XXX. Since we don't know the .plist file that originated the frame, we must remove all .plist from the cache + // FIXME:. Since we don't know the .plist file that originated the frame, we must remove all .plist from the cache if( removed ) { _loadedFileNames->clear(); @@ -340,7 +341,7 @@ void SpriteFrameCache::removeSpriteFrameByName(const std::string& name) _spriteFrames.erase(name); } - // XXX. Since we don't know the .plist file that originated the frame, we must remove all .plist from the cache + // FIXME:. Since we don't know the .plist file that originated the frame, we must remove all .plist from the cache _loadedFileNames->clear(); } diff --git a/cocos/2d/CCSpriteFrameCache.h b/cocos/2d/CCSpriteFrameCache.h index b0e5b1f391..0722ba860a 100644 --- a/cocos/2d/CCSpriteFrameCache.h +++ b/cocos/2d/CCSpriteFrameCache.h @@ -34,19 +34,17 @@ THE SOFTWARE. * To create sprite frames and texture atlas, use this tool: * http://zwoptex.zwopple.com/ */ - +#include +#include #include "2d/CCSpriteFrame.h" -#include "renderer/CCTexture2D.h" #include "base/CCRef.h" #include "base/CCValue.h" #include "base/CCMap.h" -#include -#include - NS_CC_BEGIN class Sprite; +class Texture2D; /** * @addtogroup sprite_nodes diff --git a/cocos/2d/CCTMXLayer.cpp b/cocos/2d/CCTMXLayer.cpp index a305e9f661..acc5325e50 100644 --- a/cocos/2d/CCTMXLayer.cpp +++ b/cocos/2d/CCTMXLayer.cpp @@ -26,16 +26,11 @@ THE SOFTWARE. ****************************************************************************/ #include "2d/CCTMXLayer.h" - -#include "2d/CCTMXXMLParser.h" #include "2d/CCTMXTiledMap.h" #include "2d/CCSprite.h" -#include "base/ccCArray.h" #include "base/CCDirector.h" #include "renderer/CCTextureCache.h" -#include "renderer/CCGLProgramState.h" #include "renderer/CCGLProgram.h" - #include "deprecated/CCString.h" // For StringUtils::format NS_CC_BEGIN @@ -55,7 +50,7 @@ TMXLayer * TMXLayer::create(TMXTilesetInfo *tilesetInfo, TMXLayerInfo *layerInfo } bool TMXLayer::initWithTilesetInfo(TMXTilesetInfo *tilesetInfo, TMXLayerInfo *layerInfo, TMXMapInfo *mapInfo) { - // XXX: is 35% a good estimate ? + // FIXME:: is 35% a good estimate ? Size size = layerInfo->_layerSize; float totalNumberOfTiles = size.width * size.height; float capacity = totalNumberOfTiles * 0.35f + 1; // 35 percent is occupied ? @@ -175,7 +170,7 @@ void TMXLayer::setupTiles() // gid = CFSwapInt32( gid ); /* We support little endian.*/ - // XXX: gid == 0 --> empty tile + // FIXME:: gid == 0 --> empty tile if (gid != 0) { this->appendTileForGID(gid, Vec2(x, y)); @@ -292,7 +287,7 @@ Sprite* TMXLayer::reusedTileWithRect(Rect rect) } else { - // XXX HACK: Needed because if "batch node" is nil, + // FIXME: HACK: Needed because if "batch node" is nil, // then the Sprite'squad will be reset _reusedTile->setBatchNode(nullptr); @@ -472,7 +467,7 @@ ssize_t TMXLayer::atlasIndexForExistantZ(int z) ssize_t TMXLayer::atlasIndexForNewZ(int z) { - // XXX: This can be improved with a sort of binary search + // FIXME:: This can be improved with a sort of binary search ssize_t i=0; for (i=0; i< _atlasIndexArray->num ; i++) { diff --git a/cocos/2d/CCTMXLayer.h b/cocos/2d/CCTMXLayer.h index 2ab316b90e..470abc0f10 100644 --- a/cocos/2d/CCTMXLayer.h +++ b/cocos/2d/CCTMXLayer.h @@ -27,10 +27,8 @@ THE SOFTWARE. #ifndef __CCTMX_LAYER_H__ #define __CCTMX_LAYER_H__ -#include "CCTMXObjectGroup.h" -#include "CCAtlasNode.h" #include "2d/CCSpriteBatchNode.h" -#include "CCTMXXMLParser.h" +#include "2d/CCTMXXMLParser.h" #include "base/ccCArray.h" NS_CC_BEGIN diff --git a/cocos/2d/CCTMXObjectGroup.cpp b/cocos/2d/CCTMXObjectGroup.cpp index 6b2a55af32..ff83c41bbf 100644 --- a/cocos/2d/CCTMXObjectGroup.cpp +++ b/cocos/2d/CCTMXObjectGroup.cpp @@ -25,7 +25,7 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#include "CCTMXObjectGroup.h" +#include "2d/CCTMXObjectGroup.h" #include "base/ccMacros.h" NS_CC_BEGIN diff --git a/cocos/2d/CCTMXTiledMap.cpp b/cocos/2d/CCTMXTiledMap.cpp index 0559a22203..d8176215d0 100644 --- a/cocos/2d/CCTMXTiledMap.cpp +++ b/cocos/2d/CCTMXTiledMap.cpp @@ -24,14 +24,12 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#include "CCTMXTiledMap.h" -#include "CCTMXXMLParser.h" -#include "CCTMXLayer.h" +#include "2d/CCTMXTiledMap.h" +#include "2d/CCTMXXMLParser.h" +#include "2d/CCTMXLayer.h" #include "2d/CCSprite.h" #include "deprecated/CCString.h" // For StringUtils::format -#include - NS_CC_BEGIN // implementation TMXTiledMap @@ -138,7 +136,7 @@ TMXTilesetInfo * TMXTiledMap::tilesetForLayer(TMXLayerInfo *layerInfo, TMXMapInf // gid = CFSwapInt32( gid ); /* We support little endian.*/ - // XXX: gid == 0 --> empty tile + // FIXME:: gid == 0 --> empty tile if( gid != 0 ) { // Optimization: quick return diff --git a/cocos/2d/CCTMXTiledMap.h b/cocos/2d/CCTMXTiledMap.h index a4cbda3b64..1951002324 100644 --- a/cocos/2d/CCTMXTiledMap.h +++ b/cocos/2d/CCTMXTiledMap.h @@ -28,12 +28,11 @@ THE SOFTWARE. #define __CCTMX_TILE_MAP_H__ #include "2d/CCNode.h" -#include "CCTMXObjectGroup.h" +#include "2d/CCTMXObjectGroup.h" #include "base/CCValue.h" NS_CC_BEGIN -class TMXObjectGroup; class TMXLayer; class TMXLayerInfo; class TMXTilesetInfo; diff --git a/cocos/2d/CCTMXXMLParser.cpp b/cocos/2d/CCTMXXMLParser.cpp index 396c73260b..8d15046181 100644 --- a/cocos/2d/CCTMXXMLParser.cpp +++ b/cocos/2d/CCTMXXMLParser.cpp @@ -26,15 +26,14 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ +#include "2d/CCTMXXMLParser.h" #include #include -#include "CCTMXXMLParser.h" -#include "CCTMXTiledMap.h" -#include "base/ccMacros.h" -#include "platform/CCFileUtils.h" +#include "2d/CCTMXTiledMap.h" #include "base/ZipUtils.h" #include "base/base64.h" #include "base/CCDirector.h" +#include "platform/CCFileUtils.h" using namespace std; diff --git a/cocos/2d/CCTMXXMLParser.h b/cocos/2d/CCTMXXMLParser.h index dde1c4f535..6c011a25c2 100644 --- a/cocos/2d/CCTMXXMLParser.h +++ b/cocos/2d/CCTMXXMLParser.h @@ -33,13 +33,13 @@ THE SOFTWARE. #include "platform/CCSAXParser.h" #include "base/CCVector.h" #include "base/CCValue.h" +#include "2d/CCTMXObjectGroup.h" // needed for Vector for binding #include NS_CC_BEGIN class TMXLayerInfo; -class TMXObjectGroup; class TMXTilesetInfo; /** @file diff --git a/cocos/2d/CCTextFieldTTF.cpp b/cocos/2d/CCTextFieldTTF.cpp index 2bc51e86b5..1a8ed91c01 100644 --- a/cocos/2d/CCTextFieldTTF.cpp +++ b/cocos/2d/CCTextFieldTTF.cpp @@ -23,7 +23,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#include "CCTextFieldTTF.h" +#include "2d/CCTextFieldTTF.h" #include "base/CCDirector.h" diff --git a/cocos/2d/CCTileMapAtlas.cpp b/cocos/2d/CCTileMapAtlas.cpp index a3d070ed69..18c772db27 100644 --- a/cocos/2d/CCTileMapAtlas.cpp +++ b/cocos/2d/CCTileMapAtlas.cpp @@ -24,14 +24,13 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#include "CCTileMapAtlas.h" +#include "2d/CCTileMapAtlas.h" #include "platform/CCFileUtils.h" #include "renderer/CCTextureAtlas.h" #include "base/TGAlib.h" -#include "base/ccConfig.h" #include "base/CCDirector.h" #include "deprecated/CCString.h" -#include + NS_CC_BEGIN @@ -142,8 +141,8 @@ void TileMapAtlas::setTile(const Color3B& tile, const Vec2& position) { ptr[(unsigned int)(position.x + position.y * _TGAInfo->width)] = tile; - // XXX: this method consumes a lot of memory - // XXX: a tree of something like that shall be implemented + // FIXME:: this method consumes a lot of memory + // FIXME:: a tree of something like that shall be implemented std::string key = StringUtils::toString(position.x) + "," + StringUtils::toString(position.y); int num = _posToAtlasIndex[key].asInt(); diff --git a/cocos/2d/CCTileMapAtlas.h b/cocos/2d/CCTileMapAtlas.h index 7ac9382f3c..dc7eef3734 100644 --- a/cocos/2d/CCTileMapAtlas.h +++ b/cocos/2d/CCTileMapAtlas.h @@ -27,7 +27,7 @@ THE SOFTWARE. #ifndef __CCTILE_MAP_ATLAS__ #define __CCTILE_MAP_ATLAS__ -#include "CCAtlasNode.h" +#include "2d/CCAtlasNode.h" #include "base/CCValue.h" NS_CC_BEGIN diff --git a/cocos/2d/CCTransitionPageTurn.cpp b/cocos/2d/CCTransitionPageTurn.cpp index eb2797db64..cbeaa0a019 100644 --- a/cocos/2d/CCTransitionPageTurn.cpp +++ b/cocos/2d/CCTransitionPageTurn.cpp @@ -62,7 +62,7 @@ TransitionPageTurn * TransitionPageTurn::create(float t, Scene *scene, bool back /** initializes a transition with duration and incoming scene */ bool TransitionPageTurn::initWithDuration(float t, Scene *scene, bool backwards) { - // XXX: needed before [super init] + // FIXME:: needed before [super init] _back = backwards; if (TransitionScene::initWithDuration(t, scene)) diff --git a/cocos/3d/CCAnimate3D.cpp b/cocos/3d/CCAnimate3D.cpp index 00cd4cd9ca..11f71d6a09 100644 --- a/cocos/3d/CCAnimate3D.cpp +++ b/cocos/3d/CCAnimate3D.cpp @@ -23,12 +23,9 @@ ****************************************************************************/ #include "3d/CCAnimate3D.h" -#include "3d/CCAnimation3D.h" #include "3d/CCSprite3D.h" #include "3d/CCSkeleton3D.h" #include "3d/CCMeshSkin.h" - -#include "base/ccMacros.h" #include "platform/CCFileUtils.h" NS_CC_BEGIN diff --git a/cocos/3d/CCAnimate3D.h b/cocos/3d/CCAnimate3D.h index d6d8152bb2..a1c79adefd 100644 --- a/cocos/3d/CCAnimate3D.h +++ b/cocos/3d/CCAnimate3D.h @@ -28,17 +28,13 @@ #include #include "3d/CCAnimation3D.h" - +#include "3d/3dExport.h" #include "base/ccMacros.h" #include "base/CCRef.h" -#include "base/ccTypes.h" -#include "base/CCPlatformMacros.h" #include "2d/CCActionInterval.h" -#include "3d/3dExport.h" NS_CC_BEGIN -class Animation3D; class Bone3D; /** * Animate3D, Animates a Sprite3D given with an Animation3D diff --git a/cocos/3d/CCAnimation3D.cpp b/cocos/3d/CCAnimation3D.cpp index 97e6489fa3..8ef889f106 100644 --- a/cocos/3d/CCAnimation3D.cpp +++ b/cocos/3d/CCAnimation3D.cpp @@ -24,8 +24,6 @@ #include "3d/CCAnimation3D.h" #include "3d/CCBundle3D.h" - -#include "base/ccMacros.h" #include "platform/CCFileUtils.h" NS_CC_BEGIN diff --git a/cocos/3d/CCAnimation3D.h b/cocos/3d/CCAnimation3D.h index 006506d018..3be514be6e 100644 --- a/cocos/3d/CCAnimation3D.h +++ b/cocos/3d/CCAnimation3D.h @@ -31,8 +31,7 @@ #include "base/ccMacros.h" #include "base/CCRef.h" -#include "base/ccTypes.h" -#include "CCBundle3DData.h" +#include "3d/CCBundle3DData.h" #include "3d/3dExport.h" NS_CC_BEGIN diff --git a/cocos/3d/CCAnimationCurve.h b/cocos/3d/CCAnimationCurve.h index 8458ba787a..0f2b9eb0c4 100644 --- a/cocos/3d/CCAnimationCurve.h +++ b/cocos/3d/CCAnimationCurve.h @@ -24,10 +24,8 @@ #ifndef __CCANIMATIONCURVE_H__ #define __CCANIMATIONCURVE_H__ -#include #include -#include "base/ccTypes.h" #include "base/CCPlatformMacros.h" #include "base/CCRef.h" #include "math/CCMath.h" diff --git a/cocos/3d/CCAttachNode.cpp b/cocos/3d/CCAttachNode.cpp index 3d0f575d30..ee53d03d9d 100644 --- a/cocos/3d/CCAttachNode.cpp +++ b/cocos/3d/CCAttachNode.cpp @@ -25,12 +25,6 @@ #include "3d/CCAttachNode.h" #include "3d/CCSkeleton3D.h" -#include "2d/CCNode.h" - -#include "base/CCDirector.h" -#include "base/CCPlatformMacros.h" -#include "base/ccMacros.h" - NS_CC_BEGIN AttachNode* AttachNode::create(Bone3D* attachBone) diff --git a/cocos/3d/CCAttachNode.h b/cocos/3d/CCAttachNode.h index ed67bca143..57013cceb6 100644 --- a/cocos/3d/CCAttachNode.h +++ b/cocos/3d/CCAttachNode.h @@ -25,14 +25,8 @@ #ifndef __CCATTACHNODE_H__ #define __CCATTACHNODE_H__ -#include - -#include "base/CCVector.h" -#include "base/ccTypes.h" -#include "base/CCProtocols.h" #include "math/CCMath.h" #include "2d/CCNode.h" -#include "renderer/CCMeshCommand.h" #include "3d/3dExport.h" NS_CC_BEGIN diff --git a/cocos/3d/CCBundle3D.h b/cocos/3d/CCBundle3D.h index 6388e14ad6..bd100d6d7a 100644 --- a/cocos/3d/CCBundle3D.h +++ b/cocos/3d/CCBundle3D.h @@ -25,18 +25,10 @@ #ifndef __CCBUNDLE3D_H__ #define __CCBUNDLE3D_H__ -#include -#include - #include "3d/CCBundle3DData.h" - -#include "base/ccMacros.h" -#include "base/CCRef.h" -#include "base/ccTypes.h" - -#include "json/document.h" -#include "CCBundleReader.h" #include "3d/3dExport.h" +#include "3d/CCBundleReader.h" +#include "json/document.h" NS_CC_BEGIN class Animation3D; diff --git a/cocos/3d/CCMesh.cpp b/cocos/3d/CCMesh.cpp index 9b4d825f8d..0c524e4af2 100644 --- a/cocos/3d/CCMesh.cpp +++ b/cocos/3d/CCMesh.cpp @@ -22,26 +22,14 @@ THE SOFTWARE. ****************************************************************************/ -#include -#include -#include -#include - #include "3d/CCMesh.h" #include "3d/CCMeshSkin.h" +#include "3d/CCSkeleton3D.h" #include "3d/CCMeshVertexIndexData.h" - -#include "base/ccMacros.h" -#include "base/CCEventCustom.h" -#include "base/CCEventListenerCustom.h" #include "base/CCEventDispatcher.h" -#include "base/CCEventType.h" #include "base/CCDirector.h" -#include "renderer/ccGLStateCache.h" -#include "renderer/CCTexture2D.h" #include "renderer/CCTextureCache.h" -#include "renderer/CCGLProgramCache.h" - +#include "renderer/CCGLProgramState.h" using namespace std; diff --git a/cocos/3d/CCMesh.h b/cocos/3d/CCMesh.h index 5080d74f48..c55f949460 100644 --- a/cocos/3d/CCMesh.h +++ b/cocos/3d/CCMesh.h @@ -26,17 +26,13 @@ #define __CCMESH_H__ #include -#include #include "3d/CCBundle3DData.h" #include "3d/CCAABB.h" #include "3d/3dExport.h" #include "base/CCRef.h" -#include "base/ccTypes.h" #include "math/CCMath.h" -#include "renderer/CCGLProgram.h" -#include "renderer/CCGLProgramState.h" #include "renderer/CCMeshCommand.h" NS_CC_BEGIN @@ -44,6 +40,8 @@ NS_CC_BEGIN class Texture2D; class MeshSkin; class MeshIndexData; +class GLProgramState; +class GLProgram; /** * Mesh: contains ref to index buffer, GLProgramState, texture, skin, blend function, aabb and so on */ diff --git a/cocos/3d/CCMeshSkin.cpp b/cocos/3d/CCMeshSkin.cpp index 3387de9da5..6966178b9a 100644 --- a/cocos/3d/CCMeshSkin.cpp +++ b/cocos/3d/CCMeshSkin.cpp @@ -25,10 +25,7 @@ #include "3d/CCMeshSkin.h" #include "3d/CCSkeleton3D.h" #include "3d/CCBundle3D.h" - -#include "base/ccMacros.h" -#include "base/CCPlatformMacros.h" -#include "platform/CCFileUtils.h" +#include "3d/CCSkeleton3D.h" NS_CC_BEGIN diff --git a/cocos/3d/CCMeshSkin.h b/cocos/3d/CCMeshSkin.h index 6442c3401a..edc2cdfc75 100644 --- a/cocos/3d/CCMeshSkin.h +++ b/cocos/3d/CCMeshSkin.h @@ -25,17 +25,12 @@ #ifndef __CCMESHSKIN_H__ #define __CCMESHSKIN_H__ -#include - #include "3d/CCBundle3DData.h" -#include "3d/CCSkeleton3D.h" - -#include "base/ccMacros.h" +#include "3d/3dExport.h" #include "base/CCRef.h" #include "base/CCVector.h" -#include "base/ccTypes.h" #include "math/CCMath.h" -#include "3d/3dExport.h" + NS_CC_BEGIN diff --git a/cocos/3d/CCMeshVertexIndexData.h b/cocos/3d/CCMeshVertexIndexData.h index 677ec709cb..1c540b72c8 100644 --- a/cocos/3d/CCMeshVertexIndexData.h +++ b/cocos/3d/CCMeshVertexIndexData.h @@ -30,14 +30,15 @@ #include "3d/CCBundle3DData.h" #include "3d/CCAABB.h" +#include "3d/3dExport.h" #include "base/CCRef.h" -#include "base/ccTypes.h" +#include "base/CCVector.h" #include "math/CCMath.h" #include "renderer/CCGLProgram.h" #include "renderer/CCVertexIndexData.h" #include "renderer/CCVertexIndexBuffer.h" -#include "3d/3dExport.h" + NS_CC_BEGIN diff --git a/cocos/3d/CCObjLoader.cpp b/cocos/3d/CCObjLoader.cpp index 1ad3e446eb..7fb9b07576 100644 --- a/cocos/3d/CCObjLoader.cpp +++ b/cocos/3d/CCObjLoader.cpp @@ -16,17 +16,11 @@ // version 0.9.0: Initial // -#include -#include -#include +#include "CCObjLoader.h" -#include -#include -#include #include #include -#include "CCObjLoader.h" #include "platform/CCFileUtils.h" #include "base/ccUtils.h" diff --git a/cocos/3d/CCRay.cpp b/cocos/3d/CCRay.cpp index b8f6b1d56c..94189183d1 100755 --- a/cocos/3d/CCRay.cpp +++ b/cocos/3d/CCRay.cpp @@ -20,9 +20,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#include "CCRay.h" -#include "CCAABB.h" -#include "CCOBB.h" +#include "3d/CCRay.h" NS_CC_BEGIN diff --git a/cocos/3d/CCRay.h b/cocos/3d/CCRay.h index d92d0ac06c..8c127a8198 100644 --- a/cocos/3d/CCRay.h +++ b/cocos/3d/CCRay.h @@ -25,10 +25,9 @@ #ifndef __CC_RAY_H_ #define __CC_RAY_H_ -#include "base/ccMacros.h" #include "math/CCMath.h" -#include "CCAABB.h" -#include "CCOBB.h" +#include "3d/CCAABB.h" +#include "3d/CCOBB.h" #include "3d/3dExport.h" NS_CC_BEGIN diff --git a/cocos/3d/CCSkeleton3D.cpp b/cocos/3d/CCSkeleton3D.cpp index 7733141535..f3dc240a47 100644 --- a/cocos/3d/CCSkeleton3D.cpp +++ b/cocos/3d/CCSkeleton3D.cpp @@ -23,11 +23,7 @@ ****************************************************************************/ #include "3d/CCSkeleton3D.h" -#include "3d/CCBundle3D.h" -#include "base/ccMacros.h" -#include "base/CCPlatformMacros.h" -#include "platform/CCFileUtils.h" NS_CC_BEGIN diff --git a/cocos/3d/CCSkeleton3D.h b/cocos/3d/CCSkeleton3D.h index aadd977967..26bb85c73b 100644 --- a/cocos/3d/CCSkeleton3D.h +++ b/cocos/3d/CCSkeleton3D.h @@ -25,16 +25,11 @@ #ifndef __CCSKELETON3D_H__ #define __CCSKELETON3D_H__ -#include - #include "3d/CCBundle3DData.h" - -#include "base/ccMacros.h" +#include "3d/3dExport.h" #include "base/CCRef.h" #include "base/CCVector.h" -#include "base/ccTypes.h" -#include "math/CCMath.h" -#include "3d/3dExport.h" + NS_CC_BEGIN diff --git a/cocos/3d/CCSprite3D.cpp b/cocos/3d/CCSprite3D.cpp index 5a70261fd5..8d289035ab 100644 --- a/cocos/3d/CCSprite3D.cpp +++ b/cocos/3d/CCSprite3D.cpp @@ -28,7 +28,7 @@ #include "3d/CCBundle3D.h" #include "3d/CCSprite3DMaterial.h" #include "3d/CCAttachNode.h" -#include "3d/CCSkeleton3D.h" +#include "3d/CCMesh.h" #include "base/CCDirector.h" #include "base/CCPlatformMacros.h" diff --git a/cocos/3d/CCSprite3D.h b/cocos/3d/CCSprite3D.h index ad3679d975..c7ab28893c 100644 --- a/cocos/3d/CCSprite3D.h +++ b/cocos/3d/CCSprite3D.h @@ -25,7 +25,6 @@ #ifndef __CCSPRITE3D_H__ #define __CCSPRITE3D_H__ -#include #include #include "base/CCVector.h" @@ -33,9 +32,9 @@ #include "base/CCProtocols.h" #include "2d/CCNode.h" #include "renderer/CCMeshCommand.h" +#include "3d/CCSkeleton3D.h" // need to include for lua-binding #include "3d/CCAABB.h" #include "3d/CCBundle3DData.h" -#include "3d/CCMesh.h" #include "3d/CCMeshVertexIndexData.h" #include "3d/3dExport.h" @@ -47,10 +46,7 @@ class Mesh; class Texture2D; class MeshSkin; class AttachNode; -class SubMeshState; -class Skeleton3D; struct NodeData; -class SubMesh; /** Sprite3D: A sprite can be loaded from 3D model files, .obj, .c3t, .c3b, then can be drawed as sprite */ class CC_3D_DLL Sprite3D : public Node, public BlendProtocol { diff --git a/cocos/3d/CCSprite3DMaterial.cpp b/cocos/3d/CCSprite3DMaterial.cpp index 5068ff8166..cbe2548136 100644 --- a/cocos/3d/CCSprite3DMaterial.cpp +++ b/cocos/3d/CCSprite3DMaterial.cpp @@ -24,13 +24,7 @@ #include "3d/CCSprite3DMaterial.h" -#include "platform/CCFileUtils.h" -#include "renderer/CCTextureCache.h" -#include "base/CCEventCustom.h" -#include "base/CCEventListenerCustom.h" -#include "base/CCEventDispatcher.h" -#include "base/CCEventType.h" -#include "base/CCDirector.h" +#include "renderer/CCTexture2D.h" NS_CC_BEGIN diff --git a/cocos/3d/CCSprite3DMaterial.h b/cocos/3d/CCSprite3DMaterial.h index 68705c5c52..bed804841c 100644 --- a/cocos/3d/CCSprite3DMaterial.h +++ b/cocos/3d/CCSprite3DMaterial.h @@ -28,14 +28,9 @@ #include #include #include "base/ccTypes.h" -#include "base/CCMap.h" NS_CC_BEGIN -class Sprite3D; -class Mesh; -class EventListenerCustom; -class EventCustom; class Texture2D; /** diff --git a/cocos/audio/include/SimpleAudioEngine.h b/cocos/audio/include/SimpleAudioEngine.h index 8eda5ddeb6..d57eed70e1 100644 --- a/cocos/audio/include/SimpleAudioEngine.h +++ b/cocos/audio/include/SimpleAudioEngine.h @@ -27,11 +27,7 @@ THE SOFTWARE. #ifndef _SIMPLE_AUDIO_ENGINE_H_ #define _SIMPLE_AUDIO_ENGINE_H_ -#include #include "Export.h" -#include -#include -#include #if defined(__GNUC__) && ((__GNUC__ >= 4) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1))) #define CC_DEPRECATED_ATTRIBUTE __attribute__((deprecated)) diff --git a/cocos/audio/mac/CocosDenshion.h b/cocos/audio/mac/CocosDenshion.h index 1516b2372e..2e40c2eaae 100644 --- a/cocos/audio/mac/CocosDenshion.h +++ b/cocos/audio/mac/CocosDenshion.h @@ -338,7 +338,7 @@ typedef struct _sourceInfo { #pragma mark CDAsynchBufferLoader /** CDAsynchBufferLoader - TODO + * TODO: ??? */ @interface CDAsynchBufferLoader : NSOperation { NSArray *_loadRequests; diff --git a/cocos/base/CCAutoreleasePool.h b/cocos/base/CCAutoreleasePool.h index 6d1134a77e..1408469edf 100644 --- a/cocos/base/CCAutoreleasePool.h +++ b/cocos/base/CCAutoreleasePool.h @@ -25,7 +25,6 @@ THE SOFTWARE. #ifndef __AUTORELEASEPOOL_H__ #define __AUTORELEASEPOOL_H__ -#include #include #include #include "base/CCRef.h" diff --git a/cocos/base/CCCamera.cpp b/cocos/base/CCCamera.cpp index feb537db8a..6067830fd1 100644 --- a/cocos/base/CCCamera.cpp +++ b/cocos/base/CCCamera.cpp @@ -25,7 +25,6 @@ #include "base/CCDirector.h" #include "platform/CCGLView.h" #include "2d/CCScene.h" -#include "2d/CCNode.h" NS_CC_BEGIN diff --git a/cocos/base/CCCamera.h b/cocos/base/CCCamera.h index 6825b14268..aa95b15064 100644 --- a/cocos/base/CCCamera.h +++ b/cocos/base/CCCamera.h @@ -24,7 +24,6 @@ THE SOFTWARE. #ifndef _CCCAMERA_H__ #define _CCCAMERA_H__ -#include "base/CCVector.h" #include "2d/CCNode.h" NS_CC_BEGIN diff --git a/cocos/base/CCConfiguration.cpp b/cocos/base/CCConfiguration.cpp index 5c9d9d0cae..2e43302dda 100644 --- a/cocos/base/CCConfiguration.cpp +++ b/cocos/base/CCConfiguration.cpp @@ -25,9 +25,6 @@ THE SOFTWARE. ****************************************************************************/ #include "base/CCConfiguration.h" -#include -#include "base/ccMacros.h" -#include "base/ccConfig.h" #include "platform/CCFileUtils.h" NS_CC_BEGIN @@ -161,13 +158,13 @@ void Configuration::destroyInstance() CC_SAFE_RELEASE_NULL(s_sharedConfiguration); } -// XXX: deprecated +// FIXME: deprecated Configuration* Configuration::sharedConfiguration() { return Configuration::getInstance(); } -// XXX: deprecated +// FIXME: deprecated void Configuration::purgeConfiguration() { Configuration::destroyInstance(); diff --git a/cocos/base/CCConsole.cpp b/cocos/base/CCConsole.cpp index 85775dbaad..262c8e9891 100644 --- a/cocos/base/CCConsole.cpp +++ b/cocos/base/CCConsole.cpp @@ -237,7 +237,7 @@ static void _log(const char *format, va_list args) } -// XXX: Deprecated +// FIXME: Deprecated void CCLog(const char * format, ...) { va_list args; diff --git a/cocos/base/CCController.cpp b/cocos/base/CCController.cpp index cf3dc2050c..e326a7feec 100644 --- a/cocos/base/CCController.cpp +++ b/cocos/base/CCController.cpp @@ -23,15 +23,13 @@ THE SOFTWARE. ****************************************************************************/ -#include "CCController.h" +#include "base/CCController.h" #if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS) -#include "ccMacros.h" -#include "CCEventDispatcher.h" -#include "CCEventController.h" -#include "CCEventListenerController.h" -#include "CCDirector.h" +#include "base/CCEventDispatcher.h" +#include "base/CCEventController.h" +#include "base/CCDirector.h" NS_CC_BEGIN diff --git a/cocos/base/CCData.cpp b/cocos/base/CCData.cpp index 3092202337..db4f639e95 100644 --- a/cocos/base/CCData.cpp +++ b/cocos/base/CCData.cpp @@ -24,10 +24,6 @@ ****************************************************************************/ #include "base/CCData.h" -#include "platform/CCCommon.h" -#include "base/ccMacros.h" - -#include NS_CC_BEGIN diff --git a/cocos/base/CCDirector.cpp b/cocos/base/CCDirector.cpp index bc69228f55..e660eb96e7 100644 --- a/cocos/base/CCDirector.cpp +++ b/cocos/base/CCDirector.cpp @@ -32,16 +32,16 @@ THE SOFTWARE. #include #include "2d/CCDrawingPrimitives.h" -#include "2d/CCScene.h" #include "2d/CCSpriteFrameCache.h" #include "platform/CCFileUtils.h" -#include "platform/CCImage.h" + #include "2d/CCActionManager.h" #include "2d/CCFontFNT.h" #include "2d/CCFontAtlasCache.h" #include "2d/CCAnimationCache.h" #include "2d/CCTransition.h" #include "2d/CCFontFreeType.h" +#include "2d/CCLabelAtlas.h" #include "renderer/CCGLProgramCache.h" #include "renderer/CCGLProgramStateCache.h" #include "renderer/CCTextureCache.h" @@ -55,12 +55,9 @@ THE SOFTWARE. #include "base/CCEventDispatcher.h" #include "base/CCEventCustom.h" #include "base/CCConsole.h" -#include "base/CCTouch.h" #include "base/CCAutoreleasePool.h" -#include "base/CCProfiling.h" #include "base/CCConfiguration.h" -#include "base/CCNS.h" -#include "math/CCMath.h" + #include "CCApplication.h" #include "CCGLViewImpl.h" @@ -76,7 +73,7 @@ THE SOFTWARE. using namespace std; NS_CC_BEGIN -// XXX it should be a Director ivar. Move it there once support for multiple directors is added +// FIXME: it should be a Director ivar. Move it there once support for multiple directors is added // singleton stuff static DisplayLinkDirector *s_SharedDirector = nullptr; @@ -241,7 +238,7 @@ void Director::setGLDefaultValues() CCASSERT(_openGLView, "opengl view should not be null"); setAlphaBlending(true); - // XXX: Fix me, should enable/disable depth test according the depth format as cocos2d-iphone did + // FIXME: Fix me, should enable/disable depth test according the depth format as cocos2d-iphone did // [self setDepthTest: view_.depthFormat]; setDepthTest(false); setProjection(_projection); @@ -277,7 +274,8 @@ void Director::drawScene() glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); /* to avoid flickr, nextScene MUST be here: after tick and before draw. - XXX: Which bug is this one. It seems that it can't be reproduced with v0.9 */ + * FIXME: Which bug is this one. It seems that it can't be reproduced with v0.9 + */ if (_nextScene) { setNextScene(); @@ -1158,7 +1156,7 @@ void Director::calculateMPF() // returns the FPS image data pointer and len void Director::getFPSImageData(unsigned char** datapointer, ssize_t* length) { - // XXX fixed me if it should be used + // FIXME: fixed me if it should be used *datapointer = cc_fps_images_png; *length = cc_fps_images_len(); } diff --git a/cocos/base/CCDirector.h b/cocos/base/CCDirector.h index c5ffd80e0a..dc388b451a 100644 --- a/cocos/base/CCDirector.h +++ b/cocos/base/CCDirector.h @@ -31,12 +31,9 @@ THE SOFTWARE. #include "base/CCPlatformMacros.h" #include "base/CCRef.h" -#include "base/ccTypes.h" -#include "math/CCGeometry.h" #include "base/CCVector.h" -#include "CCGL.h" -#include "2d/CCLabelAtlas.h" #include "2d/CCScene.h" +#include "CCGL.h" #include #include "math/CCMath.h" #include "platform/CCGLView.h" @@ -50,7 +47,6 @@ NS_CC_BEGIN /* Forward declarations. */ class LabelAtlas; -class Scene; //class GLView; class DirectorDelegate; class Node; @@ -246,7 +242,7 @@ public: */ Vec2 convertToUI(const Vec2& point); - /// XXX: missing description + /// FIXME: missing description float getZEye() const; // Scene Management diff --git a/cocos/base/CCEvent.h b/cocos/base/CCEvent.h index fa2445d60a..14e13b5c3a 100644 --- a/cocos/base/CCEvent.h +++ b/cocos/base/CCEvent.h @@ -26,9 +26,6 @@ #ifndef __CCEVENT_H__ #define __CCEVENT_H__ -#include -#include - #include "base/CCRef.h" #include "base/CCPlatformMacros.h" diff --git a/cocos/base/CCEventCustom.cpp b/cocos/base/CCEventCustom.cpp index 8c0e7b5e8b..846f44f42e 100644 --- a/cocos/base/CCEventCustom.cpp +++ b/cocos/base/CCEventCustom.cpp @@ -23,8 +23,7 @@ ****************************************************************************/ #include "base/CCEventCustom.h" -#include "base/ccMacros.h" -#include +#include "base/CCEvent.h" NS_CC_BEGIN diff --git a/cocos/base/CCEventCustom.h b/cocos/base/CCEventCustom.h index 00ea4555ed..8699d8cf62 100644 --- a/cocos/base/CCEventCustom.h +++ b/cocos/base/CCEventCustom.h @@ -25,6 +25,7 @@ #ifndef __cocos2d_libs__CCCustomEvent__ #define __cocos2d_libs__CCCustomEvent__ +#include #include "base/CCEvent.h" NS_CC_BEGIN diff --git a/cocos/base/CCEventDispatcher.cpp b/cocos/base/CCEventDispatcher.cpp index b7706184fe..6ca69ed9a2 100644 --- a/cocos/base/CCEventDispatcher.cpp +++ b/cocos/base/CCEventDispatcher.cpp @@ -22,8 +22,8 @@ THE SOFTWARE. ****************************************************************************/ #include "base/CCEventDispatcher.h" -#include "base/CCEvent.h" -#include "base/CCEventTouch.h" +#include + #include "base/CCEventCustom.h" #include "base/CCEventListenerTouch.h" #include "base/CCEventListenerAcceleration.h" @@ -38,8 +38,6 @@ #include "base/CCDirector.h" #include "base/CCEventType.h" -#include - #define DUMP_LISTENER_ITEM_PRIORITY_INFO 0 diff --git a/cocos/base/CCEventDispatcher.h b/cocos/base/CCEventDispatcher.h index 249e39d23e..0c43ef1919 100644 --- a/cocos/base/CCEventDispatcher.h +++ b/cocos/base/CCEventDispatcher.h @@ -25,17 +25,17 @@ #ifndef __CC_EVENT_DISPATCHER_H__ #define __CC_EVENT_DISPATCHER_H__ +#include +#include +#include +#include +#include + #include "base/CCPlatformMacros.h" #include "base/CCEventListener.h" #include "base/CCEvent.h" #include "CCStdC.h" -#include -#include -#include -#include -#include - NS_CC_BEGIN class Event; diff --git a/cocos/base/CCEventFocus.cpp b/cocos/base/CCEventFocus.cpp index f1249576a2..442f72372c 100644 --- a/cocos/base/CCEventFocus.cpp +++ b/cocos/base/CCEventFocus.cpp @@ -23,7 +23,7 @@ THE SOFTWARE. ****************************************************************************/ -#include "CCEventFocus.h" +#include "base/CCEventFocus.h" NS_CC_BEGIN diff --git a/cocos/base/CCEventFocus.h b/cocos/base/CCEventFocus.h index c43399d446..100b207cbd 100644 --- a/cocos/base/CCEventFocus.h +++ b/cocos/base/CCEventFocus.h @@ -26,7 +26,7 @@ #ifndef __cocos2d_libs__CCEventFocus__ #define __cocos2d_libs__CCEventFocus__ -#include "CCEvent.h" +#include "base/CCEvent.h" NS_CC_BEGIN diff --git a/cocos/base/CCEventListener.cpp b/cocos/base/CCEventListener.cpp index ca67dfbabd..0c7c32f598 100644 --- a/cocos/base/CCEventListener.cpp +++ b/cocos/base/CCEventListener.cpp @@ -22,9 +22,7 @@ THE SOFTWARE. ****************************************************************************/ -#include "base/CCConsole.h" #include "base/CCEventListener.h" -#include "platform/CCCommon.h" NS_CC_BEGIN diff --git a/cocos/base/CCEventListener.h b/cocos/base/CCEventListener.h index 18a135515f..b316e335e9 100644 --- a/cocos/base/CCEventListener.h +++ b/cocos/base/CCEventListener.h @@ -25,13 +25,12 @@ #ifndef __CCEVENTLISTENER_H__ #define __CCEVENTLISTENER_H__ -#include "base/CCPlatformMacros.h" -#include "base/CCRef.h" - #include #include #include -#include + +#include "base/CCPlatformMacros.h" +#include "base/CCRef.h" NS_CC_BEGIN diff --git a/cocos/base/CCEventListenerController.cpp b/cocos/base/CCEventListenerController.cpp index a83293b5b2..7d9b531d0d 100644 --- a/cocos/base/CCEventListenerController.cpp +++ b/cocos/base/CCEventListenerController.cpp @@ -23,9 +23,9 @@ THE SOFTWARE. ****************************************************************************/ -#include "CCEventListenerController.h" -#include "CCEventController.h" -#include "ccMacros.h" +#include "base/CCEventListenerController.h" +#include "base/CCEventController.h" +#include "base/ccMacros.h" #include "base/CCController.h" NS_CC_BEGIN diff --git a/cocos/base/CCEventListenerFocus.cpp b/cocos/base/CCEventListenerFocus.cpp index 1fa42532d0..da32e6a1d1 100644 --- a/cocos/base/CCEventListenerFocus.cpp +++ b/cocos/base/CCEventListenerFocus.cpp @@ -23,9 +23,9 @@ THE SOFTWARE. ****************************************************************************/ -#include "CCEventListenerFocus.h" -#include "CCEventFocus.h" -#include "ccMacros.h" +#include "base/CCEventListenerFocus.h" +#include "base/CCEventFocus.h" +#include "base/ccMacros.h" NS_CC_BEGIN diff --git a/cocos/base/CCEventListenerFocus.h b/cocos/base/CCEventListenerFocus.h index 300fdcdac8..00c78bb22d 100644 --- a/cocos/base/CCEventListenerFocus.h +++ b/cocos/base/CCEventListenerFocus.h @@ -26,7 +26,7 @@ #ifndef __cocos2d_libs__CCEventListenerFocus__ #define __cocos2d_libs__CCEventListenerFocus__ -#include "CCEventListener.h" +#include "base/CCEventListener.h" NS_CC_BEGIN diff --git a/cocos/base/CCEventListenerKeyboard.cpp b/cocos/base/CCEventListenerKeyboard.cpp index 40135a384e..56f286fa61 100644 --- a/cocos/base/CCEventListenerKeyboard.cpp +++ b/cocos/base/CCEventListenerKeyboard.cpp @@ -24,7 +24,6 @@ ****************************************************************************/ #include "base/CCEventListenerKeyboard.h" -#include "base/CCEventKeyboard.h" #include "base/ccMacros.h" NS_CC_BEGIN diff --git a/cocos/base/CCEventListenerTouch.cpp b/cocos/base/CCEventListenerTouch.cpp index 9cbc1bcb4a..3870826e96 100644 --- a/cocos/base/CCEventListenerTouch.cpp +++ b/cocos/base/CCEventListenerTouch.cpp @@ -25,6 +25,7 @@ #include "base/CCEventListenerTouch.h" #include "base/CCEventDispatcher.h" #include "base/CCEventTouch.h" +#include "base/CCTouch.h" #include diff --git a/cocos/base/CCEventListenerTouch.h b/cocos/base/CCEventListenerTouch.h index b125b8e95f..353c938e9d 100644 --- a/cocos/base/CCEventListenerTouch.h +++ b/cocos/base/CCEventListenerTouch.h @@ -27,12 +27,13 @@ #define __cocos2d_libs__CCTouchEventListener__ #include "base/CCEventListener.h" -#include "base/CCTouch.h" #include NS_CC_BEGIN +class Touch; + class CC_DLL EventListenerTouchOneByOne : public EventListener { public: diff --git a/cocos/base/CCEventTouch.cpp b/cocos/base/CCEventTouch.cpp index 3c78fb89aa..93632a7344 100644 --- a/cocos/base/CCEventTouch.cpp +++ b/cocos/base/CCEventTouch.cpp @@ -23,6 +23,7 @@ ****************************************************************************/ #include "base/CCEventTouch.h" +#include "base/CCTouch.h" NS_CC_BEGIN diff --git a/cocos/base/CCEventTouch.h b/cocos/base/CCEventTouch.h index 52bbbf9a2c..d4d5d9625b 100644 --- a/cocos/base/CCEventTouch.h +++ b/cocos/base/CCEventTouch.h @@ -26,11 +26,12 @@ #define __cocos2d_libs__TouchEvent__ #include "base/CCEvent.h" -#include "base/CCTouch.h" #include NS_CC_BEGIN +class Touch; + #define TOUCH_PERF_DEBUG 1 class CC_DLL EventTouch : public Event diff --git a/cocos/base/CCGameController.h b/cocos/base/CCGameController.h index 0aa4df4abb..fbc93bce17 100644 --- a/cocos/base/CCGameController.h +++ b/cocos/base/CCGameController.h @@ -26,8 +26,8 @@ #ifndef __cocos2d_libs__CCGameController__ #define __cocos2d_libs__CCGameController__ -#include "CCController.h" -#include "CCEventController.h" -#include "CCEventListenerController.h" +#include "base/CCController.h" +#include "base/CCEventController.h" +#include "base/CCEventListenerController.h" #endif /* defined(__cocos2d_libs__CCGameController__) */ diff --git a/cocos/base/CCProfiling.cpp b/cocos/base/CCProfiling.cpp index a97c0d70c6..c96d780f20 100644 --- a/cocos/base/CCProfiling.cpp +++ b/cocos/base/CCProfiling.cpp @@ -25,8 +25,6 @@ THE SOFTWARE. ****************************************************************************/ #include "base/CCProfiling.h" -#include - using namespace std; NS_CC_BEGIN @@ -51,7 +49,7 @@ Profiler* Profiler::getInstance() return g_sSharedProfiler; } -// XXX: deprecated +// FIXME:: deprecated Profiler* Profiler::sharedProfiler(void) { return Profiler::getInstance(); diff --git a/cocos/base/CCUserDefault.cpp b/cocos/base/CCUserDefault.cpp index 3302018233..f22d4216da 100644 --- a/cocos/base/CCUserDefault.cpp +++ b/cocos/base/CCUserDefault.cpp @@ -428,13 +428,13 @@ void UserDefault::destroyInstance() CC_SAFE_DELETE(_userDefault); } -// XXX: deprecated +// FIXME:: deprecated UserDefault* UserDefault::sharedUserDefault() { return UserDefault::getInstance(); } -// XXX: deprecated +// FIXME:: deprecated void UserDefault::purgeSharedUserDefault() { return UserDefault::destroyInstance(); diff --git a/cocos/base/CCUserDefault.mm b/cocos/base/CCUserDefault.mm index 2613965e4b..3d7dd6f14e 100644 --- a/cocos/base/CCUserDefault.mm +++ b/cocos/base/CCUserDefault.mm @@ -490,13 +490,13 @@ void UserDefault::destroyInstance() CC_SAFE_DELETE(_userDefault); } -// XXX: deprecated +// FIXME:: deprecated UserDefault* UserDefault::sharedUserDefault() { return UserDefault::getInstance(); } -// XXX: deprecated +// FIXME:: deprecated void UserDefault::purgeSharedUserDefault() { UserDefault::destroyInstance(); diff --git a/cocos/base/CCUserDefaultAndroid.cpp b/cocos/base/CCUserDefaultAndroid.cpp index 5c66fc6c6a..9240747e5c 100644 --- a/cocos/base/CCUserDefaultAndroid.cpp +++ b/cocos/base/CCUserDefaultAndroid.cpp @@ -146,7 +146,7 @@ UserDefault::UserDefault() { } -// XXX: deprecated +// FIXME:: deprecated void UserDefault::purgeSharedUserDefault() { UserDefault::destroyInstance(); @@ -468,7 +468,7 @@ void UserDefault::setDataForKey(const char* pKey, const Data& value) free(encodedData); } -// XXX: deprecated +// FIXME:: deprecated UserDefault* UserDefault::sharedUserDefault() { return UserDefault::getInstance(); diff --git a/cocos/base/ObjectFactory.cpp b/cocos/base/ObjectFactory.cpp index 0866ca38b2..4d9c11145b 100644 --- a/cocos/base/ObjectFactory.cpp +++ b/cocos/base/ObjectFactory.cpp @@ -23,7 +23,7 @@ THE SOFTWARE. ****************************************************************************/ #include -#include "ObjectFactory.h" +#include "base/ObjectFactory.h" NS_CC_BEGIN diff --git a/cocos/base/ccCArray.cpp b/cocos/base/ccCArray.cpp index a9a463e624..8be669f81f 100644 --- a/cocos/base/ccCArray.cpp +++ b/cocos/base/ccCArray.cpp @@ -25,7 +25,6 @@ THE SOFTWARE. ****************************************************************************/ #include "base/ccCArray.h" -#include "base/CCRef.h" #include "base/ccTypes.h" NS_CC_BEGIN diff --git a/cocos/base/ccMacros.h b/cocos/base/ccMacros.h index e72c32f265..cce54e8f83 100644 --- a/cocos/base/ccMacros.h +++ b/cocos/base/ccMacros.h @@ -55,7 +55,7 @@ THE SOFTWARE. #define GP_ASSERT(cond) CCASSERT(cond, "") -// XXX: Backward compatible +// FIXME:: Backward compatible #define CCAssert CCASSERT #endif // CCASSERT diff --git a/cocos/base/ccTypes.h b/cocos/base/ccTypes.h index 8e75b828a8..7b2902f749 100644 --- a/cocos/base/ccTypes.h +++ b/cocos/base/ccTypes.h @@ -362,7 +362,7 @@ struct CC_DLL BlendFunc // Label::VAlignment // Label::HAlignment -// XXX: If any of these enums are edited and/or reordered, update Texture2D.m +// FIXME:: If any of these enums are edited and/or reordered, update Texture2D.m //! Vertical text alignment type enum class CC_DLL TextVAlignment { @@ -371,7 +371,7 @@ enum class CC_DLL TextVAlignment BOTTOM, }; -// XXX: If any of these enums are edited and/or reordered, update Texture2D.m +// FIXME:: If any of these enums are edited and/or reordered, update Texture2D.m //! Horizontal text alignment type enum class CC_DLL TextHAlignment { diff --git a/cocos/base/ccUTF8.cpp b/cocos/base/ccUTF8.cpp index fd9514f4c9..e81b160dcf 100644 --- a/cocos/base/ccUTF8.cpp +++ b/cocos/base/ccUTF8.cpp @@ -23,7 +23,7 @@ THE SOFTWARE. ****************************************************************************/ -#include "ccUTF8.h" +#include "base/ccUTF8.h" #include "platform/CCCommon.h" #include "base/CCConsole.h" #include "ConvertUTF.h" diff --git a/cocos/deprecated/CCNotificationCenter.cpp b/cocos/deprecated/CCNotificationCenter.cpp index 467698346d..aea2f6bf14 100644 --- a/cocos/deprecated/CCNotificationCenter.cpp +++ b/cocos/deprecated/CCNotificationCenter.cpp @@ -63,13 +63,13 @@ void __NotificationCenter::destroyInstance() CC_SAFE_RELEASE_NULL(s_sharedNotifCenter); } -// XXX: deprecated +// FIXME:: deprecated __NotificationCenter *__NotificationCenter::sharedNotificationCenter(void) { return __NotificationCenter::getInstance(); } -// XXX: deprecated +// FIXME:: deprecated void __NotificationCenter::purgeNotificationCenter(void) { __NotificationCenter::destroyInstance(); diff --git a/cocos/editor-support/cocosbuilder/CCBAnimationManager.cpp b/cocos/editor-support/cocosbuilder/CCBAnimationManager.cpp index eff4c54f19..c0ee2f2ae8 100644 --- a/cocos/editor-support/cocosbuilder/CCBAnimationManager.cpp +++ b/cocos/editor-support/cocosbuilder/CCBAnimationManager.cpp @@ -1,8 +1,6 @@ #include "CCBAnimationManager.h" -#include "CCBSequence.h" -#include "CCBSequenceProperty.h" + #include "CCBReader.h" -#include "CCBKeyframe.h" #include "CCNode+CCBRelativePositioning.h" #include "audio/include/SimpleAudioEngine.h" #include "CCBSelectorResolver.h" @@ -481,7 +479,7 @@ void CCBAnimationManager::setAnimatedProperty(const std::string& propName, Node { // [node setValue:value forKey:name]; - // TODO only handle rotation, opacity, displayFrame, color + // TODO: only handle rotation, opacity, displayFrame, color if (propName == "rotation") { float rotate = value.asFloat(); diff --git a/cocos/editor-support/cocosbuilder/CCBAnimationManager.h b/cocos/editor-support/cocosbuilder/CCBAnimationManager.h index 9d272d9585..d22d093153 100644 --- a/cocos/editor-support/cocosbuilder/CCBAnimationManager.h +++ b/cocos/editor-support/cocosbuilder/CCBAnimationManager.h @@ -8,6 +8,7 @@ #include "extensions/ExtensionMacros.h" #include "CCBSequence.h" +#include "CCBKeyframe.h" #include "CCBSequenceProperty.h" #include "extensions/GUI/CCControlExtension/CCControl.h" diff --git a/cocos/editor-support/cocosbuilder/CCBFileLoader.h b/cocos/editor-support/cocosbuilder/CCBFileLoader.h index 9876a62ead..1c5c9c87a5 100644 --- a/cocos/editor-support/cocosbuilder/CCBFileLoader.h +++ b/cocos/editor-support/cocosbuilder/CCBFileLoader.h @@ -2,7 +2,6 @@ #define _CCB_CCBFILELOADER_H_ #include "CCNodeLoader.h" -#include "CCBReader.h" namespace cocosbuilder { diff --git a/cocos/editor-support/cocosbuilder/CCBReader.cpp b/cocos/editor-support/cocosbuilder/CCBReader.cpp index 824612a0da..c0a408bb20 100644 --- a/cocos/editor-support/cocosbuilder/CCBReader.cpp +++ b/cocos/editor-support/cocosbuilder/CCBReader.cpp @@ -477,7 +477,7 @@ float CCBReader::readFloat() { /* using a memcpy since the compiler isn't * doing the float ptr math correctly on device. - * TODO still applies in C++ ? */ + * TODO: still applies in C++ ? */ unsigned char* pF = (this->_bytes + this->_currentByte); float f = 0; diff --git a/cocos/editor-support/cocosbuilder/CCBReader.h b/cocos/editor-support/cocosbuilder/CCBReader.h index f4a81b4437..d89b153c76 100644 --- a/cocos/editor-support/cocosbuilder/CCBReader.h +++ b/cocos/editor-support/cocosbuilder/CCBReader.h @@ -1,6 +1,7 @@ #ifndef _CCB_CCBREADER_H_ #define _CCB_CCBREADER_H_ +#include #include #include #include "2d/CCNode.h" diff --git a/cocos/editor-support/cocosbuilder/CCControlButtonLoader.cpp b/cocos/editor-support/cocosbuilder/CCControlButtonLoader.cpp index 7cd0f56cf4..ba2d530f87 100644 --- a/cocos/editor-support/cocosbuilder/CCControlButtonLoader.cpp +++ b/cocos/editor-support/cocosbuilder/CCControlButtonLoader.cpp @@ -19,7 +19,8 @@ namespace cocosbuilder {; #define PROPERTY_TITLETTFSIZE_HIGHLIGHTED "titleTTFSize|2" #define PROPERTY_TITLETTFSIZE_DISABLED "titleTTFSize|3" #define PROPERTY_LABELANCHORPOINT "labelAnchorPoint" -#define PROPERTY_PREFEREDSIZE "preferedSize" // TODO Should be "preferredSize". This is a typo in cocos2d-iphone, cocos2d-x and CocosBuilder! +// TODO: Should be "preferredSize". This is a typo in cocos2d-iphone, cocos2d-x and CocosBuilder! +#define PROPERTY_PREFEREDSIZE "preferedSize" #define PROPERTY_BACKGROUNDSPRITEFRAME_NORMAL "backgroundSpriteFrame|1" #define PROPERTY_BACKGROUNDSPRITEFRAME_HIGHLIGHTED "backgroundSpriteFrame|2" #define PROPERTY_BACKGROUNDSPRITEFRAME_DISABLED "backgroundSpriteFrame|3" diff --git a/cocos/editor-support/cocosbuilder/CCLayerGradientLoader.cpp b/cocos/editor-support/cocosbuilder/CCLayerGradientLoader.cpp index aaf3eddbce..3886e46fc8 100644 --- a/cocos/editor-support/cocosbuilder/CCLayerGradientLoader.cpp +++ b/cocos/editor-support/cocosbuilder/CCLayerGradientLoader.cpp @@ -44,7 +44,7 @@ void LayerGradientLoader::onHandlePropTypePoint(Node * pNode, Node * pParent, co if(strcmp(pPropertyName, PROPERTY_VECTOR) == 0) { ((LayerGradient *)pNode)->setVector(pPoint); - // TODO Not passed along the ccbi file. + // TODO: Not passed along the ccbi file. // ((LayerGradient *)pNode)->setCompressedInterpolation(true); } else { LayerLoader::onHandlePropTypePoint(pNode, pParent, pPropertyName, pPoint, ccbReader); diff --git a/cocos/editor-support/cocosbuilder/CCLayerLoader.cpp b/cocos/editor-support/cocosbuilder/CCLayerLoader.cpp index 79febcc5d3..9cea820ede 100644 --- a/cocos/editor-support/cocosbuilder/CCLayerLoader.cpp +++ b/cocos/editor-support/cocosbuilder/CCLayerLoader.cpp @@ -25,10 +25,10 @@ void LayerLoader::onHandlePropTypeCheck(Node * pNode, Node * pParent, const char } else if(strcmp(pPropertyName, PROPERTY_ACCELEROMETER_ENABLED) == 0) { ((Layer *)pNode)->setAccelerometerEnabled(pCheck); } else if(strcmp(pPropertyName, PROPERTY_MOUSE_ENABLED) == 0) { - // TODO XXX + // TODO: Not supported CCLOG("The property '%s' is not supported!", PROPERTY_MOUSE_ENABLED); } else if(strcmp(pPropertyName, PROPERTY_KEYBOARD_ENABLED) == 0) { - // TODO XXX + // TODO: Not supported CCLOG("The property '%s' is not supported!", PROPERTY_KEYBOARD_ENABLED); // This comes closest: ((Layer *)pNode)->setKeypadEnabled(pCheck); } else { diff --git a/cocos/editor-support/cocosbuilder/CCNodeLoader.cpp b/cocos/editor-support/cocosbuilder/CCNodeLoader.cpp index 51f205ea30..bd560ca67a 100644 --- a/cocos/editor-support/cocosbuilder/CCNodeLoader.cpp +++ b/cocos/editor-support/cocosbuilder/CCNodeLoader.cpp @@ -619,7 +619,7 @@ Animation * NodeLoader::parsePropTypeAnimation(Node * pNode, Node * pParent, CCB // know what to do with them, since its pulling from bundle. // Eventually this should be handled by a client side asset manager // interface which figured out what resources to load. - // TODO Does this problem exist in C++? + // TODO: Does this problem exist in C++? animation = CCBReader::lastPathComponent(animation.c_str()); animationFile = CCBReader::lastPathComponent(animationFile.c_str()); @@ -742,7 +742,7 @@ std::string NodeLoader::parsePropTypeFontTTF(Node * pNode, Node * pParent, CCBRe // String * ttfEnding = String::create(".ttf"); - // TODO Fix me if it is wrong + // TODO: Fix me if it is wrong /* If the fontTTF comes with the ".ttf" extension, prepend the absolute path. * System fonts come without the ".ttf" extension and do not need the path prepended. */ /* diff --git a/cocos/editor-support/cocosbuilder/CCScale9SpriteLoader.cpp b/cocos/editor-support/cocosbuilder/CCScale9SpriteLoader.cpp index ac9bfd7ca7..2089898058 100644 --- a/cocos/editor-support/cocosbuilder/CCScale9SpriteLoader.cpp +++ b/cocos/editor-support/cocosbuilder/CCScale9SpriteLoader.cpp @@ -8,7 +8,8 @@ using namespace cocos2d::extension; #define PROPERTY_COLOR "color" #define PROPERTY_OPACITY "opacity" #define PROPERTY_BLENDFUNC "blendFunc" -#define PROPERTY_PREFEREDSIZE "preferedSize" // TODO Should be "preferredSize". This is a typo in cocos2d-iphone, cocos2d-x and CocosBuilder! +// TODO: Should be "preferredSize". This is a typo in cocos2d-iphone, cocos2d-x and CocosBuilder! +#define PROPERTY_PREFEREDSIZE "preferedSize" #define PROPERTY_INSETLEFT "insetLeft" #define PROPERTY_INSETTOP "insetTop" #define PROPERTY_INSETRIGHT "insetRight" diff --git a/cocos/editor-support/cocostudio/ActionTimeline/CCActionTimeline.h b/cocos/editor-support/cocostudio/ActionTimeline/CCActionTimeline.h index ae8427002b..321b1136fa 100644 --- a/cocos/editor-support/cocostudio/ActionTimeline/CCActionTimeline.h +++ b/cocos/editor-support/cocostudio/ActionTimeline/CCActionTimeline.h @@ -26,8 +26,8 @@ THE SOFTWARE. #define __CCTIMELINE_ACTION_H__ #include "CCTimeLine.h" -#include "renderer/CCRenderer.h" #include "cocostudio/CocosStudioExport.h" +#include "2d/CCAction.h" NS_TIMELINE_BEGIN diff --git a/cocos/editor-support/cocostudio/ActionTimeline/CCActionTimelineCache.cpp b/cocos/editor-support/cocostudio/ActionTimeline/CCActionTimelineCache.cpp index 395b215a40..312aee2b6d 100644 --- a/cocos/editor-support/cocostudio/ActionTimeline/CCActionTimelineCache.cpp +++ b/cocos/editor-support/cocostudio/ActionTimeline/CCActionTimelineCache.cpp @@ -27,6 +27,9 @@ THE SOFTWARE. #include "CCFrame.h" #include "CCTimeLine.h" #include "CCActionTimeline.h" +#include "platform/CCFileUtils.h" +#include "2d/CCSpriteFrameCache.h" +#include "2d/CCSpriteFrame.h" using namespace cocos2d; @@ -130,7 +133,7 @@ ActionTimeline* ActionTimelineCache::createAction(const std::string& fileName) ActionTimeline* ActionTimelineCache::loadAnimationActionWithFile(const std::string& fileName) { // Read content from file - std::string fullPath = CCFileUtils::getInstance()->fullPathForFilename(fileName); + std::string fullPath = FileUtils::getInstance()->fullPathForFilename(fileName); std::string contentStr = FileUtils::getInstance()->getStringFromFile(fullPath); return loadAnimationActionWithContent(fileName, contentStr); diff --git a/cocos/editor-support/cocostudio/ActionTimeline/CCActionTimelineCache.h b/cocos/editor-support/cocostudio/ActionTimeline/CCActionTimelineCache.h index c2b2ec4fe0..43953e7d75 100644 --- a/cocos/editor-support/cocostudio/ActionTimeline/CCActionTimelineCache.h +++ b/cocos/editor-support/cocostudio/ActionTimeline/CCActionTimelineCache.h @@ -25,7 +25,9 @@ THE SOFTWARE. #ifndef __CCTIMELINE_ACTION_CACHE_H__ #define __CCTIMELINE_ACTION_CACHE_H__ -#include "cocos2d.h" +#include +#include "base/CCMap.h" + #include "cocostudio/DictionaryHelper.h" #include "CCTimelineMacro.h" #include "cocostudio/CocosStudioExport.h" diff --git a/cocos/editor-support/cocostudio/ActionTimeline/CCFrame.cpp b/cocos/editor-support/cocostudio/ActionTimeline/CCFrame.cpp index fab94198ae..d0f698d419 100644 --- a/cocos/editor-support/cocostudio/ActionTimeline/CCFrame.cpp +++ b/cocos/editor-support/cocostudio/ActionTimeline/CCFrame.cpp @@ -25,6 +25,8 @@ THE SOFTWARE. #include "CCFrame.h" #include "CCTimeLine.h" #include "CCActionTimeline.h" +#include "2d/CCSpriteFrameCache.h" +#include "2d/CCSpriteFrame.h" USING_NS_CC; diff --git a/cocos/editor-support/cocostudio/ActionTimeline/CCFrame.h b/cocos/editor-support/cocostudio/ActionTimeline/CCFrame.h index c0e28ec1a7..46022f7f0e 100644 --- a/cocos/editor-support/cocostudio/ActionTimeline/CCFrame.h +++ b/cocos/editor-support/cocostudio/ActionTimeline/CCFrame.h @@ -25,10 +25,15 @@ THE SOFTWARE. #ifndef __CCFRAME_H__ #define __CCFRAME_H__ -#include "cocos2d.h" +#include +#include "base/CCRef.h" +#include "base/CCVector.h" +#include "2d/CCNode.h" +#include "2d/CCSprite.h" #include "CCTimelineMacro.h" #include "cocostudio/CocosStudioExport.h" + NS_TIMELINE_BEGIN class Timeline; diff --git a/cocos/editor-support/cocostudio/ActionTimeline/CCNodeReader.h b/cocos/editor-support/cocostudio/ActionTimeline/CCNodeReader.h index c45b99638c..28e358ab5e 100644 --- a/cocos/editor-support/cocostudio/ActionTimeline/CCNodeReader.h +++ b/cocos/editor-support/cocostudio/ActionTimeline/CCNodeReader.h @@ -25,9 +25,10 @@ THE SOFTWARE. #ifndef __CC_NODE_CACHE_H__ #define __CC_NODE_CACHE_H__ +#include #include "cocostudio/DictionaryHelper.h" #include "cocostudio/CocosStudioExport.h" -#include "cocos2d.h" +#include "2d/CCNode.h" namespace cocostudio { diff --git a/cocos/editor-support/cocostudio/CCActionManagerEx.cpp b/cocos/editor-support/cocostudio/CCActionManagerEx.cpp index af4d80e855..91753ef118 100644 --- a/cocos/editor-support/cocostudio/CCActionManagerEx.cpp +++ b/cocos/editor-support/cocostudio/CCActionManagerEx.cpp @@ -23,7 +23,6 @@ THE SOFTWARE. ****************************************************************************/ #include "cocostudio/CCActionManagerEx.h" -#include "cocostudio/DictionaryHelper.h" #include "cocostudio/CocoLoader.h" using namespace cocos2d; diff --git a/cocos/editor-support/cocostudio/CCActionNode.cpp b/cocos/editor-support/cocostudio/CCActionNode.cpp index 20b5f929ac..d1dfa4f438 100644 --- a/cocos/editor-support/cocostudio/CCActionNode.cpp +++ b/cocos/editor-support/cocostudio/CCActionNode.cpp @@ -24,7 +24,6 @@ THE SOFTWARE. #include "cocostudio/CCActionNode.h" #include "cocostudio/CCActionFrameEasing.h" -#include "cocostudio/DictionaryHelper.h" #include "ui/UIWidget.h" #include "ui/UIHelper.h" #include "cocostudio/CocoLoader.h" diff --git a/cocos/editor-support/cocostudio/CCActionObject.cpp b/cocos/editor-support/cocostudio/CCActionObject.cpp index fbaabf7efe..653b5a705c 100644 --- a/cocos/editor-support/cocostudio/CCActionObject.cpp +++ b/cocos/editor-support/cocostudio/CCActionObject.cpp @@ -23,7 +23,6 @@ THE SOFTWARE. ****************************************************************************/ #include "cocostudio/CCActionObject.h" -#include "cocostudio/DictionaryHelper.h" #include "cocostudio/CocoLoader.h" #include "base/CCDirector.h" diff --git a/cocos/editor-support/cocostudio/CCBatchNode.cpp b/cocos/editor-support/cocostudio/CCBatchNode.cpp index 8edb034e4e..c8128748f3 100644 --- a/cocos/editor-support/cocostudio/CCBatchNode.cpp +++ b/cocos/editor-support/cocostudio/CCBatchNode.cpp @@ -23,7 +23,6 @@ THE SOFTWARE. ****************************************************************************/ #include "cocostudio/CCBatchNode.h" -#include "cocostudio/CCArmatureDefine.h" #include "cocostudio/CCArmature.h" #include "cocostudio/CCSkin.h" diff --git a/cocos/editor-support/cocostudio/CCDataReaderHelper.cpp b/cocos/editor-support/cocostudio/CCDataReaderHelper.cpp index 44b4eec1ce..b275634871 100644 --- a/cocos/editor-support/cocostudio/CCDataReaderHelper.cpp +++ b/cocos/editor-support/cocostudio/CCDataReaderHelper.cpp @@ -420,7 +420,7 @@ void DataReaderHelper::addDataFromFileAsync(const std::string& imagePath, const filereadmode += "b"; } ssize_t size; - // XXX fileContent is being leaked + // FIXME: fileContent is being leaked _dataReaderHelper->_getFileMutex.lock(); unsigned char *pBytes = FileUtils::getInstance()->getFileData(fullPath.c_str() , filereadmode.c_str(), &size); diff --git a/cocos/editor-support/cocostudio/CCDataReaderHelper.h b/cocos/editor-support/cocostudio/CCDataReaderHelper.h index 4e8b941f5a..eb0330af3c 100644 --- a/cocos/editor-support/cocostudio/CCDataReaderHelper.h +++ b/cocos/editor-support/cocostudio/CCDataReaderHelper.h @@ -36,7 +36,6 @@ THE SOFTWARE. #include #include -#include #include #include #include diff --git a/cocos/editor-support/cocostudio/CCSGUIReader.cpp b/cocos/editor-support/cocostudio/CCSGUIReader.cpp index 6d43979d30..e1e1cf9af3 100644 --- a/cocos/editor-support/cocostudio/CCSGUIReader.cpp +++ b/cocos/editor-support/cocostudio/CCSGUIReader.cpp @@ -40,7 +40,6 @@ THE SOFTWARE. #include "WidgetReader/ScrollViewReader/ScrollViewReader.h" #include "WidgetReader/ListViewReader/ListViewReader.h" #include "cocostudio/CocoLoader.h" -#include "ui/CocosGUI.h" using namespace cocos2d; using namespace cocos2d::ui; diff --git a/cocos/editor-support/cocostudio/CCSkin.cpp b/cocos/editor-support/cocostudio/CCSkin.cpp index a573a7b21b..c1a9ddda72 100644 --- a/cocos/editor-support/cocostudio/CCSkin.cpp +++ b/cocos/editor-support/cocostudio/CCSkin.cpp @@ -224,7 +224,7 @@ void Skin::draw(Renderer *renderer, const Mat4 &transform, uint32_t flags) { Mat4 mv = Director::getInstance()->getMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW); - //TODO implement z order + //TODO: implement z order _quadCommand.init(_globalZOrder, _texture->getName(), getGLProgramState(), _blendFunc, &_quad, 1, mv); renderer->addCommand(&_quadCommand); } diff --git a/cocos/editor-support/cocostudio/CCSpriteFrameCacheHelper.h b/cocos/editor-support/cocostudio/CCSpriteFrameCacheHelper.h index 6a98a8ead5..d0e6fa9585 100644 --- a/cocos/editor-support/cocostudio/CCSpriteFrameCacheHelper.h +++ b/cocos/editor-support/cocostudio/CCSpriteFrameCacheHelper.h @@ -27,7 +27,6 @@ THE SOFTWARE. #include "base/CCPlatformMacros.h" #include "cocostudio/CCArmatureDefine.h" #include "cocostudio/CocosStudioExport.h" -#include #include namespace cocostudio { diff --git a/cocos/editor-support/cocostudio/CocoLoader.h b/cocos/editor-support/cocostudio/CocoLoader.h index 29d0983e4d..ddee90ea02 100644 --- a/cocos/editor-support/cocostudio/CocoLoader.h +++ b/cocos/editor-support/cocostudio/CocoLoader.h @@ -25,11 +25,7 @@ #ifndef _COCOLOADER_H #define _COCOLOADER_H -#include -#include -#include #include -#include "json/rapidjson.h" #include "json/document.h" #include "cocostudio/CocosStudioExport.h" diff --git a/cocos/editor-support/cocostudio/TriggerBase.h b/cocos/editor-support/cocostudio/TriggerBase.h index 31dc0c0308..6cce96776a 100755 --- a/cocos/editor-support/cocostudio/TriggerBase.h +++ b/cocos/editor-support/cocostudio/TriggerBase.h @@ -25,7 +25,6 @@ THE SOFTWARE. #ifndef __TRIGGEREVENT_H__ #define __TRIGGEREVENT_H__ -#include "cocos2d.h" #include "cocostudio/CocoStudio.h" #include "base/ObjectFactory.h" #include "TriggerObj.h" diff --git a/cocos/editor-support/cocostudio/TriggerMng.h b/cocos/editor-support/cocostudio/TriggerMng.h index 7d43eb5e74..bb996cbe6d 100755 --- a/cocos/editor-support/cocostudio/TriggerMng.h +++ b/cocos/editor-support/cocostudio/TriggerMng.h @@ -24,7 +24,6 @@ THE SOFTWARE. #ifndef __TRIGGERMNG_H__ #define __TRIGGERMNG_H__ -#include "cocos2d.h" #include "CocoStudio.h" namespace cocos2d { diff --git a/cocos/editor-support/cocostudio/TriggerObj.h b/cocos/editor-support/cocostudio/TriggerObj.h index 464c0d98f7..2373786581 100755 --- a/cocos/editor-support/cocostudio/TriggerObj.h +++ b/cocos/editor-support/cocostudio/TriggerObj.h @@ -25,9 +25,8 @@ THE SOFTWARE. #ifndef __TRIGGEROBJ_H__ #define __TRIGGEROBJ_H__ -#include "cocos2d.h" #include "CocoStudio.h" -#include +#include "base/CCVector.h" namespace cocos2d { class EventListenerCustom; diff --git a/cocos/editor-support/cocostudio/WidgetReader/ScrollViewReader/ScrollViewReader.cpp b/cocos/editor-support/cocostudio/WidgetReader/ScrollViewReader/ScrollViewReader.cpp index a0ad66f89c..1fb4bccc36 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/ScrollViewReader/ScrollViewReader.cpp +++ b/cocos/editor-support/cocostudio/WidgetReader/ScrollViewReader/ScrollViewReader.cpp @@ -39,7 +39,7 @@ namespace cocostudio void ScrollViewReader::setPropsFromBinary(cocos2d::ui::Widget *widget, CocoLoader *cocoLoader, stExpCocoNode* cocoNode) { - //TODO::need to refactor... + //TODO: need to refactor... LayoutReader::setPropsFromBinary(widget, cocoLoader, cocoNode); ScrollView* scrollView = static_cast(widget); diff --git a/cocos/editor-support/spine/spine-cocos2dx.h b/cocos/editor-support/spine/spine-cocos2dx.h index f0b597be4b..51d6f689ac 100644 --- a/cocos/editor-support/spine/spine-cocos2dx.h +++ b/cocos/editor-support/spine/spine-cocos2dx.h @@ -34,8 +34,8 @@ #ifndef SPINE_COCOS2DX_H_ #define SPINE_COCOS2DX_H_ -#include #include "cocos2d.h" +#include #include #include diff --git a/cocos/math/CCGeometry.h b/cocos/math/CCGeometry.h index 056f6939b9..1ea35bf059 100644 --- a/cocos/math/CCGeometry.h +++ b/cocos/math/CCGeometry.h @@ -27,7 +27,6 @@ THE SOFTWARE. #define __MATH_CCGEOMETRY_H__ #include -#include #include "base/CCPlatformMacros.h" #include "base/ccMacros.h" diff --git a/cocos/math/TransformUtils.h b/cocos/math/TransformUtils.h index 30ec353ba7..eea629af11 100644 --- a/cocos/math/TransformUtils.h +++ b/cocos/math/TransformUtils.h @@ -27,8 +27,7 @@ THE SOFTWARE. #ifndef __SUPPORT_TRANSFORM_UTILS_H__ #define __SUPPORT_TRANSFORM_UTILS_H__ -// todo: -// when in MAC or windows, it includes +// TODO: when in MAC or windows, it includes #include "CCGL.h" #include "base/ccMacros.h" diff --git a/cocos/network/WebSocket.cpp b/cocos/network/WebSocket.cpp index 2ac99901bc..934b1e0c6a 100644 --- a/cocos/network/WebSocket.cpp +++ b/cocos/network/WebSocket.cpp @@ -34,6 +34,7 @@ #include #include #include +#include #include #include diff --git a/cocos/network/WebSocket.h b/cocos/network/WebSocket.h index 956a36a56c..5548ca50fa 100644 --- a/cocos/network/WebSocket.h +++ b/cocos/network/WebSocket.h @@ -32,7 +32,6 @@ #include "base/CCPlatformMacros.h" #include "CCStdC.h" -#include #include #include diff --git a/cocos/physics/chipmunk/CCPhysicsBodyInfo_chipmunk.cpp b/cocos/physics/chipmunk/CCPhysicsBodyInfo_chipmunk.cpp index eb74a8ecc2..a641086bb7 100644 --- a/cocos/physics/chipmunk/CCPhysicsBodyInfo_chipmunk.cpp +++ b/cocos/physics/chipmunk/CCPhysicsBodyInfo_chipmunk.cpp @@ -24,6 +24,7 @@ #include "CCPhysicsBodyInfo_chipmunk.h" #if CC_USE_PHYSICS +#include "chipmunk.h" NS_CC_BEGIN PhysicsBodyInfo::PhysicsBodyInfo() diff --git a/cocos/physics/chipmunk/CCPhysicsBodyInfo_chipmunk.h b/cocos/physics/chipmunk/CCPhysicsBodyInfo_chipmunk.h index 01e21dcada..f26e327158 100644 --- a/cocos/physics/chipmunk/CCPhysicsBodyInfo_chipmunk.h +++ b/cocos/physics/chipmunk/CCPhysicsBodyInfo_chipmunk.h @@ -28,10 +28,11 @@ #include "base/ccConfig.h" #if CC_USE_PHYSICS -#include "chipmunk.h" #include "base/CCPlatformMacros.h" #include "base/CCRef.h" +struct cpBody; + NS_CC_BEGIN class PhysicsBodyInfo diff --git a/cocos/physics/chipmunk/CCPhysicsContactInfo_chipmunk.cpp b/cocos/physics/chipmunk/CCPhysicsContactInfo_chipmunk.cpp index 54041c0a85..238d6d5387 100644 --- a/cocos/physics/chipmunk/CCPhysicsContactInfo_chipmunk.cpp +++ b/cocos/physics/chipmunk/CCPhysicsContactInfo_chipmunk.cpp @@ -24,6 +24,7 @@ #include "CCPhysicsContactInfo_chipmunk.h" #if CC_USE_PHYSICS +#include "chipmunk.h" NS_CC_BEGIN PhysicsContactInfo::PhysicsContactInfo(PhysicsContact* contact) diff --git a/cocos/physics/chipmunk/CCPhysicsContactInfo_chipmunk.h b/cocos/physics/chipmunk/CCPhysicsContactInfo_chipmunk.h index 47900c81ff..13dde02524 100644 --- a/cocos/physics/chipmunk/CCPhysicsContactInfo_chipmunk.h +++ b/cocos/physics/chipmunk/CCPhysicsContactInfo_chipmunk.h @@ -28,7 +28,6 @@ #include "base/ccConfig.h" #if CC_USE_PHYSICS -#include "chipmunk.h" #include "base/CCPlatformMacros.h" NS_CC_BEGIN diff --git a/cocos/physics/chipmunk/CCPhysicsJointInfo_chipmunk.cpp b/cocos/physics/chipmunk/CCPhysicsJointInfo_chipmunk.cpp index 9443a9f36c..00d174fecf 100644 --- a/cocos/physics/chipmunk/CCPhysicsJointInfo_chipmunk.cpp +++ b/cocos/physics/chipmunk/CCPhysicsJointInfo_chipmunk.cpp @@ -26,6 +26,7 @@ #if CC_USE_PHYSICS #include #include +#include "chipmunk.h" NS_CC_BEGIN diff --git a/cocos/physics/chipmunk/CCPhysicsJointInfo_chipmunk.h b/cocos/physics/chipmunk/CCPhysicsJointInfo_chipmunk.h index 22c62abc5a..fca8f708ad 100644 --- a/cocos/physics/chipmunk/CCPhysicsJointInfo_chipmunk.h +++ b/cocos/physics/chipmunk/CCPhysicsJointInfo_chipmunk.h @@ -28,10 +28,11 @@ #include "base/ccConfig.h" #if CC_USE_PHYSICS -#include "chipmunk.h" #include "base/CCPlatformMacros.h" #include #include + +struct cpConstraint; NS_CC_BEGIN class PhysicsJoint; diff --git a/cocos/physics/chipmunk/CCPhysicsShapeInfo_chipmunk.cpp b/cocos/physics/chipmunk/CCPhysicsShapeInfo_chipmunk.cpp index c1b8693259..450745f7d3 100644 --- a/cocos/physics/chipmunk/CCPhysicsShapeInfo_chipmunk.cpp +++ b/cocos/physics/chipmunk/CCPhysicsShapeInfo_chipmunk.cpp @@ -26,6 +26,7 @@ #if CC_USE_PHYSICS #include #include +#include "chipmunk.h" NS_CC_BEGIN diff --git a/cocos/physics/chipmunk/CCPhysicsShapeInfo_chipmunk.h b/cocos/physics/chipmunk/CCPhysicsShapeInfo_chipmunk.h index c48acbce60..f760ec15a6 100644 --- a/cocos/physics/chipmunk/CCPhysicsShapeInfo_chipmunk.h +++ b/cocos/physics/chipmunk/CCPhysicsShapeInfo_chipmunk.h @@ -30,9 +30,12 @@ #include #include -#include "chipmunk.h" #include "base/CCPlatformMacros.h" +typedef uintptr_t cpGroup; +struct cpShape; +struct cpBody; + NS_CC_BEGIN class PhysicsShape; diff --git a/cocos/physics/chipmunk/CCPhysicsWorldInfo_chipmunk.cpp b/cocos/physics/chipmunk/CCPhysicsWorldInfo_chipmunk.cpp index 23890b2198..8290b28490 100644 --- a/cocos/physics/chipmunk/CCPhysicsWorldInfo_chipmunk.cpp +++ b/cocos/physics/chipmunk/CCPhysicsWorldInfo_chipmunk.cpp @@ -28,6 +28,8 @@ #include "CCPhysicsBodyInfo_chipmunk.h" #include "CCPhysicsShapeInfo_chipmunk.h" #include "CCPhysicsJointInfo_chipmunk.h" +#include "chipmunk.h" + NS_CC_BEGIN PhysicsWorldInfo::PhysicsWorldInfo() @@ -96,5 +98,15 @@ void PhysicsWorldInfo::removeJoint(PhysicsJointInfo& joint) } } +bool PhysicsWorldInfo::isLocked() +{ + return 0 == _space->locked_private ? false : true; +} + +void PhysicsWorldInfo::step(float delta) +{ + cpSpaceStep(_space, delta); +} + NS_CC_END #endif // CC_USE_PHYSICS diff --git a/cocos/physics/chipmunk/CCPhysicsWorldInfo_chipmunk.h b/cocos/physics/chipmunk/CCPhysicsWorldInfo_chipmunk.h index f5e885b86d..2027dd23ac 100644 --- a/cocos/physics/chipmunk/CCPhysicsWorldInfo_chipmunk.h +++ b/cocos/physics/chipmunk/CCPhysicsWorldInfo_chipmunk.h @@ -29,9 +29,12 @@ #if CC_USE_PHYSICS #include -#include "chipmunk.h" #include "base/CCPlatformMacros.h" #include "math/CCGeometry.h" + +struct cpSpace; + + NS_CC_BEGIN typedef Vec2 Vect; class PhysicsBodyInfo; @@ -49,8 +52,8 @@ public: void addJoint(PhysicsJointInfo& joint); void removeJoint(PhysicsJointInfo& joint); void setGravity(const Vect& gravity); - inline bool isLocked() { return 0 == _space->locked_private ? false : true; } - inline void step(float delta) { cpSpaceStep(_space, delta); } + bool isLocked(); + void step(float delta); private: PhysicsWorldInfo(); diff --git a/cocos/platform/CCFileUtils.cpp b/cocos/platform/CCFileUtils.cpp index bc839281ca..755d990f80 100644 --- a/cocos/platform/CCFileUtils.cpp +++ b/cocos/platform/CCFileUtils.cpp @@ -753,7 +753,7 @@ std::string FileUtils::fullPathForFilename(const std::string &filename) CCLOG("cocos2d: fullPathForFilename: No file found at %s. Possible missing file.", filename.c_str()); - // XXX: Should it return nullptr ? or an empty string ? + // FIXME: Should it return nullptr ? or an empty string ? // The file wasn't found, return the file name passed in. return filename; } diff --git a/cocos/platform/CCThread.h b/cocos/platform/CCThread.h index f2c6453f9f..b9aa869af3 100644 --- a/cocos/platform/CCThread.h +++ b/cocos/platform/CCThread.h @@ -26,13 +26,7 @@ THE SOFTWARE. #ifndef __CC_PLATFORM_THREAD_H__ #define __CC_PLATFORM_THREAD_H__ -#include -#include -#include - -#include "platform/CCCommon.h" #include "base/CCPlatformMacros.h" -#include "base/CCDirector.h" NS_CC_BEGIN @@ -48,7 +42,6 @@ NS_CC_BEGIN class CC_DLL ThreadHelper { public: - friend DisplayLinkDirector; /** Create an autorelease pool for objective-c codes. * @js NA diff --git a/cocos/platform/mac/CCDevice.mm b/cocos/platform/mac/CCDevice.mm index 885a643bc6..87dbaeadb5 100644 --- a/cocos/platform/mac/CCDevice.mm +++ b/cocos/platform/mac/CCDevice.mm @@ -36,7 +36,7 @@ NS_CC_BEGIN int Device::getDPI() { -//TODO: + //TODO: return correct DPI return 160; } diff --git a/cocos/platform/win32/CCFileUtilsWin32.cpp b/cocos/platform/win32/CCFileUtilsWin32.cpp index a652850879..c43339c8a7 100644 --- a/cocos/platform/win32/CCFileUtilsWin32.cpp +++ b/cocos/platform/win32/CCFileUtilsWin32.cpp @@ -278,7 +278,7 @@ string FileUtilsWin32::getWritablePath() const ::GetModuleFileNameA(nullptr, full_path, CC_MAX_PATH + 1); // Debug app uses executable directory; Non-debug app uses local app data directory -#ifndef _DEBUG +//#ifndef _DEBUG // Get filename of executable only, e.g. MyGame.exe char *base_name = strrchr(full_path, '\\'); @@ -306,7 +306,7 @@ string FileUtilsWin32::getWritablePath() const } } } -#endif // not defined _DEBUG +//#endif // not defined _DEBUG // If fetching of local app data directory fails, use the executable one string ret((char*)full_path); diff --git a/cocos/renderer/CCBatchCommand.cpp b/cocos/renderer/CCBatchCommand.cpp index af9fa47f40..1a7c7c8bef 100644 --- a/cocos/renderer/CCBatchCommand.cpp +++ b/cocos/renderer/CCBatchCommand.cpp @@ -27,6 +27,7 @@ #include "renderer/ccGLStateCache.h" #include "renderer/CCTextureAtlas.h" #include "renderer/CCTexture2D.h" +#include "renderer/CCGLProgram.h" NS_CC_BEGIN diff --git a/cocos/renderer/CCBatchCommand.h b/cocos/renderer/CCBatchCommand.h index 05f94db160..90fa52e28d 100644 --- a/cocos/renderer/CCBatchCommand.h +++ b/cocos/renderer/CCBatchCommand.h @@ -26,12 +26,11 @@ #define _CC_BATCHCOMMAND_H_ #include "renderer/CCRenderCommand.h" -#include "renderer/CCGLProgram.h" -#include "CCRenderCommandPool.h" NS_CC_BEGIN class TextureAtlas; +class GLProgram; class CC_DLL BatchCommand : public RenderCommand { diff --git a/cocos/renderer/CCCustomCommand.h b/cocos/renderer/CCCustomCommand.h index f39dfd5331..e22750a4b8 100644 --- a/cocos/renderer/CCCustomCommand.h +++ b/cocos/renderer/CCCustomCommand.h @@ -27,7 +27,6 @@ #define _CC_CUSTOMCOMMAND_H_ #include "renderer/CCRenderCommand.h" -#include "renderer/CCRenderCommandPool.h" NS_CC_BEGIN diff --git a/cocos/renderer/CCGLProgram.cpp b/cocos/renderer/CCGLProgram.cpp index 4b757c5b0f..9fcfbd75e5 100644 --- a/cocos/renderer/CCGLProgram.cpp +++ b/cocos/renderer/CCGLProgram.cpp @@ -33,11 +33,9 @@ THE SOFTWARE. #endif #include "base/CCDirector.h" -#include "base/ccMacros.h" #include "base/uthash.h" #include "renderer/ccGLStateCache.h" #include "platform/CCFileUtils.h" -#include "CCGL.h" #include "deprecated/CCString.h" diff --git a/cocos/renderer/CCGLProgramCache.cpp b/cocos/renderer/CCGLProgramCache.cpp index c4955a922c..6cc2bc3e91 100644 --- a/cocos/renderer/CCGLProgramCache.cpp +++ b/cocos/renderer/CCGLProgramCache.cpp @@ -74,13 +74,13 @@ void GLProgramCache::destroyInstance() CC_SAFE_RELEASE_NULL(_sharedGLProgramCache); } -// XXX: deprecated +// FIXME: deprecated GLProgramCache* GLProgramCache::sharedShaderCache() { return GLProgramCache::getInstance(); } -// XXX: deprecated +// FIXME: deprecated void GLProgramCache::purgeSharedShaderCache() { GLProgramCache::destroyInstance(); diff --git a/cocos/renderer/CCGLProgramState.cpp b/cocos/renderer/CCGLProgramState.cpp index 1a4ebad0c0..8955adddc3 100644 --- a/cocos/renderer/CCGLProgramState.cpp +++ b/cocos/renderer/CCGLProgramState.cpp @@ -114,7 +114,7 @@ void UniformValue::apply() void UniformValue::setCallback(const std::function &callback) { // delete previously set callback - // XXX TODO: memory will leak if the user does: + // TODO: memory will leak if the user does: // value->setCallback(); // value->setFloat(); if (_useCallback) diff --git a/cocos/renderer/CCGroupCommand.h b/cocos/renderer/CCGroupCommand.h index 4d1c3732cc..96fa8f70da 100644 --- a/cocos/renderer/CCGroupCommand.h +++ b/cocos/renderer/CCGroupCommand.h @@ -30,7 +30,6 @@ #include "base/CCRef.h" #include "CCRenderCommand.h" -#include "CCRenderCommandPool.h" NS_CC_BEGIN diff --git a/cocos/renderer/CCMeshCommand.cpp b/cocos/renderer/CCMeshCommand.cpp index dbe69989d6..03fb342c5d 100644 --- a/cocos/renderer/CCMeshCommand.cpp +++ b/cocos/renderer/CCMeshCommand.cpp @@ -22,6 +22,7 @@ THE SOFTWARE. ****************************************************************************/ +#include "renderer/CCMeshCommand.h" #include "base/ccMacros.h" #include "base/CCConfiguration.h" #include "base/CCDirector.h" @@ -29,9 +30,7 @@ #include "base/CCEventListenerCustom.h" #include "base/CCEventDispatcher.h" #include "base/CCEventType.h" -#include "renderer/CCMeshCommand.h" #include "renderer/ccGLStateCache.h" -#include "renderer/CCGLProgram.h" #include "renderer/CCGLProgramState.h" #include "renderer/CCRenderer.h" #include "renderer/CCTextureAtlas.h" diff --git a/cocos/renderer/CCMeshCommand.h b/cocos/renderer/CCMeshCommand.h index d394aac366..094b735e6d 100644 --- a/cocos/renderer/CCMeshCommand.h +++ b/cocos/renderer/CCMeshCommand.h @@ -26,10 +26,9 @@ #define _CC_MESHCOMMAND_H_ #include -#include "CCRenderCommand.h" +#include "renderer/CCRenderCommand.h" #include "renderer/CCGLProgram.h" #include "math/CCMath.h" -#include "CCRenderCommandPool.h" NS_CC_BEGIN diff --git a/cocos/renderer/CCPrimitive.cpp b/cocos/renderer/CCPrimitive.cpp index 357e61fa43..5263c699af 100644 --- a/cocos/renderer/CCPrimitive.cpp +++ b/cocos/renderer/CCPrimitive.cpp @@ -23,6 +23,7 @@ ****************************************************************************/ #include "renderer/CCPrimitive.h" +#include "renderer/CCVertexIndexBuffer.h" NS_CC_BEGIN @@ -86,7 +87,7 @@ bool Primitive::init(VertexData* verts, IndexBuffer* indices, int type) void Primitive::draw() { - if(_verts && _indices) + if(_verts) { _verts->use(); if(_indices!= nullptr) @@ -98,7 +99,7 @@ void Primitive::draw() } else { - glDrawArrays((GLenum)_type, _count, _start); + glDrawArrays((GLenum)_type, _start, _count); } glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); diff --git a/cocos/renderer/CCPrimitive.h b/cocos/renderer/CCPrimitive.h index 83d3aef2b3..3e1ca419f0 100644 --- a/cocos/renderer/CCPrimitive.h +++ b/cocos/renderer/CCPrimitive.h @@ -29,6 +29,8 @@ NS_CC_BEGIN +class IndexBuffer; + class CC_DLL Primitive : public Ref { public: diff --git a/cocos/renderer/CCQuadCommand.cpp b/cocos/renderer/CCQuadCommand.cpp index d5cff627f6..ac52bb0f1a 100644 --- a/cocos/renderer/CCQuadCommand.cpp +++ b/cocos/renderer/CCQuadCommand.cpp @@ -27,7 +27,6 @@ #include "renderer/ccGLStateCache.h" #include "renderer/CCGLProgram.h" -#include "renderer/CCGLProgramState.h" #include "xxhash.h" NS_CC_BEGIN diff --git a/cocos/renderer/CCQuadCommand.h b/cocos/renderer/CCQuadCommand.h index 5c731b784b..25e003b4a5 100644 --- a/cocos/renderer/CCQuadCommand.h +++ b/cocos/renderer/CCQuadCommand.h @@ -27,7 +27,6 @@ #include "renderer/CCRenderCommand.h" #include "renderer/CCGLProgramState.h" -#include "renderer/CCRenderCommandPool.h" NS_CC_BEGIN diff --git a/cocos/renderer/CCRenderCommandPool.h b/cocos/renderer/CCRenderCommandPool.h index ccee61c5cc..de4c5e0201 100644 --- a/cocos/renderer/CCRenderCommandPool.h +++ b/cocos/renderer/CCRenderCommandPool.h @@ -26,7 +26,6 @@ #ifndef __CC_RENDERCOMMANDPOOL_H__ #define __CC_RENDERCOMMANDPOOL_H__ -#include #include #include "base/CCPlatformMacros.h" diff --git a/cocos/renderer/CCRenderer.cpp b/cocos/renderer/CCRenderer.cpp index 3618774fc5..63c4b00d7a 100644 --- a/cocos/renderer/CCRenderer.cpp +++ b/cocos/renderer/CCRenderer.cpp @@ -358,7 +358,7 @@ void Renderer::render() //Uncomment this once everything is rendered by new renderer //glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - //TODO setup camera or MVP + //TODO: setup camera or MVP _isRendering = true; if (_glViewAssigned) @@ -424,7 +424,7 @@ void Renderer::convertToWorldCoordinates(V3F_C4B_T2F_Quad* quads, ssize_t quanti void Renderer::drawBatchedQuads() { - //TODO we can improve the draw performance by insert material switching command before hand. + //TODO: we can improve the draw performance by insert material switching command before hand. int quadsToDraw = 0; int startQuad = 0; diff --git a/cocos/renderer/CCRenderer.h b/cocos/renderer/CCRenderer.h index 0c56b989e0..44a9755a5e 100644 --- a/cocos/renderer/CCRenderer.h +++ b/cocos/renderer/CCRenderer.h @@ -81,7 +81,7 @@ public: Renderer(); ~Renderer(); - //TODO manage GLView inside Render itself + //TODO: manage GLView inside Render itself void initGLView(); /** Adds a `RenderComamnd` into the renderer */ diff --git a/cocos/renderer/CCTexture2D.h b/cocos/renderer/CCTexture2D.h index 9944c2b163..ad73a85465 100644 --- a/cocos/renderer/CCTexture2D.h +++ b/cocos/renderer/CCTexture2D.h @@ -29,7 +29,6 @@ THE SOFTWARE. #include #include -#include #include "base/CCRef.h" #include "math/CCGeometry.h" diff --git a/cocos/renderer/CCTextureAtlas.cpp b/cocos/renderer/CCTextureAtlas.cpp index b60c47bc92..c62cdb164f 100644 --- a/cocos/renderer/CCTextureAtlas.cpp +++ b/cocos/renderer/CCTextureAtlas.cpp @@ -614,7 +614,7 @@ void TextureAtlas::drawNumberOfQuads(ssize_t numberOfQuads, ssize_t start) // Using VBO and VAO // - // XXX: update is done in draw... perhaps it should be done in a timer + // FIXME:: update is done in draw... perhaps it should be done in a timer if (_dirty) { glBindBuffer(GL_ARRAY_BUFFER, _buffersVBO[0]); @@ -625,9 +625,9 @@ void TextureAtlas::drawNumberOfQuads(ssize_t numberOfQuads, ssize_t start) // glBufferData(GL_ARRAY_BUFFER, sizeof(quads_[0]) * (n-start), &quads_[start], GL_DYNAMIC_DRAW); // option 3: orphaning + glMapBuffer - glBufferData(GL_ARRAY_BUFFER, sizeof(_quads[0]) * (numberOfQuads-start), nullptr, GL_DYNAMIC_DRAW); + glBufferData(GL_ARRAY_BUFFER, sizeof(_quads[0]) * _capacity, nullptr, GL_DYNAMIC_DRAW); void *buf = glMapBuffer(GL_ARRAY_BUFFER, GL_WRITE_ONLY); - memcpy(buf, _quads, sizeof(_quads[0])* (numberOfQuads-start)); + memcpy(buf, _quads, sizeof(_quads[0])* _totalQuads); glUnmapBuffer(GL_ARRAY_BUFFER); glBindBuffer(GL_ARRAY_BUFFER, 0); @@ -658,10 +658,10 @@ void TextureAtlas::drawNumberOfQuads(ssize_t numberOfQuads, ssize_t start) #define kQuadSize sizeof(_quads[0].bl) glBindBuffer(GL_ARRAY_BUFFER, _buffersVBO[0]); - // XXX: update is done in draw... perhaps it should be done in a timer + // FIXME:: update is done in draw... perhaps it should be done in a timer if (_dirty) { - glBufferSubData(GL_ARRAY_BUFFER, sizeof(_quads[0])*start, sizeof(_quads[0]) * numberOfQuads , &_quads[start] ); + glBufferSubData(GL_ARRAY_BUFFER, 0, sizeof(_quads[0]) * _totalQuads , &_quads[0] ); _dirty = false; } diff --git a/cocos/renderer/CCVertexIndexBuffer.cpp b/cocos/renderer/CCVertexIndexBuffer.cpp index a3cf1ac967..ff8285078e 100644 --- a/cocos/renderer/CCVertexIndexBuffer.cpp +++ b/cocos/renderer/CCVertexIndexBuffer.cpp @@ -26,6 +26,7 @@ #include "base/CCEventType.h" #include "base/CCEventListenerCustom.h" #include "base/CCEventDispatcher.h" +#include "base/CCDirector.h" NS_CC_BEGIN diff --git a/cocos/renderer/CCVertexIndexBuffer.h b/cocos/renderer/CCVertexIndexBuffer.h index ebc21b1537..6454c17cd1 100644 --- a/cocos/renderer/CCVertexIndexBuffer.h +++ b/cocos/renderer/CCVertexIndexBuffer.h @@ -25,8 +25,9 @@ #ifndef __CC_VERTEX_INDEX_BUFFER_H__ #define __CC_VERTEX_INDEX_BUFFER_H__ +#include #include "base/CCRef.h" -#include "base/CCDirector.h" +#include "CCGL.h" NS_CC_BEGIN diff --git a/cocos/renderer/CCVertexIndexData.cpp b/cocos/renderer/CCVertexIndexData.cpp index 9e0e163d09..6faa54a2a7 100644 --- a/cocos/renderer/CCVertexIndexData.cpp +++ b/cocos/renderer/CCVertexIndexData.cpp @@ -24,7 +24,8 @@ #include "renderer/CCVertexIndexData.h" #include "renderer/ccGLStateCache.h" -#include "base/CCEventDispatcher.h" +#include "renderer/CCVertexIndexBuffer.h" + NS_CC_BEGIN VertexData* VertexData::create() diff --git a/cocos/renderer/CCVertexIndexData.h b/cocos/renderer/CCVertexIndexData.h index 7af66da4cc..300e1d9feb 100644 --- a/cocos/renderer/CCVertexIndexData.h +++ b/cocos/renderer/CCVertexIndexData.h @@ -26,8 +26,6 @@ #define __CC_VERTEX_INDEX_DATA_H__ #include "base/CCRef.h" -#include "renderer/CCVertexIndexBuffer.h" -#include "base/CCMap.h" #include NS_CC_BEGIN diff --git a/cocos/renderer/ccShader_Label_df.frag b/cocos/renderer/ccShader_Label_df.frag index cb3dac1122..27f8814c8a 100644 --- a/cocos/renderer/ccShader_Label_df.frag +++ b/cocos/renderer/ccShader_Label_df.frag @@ -16,7 +16,7 @@ void main() //float dist = color.b+color.g/256.0; \n // the texture use single channel 8-bit output for distance_map \n float dist = color.a; - //todo:Implementation 'fwidth' for glsl 1.0 \n + //TODO: Implementation 'fwidth' for glsl 1.0 \n //float width = fwidth(dist); \n //assign width for constant will lead to a little bit fuzzy,it's temporary measure.\n float width = 0.04; diff --git a/cocos/renderer/ccShader_Label_df_glow.frag b/cocos/renderer/ccShader_Label_df_glow.frag index b33b3e3d4d..80c8a0fae1 100644 --- a/cocos/renderer/ccShader_Label_df_glow.frag +++ b/cocos/renderer/ccShader_Label_df_glow.frag @@ -13,7 +13,7 @@ uniform vec4 u_textColor; void main() { float dist = texture2D(CC_Texture0, v_texCoord).a; - //todo:Implementation 'fwidth' for glsl 1.0 \n + //TODO: Implementation 'fwidth' for glsl 1.0 \n //float width = fwidth(dist); \n //assign width for constant will lead to a little bit fuzzy,it's temporary measure.\n float width = 0.04; diff --git a/cocos/scripting/lua-bindings/auto/api/lua_cocos2dx_3d_auto_api.lua b/cocos/scripting/lua-bindings/auto/api/lua_cocos2dx_3d_auto_api.lua index 5f7bcabe55..99551a8c83 100644 --- a/cocos/scripting/lua-bindings/auto/api/lua_cocos2dx_3d_auto_api.lua +++ b/cocos/scripting/lua-bindings/auto/api/lua_cocos2dx_3d_auto_api.lua @@ -2,8 +2,8 @@ -- @module cc -------------------------------------------------------- --- the cc Mesh --- @field [parent=#cc] Mesh#Mesh Mesh preloaded module +-- the cc Skeleton3D +-- @field [parent=#cc] Skeleton3D#Skeleton3D Skeleton3D preloaded module -------------------------------------------------------- @@ -12,8 +12,8 @@ -------------------------------------------------------- --- the cc Skeleton3D --- @field [parent=#cc] Skeleton3D#Skeleton3D Skeleton3D preloaded module +-- the cc Mesh +-- @field [parent=#cc] Mesh#Mesh Mesh preloaded module -------------------------------------------------------- diff --git a/cocos/scripting/lua-bindings/auto/api/lua_cocos2dx_auto_api.lua b/cocos/scripting/lua-bindings/auto/api/lua_cocos2dx_auto_api.lua index 92622ff8ba..c4905a9598 100644 --- a/cocos/scripting/lua-bindings/auto/api/lua_cocos2dx_auto_api.lua +++ b/cocos/scripting/lua-bindings/auto/api/lua_cocos2dx_auto_api.lua @@ -41,21 +41,6 @@ -- @field [parent=#cc] Node#Node Node preloaded module --------------------------------------------------------- --- the cc GLProgramState --- @field [parent=#cc] GLProgramState#GLProgramState GLProgramState preloaded module - - --------------------------------------------------------- --- the cc AtlasNode --- @field [parent=#cc] AtlasNode#AtlasNode AtlasNode preloaded module - - --------------------------------------------------------- --- the cc LabelAtlas --- @field [parent=#cc] LabelAtlas#LabelAtlas LabelAtlas preloaded module - - -------------------------------------------------------- -- the cc Scene -- @field [parent=#cc] Scene#Scene Scene preloaded module @@ -746,14 +731,24 @@ -- @field [parent=#cc] CatmullRomBy#CatmullRomBy CatmullRomBy preloaded module +-------------------------------------------------------- +-- the cc GLProgramState +-- @field [parent=#cc] GLProgramState#GLProgramState GLProgramState preloaded module + + +-------------------------------------------------------- +-- the cc AtlasNode +-- @field [parent=#cc] AtlasNode#AtlasNode AtlasNode preloaded module + + -------------------------------------------------------- -- the cc DrawNode -- @field [parent=#cc] DrawNode#DrawNode DrawNode preloaded module -------------------------------------------------------- --- the cc GLProgram --- @field [parent=#cc] GLProgram#GLProgram GLProgram preloaded module +-- the cc LabelAtlas +-- @field [parent=#cc] LabelAtlas#LabelAtlas LabelAtlas preloaded module -------------------------------------------------------- @@ -1022,13 +1017,13 @@ -------------------------------------------------------- --- the cc Sprite --- @field [parent=#cc] Sprite#Sprite Sprite preloaded module +-- the cc ProgressTimer +-- @field [parent=#cc] ProgressTimer#ProgressTimer ProgressTimer preloaded module -------------------------------------------------------- --- the cc ProgressTimer --- @field [parent=#cc] ProgressTimer#ProgressTimer ProgressTimer preloaded module +-- the cc Sprite +-- @field [parent=#cc] Sprite#Sprite Sprite preloaded module -------------------------------------------------------- @@ -1131,6 +1126,11 @@ -- @field [parent=#cc] TiledGrid3D#TiledGrid3D TiledGrid3D preloaded module +-------------------------------------------------------- +-- the cc GLProgram +-- @field [parent=#cc] GLProgram#GLProgram GLProgram preloaded module + + -------------------------------------------------------- -- the cc GLProgramCache -- @field [parent=#cc] GLProgramCache#GLProgramCache GLProgramCache preloaded module diff --git a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_3d_auto.cpp b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_3d_auto.cpp index 08c7fc576c..77190063f7 100644 --- a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_3d_auto.cpp +++ b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_3d_auto.cpp @@ -5,6 +5,987 @@ +int lua_cocos2dx_3d_Skeleton3D_getBoneByName(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Skeleton3D* 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.Skeleton3D",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Skeleton3D*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_3d_Skeleton3D_getBoneByName'", 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.Skeleton3D:getBoneByName"); + if(!ok) + return 0; + cocos2d::Bone3D* ret = cobj->getBoneByName(arg0); + object_to_luaval(tolua_S, "cc.Bone3D",(cocos2d::Bone3D*)ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Skeleton3D:getBoneByName",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_3d_Skeleton3D_getBoneByName'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_3d_Skeleton3D_getRootBone(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Skeleton3D* 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.Skeleton3D",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Skeleton3D*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_3d_Skeleton3D_getRootBone'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + int arg0; + + ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "cc.Skeleton3D:getRootBone"); + if(!ok) + return 0; + cocos2d::Bone3D* ret = cobj->getRootBone(arg0); + object_to_luaval(tolua_S, "cc.Bone3D",(cocos2d::Bone3D*)ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Skeleton3D:getRootBone",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_3d_Skeleton3D_getRootBone'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_3d_Skeleton3D_updateBoneMatrix(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Skeleton3D* 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.Skeleton3D",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Skeleton3D*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_3d_Skeleton3D_updateBoneMatrix'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + return 0; + cobj->updateBoneMatrix(); + return 0; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Skeleton3D:updateBoneMatrix",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_3d_Skeleton3D_updateBoneMatrix'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_3d_Skeleton3D_getBoneByIndex(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Skeleton3D* 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.Skeleton3D",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Skeleton3D*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_3d_Skeleton3D_getBoneByIndex'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + unsigned int arg0; + + ok &= luaval_to_uint32(tolua_S, 2,&arg0, "cc.Skeleton3D:getBoneByIndex"); + if(!ok) + return 0; + cocos2d::Bone3D* ret = cobj->getBoneByIndex(arg0); + object_to_luaval(tolua_S, "cc.Bone3D",(cocos2d::Bone3D*)ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Skeleton3D:getBoneByIndex",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_3d_Skeleton3D_getBoneByIndex'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_3d_Skeleton3D_getRootCount(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Skeleton3D* 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.Skeleton3D",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Skeleton3D*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_3d_Skeleton3D_getRootCount'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + return 0; + ssize_t ret = cobj->getRootCount(); + tolua_pushnumber(tolua_S,(lua_Number)ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Skeleton3D:getRootCount",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_3d_Skeleton3D_getRootCount'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_3d_Skeleton3D_getBoneIndex(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Skeleton3D* 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.Skeleton3D",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Skeleton3D*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_3d_Skeleton3D_getBoneIndex'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + cocos2d::Bone3D* arg0; + + ok &= luaval_to_object(tolua_S, 2, "cc.Bone3D",&arg0); + if(!ok) + return 0; + int ret = cobj->getBoneIndex(arg0); + tolua_pushnumber(tolua_S,(lua_Number)ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Skeleton3D:getBoneIndex",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_3d_Skeleton3D_getBoneIndex'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_3d_Skeleton3D_getBoneCount(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Skeleton3D* 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.Skeleton3D",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Skeleton3D*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_3d_Skeleton3D_getBoneCount'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + return 0; + ssize_t ret = cobj->getBoneCount(); + tolua_pushnumber(tolua_S,(lua_Number)ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Skeleton3D:getBoneCount",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_3d_Skeleton3D_getBoneCount'.",&tolua_err); +#endif + + return 0; +} +static int lua_cocos2dx_3d_Skeleton3D_finalize(lua_State* tolua_S) +{ + printf("luabindings: finalizing LUA object (Skeleton3D)"); + return 0; +} + +int lua_register_cocos2dx_3d_Skeleton3D(lua_State* tolua_S) +{ + tolua_usertype(tolua_S,"cc.Skeleton3D"); + tolua_cclass(tolua_S,"Skeleton3D","cc.Skeleton3D","cc.Ref",nullptr); + + tolua_beginmodule(tolua_S,"Skeleton3D"); + tolua_function(tolua_S,"getBoneByName",lua_cocos2dx_3d_Skeleton3D_getBoneByName); + tolua_function(tolua_S,"getRootBone",lua_cocos2dx_3d_Skeleton3D_getRootBone); + tolua_function(tolua_S,"updateBoneMatrix",lua_cocos2dx_3d_Skeleton3D_updateBoneMatrix); + tolua_function(tolua_S,"getBoneByIndex",lua_cocos2dx_3d_Skeleton3D_getBoneByIndex); + tolua_function(tolua_S,"getRootCount",lua_cocos2dx_3d_Skeleton3D_getRootCount); + tolua_function(tolua_S,"getBoneIndex",lua_cocos2dx_3d_Skeleton3D_getBoneIndex); + tolua_function(tolua_S,"getBoneCount",lua_cocos2dx_3d_Skeleton3D_getBoneCount); + tolua_endmodule(tolua_S); + std::string typeName = typeid(cocos2d::Skeleton3D).name(); + g_luaType[typeName] = "cc.Skeleton3D"; + g_typeCast["Skeleton3D"] = "cc.Skeleton3D"; + return 1; +} + +int lua_cocos2dx_3d_Sprite3D_setCullFaceEnabled(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Sprite3D* 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.Sprite3D",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Sprite3D*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_3d_Sprite3D_setCullFaceEnabled'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + bool arg0; + + ok &= luaval_to_boolean(tolua_S, 2,&arg0, "cc.Sprite3D:setCullFaceEnabled"); + if(!ok) + return 0; + cobj->setCullFaceEnabled(arg0); + return 0; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite3D:setCullFaceEnabled",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_3d_Sprite3D_setCullFaceEnabled'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_3d_Sprite3D_setTexture(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Sprite3D* 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.Sprite3D",0,&tolua_err)) goto tolua_lerror; +#endif + cobj = (cocos2d::Sprite3D*)tolua_tousertype(tolua_S,1,0); +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_3d_Sprite3D_setTexture'", nullptr); + return 0; + } +#endif + argc = lua_gettop(tolua_S)-1; + do{ + if (argc == 1) { + cocos2d::Texture2D* arg0; + ok &= luaval_to_object(tolua_S, 2, "cc.Texture2D",&arg0); + + if (!ok) { break; } + cobj->setTexture(arg0); + return 0; + } + }while(0); + ok = true; + do{ + if (argc == 1) { + std::string arg0; + ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.Sprite3D:setTexture"); + + if (!ok) { break; } + cobj->setTexture(arg0); + return 0; + } + }while(0); + ok = true; + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite3D:setTexture",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_3d_Sprite3D_setTexture'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_3d_Sprite3D_removeAllAttachNode(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Sprite3D* 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.Sprite3D",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Sprite3D*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_3d_Sprite3D_removeAllAttachNode'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + return 0; + cobj->removeAllAttachNode(); + return 0; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite3D:removeAllAttachNode",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_3d_Sprite3D_removeAllAttachNode'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_3d_Sprite3D_setBlendFunc(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Sprite3D* 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.Sprite3D",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Sprite3D*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_3d_Sprite3D_setBlendFunc'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + cocos2d::BlendFunc arg0; + + #pragma warning NO CONVERSION TO NATIVE FOR BlendFunc; + if(!ok) + return 0; + cobj->setBlendFunc(arg0); + return 0; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite3D:setBlendFunc",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_3d_Sprite3D_setBlendFunc'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_3d_Sprite3D_getMesh(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Sprite3D* 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.Sprite3D",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Sprite3D*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_3d_Sprite3D_getMesh'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + return 0; + cocos2d::Mesh* ret = cobj->getMesh(); + object_to_luaval(tolua_S, "cc.Mesh",(cocos2d::Mesh*)ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite3D:getMesh",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_3d_Sprite3D_getMesh'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_3d_Sprite3D_getBlendFunc(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Sprite3D* 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.Sprite3D",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Sprite3D*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_3d_Sprite3D_getBlendFunc'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + return 0; + const cocos2d::BlendFunc& ret = cobj->getBlendFunc(); + blendfunc_to_luaval(tolua_S, ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite3D:getBlendFunc",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_3d_Sprite3D_getBlendFunc'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_3d_Sprite3D_setCullFace(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Sprite3D* 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.Sprite3D",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Sprite3D*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_3d_Sprite3D_setCullFace'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + unsigned int arg0; + + ok &= luaval_to_uint32(tolua_S, 2,&arg0, "cc.Sprite3D:setCullFace"); + if(!ok) + return 0; + cobj->setCullFace(arg0); + return 0; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite3D:setCullFace",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_3d_Sprite3D_setCullFace'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_3d_Sprite3D_removeAttachNode(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Sprite3D* 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.Sprite3D",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Sprite3D*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_3d_Sprite3D_removeAttachNode'", 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.Sprite3D:removeAttachNode"); + if(!ok) + return 0; + cobj->removeAttachNode(arg0); + return 0; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite3D:removeAttachNode",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_3d_Sprite3D_removeAttachNode'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_3d_Sprite3D_getMeshByIndex(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Sprite3D* 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.Sprite3D",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Sprite3D*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_3d_Sprite3D_getMeshByIndex'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + int arg0; + + ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "cc.Sprite3D:getMeshByIndex"); + if(!ok) + return 0; + cocos2d::Mesh* ret = cobj->getMeshByIndex(arg0); + object_to_luaval(tolua_S, "cc.Mesh",(cocos2d::Mesh*)ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite3D:getMeshByIndex",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_3d_Sprite3D_getMeshByIndex'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_3d_Sprite3D_getMeshByName(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Sprite3D* 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.Sprite3D",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Sprite3D*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_3d_Sprite3D_getMeshByName'", 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.Sprite3D:getMeshByName"); + if(!ok) + return 0; + cocos2d::Mesh* ret = cobj->getMeshByName(arg0); + object_to_luaval(tolua_S, "cc.Mesh",(cocos2d::Mesh*)ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite3D:getMeshByName",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_3d_Sprite3D_getMeshByName'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_3d_Sprite3D_getSkeleton(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Sprite3D* 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.Sprite3D",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Sprite3D*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_3d_Sprite3D_getSkeleton'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + return 0; + cocos2d::Skeleton3D* ret = cobj->getSkeleton(); + object_to_luaval(tolua_S, "cc.Skeleton3D",(cocos2d::Skeleton3D*)ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite3D:getSkeleton",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_3d_Sprite3D_getSkeleton'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_3d_Sprite3D_getAttachNode(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Sprite3D* 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.Sprite3D",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Sprite3D*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_3d_Sprite3D_getAttachNode'", 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.Sprite3D:getAttachNode"); + if(!ok) + return 0; + cocos2d::AttachNode* ret = cobj->getAttachNode(arg0); + object_to_luaval(tolua_S, "cc.AttachNode",(cocos2d::AttachNode*)ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite3D:getAttachNode",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_3d_Sprite3D_getAttachNode'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_3d_Sprite3D_create(lua_State* tolua_S) +{ + int argc = 0; + bool ok = true; +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertable(tolua_S,1,"cc.Sprite3D",0,&tolua_err)) goto tolua_lerror; +#endif + + argc = lua_gettop(tolua_S)-1; + + do + { + if (argc == 2) + { + std::string arg0; + ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.Sprite3D:create"); + if (!ok) { break; } + std::string arg1; + ok &= luaval_to_std_string(tolua_S, 3,&arg1, "cc.Sprite3D:create"); + if (!ok) { break; } + cocos2d::Sprite3D* ret = cocos2d::Sprite3D::create(arg0, arg1); + object_to_luaval(tolua_S, "cc.Sprite3D",(cocos2d::Sprite3D*)ret); + return 1; + } + } while (0); + ok = true; + do + { + if (argc == 1) + { + std::string arg0; + ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.Sprite3D:create"); + if (!ok) { break; } + cocos2d::Sprite3D* ret = cocos2d::Sprite3D::create(arg0); + object_to_luaval(tolua_S, "cc.Sprite3D",(cocos2d::Sprite3D*)ret); + return 1; + } + } while (0); + ok = true; + CCLOG("%s has wrong number of arguments: %d, was expecting %d", "cc.Sprite3D:create",argc, 1); + return 0; +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_3d_Sprite3D_create'.",&tolua_err); +#endif + return 0; +} +static int lua_cocos2dx_3d_Sprite3D_finalize(lua_State* tolua_S) +{ + printf("luabindings: finalizing LUA object (Sprite3D)"); + return 0; +} + +int lua_register_cocos2dx_3d_Sprite3D(lua_State* tolua_S) +{ + tolua_usertype(tolua_S,"cc.Sprite3D"); + tolua_cclass(tolua_S,"Sprite3D","cc.Sprite3D","cc.Node",nullptr); + + tolua_beginmodule(tolua_S,"Sprite3D"); + tolua_function(tolua_S,"setCullFaceEnabled",lua_cocos2dx_3d_Sprite3D_setCullFaceEnabled); + tolua_function(tolua_S,"setTexture",lua_cocos2dx_3d_Sprite3D_setTexture); + tolua_function(tolua_S,"removeAllAttachNode",lua_cocos2dx_3d_Sprite3D_removeAllAttachNode); + tolua_function(tolua_S,"setBlendFunc",lua_cocos2dx_3d_Sprite3D_setBlendFunc); + tolua_function(tolua_S,"getMesh",lua_cocos2dx_3d_Sprite3D_getMesh); + tolua_function(tolua_S,"getBlendFunc",lua_cocos2dx_3d_Sprite3D_getBlendFunc); + tolua_function(tolua_S,"setCullFace",lua_cocos2dx_3d_Sprite3D_setCullFace); + tolua_function(tolua_S,"removeAttachNode",lua_cocos2dx_3d_Sprite3D_removeAttachNode); + tolua_function(tolua_S,"getMeshByIndex",lua_cocos2dx_3d_Sprite3D_getMeshByIndex); + tolua_function(tolua_S,"getMeshByName",lua_cocos2dx_3d_Sprite3D_getMeshByName); + tolua_function(tolua_S,"getSkeleton",lua_cocos2dx_3d_Sprite3D_getSkeleton); + tolua_function(tolua_S,"getAttachNode",lua_cocos2dx_3d_Sprite3D_getAttachNode); + tolua_function(tolua_S,"create", lua_cocos2dx_3d_Sprite3D_create); + tolua_endmodule(tolua_S); + std::string typeName = typeid(cocos2d::Sprite3D).name(); + g_luaType[typeName] = "cc.Sprite3D"; + g_typeCast["Sprite3D"] = "cc.Sprite3D"; + return 1; +} + int lua_cocos2dx_3d_Mesh_getMeshVertexAttribCount(lua_State* tolua_S) { int argc = 0; @@ -898,987 +1879,6 @@ int lua_register_cocos2dx_3d_Mesh(lua_State* tolua_S) return 1; } -int lua_cocos2dx_3d_Sprite3D_setCullFaceEnabled(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::Sprite3D* 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.Sprite3D",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::Sprite3D*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_3d_Sprite3D_setCullFaceEnabled'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 1) - { - bool arg0; - - ok &= luaval_to_boolean(tolua_S, 2,&arg0, "cc.Sprite3D:setCullFaceEnabled"); - if(!ok) - return 0; - cobj->setCullFaceEnabled(arg0); - return 0; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite3D:setCullFaceEnabled",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_3d_Sprite3D_setCullFaceEnabled'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_3d_Sprite3D_setTexture(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::Sprite3D* 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.Sprite3D",0,&tolua_err)) goto tolua_lerror; -#endif - cobj = (cocos2d::Sprite3D*)tolua_tousertype(tolua_S,1,0); -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_3d_Sprite3D_setTexture'", nullptr); - return 0; - } -#endif - argc = lua_gettop(tolua_S)-1; - do{ - if (argc == 1) { - cocos2d::Texture2D* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Texture2D",&arg0); - - if (!ok) { break; } - cobj->setTexture(arg0); - return 0; - } - }while(0); - ok = true; - do{ - if (argc == 1) { - std::string arg0; - ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.Sprite3D:setTexture"); - - if (!ok) { break; } - cobj->setTexture(arg0); - return 0; - } - }while(0); - ok = true; - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite3D:setTexture",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_3d_Sprite3D_setTexture'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_3d_Sprite3D_removeAllAttachNode(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::Sprite3D* 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.Sprite3D",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::Sprite3D*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_3d_Sprite3D_removeAllAttachNode'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 0) - { - if(!ok) - return 0; - cobj->removeAllAttachNode(); - return 0; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite3D:removeAllAttachNode",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_3d_Sprite3D_removeAllAttachNode'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_3d_Sprite3D_setBlendFunc(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::Sprite3D* 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.Sprite3D",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::Sprite3D*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_3d_Sprite3D_setBlendFunc'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 1) - { - cocos2d::BlendFunc arg0; - - #pragma warning NO CONVERSION TO NATIVE FOR BlendFunc; - if(!ok) - return 0; - cobj->setBlendFunc(arg0); - return 0; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite3D:setBlendFunc",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_3d_Sprite3D_setBlendFunc'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_3d_Sprite3D_getMesh(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::Sprite3D* 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.Sprite3D",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::Sprite3D*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_3d_Sprite3D_getMesh'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 0) - { - if(!ok) - return 0; - cocos2d::Mesh* ret = cobj->getMesh(); - object_to_luaval(tolua_S, "cc.Mesh",(cocos2d::Mesh*)ret); - return 1; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite3D:getMesh",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_3d_Sprite3D_getMesh'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_3d_Sprite3D_getBlendFunc(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::Sprite3D* 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.Sprite3D",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::Sprite3D*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_3d_Sprite3D_getBlendFunc'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 0) - { - if(!ok) - return 0; - const cocos2d::BlendFunc& ret = cobj->getBlendFunc(); - blendfunc_to_luaval(tolua_S, ret); - return 1; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite3D:getBlendFunc",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_3d_Sprite3D_getBlendFunc'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_3d_Sprite3D_setCullFace(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::Sprite3D* 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.Sprite3D",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::Sprite3D*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_3d_Sprite3D_setCullFace'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 1) - { - unsigned int arg0; - - ok &= luaval_to_uint32(tolua_S, 2,&arg0, "cc.Sprite3D:setCullFace"); - if(!ok) - return 0; - cobj->setCullFace(arg0); - return 0; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite3D:setCullFace",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_3d_Sprite3D_setCullFace'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_3d_Sprite3D_removeAttachNode(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::Sprite3D* 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.Sprite3D",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::Sprite3D*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_3d_Sprite3D_removeAttachNode'", 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.Sprite3D:removeAttachNode"); - if(!ok) - return 0; - cobj->removeAttachNode(arg0); - return 0; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite3D:removeAttachNode",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_3d_Sprite3D_removeAttachNode'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_3d_Sprite3D_getMeshByIndex(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::Sprite3D* 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.Sprite3D",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::Sprite3D*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_3d_Sprite3D_getMeshByIndex'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 1) - { - int arg0; - - ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "cc.Sprite3D:getMeshByIndex"); - if(!ok) - return 0; - cocos2d::Mesh* ret = cobj->getMeshByIndex(arg0); - object_to_luaval(tolua_S, "cc.Mesh",(cocos2d::Mesh*)ret); - return 1; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite3D:getMeshByIndex",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_3d_Sprite3D_getMeshByIndex'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_3d_Sprite3D_getMeshByName(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::Sprite3D* 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.Sprite3D",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::Sprite3D*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_3d_Sprite3D_getMeshByName'", 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.Sprite3D:getMeshByName"); - if(!ok) - return 0; - cocos2d::Mesh* ret = cobj->getMeshByName(arg0); - object_to_luaval(tolua_S, "cc.Mesh",(cocos2d::Mesh*)ret); - return 1; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite3D:getMeshByName",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_3d_Sprite3D_getMeshByName'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_3d_Sprite3D_getSkeleton(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::Sprite3D* 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.Sprite3D",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::Sprite3D*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_3d_Sprite3D_getSkeleton'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 0) - { - if(!ok) - return 0; - cocos2d::Skeleton3D* ret = cobj->getSkeleton(); - object_to_luaval(tolua_S, "cc.Skeleton3D",(cocos2d::Skeleton3D*)ret); - return 1; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite3D:getSkeleton",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_3d_Sprite3D_getSkeleton'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_3d_Sprite3D_getAttachNode(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::Sprite3D* 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.Sprite3D",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::Sprite3D*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_3d_Sprite3D_getAttachNode'", 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.Sprite3D:getAttachNode"); - if(!ok) - return 0; - cocos2d::AttachNode* ret = cobj->getAttachNode(arg0); - object_to_luaval(tolua_S, "cc.AttachNode",(cocos2d::AttachNode*)ret); - return 1; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite3D:getAttachNode",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_3d_Sprite3D_getAttachNode'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_3d_Sprite3D_create(lua_State* tolua_S) -{ - int argc = 0; - bool ok = true; -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertable(tolua_S,1,"cc.Sprite3D",0,&tolua_err)) goto tolua_lerror; -#endif - - argc = lua_gettop(tolua_S)-1; - - do - { - if (argc == 2) - { - std::string arg0; - ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.Sprite3D:create"); - if (!ok) { break; } - std::string arg1; - ok &= luaval_to_std_string(tolua_S, 3,&arg1, "cc.Sprite3D:create"); - if (!ok) { break; } - cocos2d::Sprite3D* ret = cocos2d::Sprite3D::create(arg0, arg1); - object_to_luaval(tolua_S, "cc.Sprite3D",(cocos2d::Sprite3D*)ret); - return 1; - } - } while (0); - ok = true; - do - { - if (argc == 1) - { - std::string arg0; - ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.Sprite3D:create"); - if (!ok) { break; } - cocos2d::Sprite3D* ret = cocos2d::Sprite3D::create(arg0); - object_to_luaval(tolua_S, "cc.Sprite3D",(cocos2d::Sprite3D*)ret); - return 1; - } - } while (0); - ok = true; - CCLOG("%s has wrong number of arguments: %d, was expecting %d", "cc.Sprite3D:create",argc, 1); - return 0; -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_3d_Sprite3D_create'.",&tolua_err); -#endif - return 0; -} -static int lua_cocos2dx_3d_Sprite3D_finalize(lua_State* tolua_S) -{ - printf("luabindings: finalizing LUA object (Sprite3D)"); - return 0; -} - -int lua_register_cocos2dx_3d_Sprite3D(lua_State* tolua_S) -{ - tolua_usertype(tolua_S,"cc.Sprite3D"); - tolua_cclass(tolua_S,"Sprite3D","cc.Sprite3D","cc.Node",nullptr); - - tolua_beginmodule(tolua_S,"Sprite3D"); - tolua_function(tolua_S,"setCullFaceEnabled",lua_cocos2dx_3d_Sprite3D_setCullFaceEnabled); - tolua_function(tolua_S,"setTexture",lua_cocos2dx_3d_Sprite3D_setTexture); - tolua_function(tolua_S,"removeAllAttachNode",lua_cocos2dx_3d_Sprite3D_removeAllAttachNode); - tolua_function(tolua_S,"setBlendFunc",lua_cocos2dx_3d_Sprite3D_setBlendFunc); - tolua_function(tolua_S,"getMesh",lua_cocos2dx_3d_Sprite3D_getMesh); - tolua_function(tolua_S,"getBlendFunc",lua_cocos2dx_3d_Sprite3D_getBlendFunc); - tolua_function(tolua_S,"setCullFace",lua_cocos2dx_3d_Sprite3D_setCullFace); - tolua_function(tolua_S,"removeAttachNode",lua_cocos2dx_3d_Sprite3D_removeAttachNode); - tolua_function(tolua_S,"getMeshByIndex",lua_cocos2dx_3d_Sprite3D_getMeshByIndex); - tolua_function(tolua_S,"getMeshByName",lua_cocos2dx_3d_Sprite3D_getMeshByName); - tolua_function(tolua_S,"getSkeleton",lua_cocos2dx_3d_Sprite3D_getSkeleton); - tolua_function(tolua_S,"getAttachNode",lua_cocos2dx_3d_Sprite3D_getAttachNode); - tolua_function(tolua_S,"create", lua_cocos2dx_3d_Sprite3D_create); - tolua_endmodule(tolua_S); - std::string typeName = typeid(cocos2d::Sprite3D).name(); - g_luaType[typeName] = "cc.Sprite3D"; - g_typeCast["Sprite3D"] = "cc.Sprite3D"; - return 1; -} - -int lua_cocos2dx_3d_Skeleton3D_getBoneByName(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::Skeleton3D* 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.Skeleton3D",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::Skeleton3D*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_3d_Skeleton3D_getBoneByName'", 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.Skeleton3D:getBoneByName"); - if(!ok) - return 0; - cocos2d::Bone3D* ret = cobj->getBoneByName(arg0); - object_to_luaval(tolua_S, "cc.Bone3D",(cocos2d::Bone3D*)ret); - return 1; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Skeleton3D:getBoneByName",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_3d_Skeleton3D_getBoneByName'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_3d_Skeleton3D_getRootBone(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::Skeleton3D* 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.Skeleton3D",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::Skeleton3D*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_3d_Skeleton3D_getRootBone'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 1) - { - int arg0; - - ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "cc.Skeleton3D:getRootBone"); - if(!ok) - return 0; - cocos2d::Bone3D* ret = cobj->getRootBone(arg0); - object_to_luaval(tolua_S, "cc.Bone3D",(cocos2d::Bone3D*)ret); - return 1; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Skeleton3D:getRootBone",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_3d_Skeleton3D_getRootBone'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_3d_Skeleton3D_updateBoneMatrix(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::Skeleton3D* 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.Skeleton3D",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::Skeleton3D*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_3d_Skeleton3D_updateBoneMatrix'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 0) - { - if(!ok) - return 0; - cobj->updateBoneMatrix(); - return 0; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Skeleton3D:updateBoneMatrix",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_3d_Skeleton3D_updateBoneMatrix'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_3d_Skeleton3D_getBoneByIndex(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::Skeleton3D* 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.Skeleton3D",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::Skeleton3D*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_3d_Skeleton3D_getBoneByIndex'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 1) - { - unsigned int arg0; - - ok &= luaval_to_uint32(tolua_S, 2,&arg0, "cc.Skeleton3D:getBoneByIndex"); - if(!ok) - return 0; - cocos2d::Bone3D* ret = cobj->getBoneByIndex(arg0); - object_to_luaval(tolua_S, "cc.Bone3D",(cocos2d::Bone3D*)ret); - return 1; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Skeleton3D:getBoneByIndex",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_3d_Skeleton3D_getBoneByIndex'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_3d_Skeleton3D_getRootCount(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::Skeleton3D* 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.Skeleton3D",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::Skeleton3D*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_3d_Skeleton3D_getRootCount'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 0) - { - if(!ok) - return 0; - ssize_t ret = cobj->getRootCount(); - tolua_pushnumber(tolua_S,(lua_Number)ret); - return 1; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Skeleton3D:getRootCount",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_3d_Skeleton3D_getRootCount'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_3d_Skeleton3D_getBoneIndex(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::Skeleton3D* 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.Skeleton3D",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::Skeleton3D*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_3d_Skeleton3D_getBoneIndex'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 1) - { - cocos2d::Bone3D* arg0; - - ok &= luaval_to_object(tolua_S, 2, "cc.Bone3D",&arg0); - if(!ok) - return 0; - int ret = cobj->getBoneIndex(arg0); - tolua_pushnumber(tolua_S,(lua_Number)ret); - return 1; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Skeleton3D:getBoneIndex",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_3d_Skeleton3D_getBoneIndex'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_3d_Skeleton3D_getBoneCount(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::Skeleton3D* 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.Skeleton3D",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::Skeleton3D*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_3d_Skeleton3D_getBoneCount'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 0) - { - if(!ok) - return 0; - ssize_t ret = cobj->getBoneCount(); - tolua_pushnumber(tolua_S,(lua_Number)ret); - return 1; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Skeleton3D:getBoneCount",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_3d_Skeleton3D_getBoneCount'.",&tolua_err); -#endif - - return 0; -} -static int lua_cocos2dx_3d_Skeleton3D_finalize(lua_State* tolua_S) -{ - printf("luabindings: finalizing LUA object (Skeleton3D)"); - return 0; -} - -int lua_register_cocos2dx_3d_Skeleton3D(lua_State* tolua_S) -{ - tolua_usertype(tolua_S,"cc.Skeleton3D"); - tolua_cclass(tolua_S,"Skeleton3D","cc.Skeleton3D","cc.Ref",nullptr); - - tolua_beginmodule(tolua_S,"Skeleton3D"); - tolua_function(tolua_S,"getBoneByName",lua_cocos2dx_3d_Skeleton3D_getBoneByName); - tolua_function(tolua_S,"getRootBone",lua_cocos2dx_3d_Skeleton3D_getRootBone); - tolua_function(tolua_S,"updateBoneMatrix",lua_cocos2dx_3d_Skeleton3D_updateBoneMatrix); - tolua_function(tolua_S,"getBoneByIndex",lua_cocos2dx_3d_Skeleton3D_getBoneByIndex); - tolua_function(tolua_S,"getRootCount",lua_cocos2dx_3d_Skeleton3D_getRootCount); - tolua_function(tolua_S,"getBoneIndex",lua_cocos2dx_3d_Skeleton3D_getBoneIndex); - tolua_function(tolua_S,"getBoneCount",lua_cocos2dx_3d_Skeleton3D_getBoneCount); - tolua_endmodule(tolua_S); - std::string typeName = typeid(cocos2d::Skeleton3D).name(); - g_luaType[typeName] = "cc.Skeleton3D"; - g_typeCast["Skeleton3D"] = "cc.Skeleton3D"; - return 1; -} - int lua_cocos2dx_3d_Animation3D_getDuration(lua_State* tolua_S) { int argc = 0; diff --git a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.cpp b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.cpp index 88054b0c75..3f90a87db1 100644 --- a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.cpp +++ b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.cpp @@ -9042,1722 +9042,6 @@ int lua_register_cocos2dx_Node(lua_State* tolua_S) return 1; } -int lua_cocos2dx_GLProgramState_setUniformTexture(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::GLProgramState* cobj = nullptr; - bool ok = true; -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.GLProgramState",0,&tolua_err)) goto tolua_lerror; -#endif - cobj = (cocos2d::GLProgramState*)tolua_tousertype(tolua_S,1,0); -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_GLProgramState_setUniformTexture'", nullptr); - return 0; - } -#endif - argc = lua_gettop(tolua_S)-1; - do{ - if (argc == 2) { - std::string arg0; - ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.GLProgramState:setUniformTexture"); - - if (!ok) { break; } - unsigned int arg1; - ok &= luaval_to_uint32(tolua_S, 3,&arg1, "cc.GLProgramState:setUniformTexture"); - - if (!ok) { break; } - cobj->setUniformTexture(arg0, arg1); - return 0; - } - }while(0); - ok = true; - do{ - if (argc == 2) { - std::string arg0; - ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.GLProgramState:setUniformTexture"); - - if (!ok) { break; } - cocos2d::Texture2D* arg1; - ok &= luaval_to_object(tolua_S, 3, "cc.Texture2D",&arg1); - - if (!ok) { break; } - cobj->setUniformTexture(arg0, arg1); - return 0; - } - }while(0); - ok = true; - do{ - if (argc == 2) { - int arg0; - ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "cc.GLProgramState:setUniformTexture"); - - if (!ok) { break; } - cocos2d::Texture2D* arg1; - ok &= luaval_to_object(tolua_S, 3, "cc.Texture2D",&arg1); - - if (!ok) { break; } - cobj->setUniformTexture(arg0, arg1); - return 0; - } - }while(0); - ok = true; - do{ - if (argc == 2) { - int arg0; - ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "cc.GLProgramState:setUniformTexture"); - - if (!ok) { break; } - unsigned int arg1; - ok &= luaval_to_uint32(tolua_S, 3,&arg1, "cc.GLProgramState:setUniformTexture"); - - if (!ok) { break; } - cobj->setUniformTexture(arg0, arg1); - return 0; - } - }while(0); - ok = true; - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.GLProgramState:setUniformTexture",argc, 2); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgramState_setUniformTexture'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_GLProgramState_setUniformMat4(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::GLProgramState* cobj = nullptr; - bool ok = true; -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.GLProgramState",0,&tolua_err)) goto tolua_lerror; -#endif - cobj = (cocos2d::GLProgramState*)tolua_tousertype(tolua_S,1,0); -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_GLProgramState_setUniformMat4'", nullptr); - return 0; - } -#endif - argc = lua_gettop(tolua_S)-1; - do{ - if (argc == 2) { - int arg0; - ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "cc.GLProgramState:setUniformMat4"); - - if (!ok) { break; } - cocos2d::Mat4 arg1; - ok &= luaval_to_mat4(tolua_S, 3, &arg1, "cc.GLProgramState:setUniformMat4"); - - if (!ok) { break; } - cobj->setUniformMat4(arg0, arg1); - return 0; - } - }while(0); - ok = true; - do{ - if (argc == 2) { - std::string arg0; - ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.GLProgramState:setUniformMat4"); - - if (!ok) { break; } - cocos2d::Mat4 arg1; - ok &= luaval_to_mat4(tolua_S, 3, &arg1, "cc.GLProgramState:setUniformMat4"); - - if (!ok) { break; } - cobj->setUniformMat4(arg0, arg1); - return 0; - } - }while(0); - ok = true; - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.GLProgramState:setUniformMat4",argc, 2); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgramState_setUniformMat4'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_GLProgramState_applyUniforms(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::GLProgramState* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.GLProgramState",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::GLProgramState*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_GLProgramState_applyUniforms'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 0) - { - if(!ok) - return 0; - cobj->applyUniforms(); - return 0; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.GLProgramState:applyUniforms",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgramState_applyUniforms'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_GLProgramState_applyGLProgram(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::GLProgramState* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.GLProgramState",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::GLProgramState*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_GLProgramState_applyGLProgram'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 1) - { - cocos2d::Mat4 arg0; - - ok &= luaval_to_mat4(tolua_S, 2, &arg0, "cc.GLProgramState:applyGLProgram"); - if(!ok) - return 0; - cobj->applyGLProgram(arg0); - return 0; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.GLProgramState:applyGLProgram",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgramState_applyGLProgram'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_GLProgramState_getUniformCount(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::GLProgramState* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.GLProgramState",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::GLProgramState*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_GLProgramState_getUniformCount'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 0) - { - if(!ok) - return 0; - ssize_t ret = cobj->getUniformCount(); - tolua_pushnumber(tolua_S,(lua_Number)ret); - return 1; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.GLProgramState:getUniformCount",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgramState_getUniformCount'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_GLProgramState_applyAttributes(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::GLProgramState* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.GLProgramState",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::GLProgramState*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_GLProgramState_applyAttributes'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 0) - { - if(!ok) - return 0; - cobj->applyAttributes(); - return 0; - } - if (argc == 1) - { - bool arg0; - - ok &= luaval_to_boolean(tolua_S, 2,&arg0, "cc.GLProgramState:applyAttributes"); - if(!ok) - return 0; - cobj->applyAttributes(arg0); - return 0; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.GLProgramState:applyAttributes",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgramState_applyAttributes'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_GLProgramState_setUniformFloat(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::GLProgramState* cobj = nullptr; - bool ok = true; -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.GLProgramState",0,&tolua_err)) goto tolua_lerror; -#endif - cobj = (cocos2d::GLProgramState*)tolua_tousertype(tolua_S,1,0); -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_GLProgramState_setUniformFloat'", nullptr); - return 0; - } -#endif - argc = lua_gettop(tolua_S)-1; - do{ - if (argc == 2) { - int arg0; - ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "cc.GLProgramState:setUniformFloat"); - - if (!ok) { break; } - double arg1; - ok &= luaval_to_number(tolua_S, 3,&arg1, "cc.GLProgramState:setUniformFloat"); - - if (!ok) { break; } - cobj->setUniformFloat(arg0, arg1); - return 0; - } - }while(0); - ok = true; - do{ - if (argc == 2) { - std::string arg0; - ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.GLProgramState:setUniformFloat"); - - if (!ok) { break; } - double arg1; - ok &= luaval_to_number(tolua_S, 3,&arg1, "cc.GLProgramState:setUniformFloat"); - - if (!ok) { break; } - cobj->setUniformFloat(arg0, arg1); - return 0; - } - }while(0); - ok = true; - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.GLProgramState:setUniformFloat",argc, 2); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgramState_setUniformFloat'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_GLProgramState_setUniformVec3(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::GLProgramState* cobj = nullptr; - bool ok = true; -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.GLProgramState",0,&tolua_err)) goto tolua_lerror; -#endif - cobj = (cocos2d::GLProgramState*)tolua_tousertype(tolua_S,1,0); -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_GLProgramState_setUniformVec3'", nullptr); - return 0; - } -#endif - argc = lua_gettop(tolua_S)-1; - do{ - if (argc == 2) { - int arg0; - ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "cc.GLProgramState:setUniformVec3"); - - if (!ok) { break; } - cocos2d::Vec3 arg1; - ok &= luaval_to_vec3(tolua_S, 3, &arg1, "cc.GLProgramState:setUniformVec3"); - - if (!ok) { break; } - cobj->setUniformVec3(arg0, arg1); - return 0; - } - }while(0); - ok = true; - do{ - if (argc == 2) { - std::string arg0; - ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.GLProgramState:setUniformVec3"); - - if (!ok) { break; } - cocos2d::Vec3 arg1; - ok &= luaval_to_vec3(tolua_S, 3, &arg1, "cc.GLProgramState:setUniformVec3"); - - if (!ok) { break; } - cobj->setUniformVec3(arg0, arg1); - return 0; - } - }while(0); - ok = true; - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.GLProgramState:setUniformVec3",argc, 2); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgramState_setUniformVec3'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_GLProgramState_setUniformInt(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::GLProgramState* cobj = nullptr; - bool ok = true; -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.GLProgramState",0,&tolua_err)) goto tolua_lerror; -#endif - cobj = (cocos2d::GLProgramState*)tolua_tousertype(tolua_S,1,0); -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_GLProgramState_setUniformInt'", nullptr); - return 0; - } -#endif - argc = lua_gettop(tolua_S)-1; - do{ - if (argc == 2) { - int arg0; - ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "cc.GLProgramState:setUniformInt"); - - if (!ok) { break; } - int arg1; - ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1, "cc.GLProgramState:setUniformInt"); - - if (!ok) { break; } - cobj->setUniformInt(arg0, arg1); - return 0; - } - }while(0); - ok = true; - do{ - if (argc == 2) { - std::string arg0; - ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.GLProgramState:setUniformInt"); - - if (!ok) { break; } - int arg1; - ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1, "cc.GLProgramState:setUniformInt"); - - if (!ok) { break; } - cobj->setUniformInt(arg0, arg1); - return 0; - } - }while(0); - ok = true; - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.GLProgramState:setUniformInt",argc, 2); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgramState_setUniformInt'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_GLProgramState_getVertexAttribCount(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::GLProgramState* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.GLProgramState",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::GLProgramState*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_GLProgramState_getVertexAttribCount'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 0) - { - if(!ok) - return 0; - ssize_t ret = cobj->getVertexAttribCount(); - tolua_pushnumber(tolua_S,(lua_Number)ret); - return 1; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.GLProgramState:getVertexAttribCount",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgramState_getVertexAttribCount'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_GLProgramState_setUniformVec4(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::GLProgramState* cobj = nullptr; - bool ok = true; -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.GLProgramState",0,&tolua_err)) goto tolua_lerror; -#endif - cobj = (cocos2d::GLProgramState*)tolua_tousertype(tolua_S,1,0); -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_GLProgramState_setUniformVec4'", nullptr); - return 0; - } -#endif - argc = lua_gettop(tolua_S)-1; - do{ - if (argc == 2) { - int arg0; - ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "cc.GLProgramState:setUniformVec4"); - - if (!ok) { break; } - cocos2d::Vec4 arg1; - ok &= luaval_to_vec4(tolua_S, 3, &arg1, "cc.GLProgramState:setUniformVec4"); - - if (!ok) { break; } - cobj->setUniformVec4(arg0, arg1); - return 0; - } - }while(0); - ok = true; - do{ - if (argc == 2) { - std::string arg0; - ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.GLProgramState:setUniformVec4"); - - if (!ok) { break; } - cocos2d::Vec4 arg1; - ok &= luaval_to_vec4(tolua_S, 3, &arg1, "cc.GLProgramState:setUniformVec4"); - - if (!ok) { break; } - cobj->setUniformVec4(arg0, arg1); - return 0; - } - }while(0); - ok = true; - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.GLProgramState:setUniformVec4",argc, 2); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgramState_setUniformVec4'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_GLProgramState_setGLProgram(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::GLProgramState* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.GLProgramState",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::GLProgramState*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_GLProgramState_setGLProgram'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 1) - { - cocos2d::GLProgram* arg0; - - ok &= luaval_to_object(tolua_S, 2, "cc.GLProgram",&arg0); - if(!ok) - return 0; - cobj->setGLProgram(arg0); - return 0; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.GLProgramState:setGLProgram",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgramState_setGLProgram'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_GLProgramState_setUniformVec2(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::GLProgramState* cobj = nullptr; - bool ok = true; -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.GLProgramState",0,&tolua_err)) goto tolua_lerror; -#endif - cobj = (cocos2d::GLProgramState*)tolua_tousertype(tolua_S,1,0); -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_GLProgramState_setUniformVec2'", nullptr); - return 0; - } -#endif - argc = lua_gettop(tolua_S)-1; - do{ - if (argc == 2) { - int arg0; - ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "cc.GLProgramState:setUniformVec2"); - - if (!ok) { break; } - cocos2d::Vec2 arg1; - ok &= luaval_to_vec2(tolua_S, 3, &arg1, "cc.GLProgramState:setUniformVec2"); - - if (!ok) { break; } - cobj->setUniformVec2(arg0, arg1); - return 0; - } - }while(0); - ok = true; - do{ - if (argc == 2) { - std::string arg0; - ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.GLProgramState:setUniformVec2"); - - if (!ok) { break; } - cocos2d::Vec2 arg1; - ok &= luaval_to_vec2(tolua_S, 3, &arg1, "cc.GLProgramState:setUniformVec2"); - - if (!ok) { break; } - cobj->setUniformVec2(arg0, arg1); - return 0; - } - }while(0); - ok = true; - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.GLProgramState:setUniformVec2",argc, 2); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgramState_setUniformVec2'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_GLProgramState_getVertexAttribsFlags(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::GLProgramState* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.GLProgramState",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::GLProgramState*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_GLProgramState_getVertexAttribsFlags'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 0) - { - if(!ok) - return 0; - unsigned int ret = cobj->getVertexAttribsFlags(); - tolua_pushnumber(tolua_S,(lua_Number)ret); - return 1; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.GLProgramState:getVertexAttribsFlags",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgramState_getVertexAttribsFlags'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_GLProgramState_apply(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::GLProgramState* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.GLProgramState",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::GLProgramState*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_GLProgramState_apply'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 1) - { - cocos2d::Mat4 arg0; - - ok &= luaval_to_mat4(tolua_S, 2, &arg0, "cc.GLProgramState:apply"); - if(!ok) - return 0; - cobj->apply(arg0); - return 0; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.GLProgramState:apply",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgramState_apply'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_GLProgramState_getGLProgram(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::GLProgramState* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.GLProgramState",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::GLProgramState*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_GLProgramState_getGLProgram'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 0) - { - if(!ok) - return 0; - cocos2d::GLProgram* ret = cobj->getGLProgram(); - object_to_luaval(tolua_S, "cc.GLProgram",(cocos2d::GLProgram*)ret); - return 1; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.GLProgramState:getGLProgram",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgramState_getGLProgram'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_GLProgramState_create(lua_State* tolua_S) -{ - int argc = 0; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertable(tolua_S,1,"cc.GLProgramState",0,&tolua_err)) goto tolua_lerror; -#endif - - argc = lua_gettop(tolua_S) - 1; - - if (argc == 1) - { - cocos2d::GLProgram* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.GLProgram",&arg0); - if(!ok) - return 0; - cocos2d::GLProgramState* ret = cocos2d::GLProgramState::create(arg0); - object_to_luaval(tolua_S, "cc.GLProgramState",(cocos2d::GLProgramState*)ret); - return 1; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d\n ", "cc.GLProgramState:create",argc, 1); - return 0; -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgramState_create'.",&tolua_err); -#endif - return 0; -} -int lua_cocos2dx_GLProgramState_getOrCreateWithGLProgramName(lua_State* tolua_S) -{ - int argc = 0; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertable(tolua_S,1,"cc.GLProgramState",0,&tolua_err)) goto tolua_lerror; -#endif - - argc = lua_gettop(tolua_S) - 1; - - if (argc == 1) - { - std::string arg0; - ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.GLProgramState:getOrCreateWithGLProgramName"); - if(!ok) - return 0; - cocos2d::GLProgramState* ret = cocos2d::GLProgramState::getOrCreateWithGLProgramName(arg0); - object_to_luaval(tolua_S, "cc.GLProgramState",(cocos2d::GLProgramState*)ret); - return 1; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d\n ", "cc.GLProgramState:getOrCreateWithGLProgramName",argc, 1); - return 0; -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgramState_getOrCreateWithGLProgramName'.",&tolua_err); -#endif - return 0; -} -int lua_cocos2dx_GLProgramState_getOrCreateWithGLProgram(lua_State* tolua_S) -{ - int argc = 0; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertable(tolua_S,1,"cc.GLProgramState",0,&tolua_err)) goto tolua_lerror; -#endif - - argc = lua_gettop(tolua_S) - 1; - - if (argc == 1) - { - cocos2d::GLProgram* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.GLProgram",&arg0); - if(!ok) - return 0; - cocos2d::GLProgramState* ret = cocos2d::GLProgramState::getOrCreateWithGLProgram(arg0); - object_to_luaval(tolua_S, "cc.GLProgramState",(cocos2d::GLProgramState*)ret); - return 1; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d\n ", "cc.GLProgramState:getOrCreateWithGLProgram",argc, 1); - return 0; -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgramState_getOrCreateWithGLProgram'.",&tolua_err); -#endif - return 0; -} -static int lua_cocos2dx_GLProgramState_finalize(lua_State* tolua_S) -{ - printf("luabindings: finalizing LUA object (GLProgramState)"); - return 0; -} - -int lua_register_cocos2dx_GLProgramState(lua_State* tolua_S) -{ - tolua_usertype(tolua_S,"cc.GLProgramState"); - tolua_cclass(tolua_S,"GLProgramState","cc.GLProgramState","cc.Ref",nullptr); - - tolua_beginmodule(tolua_S,"GLProgramState"); - tolua_function(tolua_S,"setUniformTexture",lua_cocos2dx_GLProgramState_setUniformTexture); - tolua_function(tolua_S,"setUniformMat4",lua_cocos2dx_GLProgramState_setUniformMat4); - tolua_function(tolua_S,"applyUniforms",lua_cocos2dx_GLProgramState_applyUniforms); - tolua_function(tolua_S,"applyGLProgram",lua_cocos2dx_GLProgramState_applyGLProgram); - tolua_function(tolua_S,"getUniformCount",lua_cocos2dx_GLProgramState_getUniformCount); - tolua_function(tolua_S,"applyAttributes",lua_cocos2dx_GLProgramState_applyAttributes); - tolua_function(tolua_S,"setUniformFloat",lua_cocos2dx_GLProgramState_setUniformFloat); - tolua_function(tolua_S,"setUniformVec3",lua_cocos2dx_GLProgramState_setUniformVec3); - tolua_function(tolua_S,"setUniformInt",lua_cocos2dx_GLProgramState_setUniformInt); - tolua_function(tolua_S,"getVertexAttribCount",lua_cocos2dx_GLProgramState_getVertexAttribCount); - tolua_function(tolua_S,"setUniformVec4",lua_cocos2dx_GLProgramState_setUniformVec4); - tolua_function(tolua_S,"setGLProgram",lua_cocos2dx_GLProgramState_setGLProgram); - tolua_function(tolua_S,"setUniformVec2",lua_cocos2dx_GLProgramState_setUniformVec2); - tolua_function(tolua_S,"getVertexAttribsFlags",lua_cocos2dx_GLProgramState_getVertexAttribsFlags); - tolua_function(tolua_S,"apply",lua_cocos2dx_GLProgramState_apply); - tolua_function(tolua_S,"getGLProgram",lua_cocos2dx_GLProgramState_getGLProgram); - tolua_function(tolua_S,"create", lua_cocos2dx_GLProgramState_create); - tolua_function(tolua_S,"getOrCreateWithGLProgramName", lua_cocos2dx_GLProgramState_getOrCreateWithGLProgramName); - tolua_function(tolua_S,"getOrCreateWithGLProgram", lua_cocos2dx_GLProgramState_getOrCreateWithGLProgram); - tolua_endmodule(tolua_S); - std::string typeName = typeid(cocos2d::GLProgramState).name(); - g_luaType[typeName] = "cc.GLProgramState"; - g_typeCast["GLProgramState"] = "cc.GLProgramState"; - return 1; -} - -int lua_cocos2dx_AtlasNode_updateAtlasValues(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::AtlasNode* 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.AtlasNode",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::AtlasNode*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_AtlasNode_updateAtlasValues'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 0) - { - if(!ok) - return 0; - cobj->updateAtlasValues(); - return 0; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.AtlasNode:updateAtlasValues",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_AtlasNode_updateAtlasValues'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_AtlasNode_getTexture(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::AtlasNode* 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.AtlasNode",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::AtlasNode*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_AtlasNode_getTexture'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 0) - { - if(!ok) - return 0; - cocos2d::Texture2D* ret = cobj->getTexture(); - object_to_luaval(tolua_S, "cc.Texture2D",(cocos2d::Texture2D*)ret); - return 1; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.AtlasNode:getTexture",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_AtlasNode_getTexture'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_AtlasNode_setTextureAtlas(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::AtlasNode* 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.AtlasNode",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::AtlasNode*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_AtlasNode_setTextureAtlas'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 1) - { - cocos2d::TextureAtlas* arg0; - - ok &= luaval_to_object(tolua_S, 2, "cc.TextureAtlas",&arg0); - if(!ok) - return 0; - cobj->setTextureAtlas(arg0); - return 0; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.AtlasNode:setTextureAtlas",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_AtlasNode_setTextureAtlas'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_AtlasNode_getTextureAtlas(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::AtlasNode* 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.AtlasNode",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::AtlasNode*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_AtlasNode_getTextureAtlas'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 0) - { - if(!ok) - return 0; - cocos2d::TextureAtlas* ret = cobj->getTextureAtlas(); - object_to_luaval(tolua_S, "cc.TextureAtlas",(cocos2d::TextureAtlas*)ret); - return 1; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.AtlasNode:getTextureAtlas",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_AtlasNode_getTextureAtlas'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_AtlasNode_getQuadsToDraw(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::AtlasNode* 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.AtlasNode",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::AtlasNode*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_AtlasNode_getQuadsToDraw'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 0) - { - if(!ok) - return 0; - ssize_t ret = cobj->getQuadsToDraw(); - tolua_pushnumber(tolua_S,(lua_Number)ret); - return 1; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.AtlasNode:getQuadsToDraw",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_AtlasNode_getQuadsToDraw'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_AtlasNode_setTexture(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::AtlasNode* 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.AtlasNode",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::AtlasNode*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_AtlasNode_setTexture'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 1) - { - cocos2d::Texture2D* arg0; - - ok &= luaval_to_object(tolua_S, 2, "cc.Texture2D",&arg0); - if(!ok) - return 0; - cobj->setTexture(arg0); - return 0; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.AtlasNode:setTexture",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_AtlasNode_setTexture'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_AtlasNode_setQuadsToDraw(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::AtlasNode* 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.AtlasNode",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::AtlasNode*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_AtlasNode_setQuadsToDraw'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 1) - { - ssize_t arg0; - - ok &= luaval_to_ssize(tolua_S, 2, &arg0, "cc.AtlasNode:setQuadsToDraw"); - if(!ok) - return 0; - cobj->setQuadsToDraw(arg0); - return 0; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.AtlasNode:setQuadsToDraw",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_AtlasNode_setQuadsToDraw'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_AtlasNode_create(lua_State* tolua_S) -{ - int argc = 0; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertable(tolua_S,1,"cc.AtlasNode",0,&tolua_err)) goto tolua_lerror; -#endif - - argc = lua_gettop(tolua_S) - 1; - - if (argc == 4) - { - std::string arg0; - int arg1; - int arg2; - int arg3; - ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.AtlasNode:create"); - ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1, "cc.AtlasNode:create"); - ok &= luaval_to_int32(tolua_S, 4,(int *)&arg2, "cc.AtlasNode:create"); - ok &= luaval_to_int32(tolua_S, 5,(int *)&arg3, "cc.AtlasNode:create"); - if(!ok) - return 0; - cocos2d::AtlasNode* ret = cocos2d::AtlasNode::create(arg0, arg1, arg2, arg3); - object_to_luaval(tolua_S, "cc.AtlasNode",(cocos2d::AtlasNode*)ret); - return 1; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d\n ", "cc.AtlasNode:create",argc, 4); - return 0; -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_AtlasNode_create'.",&tolua_err); -#endif - return 0; -} -static int lua_cocos2dx_AtlasNode_finalize(lua_State* tolua_S) -{ - printf("luabindings: finalizing LUA object (AtlasNode)"); - return 0; -} - -int lua_register_cocos2dx_AtlasNode(lua_State* tolua_S) -{ - tolua_usertype(tolua_S,"cc.AtlasNode"); - tolua_cclass(tolua_S,"AtlasNode","cc.AtlasNode","cc.Node",nullptr); - - tolua_beginmodule(tolua_S,"AtlasNode"); - tolua_function(tolua_S,"updateAtlasValues",lua_cocos2dx_AtlasNode_updateAtlasValues); - tolua_function(tolua_S,"getTexture",lua_cocos2dx_AtlasNode_getTexture); - tolua_function(tolua_S,"setTextureAtlas",lua_cocos2dx_AtlasNode_setTextureAtlas); - tolua_function(tolua_S,"getTextureAtlas",lua_cocos2dx_AtlasNode_getTextureAtlas); - tolua_function(tolua_S,"getQuadsToDraw",lua_cocos2dx_AtlasNode_getQuadsToDraw); - tolua_function(tolua_S,"setTexture",lua_cocos2dx_AtlasNode_setTexture); - tolua_function(tolua_S,"setQuadsToDraw",lua_cocos2dx_AtlasNode_setQuadsToDraw); - tolua_function(tolua_S,"create", lua_cocos2dx_AtlasNode_create); - tolua_endmodule(tolua_S); - std::string typeName = typeid(cocos2d::AtlasNode).name(); - g_luaType[typeName] = "cc.AtlasNode"; - g_typeCast["AtlasNode"] = "cc.AtlasNode"; - return 1; -} - -int lua_cocos2dx_LabelAtlas_setString(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::LabelAtlas* 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.LabelAtlas",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::LabelAtlas*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_LabelAtlas_setString'", 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.LabelAtlas:setString"); - if(!ok) - return 0; - cobj->setString(arg0); - return 0; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.LabelAtlas:setString",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_LabelAtlas_setString'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_LabelAtlas_initWithString(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::LabelAtlas* 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.LabelAtlas",0,&tolua_err)) goto tolua_lerror; -#endif - cobj = (cocos2d::LabelAtlas*)tolua_tousertype(tolua_S,1,0); -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_LabelAtlas_initWithString'", nullptr); - return 0; - } -#endif - argc = lua_gettop(tolua_S)-1; - do{ - if (argc == 2) { - std::string arg0; - ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.LabelAtlas:initWithString"); - - if (!ok) { break; } - std::string arg1; - ok &= luaval_to_std_string(tolua_S, 3,&arg1, "cc.LabelAtlas:initWithString"); - - if (!ok) { break; } - bool ret = cobj->initWithString(arg0, arg1); - tolua_pushboolean(tolua_S,(bool)ret); - return 1; - } - }while(0); - ok = true; - do{ - if (argc == 5) { - std::string arg0; - ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.LabelAtlas:initWithString"); - - if (!ok) { break; } - std::string arg1; - ok &= luaval_to_std_string(tolua_S, 3,&arg1, "cc.LabelAtlas:initWithString"); - - if (!ok) { break; } - int arg2; - ok &= luaval_to_int32(tolua_S, 4,(int *)&arg2, "cc.LabelAtlas:initWithString"); - - if (!ok) { break; } - int arg3; - ok &= luaval_to_int32(tolua_S, 5,(int *)&arg3, "cc.LabelAtlas:initWithString"); - - if (!ok) { break; } - int arg4; - ok &= luaval_to_int32(tolua_S, 6,(int *)&arg4, "cc.LabelAtlas:initWithString"); - - if (!ok) { break; } - bool ret = cobj->initWithString(arg0, arg1, arg2, arg3, arg4); - tolua_pushboolean(tolua_S,(bool)ret); - return 1; - } - }while(0); - ok = true; - do{ - if (argc == 5) { - std::string arg0; - ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.LabelAtlas:initWithString"); - - if (!ok) { break; } - cocos2d::Texture2D* arg1; - ok &= luaval_to_object(tolua_S, 3, "cc.Texture2D",&arg1); - - if (!ok) { break; } - int arg2; - ok &= luaval_to_int32(tolua_S, 4,(int *)&arg2, "cc.LabelAtlas:initWithString"); - - if (!ok) { break; } - int arg3; - ok &= luaval_to_int32(tolua_S, 5,(int *)&arg3, "cc.LabelAtlas:initWithString"); - - if (!ok) { break; } - int arg4; - ok &= luaval_to_int32(tolua_S, 6,(int *)&arg4, "cc.LabelAtlas:initWithString"); - - if (!ok) { break; } - bool ret = cobj->initWithString(arg0, arg1, arg2, arg3, arg4); - tolua_pushboolean(tolua_S,(bool)ret); - return 1; - } - }while(0); - ok = true; - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.LabelAtlas:initWithString",argc, 5); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_LabelAtlas_initWithString'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_LabelAtlas_updateAtlasValues(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::LabelAtlas* 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.LabelAtlas",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::LabelAtlas*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_LabelAtlas_updateAtlasValues'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 0) - { - if(!ok) - return 0; - cobj->updateAtlasValues(); - return 0; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.LabelAtlas:updateAtlasValues",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_LabelAtlas_updateAtlasValues'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_LabelAtlas_getString(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::LabelAtlas* 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.LabelAtlas",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::LabelAtlas*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_LabelAtlas_getString'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 0) - { - if(!ok) - return 0; - const std::string& ret = cobj->getString(); - tolua_pushcppstring(tolua_S,ret); - return 1; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.LabelAtlas:getString",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_LabelAtlas_getString'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_LabelAtlas_create(lua_State* tolua_S) -{ - int argc = 0; - bool ok = true; -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertable(tolua_S,1,"cc.LabelAtlas",0,&tolua_err)) goto tolua_lerror; -#endif - - argc = lua_gettop(tolua_S)-1; - - do - { - if (argc == 5) - { - std::string arg0; - ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.LabelAtlas:create"); - if (!ok) { break; } - std::string arg1; - ok &= luaval_to_std_string(tolua_S, 3,&arg1, "cc.LabelAtlas:create"); - if (!ok) { break; } - int arg2; - ok &= luaval_to_int32(tolua_S, 4,(int *)&arg2, "cc.LabelAtlas:create"); - if (!ok) { break; } - int arg3; - ok &= luaval_to_int32(tolua_S, 5,(int *)&arg3, "cc.LabelAtlas:create"); - if (!ok) { break; } - int arg4; - ok &= luaval_to_int32(tolua_S, 6,(int *)&arg4, "cc.LabelAtlas:create"); - if (!ok) { break; } - cocos2d::LabelAtlas* ret = cocos2d::LabelAtlas::create(arg0, arg1, arg2, arg3, arg4); - object_to_luaval(tolua_S, "cc.LabelAtlas",(cocos2d::LabelAtlas*)ret); - return 1; - } - } while (0); - ok = true; - do - { - if (argc == 0) - { - cocos2d::LabelAtlas* ret = cocos2d::LabelAtlas::create(); - object_to_luaval(tolua_S, "cc.LabelAtlas",(cocos2d::LabelAtlas*)ret); - return 1; - } - } while (0); - ok = true; - do - { - if (argc == 2) - { - std::string arg0; - ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.LabelAtlas:create"); - if (!ok) { break; } - std::string arg1; - ok &= luaval_to_std_string(tolua_S, 3,&arg1, "cc.LabelAtlas:create"); - if (!ok) { break; } - cocos2d::LabelAtlas* ret = cocos2d::LabelAtlas::create(arg0, arg1); - object_to_luaval(tolua_S, "cc.LabelAtlas",(cocos2d::LabelAtlas*)ret); - return 1; - } - } while (0); - ok = true; - CCLOG("%s has wrong number of arguments: %d, was expecting %d", "cc.LabelAtlas:create",argc, 2); - return 0; -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_LabelAtlas_create'.",&tolua_err); -#endif - return 0; -} -static int lua_cocos2dx_LabelAtlas_finalize(lua_State* tolua_S) -{ - printf("luabindings: finalizing LUA object (LabelAtlas)"); - return 0; -} - -int lua_register_cocos2dx_LabelAtlas(lua_State* tolua_S) -{ - tolua_usertype(tolua_S,"cc.LabelAtlas"); - tolua_cclass(tolua_S,"LabelAtlas","cc.LabelAtlas","cc.AtlasNode",nullptr); - - tolua_beginmodule(tolua_S,"LabelAtlas"); - tolua_function(tolua_S,"setString",lua_cocos2dx_LabelAtlas_setString); - tolua_function(tolua_S,"initWithString",lua_cocos2dx_LabelAtlas_initWithString); - tolua_function(tolua_S,"updateAtlasValues",lua_cocos2dx_LabelAtlas_updateAtlasValues); - tolua_function(tolua_S,"getString",lua_cocos2dx_LabelAtlas_getString); - tolua_function(tolua_S,"_create", lua_cocos2dx_LabelAtlas_create); - tolua_endmodule(tolua_S); - std::string typeName = typeid(cocos2d::LabelAtlas).name(); - g_luaType[typeName] = "cc.LabelAtlas"; - g_typeCast["LabelAtlas"] = "cc.LabelAtlas"; - return 1; -} - int lua_cocos2dx_Scene_getPhysicsWorld(lua_State* tolua_S) { int argc = 0; @@ -33781,6 +32065,1389 @@ int lua_register_cocos2dx_CatmullRomBy(lua_State* tolua_S) return 1; } +int lua_cocos2dx_GLProgramState_setUniformTexture(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::GLProgramState* cobj = nullptr; + bool ok = true; +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.GLProgramState",0,&tolua_err)) goto tolua_lerror; +#endif + cobj = (cocos2d::GLProgramState*)tolua_tousertype(tolua_S,1,0); +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_GLProgramState_setUniformTexture'", nullptr); + return 0; + } +#endif + argc = lua_gettop(tolua_S)-1; + do{ + if (argc == 2) { + std::string arg0; + ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.GLProgramState:setUniformTexture"); + + if (!ok) { break; } + unsigned int arg1; + ok &= luaval_to_uint32(tolua_S, 3,&arg1, "cc.GLProgramState:setUniformTexture"); + + if (!ok) { break; } + cobj->setUniformTexture(arg0, arg1); + return 0; + } + }while(0); + ok = true; + do{ + if (argc == 2) { + std::string arg0; + ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.GLProgramState:setUniformTexture"); + + if (!ok) { break; } + cocos2d::Texture2D* arg1; + ok &= luaval_to_object(tolua_S, 3, "cc.Texture2D",&arg1); + + if (!ok) { break; } + cobj->setUniformTexture(arg0, arg1); + return 0; + } + }while(0); + ok = true; + do{ + if (argc == 2) { + int arg0; + ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "cc.GLProgramState:setUniformTexture"); + + if (!ok) { break; } + cocos2d::Texture2D* arg1; + ok &= luaval_to_object(tolua_S, 3, "cc.Texture2D",&arg1); + + if (!ok) { break; } + cobj->setUniformTexture(arg0, arg1); + return 0; + } + }while(0); + ok = true; + do{ + if (argc == 2) { + int arg0; + ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "cc.GLProgramState:setUniformTexture"); + + if (!ok) { break; } + unsigned int arg1; + ok &= luaval_to_uint32(tolua_S, 3,&arg1, "cc.GLProgramState:setUniformTexture"); + + if (!ok) { break; } + cobj->setUniformTexture(arg0, arg1); + return 0; + } + }while(0); + ok = true; + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.GLProgramState:setUniformTexture",argc, 2); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgramState_setUniformTexture'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_GLProgramState_setUniformMat4(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::GLProgramState* cobj = nullptr; + bool ok = true; +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.GLProgramState",0,&tolua_err)) goto tolua_lerror; +#endif + cobj = (cocos2d::GLProgramState*)tolua_tousertype(tolua_S,1,0); +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_GLProgramState_setUniformMat4'", nullptr); + return 0; + } +#endif + argc = lua_gettop(tolua_S)-1; + do{ + if (argc == 2) { + int arg0; + ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "cc.GLProgramState:setUniformMat4"); + + if (!ok) { break; } + cocos2d::Mat4 arg1; + ok &= luaval_to_mat4(tolua_S, 3, &arg1, "cc.GLProgramState:setUniformMat4"); + + if (!ok) { break; } + cobj->setUniformMat4(arg0, arg1); + return 0; + } + }while(0); + ok = true; + do{ + if (argc == 2) { + std::string arg0; + ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.GLProgramState:setUniformMat4"); + + if (!ok) { break; } + cocos2d::Mat4 arg1; + ok &= luaval_to_mat4(tolua_S, 3, &arg1, "cc.GLProgramState:setUniformMat4"); + + if (!ok) { break; } + cobj->setUniformMat4(arg0, arg1); + return 0; + } + }while(0); + ok = true; + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.GLProgramState:setUniformMat4",argc, 2); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgramState_setUniformMat4'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_GLProgramState_applyUniforms(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::GLProgramState* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.GLProgramState",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::GLProgramState*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_GLProgramState_applyUniforms'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + return 0; + cobj->applyUniforms(); + return 0; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.GLProgramState:applyUniforms",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgramState_applyUniforms'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_GLProgramState_applyGLProgram(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::GLProgramState* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.GLProgramState",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::GLProgramState*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_GLProgramState_applyGLProgram'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + cocos2d::Mat4 arg0; + + ok &= luaval_to_mat4(tolua_S, 2, &arg0, "cc.GLProgramState:applyGLProgram"); + if(!ok) + return 0; + cobj->applyGLProgram(arg0); + return 0; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.GLProgramState:applyGLProgram",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgramState_applyGLProgram'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_GLProgramState_getUniformCount(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::GLProgramState* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.GLProgramState",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::GLProgramState*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_GLProgramState_getUniformCount'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + return 0; + ssize_t ret = cobj->getUniformCount(); + tolua_pushnumber(tolua_S,(lua_Number)ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.GLProgramState:getUniformCount",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgramState_getUniformCount'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_GLProgramState_applyAttributes(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::GLProgramState* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.GLProgramState",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::GLProgramState*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_GLProgramState_applyAttributes'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + return 0; + cobj->applyAttributes(); + return 0; + } + if (argc == 1) + { + bool arg0; + + ok &= luaval_to_boolean(tolua_S, 2,&arg0, "cc.GLProgramState:applyAttributes"); + if(!ok) + return 0; + cobj->applyAttributes(arg0); + return 0; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.GLProgramState:applyAttributes",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgramState_applyAttributes'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_GLProgramState_setUniformFloat(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::GLProgramState* cobj = nullptr; + bool ok = true; +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.GLProgramState",0,&tolua_err)) goto tolua_lerror; +#endif + cobj = (cocos2d::GLProgramState*)tolua_tousertype(tolua_S,1,0); +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_GLProgramState_setUniformFloat'", nullptr); + return 0; + } +#endif + argc = lua_gettop(tolua_S)-1; + do{ + if (argc == 2) { + int arg0; + ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "cc.GLProgramState:setUniformFloat"); + + if (!ok) { break; } + double arg1; + ok &= luaval_to_number(tolua_S, 3,&arg1, "cc.GLProgramState:setUniformFloat"); + + if (!ok) { break; } + cobj->setUniformFloat(arg0, arg1); + return 0; + } + }while(0); + ok = true; + do{ + if (argc == 2) { + std::string arg0; + ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.GLProgramState:setUniformFloat"); + + if (!ok) { break; } + double arg1; + ok &= luaval_to_number(tolua_S, 3,&arg1, "cc.GLProgramState:setUniformFloat"); + + if (!ok) { break; } + cobj->setUniformFloat(arg0, arg1); + return 0; + } + }while(0); + ok = true; + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.GLProgramState:setUniformFloat",argc, 2); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgramState_setUniformFloat'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_GLProgramState_setUniformVec3(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::GLProgramState* cobj = nullptr; + bool ok = true; +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.GLProgramState",0,&tolua_err)) goto tolua_lerror; +#endif + cobj = (cocos2d::GLProgramState*)tolua_tousertype(tolua_S,1,0); +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_GLProgramState_setUniformVec3'", nullptr); + return 0; + } +#endif + argc = lua_gettop(tolua_S)-1; + do{ + if (argc == 2) { + int arg0; + ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "cc.GLProgramState:setUniformVec3"); + + if (!ok) { break; } + cocos2d::Vec3 arg1; + ok &= luaval_to_vec3(tolua_S, 3, &arg1, "cc.GLProgramState:setUniformVec3"); + + if (!ok) { break; } + cobj->setUniformVec3(arg0, arg1); + return 0; + } + }while(0); + ok = true; + do{ + if (argc == 2) { + std::string arg0; + ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.GLProgramState:setUniformVec3"); + + if (!ok) { break; } + cocos2d::Vec3 arg1; + ok &= luaval_to_vec3(tolua_S, 3, &arg1, "cc.GLProgramState:setUniformVec3"); + + if (!ok) { break; } + cobj->setUniformVec3(arg0, arg1); + return 0; + } + }while(0); + ok = true; + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.GLProgramState:setUniformVec3",argc, 2); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgramState_setUniformVec3'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_GLProgramState_setUniformInt(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::GLProgramState* cobj = nullptr; + bool ok = true; +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.GLProgramState",0,&tolua_err)) goto tolua_lerror; +#endif + cobj = (cocos2d::GLProgramState*)tolua_tousertype(tolua_S,1,0); +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_GLProgramState_setUniformInt'", nullptr); + return 0; + } +#endif + argc = lua_gettop(tolua_S)-1; + do{ + if (argc == 2) { + int arg0; + ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "cc.GLProgramState:setUniformInt"); + + if (!ok) { break; } + int arg1; + ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1, "cc.GLProgramState:setUniformInt"); + + if (!ok) { break; } + cobj->setUniformInt(arg0, arg1); + return 0; + } + }while(0); + ok = true; + do{ + if (argc == 2) { + std::string arg0; + ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.GLProgramState:setUniformInt"); + + if (!ok) { break; } + int arg1; + ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1, "cc.GLProgramState:setUniformInt"); + + if (!ok) { break; } + cobj->setUniformInt(arg0, arg1); + return 0; + } + }while(0); + ok = true; + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.GLProgramState:setUniformInt",argc, 2); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgramState_setUniformInt'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_GLProgramState_getVertexAttribCount(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::GLProgramState* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.GLProgramState",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::GLProgramState*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_GLProgramState_getVertexAttribCount'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + return 0; + ssize_t ret = cobj->getVertexAttribCount(); + tolua_pushnumber(tolua_S,(lua_Number)ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.GLProgramState:getVertexAttribCount",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgramState_getVertexAttribCount'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_GLProgramState_setUniformVec4(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::GLProgramState* cobj = nullptr; + bool ok = true; +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.GLProgramState",0,&tolua_err)) goto tolua_lerror; +#endif + cobj = (cocos2d::GLProgramState*)tolua_tousertype(tolua_S,1,0); +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_GLProgramState_setUniformVec4'", nullptr); + return 0; + } +#endif + argc = lua_gettop(tolua_S)-1; + do{ + if (argc == 2) { + int arg0; + ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "cc.GLProgramState:setUniformVec4"); + + if (!ok) { break; } + cocos2d::Vec4 arg1; + ok &= luaval_to_vec4(tolua_S, 3, &arg1, "cc.GLProgramState:setUniformVec4"); + + if (!ok) { break; } + cobj->setUniformVec4(arg0, arg1); + return 0; + } + }while(0); + ok = true; + do{ + if (argc == 2) { + std::string arg0; + ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.GLProgramState:setUniformVec4"); + + if (!ok) { break; } + cocos2d::Vec4 arg1; + ok &= luaval_to_vec4(tolua_S, 3, &arg1, "cc.GLProgramState:setUniformVec4"); + + if (!ok) { break; } + cobj->setUniformVec4(arg0, arg1); + return 0; + } + }while(0); + ok = true; + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.GLProgramState:setUniformVec4",argc, 2); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgramState_setUniformVec4'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_GLProgramState_setGLProgram(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::GLProgramState* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.GLProgramState",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::GLProgramState*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_GLProgramState_setGLProgram'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + cocos2d::GLProgram* arg0; + + ok &= luaval_to_object(tolua_S, 2, "cc.GLProgram",&arg0); + if(!ok) + return 0; + cobj->setGLProgram(arg0); + return 0; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.GLProgramState:setGLProgram",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgramState_setGLProgram'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_GLProgramState_setUniformVec2(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::GLProgramState* cobj = nullptr; + bool ok = true; +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.GLProgramState",0,&tolua_err)) goto tolua_lerror; +#endif + cobj = (cocos2d::GLProgramState*)tolua_tousertype(tolua_S,1,0); +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_GLProgramState_setUniformVec2'", nullptr); + return 0; + } +#endif + argc = lua_gettop(tolua_S)-1; + do{ + if (argc == 2) { + int arg0; + ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "cc.GLProgramState:setUniformVec2"); + + if (!ok) { break; } + cocos2d::Vec2 arg1; + ok &= luaval_to_vec2(tolua_S, 3, &arg1, "cc.GLProgramState:setUniformVec2"); + + if (!ok) { break; } + cobj->setUniformVec2(arg0, arg1); + return 0; + } + }while(0); + ok = true; + do{ + if (argc == 2) { + std::string arg0; + ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.GLProgramState:setUniformVec2"); + + if (!ok) { break; } + cocos2d::Vec2 arg1; + ok &= luaval_to_vec2(tolua_S, 3, &arg1, "cc.GLProgramState:setUniformVec2"); + + if (!ok) { break; } + cobj->setUniformVec2(arg0, arg1); + return 0; + } + }while(0); + ok = true; + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.GLProgramState:setUniformVec2",argc, 2); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgramState_setUniformVec2'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_GLProgramState_getVertexAttribsFlags(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::GLProgramState* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.GLProgramState",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::GLProgramState*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_GLProgramState_getVertexAttribsFlags'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + return 0; + unsigned int ret = cobj->getVertexAttribsFlags(); + tolua_pushnumber(tolua_S,(lua_Number)ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.GLProgramState:getVertexAttribsFlags",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgramState_getVertexAttribsFlags'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_GLProgramState_apply(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::GLProgramState* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.GLProgramState",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::GLProgramState*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_GLProgramState_apply'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + cocos2d::Mat4 arg0; + + ok &= luaval_to_mat4(tolua_S, 2, &arg0, "cc.GLProgramState:apply"); + if(!ok) + return 0; + cobj->apply(arg0); + return 0; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.GLProgramState:apply",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgramState_apply'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_GLProgramState_getGLProgram(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::GLProgramState* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.GLProgramState",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::GLProgramState*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_GLProgramState_getGLProgram'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + return 0; + cocos2d::GLProgram* ret = cobj->getGLProgram(); + object_to_luaval(tolua_S, "cc.GLProgram",(cocos2d::GLProgram*)ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.GLProgramState:getGLProgram",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgramState_getGLProgram'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_GLProgramState_create(lua_State* tolua_S) +{ + int argc = 0; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertable(tolua_S,1,"cc.GLProgramState",0,&tolua_err)) goto tolua_lerror; +#endif + + argc = lua_gettop(tolua_S) - 1; + + if (argc == 1) + { + cocos2d::GLProgram* arg0; + ok &= luaval_to_object(tolua_S, 2, "cc.GLProgram",&arg0); + if(!ok) + return 0; + cocos2d::GLProgramState* ret = cocos2d::GLProgramState::create(arg0); + object_to_luaval(tolua_S, "cc.GLProgramState",(cocos2d::GLProgramState*)ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d\n ", "cc.GLProgramState:create",argc, 1); + return 0; +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgramState_create'.",&tolua_err); +#endif + return 0; +} +int lua_cocos2dx_GLProgramState_getOrCreateWithGLProgramName(lua_State* tolua_S) +{ + int argc = 0; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertable(tolua_S,1,"cc.GLProgramState",0,&tolua_err)) goto tolua_lerror; +#endif + + argc = lua_gettop(tolua_S) - 1; + + if (argc == 1) + { + std::string arg0; + ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.GLProgramState:getOrCreateWithGLProgramName"); + if(!ok) + return 0; + cocos2d::GLProgramState* ret = cocos2d::GLProgramState::getOrCreateWithGLProgramName(arg0); + object_to_luaval(tolua_S, "cc.GLProgramState",(cocos2d::GLProgramState*)ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d\n ", "cc.GLProgramState:getOrCreateWithGLProgramName",argc, 1); + return 0; +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgramState_getOrCreateWithGLProgramName'.",&tolua_err); +#endif + return 0; +} +int lua_cocos2dx_GLProgramState_getOrCreateWithGLProgram(lua_State* tolua_S) +{ + int argc = 0; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertable(tolua_S,1,"cc.GLProgramState",0,&tolua_err)) goto tolua_lerror; +#endif + + argc = lua_gettop(tolua_S) - 1; + + if (argc == 1) + { + cocos2d::GLProgram* arg0; + ok &= luaval_to_object(tolua_S, 2, "cc.GLProgram",&arg0); + if(!ok) + return 0; + cocos2d::GLProgramState* ret = cocos2d::GLProgramState::getOrCreateWithGLProgram(arg0); + object_to_luaval(tolua_S, "cc.GLProgramState",(cocos2d::GLProgramState*)ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d\n ", "cc.GLProgramState:getOrCreateWithGLProgram",argc, 1); + return 0; +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgramState_getOrCreateWithGLProgram'.",&tolua_err); +#endif + return 0; +} +static int lua_cocos2dx_GLProgramState_finalize(lua_State* tolua_S) +{ + printf("luabindings: finalizing LUA object (GLProgramState)"); + return 0; +} + +int lua_register_cocos2dx_GLProgramState(lua_State* tolua_S) +{ + tolua_usertype(tolua_S,"cc.GLProgramState"); + tolua_cclass(tolua_S,"GLProgramState","cc.GLProgramState","cc.Ref",nullptr); + + tolua_beginmodule(tolua_S,"GLProgramState"); + tolua_function(tolua_S,"setUniformTexture",lua_cocos2dx_GLProgramState_setUniformTexture); + tolua_function(tolua_S,"setUniformMat4",lua_cocos2dx_GLProgramState_setUniformMat4); + tolua_function(tolua_S,"applyUniforms",lua_cocos2dx_GLProgramState_applyUniforms); + tolua_function(tolua_S,"applyGLProgram",lua_cocos2dx_GLProgramState_applyGLProgram); + tolua_function(tolua_S,"getUniformCount",lua_cocos2dx_GLProgramState_getUniformCount); + tolua_function(tolua_S,"applyAttributes",lua_cocos2dx_GLProgramState_applyAttributes); + tolua_function(tolua_S,"setUniformFloat",lua_cocos2dx_GLProgramState_setUniformFloat); + tolua_function(tolua_S,"setUniformVec3",lua_cocos2dx_GLProgramState_setUniformVec3); + tolua_function(tolua_S,"setUniformInt",lua_cocos2dx_GLProgramState_setUniformInt); + tolua_function(tolua_S,"getVertexAttribCount",lua_cocos2dx_GLProgramState_getVertexAttribCount); + tolua_function(tolua_S,"setUniformVec4",lua_cocos2dx_GLProgramState_setUniformVec4); + tolua_function(tolua_S,"setGLProgram",lua_cocos2dx_GLProgramState_setGLProgram); + tolua_function(tolua_S,"setUniformVec2",lua_cocos2dx_GLProgramState_setUniformVec2); + tolua_function(tolua_S,"getVertexAttribsFlags",lua_cocos2dx_GLProgramState_getVertexAttribsFlags); + tolua_function(tolua_S,"apply",lua_cocos2dx_GLProgramState_apply); + tolua_function(tolua_S,"getGLProgram",lua_cocos2dx_GLProgramState_getGLProgram); + tolua_function(tolua_S,"create", lua_cocos2dx_GLProgramState_create); + tolua_function(tolua_S,"getOrCreateWithGLProgramName", lua_cocos2dx_GLProgramState_getOrCreateWithGLProgramName); + tolua_function(tolua_S,"getOrCreateWithGLProgram", lua_cocos2dx_GLProgramState_getOrCreateWithGLProgram); + tolua_endmodule(tolua_S); + std::string typeName = typeid(cocos2d::GLProgramState).name(); + g_luaType[typeName] = "cc.GLProgramState"; + g_typeCast["GLProgramState"] = "cc.GLProgramState"; + return 1; +} + +int lua_cocos2dx_AtlasNode_updateAtlasValues(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::AtlasNode* 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.AtlasNode",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::AtlasNode*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_AtlasNode_updateAtlasValues'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + return 0; + cobj->updateAtlasValues(); + return 0; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.AtlasNode:updateAtlasValues",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_AtlasNode_updateAtlasValues'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_AtlasNode_getTexture(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::AtlasNode* 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.AtlasNode",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::AtlasNode*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_AtlasNode_getTexture'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + return 0; + cocos2d::Texture2D* ret = cobj->getTexture(); + object_to_luaval(tolua_S, "cc.Texture2D",(cocos2d::Texture2D*)ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.AtlasNode:getTexture",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_AtlasNode_getTexture'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_AtlasNode_setTextureAtlas(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::AtlasNode* 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.AtlasNode",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::AtlasNode*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_AtlasNode_setTextureAtlas'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + cocos2d::TextureAtlas* arg0; + + ok &= luaval_to_object(tolua_S, 2, "cc.TextureAtlas",&arg0); + if(!ok) + return 0; + cobj->setTextureAtlas(arg0); + return 0; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.AtlasNode:setTextureAtlas",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_AtlasNode_setTextureAtlas'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_AtlasNode_getTextureAtlas(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::AtlasNode* 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.AtlasNode",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::AtlasNode*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_AtlasNode_getTextureAtlas'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + return 0; + cocos2d::TextureAtlas* ret = cobj->getTextureAtlas(); + object_to_luaval(tolua_S, "cc.TextureAtlas",(cocos2d::TextureAtlas*)ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.AtlasNode:getTextureAtlas",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_AtlasNode_getTextureAtlas'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_AtlasNode_getQuadsToDraw(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::AtlasNode* 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.AtlasNode",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::AtlasNode*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_AtlasNode_getQuadsToDraw'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + return 0; + ssize_t ret = cobj->getQuadsToDraw(); + tolua_pushnumber(tolua_S,(lua_Number)ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.AtlasNode:getQuadsToDraw",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_AtlasNode_getQuadsToDraw'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_AtlasNode_setTexture(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::AtlasNode* 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.AtlasNode",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::AtlasNode*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_AtlasNode_setTexture'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + cocos2d::Texture2D* arg0; + + ok &= luaval_to_object(tolua_S, 2, "cc.Texture2D",&arg0); + if(!ok) + return 0; + cobj->setTexture(arg0); + return 0; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.AtlasNode:setTexture",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_AtlasNode_setTexture'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_AtlasNode_setQuadsToDraw(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::AtlasNode* 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.AtlasNode",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::AtlasNode*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_AtlasNode_setQuadsToDraw'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + ssize_t arg0; + + ok &= luaval_to_ssize(tolua_S, 2, &arg0, "cc.AtlasNode:setQuadsToDraw"); + if(!ok) + return 0; + cobj->setQuadsToDraw(arg0); + return 0; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.AtlasNode:setQuadsToDraw",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_AtlasNode_setQuadsToDraw'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_AtlasNode_create(lua_State* tolua_S) +{ + int argc = 0; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertable(tolua_S,1,"cc.AtlasNode",0,&tolua_err)) goto tolua_lerror; +#endif + + argc = lua_gettop(tolua_S) - 1; + + if (argc == 4) + { + std::string arg0; + int arg1; + int arg2; + int arg3; + ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.AtlasNode:create"); + ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1, "cc.AtlasNode:create"); + ok &= luaval_to_int32(tolua_S, 4,(int *)&arg2, "cc.AtlasNode:create"); + ok &= luaval_to_int32(tolua_S, 5,(int *)&arg3, "cc.AtlasNode:create"); + if(!ok) + return 0; + cocos2d::AtlasNode* ret = cocos2d::AtlasNode::create(arg0, arg1, arg2, arg3); + object_to_luaval(tolua_S, "cc.AtlasNode",(cocos2d::AtlasNode*)ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d\n ", "cc.AtlasNode:create",argc, 4); + return 0; +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_AtlasNode_create'.",&tolua_err); +#endif + return 0; +} +static int lua_cocos2dx_AtlasNode_finalize(lua_State* tolua_S) +{ + printf("luabindings: finalizing LUA object (AtlasNode)"); + return 0; +} + +int lua_register_cocos2dx_AtlasNode(lua_State* tolua_S) +{ + tolua_usertype(tolua_S,"cc.AtlasNode"); + tolua_cclass(tolua_S,"AtlasNode","cc.AtlasNode","cc.Node",nullptr); + + tolua_beginmodule(tolua_S,"AtlasNode"); + tolua_function(tolua_S,"updateAtlasValues",lua_cocos2dx_AtlasNode_updateAtlasValues); + tolua_function(tolua_S,"getTexture",lua_cocos2dx_AtlasNode_getTexture); + tolua_function(tolua_S,"setTextureAtlas",lua_cocos2dx_AtlasNode_setTextureAtlas); + tolua_function(tolua_S,"getTextureAtlas",lua_cocos2dx_AtlasNode_getTextureAtlas); + tolua_function(tolua_S,"getQuadsToDraw",lua_cocos2dx_AtlasNode_getQuadsToDraw); + tolua_function(tolua_S,"setTexture",lua_cocos2dx_AtlasNode_setTexture); + tolua_function(tolua_S,"setQuadsToDraw",lua_cocos2dx_AtlasNode_setQuadsToDraw); + tolua_function(tolua_S,"create", lua_cocos2dx_AtlasNode_create); + tolua_endmodule(tolua_S); + std::string typeName = typeid(cocos2d::AtlasNode).name(); + g_luaType[typeName] = "cc.AtlasNode"; + g_typeCast["AtlasNode"] = "cc.AtlasNode"; + return 1; +} + int lua_cocos2dx_DrawNode_drawQuadraticBezier(lua_State* tolua_S) { int argc = 0; @@ -34212,10 +33879,10 @@ int lua_register_cocos2dx_DrawNode(lua_State* tolua_S) return 1; } -int lua_cocos2dx_GLProgram_getFragmentShaderLog(lua_State* tolua_S) +int lua_cocos2dx_LabelAtlas_setString(lua_State* tolua_S) { int argc = 0; - cocos2d::GLProgram* cobj = nullptr; + cocos2d::LabelAtlas* cobj = nullptr; bool ok = true; #if COCOS2D_DEBUG >= 1 @@ -34224,479 +33891,15 @@ int lua_cocos2dx_GLProgram_getFragmentShaderLog(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.GLProgram",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"cc.LabelAtlas",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (cocos2d::GLProgram*)tolua_tousertype(tolua_S,1,0); + cobj = (cocos2d::LabelAtlas*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_GLProgram_getFragmentShaderLog'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 0) - { - if(!ok) - return 0; - std::string ret = cobj->getFragmentShaderLog(); - tolua_pushcppstring(tolua_S,ret); - return 1; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.GLProgram:getFragmentShaderLog",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgram_getFragmentShaderLog'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_GLProgram_initWithByteArrays(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::GLProgram* 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.GLProgram",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::GLProgram*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_GLProgram_initWithByteArrays'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 2) - { - const char* arg0; - const char* arg1; - - std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp, "cc.GLProgram:initWithByteArrays"); arg0 = arg0_tmp.c_str(); - - std::string arg1_tmp; ok &= luaval_to_std_string(tolua_S, 3, &arg1_tmp, "cc.GLProgram:initWithByteArrays"); arg1 = arg1_tmp.c_str(); - if(!ok) - return 0; - bool ret = cobj->initWithByteArrays(arg0, arg1); - tolua_pushboolean(tolua_S,(bool)ret); - return 1; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.GLProgram:initWithByteArrays",argc, 2); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgram_initWithByteArrays'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_GLProgram_initWithFilenames(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::GLProgram* 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.GLProgram",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::GLProgram*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_GLProgram_initWithFilenames'", 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.GLProgram:initWithFilenames"); - - ok &= luaval_to_std_string(tolua_S, 3,&arg1, "cc.GLProgram:initWithFilenames"); - if(!ok) - return 0; - bool ret = cobj->initWithFilenames(arg0, arg1); - tolua_pushboolean(tolua_S,(bool)ret); - return 1; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.GLProgram:initWithFilenames",argc, 2); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgram_initWithFilenames'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_GLProgram_use(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::GLProgram* 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.GLProgram",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::GLProgram*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_GLProgram_use'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 0) - { - if(!ok) - return 0; - cobj->use(); - return 0; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.GLProgram:use",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgram_use'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_GLProgram_getVertexShaderLog(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::GLProgram* 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.GLProgram",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::GLProgram*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_GLProgram_getVertexShaderLog'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 0) - { - if(!ok) - return 0; - std::string ret = cobj->getVertexShaderLog(); - tolua_pushcppstring(tolua_S,ret); - return 1; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.GLProgram:getVertexShaderLog",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgram_getVertexShaderLog'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_GLProgram_setUniformsForBuiltins(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::GLProgram* 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.GLProgram",0,&tolua_err)) goto tolua_lerror; -#endif - cobj = (cocos2d::GLProgram*)tolua_tousertype(tolua_S,1,0); -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_GLProgram_setUniformsForBuiltins'", nullptr); - return 0; - } -#endif - argc = lua_gettop(tolua_S)-1; - do{ - if (argc == 1) { - cocos2d::Mat4 arg0; - ok &= luaval_to_mat4(tolua_S, 2, &arg0, "cc.GLProgram:setUniformsForBuiltins"); - - if (!ok) { break; } - cobj->setUniformsForBuiltins(arg0); - return 0; - } - }while(0); - ok = true; - do{ - if (argc == 0) { - cobj->setUniformsForBuiltins(); - return 0; - } - }while(0); - ok = true; - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.GLProgram:setUniformsForBuiltins",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgram_setUniformsForBuiltins'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_GLProgram_updateUniforms(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::GLProgram* 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.GLProgram",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::GLProgram*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_GLProgram_updateUniforms'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 0) - { - if(!ok) - return 0; - cobj->updateUniforms(); - return 0; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.GLProgram:updateUniforms",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgram_updateUniforms'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_GLProgram_setUniformLocationWith1i(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::GLProgram* 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.GLProgram",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::GLProgram*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_GLProgram_setUniformLocationWith1i'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 2) - { - int arg0; - int arg1; - - ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "cc.GLProgram:setUniformLocationWith1i"); - - ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1, "cc.GLProgram:setUniformLocationWith1i"); - if(!ok) - return 0; - cobj->setUniformLocationWith1i(arg0, arg1); - return 0; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.GLProgram:setUniformLocationWith1i",argc, 2); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgram_setUniformLocationWith1i'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_GLProgram_reset(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::GLProgram* 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.GLProgram",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::GLProgram*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_GLProgram_reset'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 0) - { - if(!ok) - return 0; - cobj->reset(); - return 0; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.GLProgram:reset",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgram_reset'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_GLProgram_bindAttribLocation(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::GLProgram* 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.GLProgram",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::GLProgram*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_GLProgram_bindAttribLocation'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 2) - { - std::string arg0; - unsigned int arg1; - - ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.GLProgram:bindAttribLocation"); - - ok &= luaval_to_uint32(tolua_S, 3,&arg1, "cc.GLProgram:bindAttribLocation"); - if(!ok) - return 0; - cobj->bindAttribLocation(arg0, arg1); - return 0; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.GLProgram:bindAttribLocation",argc, 2); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgram_bindAttribLocation'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_GLProgram_getAttribLocation(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::GLProgram* 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.GLProgram",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::GLProgram*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_GLProgram_getAttribLocation'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_LabelAtlas_setString'", nullptr); return 0; } #endif @@ -34706,27 +33909,129 @@ int lua_cocos2dx_GLProgram_getAttribLocation(lua_State* tolua_S) { std::string arg0; - ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.GLProgram:getAttribLocation"); + ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.LabelAtlas:setString"); if(!ok) return 0; - int ret = cobj->getAttribLocation(arg0); - tolua_pushnumber(tolua_S,(lua_Number)ret); - return 1; + cobj->setString(arg0); + return 0; } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.GLProgram:getAttribLocation",argc, 1); + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.LabelAtlas:setString",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgram_getAttribLocation'.",&tolua_err); + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_LabelAtlas_setString'.",&tolua_err); #endif return 0; } -int lua_cocos2dx_GLProgram_link(lua_State* tolua_S) +int lua_cocos2dx_LabelAtlas_initWithString(lua_State* tolua_S) { int argc = 0; - cocos2d::GLProgram* cobj = nullptr; + cocos2d::LabelAtlas* 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.LabelAtlas",0,&tolua_err)) goto tolua_lerror; +#endif + cobj = (cocos2d::LabelAtlas*)tolua_tousertype(tolua_S,1,0); +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_LabelAtlas_initWithString'", nullptr); + return 0; + } +#endif + argc = lua_gettop(tolua_S)-1; + do{ + if (argc == 2) { + std::string arg0; + ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.LabelAtlas:initWithString"); + + if (!ok) { break; } + std::string arg1; + ok &= luaval_to_std_string(tolua_S, 3,&arg1, "cc.LabelAtlas:initWithString"); + + if (!ok) { break; } + bool ret = cobj->initWithString(arg0, arg1); + tolua_pushboolean(tolua_S,(bool)ret); + return 1; + } + }while(0); + ok = true; + do{ + if (argc == 5) { + std::string arg0; + ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.LabelAtlas:initWithString"); + + if (!ok) { break; } + std::string arg1; + ok &= luaval_to_std_string(tolua_S, 3,&arg1, "cc.LabelAtlas:initWithString"); + + if (!ok) { break; } + int arg2; + ok &= luaval_to_int32(tolua_S, 4,(int *)&arg2, "cc.LabelAtlas:initWithString"); + + if (!ok) { break; } + int arg3; + ok &= luaval_to_int32(tolua_S, 5,(int *)&arg3, "cc.LabelAtlas:initWithString"); + + if (!ok) { break; } + int arg4; + ok &= luaval_to_int32(tolua_S, 6,(int *)&arg4, "cc.LabelAtlas:initWithString"); + + if (!ok) { break; } + bool ret = cobj->initWithString(arg0, arg1, arg2, arg3, arg4); + tolua_pushboolean(tolua_S,(bool)ret); + return 1; + } + }while(0); + ok = true; + do{ + if (argc == 5) { + std::string arg0; + ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.LabelAtlas:initWithString"); + + if (!ok) { break; } + cocos2d::Texture2D* arg1; + ok &= luaval_to_object(tolua_S, 3, "cc.Texture2D",&arg1); + + if (!ok) { break; } + int arg2; + ok &= luaval_to_int32(tolua_S, 4,(int *)&arg2, "cc.LabelAtlas:initWithString"); + + if (!ok) { break; } + int arg3; + ok &= luaval_to_int32(tolua_S, 5,(int *)&arg3, "cc.LabelAtlas:initWithString"); + + if (!ok) { break; } + int arg4; + ok &= luaval_to_int32(tolua_S, 6,(int *)&arg4, "cc.LabelAtlas:initWithString"); + + if (!ok) { break; } + bool ret = cobj->initWithString(arg0, arg1, arg2, arg3, arg4); + tolua_pushboolean(tolua_S,(bool)ret); + return 1; + } + }while(0); + ok = true; + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.LabelAtlas:initWithString",argc, 5); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_LabelAtlas_initWithString'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_LabelAtlas_updateAtlasValues(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::LabelAtlas* cobj = nullptr; bool ok = true; #if COCOS2D_DEBUG >= 1 @@ -34735,15 +34040,15 @@ int lua_cocos2dx_GLProgram_link(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.GLProgram",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"cc.LabelAtlas",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (cocos2d::GLProgram*)tolua_tousertype(tolua_S,1,0); + cobj = (cocos2d::LabelAtlas*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_GLProgram_link'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_LabelAtlas_updateAtlasValues'", nullptr); return 0; } #endif @@ -34753,155 +34058,157 @@ int lua_cocos2dx_GLProgram_link(lua_State* tolua_S) { if(!ok) return 0; - bool ret = cobj->link(); - tolua_pushboolean(tolua_S,(bool)ret); - return 1; + cobj->updateAtlasValues(); + return 0; } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.GLProgram:link",argc, 0); + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.LabelAtlas:updateAtlasValues",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgram_link'.",&tolua_err); + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_LabelAtlas_updateAtlasValues'.",&tolua_err); #endif return 0; } -int lua_cocos2dx_GLProgram_createWithByteArrays(lua_State* tolua_S) +int lua_cocos2dx_LabelAtlas_getString(lua_State* tolua_S) { int argc = 0; + cocos2d::LabelAtlas* cobj = nullptr; bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; #endif + #if COCOS2D_DEBUG >= 1 - if (!tolua_isusertable(tolua_S,1,"cc.GLProgram",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"cc.LabelAtlas",0,&tolua_err)) goto tolua_lerror; #endif - argc = lua_gettop(tolua_S) - 1; + cobj = (cocos2d::LabelAtlas*)tolua_tousertype(tolua_S,1,0); - if (argc == 2) +#if COCOS2D_DEBUG >= 1 + if (!cobj) { - const char* arg0; - const char* arg1; - std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp, "cc.GLProgram:createWithByteArrays"); arg0 = arg0_tmp.c_str(); - std::string arg1_tmp; ok &= luaval_to_std_string(tolua_S, 3, &arg1_tmp, "cc.GLProgram:createWithByteArrays"); arg1 = arg1_tmp.c_str(); - if(!ok) - return 0; - cocos2d::GLProgram* ret = cocos2d::GLProgram::createWithByteArrays(arg0, arg1); - object_to_luaval(tolua_S, "cc.GLProgram",(cocos2d::GLProgram*)ret); - return 1; + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_LabelAtlas_getString'", nullptr); + return 0; } - CCLOG("%s has wrong number of arguments: %d, was expecting %d\n ", "cc.GLProgram:createWithByteArrays",argc, 2); - return 0; -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgram_createWithByteArrays'.",&tolua_err); #endif - return 0; -} -int lua_cocos2dx_GLProgram_createWithFilenames(lua_State* tolua_S) -{ - int argc = 0; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertable(tolua_S,1,"cc.GLProgram",0,&tolua_err)) goto tolua_lerror; -#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.GLProgram:createWithFilenames"); - ok &= luaval_to_std_string(tolua_S, 3,&arg1, "cc.GLProgram:createWithFilenames"); - if(!ok) - return 0; - cocos2d::GLProgram* ret = cocos2d::GLProgram::createWithFilenames(arg0, arg1); - object_to_luaval(tolua_S, "cc.GLProgram",(cocos2d::GLProgram*)ret); - return 1; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d\n ", "cc.GLProgram:createWithFilenames",argc, 2); - return 0; -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgram_createWithFilenames'.",&tolua_err); -#endif - return 0; -} -int lua_cocos2dx_GLProgram_constructor(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::GLProgram* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - argc = lua_gettop(tolua_S)-1; if (argc == 0) { if(!ok) return 0; - cobj = new cocos2d::GLProgram(); - cobj->autorelease(); - int ID = (int)cobj->_ID ; - int* luaID = &cobj->_luaID ; - toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)cobj,"cc.GLProgram"); + const std::string& ret = cobj->getString(); + tolua_pushcppstring(tolua_S,ret); return 1; } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.GLProgram:GLProgram",argc, 0); + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.LabelAtlas:getString",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgram_constructor'.",&tolua_err); + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_LabelAtlas_getString'.",&tolua_err); #endif return 0; } - -static int lua_cocos2dx_GLProgram_finalize(lua_State* tolua_S) +int lua_cocos2dx_LabelAtlas_create(lua_State* tolua_S) { - printf("luabindings: finalizing LUA object (GLProgram)"); + int argc = 0; + bool ok = true; +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertable(tolua_S,1,"cc.LabelAtlas",0,&tolua_err)) goto tolua_lerror; +#endif + + argc = lua_gettop(tolua_S)-1; + + do + { + if (argc == 5) + { + std::string arg0; + ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.LabelAtlas:create"); + if (!ok) { break; } + std::string arg1; + ok &= luaval_to_std_string(tolua_S, 3,&arg1, "cc.LabelAtlas:create"); + if (!ok) { break; } + int arg2; + ok &= luaval_to_int32(tolua_S, 4,(int *)&arg2, "cc.LabelAtlas:create"); + if (!ok) { break; } + int arg3; + ok &= luaval_to_int32(tolua_S, 5,(int *)&arg3, "cc.LabelAtlas:create"); + if (!ok) { break; } + int arg4; + ok &= luaval_to_int32(tolua_S, 6,(int *)&arg4, "cc.LabelAtlas:create"); + if (!ok) { break; } + cocos2d::LabelAtlas* ret = cocos2d::LabelAtlas::create(arg0, arg1, arg2, arg3, arg4); + object_to_luaval(tolua_S, "cc.LabelAtlas",(cocos2d::LabelAtlas*)ret); + return 1; + } + } while (0); + ok = true; + do + { + if (argc == 0) + { + cocos2d::LabelAtlas* ret = cocos2d::LabelAtlas::create(); + object_to_luaval(tolua_S, "cc.LabelAtlas",(cocos2d::LabelAtlas*)ret); + return 1; + } + } while (0); + ok = true; + do + { + if (argc == 2) + { + std::string arg0; + ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.LabelAtlas:create"); + if (!ok) { break; } + std::string arg1; + ok &= luaval_to_std_string(tolua_S, 3,&arg1, "cc.LabelAtlas:create"); + if (!ok) { break; } + cocos2d::LabelAtlas* ret = cocos2d::LabelAtlas::create(arg0, arg1); + object_to_luaval(tolua_S, "cc.LabelAtlas",(cocos2d::LabelAtlas*)ret); + return 1; + } + } while (0); + ok = true; + CCLOG("%s has wrong number of arguments: %d, was expecting %d", "cc.LabelAtlas:create",argc, 2); + return 0; +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_LabelAtlas_create'.",&tolua_err); +#endif + return 0; +} +static int lua_cocos2dx_LabelAtlas_finalize(lua_State* tolua_S) +{ + printf("luabindings: finalizing LUA object (LabelAtlas)"); return 0; } -int lua_register_cocos2dx_GLProgram(lua_State* tolua_S) +int lua_register_cocos2dx_LabelAtlas(lua_State* tolua_S) { - tolua_usertype(tolua_S,"cc.GLProgram"); - tolua_cclass(tolua_S,"GLProgram","cc.GLProgram","cc.Ref",nullptr); + tolua_usertype(tolua_S,"cc.LabelAtlas"); + tolua_cclass(tolua_S,"LabelAtlas","cc.LabelAtlas","cc.AtlasNode",nullptr); - tolua_beginmodule(tolua_S,"GLProgram"); - tolua_function(tolua_S,"new",lua_cocos2dx_GLProgram_constructor); - tolua_function(tolua_S,"getFragmentShaderLog",lua_cocos2dx_GLProgram_getFragmentShaderLog); - tolua_function(tolua_S,"initWithByteArrays",lua_cocos2dx_GLProgram_initWithByteArrays); - tolua_function(tolua_S,"initWithFilenames",lua_cocos2dx_GLProgram_initWithFilenames); - tolua_function(tolua_S,"use",lua_cocos2dx_GLProgram_use); - tolua_function(tolua_S,"getVertexShaderLog",lua_cocos2dx_GLProgram_getVertexShaderLog); - tolua_function(tolua_S,"setUniformsForBuiltins",lua_cocos2dx_GLProgram_setUniformsForBuiltins); - tolua_function(tolua_S,"updateUniforms",lua_cocos2dx_GLProgram_updateUniforms); - tolua_function(tolua_S,"setUniformLocationI32",lua_cocos2dx_GLProgram_setUniformLocationWith1i); - tolua_function(tolua_S,"reset",lua_cocos2dx_GLProgram_reset); - tolua_function(tolua_S,"bindAttribLocation",lua_cocos2dx_GLProgram_bindAttribLocation); - tolua_function(tolua_S,"getAttribLocation",lua_cocos2dx_GLProgram_getAttribLocation); - tolua_function(tolua_S,"link",lua_cocos2dx_GLProgram_link); - tolua_function(tolua_S,"createWithByteArrays", lua_cocos2dx_GLProgram_createWithByteArrays); - tolua_function(tolua_S,"createWithFilenames", lua_cocos2dx_GLProgram_createWithFilenames); + tolua_beginmodule(tolua_S,"LabelAtlas"); + tolua_function(tolua_S,"setString",lua_cocos2dx_LabelAtlas_setString); + tolua_function(tolua_S,"initWithString",lua_cocos2dx_LabelAtlas_initWithString); + tolua_function(tolua_S,"updateAtlasValues",lua_cocos2dx_LabelAtlas_updateAtlasValues); + tolua_function(tolua_S,"getString",lua_cocos2dx_LabelAtlas_getString); + tolua_function(tolua_S,"_create", lua_cocos2dx_LabelAtlas_create); tolua_endmodule(tolua_S); - std::string typeName = typeid(cocos2d::GLProgram).name(); - g_luaType[typeName] = "cc.GLProgram"; - g_typeCast["GLProgram"] = "cc.GLProgram"; + std::string typeName = typeid(cocos2d::LabelAtlas).name(); + g_luaType[typeName] = "cc.LabelAtlas"; + g_typeCast["LabelAtlas"] = "cc.LabelAtlas"; return 1; } @@ -45140,6 +44447,618 @@ int lua_register_cocos2dx_MotionStreak(lua_State* tolua_S) return 1; } +int lua_cocos2dx_ProgressTimer_isReverseDirection(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::ProgressTimer* 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.ProgressTimer",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::ProgressTimer*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ProgressTimer_isReverseDirection'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + return 0; + bool ret = cobj->isReverseDirection(); + tolua_pushboolean(tolua_S,(bool)ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.ProgressTimer:isReverseDirection",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ProgressTimer_isReverseDirection'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_ProgressTimer_setBarChangeRate(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::ProgressTimer* 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.ProgressTimer",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::ProgressTimer*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ProgressTimer_setBarChangeRate'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + cocos2d::Vec2 arg0; + + ok &= luaval_to_vec2(tolua_S, 2, &arg0, "cc.ProgressTimer:setBarChangeRate"); + if(!ok) + return 0; + cobj->setBarChangeRate(arg0); + return 0; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.ProgressTimer:setBarChangeRate",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ProgressTimer_setBarChangeRate'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_ProgressTimer_getPercentage(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::ProgressTimer* 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.ProgressTimer",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::ProgressTimer*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ProgressTimer_getPercentage'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + return 0; + double ret = cobj->getPercentage(); + tolua_pushnumber(tolua_S,(lua_Number)ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.ProgressTimer:getPercentage",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ProgressTimer_getPercentage'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_ProgressTimer_setSprite(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::ProgressTimer* 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.ProgressTimer",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::ProgressTimer*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ProgressTimer_setSprite'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + cocos2d::Sprite* arg0; + + ok &= luaval_to_object(tolua_S, 2, "cc.Sprite",&arg0); + if(!ok) + return 0; + cobj->setSprite(arg0); + return 0; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.ProgressTimer:setSprite",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ProgressTimer_setSprite'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_ProgressTimer_getType(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::ProgressTimer* 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.ProgressTimer",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::ProgressTimer*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ProgressTimer_getType'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + return 0; + int ret = (int)cobj->getType(); + tolua_pushnumber(tolua_S,(lua_Number)ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.ProgressTimer:getType",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ProgressTimer_getType'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_ProgressTimer_getSprite(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::ProgressTimer* 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.ProgressTimer",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::ProgressTimer*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ProgressTimer_getSprite'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + return 0; + cocos2d::Sprite* ret = cobj->getSprite(); + object_to_luaval(tolua_S, "cc.Sprite",(cocos2d::Sprite*)ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.ProgressTimer:getSprite",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ProgressTimer_getSprite'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_ProgressTimer_setMidpoint(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::ProgressTimer* 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.ProgressTimer",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::ProgressTimer*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ProgressTimer_setMidpoint'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + cocos2d::Vec2 arg0; + + ok &= luaval_to_vec2(tolua_S, 2, &arg0, "cc.ProgressTimer:setMidpoint"); + if(!ok) + return 0; + cobj->setMidpoint(arg0); + return 0; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.ProgressTimer:setMidpoint",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ProgressTimer_setMidpoint'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_ProgressTimer_getBarChangeRate(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::ProgressTimer* 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.ProgressTimer",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::ProgressTimer*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ProgressTimer_getBarChangeRate'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + return 0; + cocos2d::Vec2 ret = cobj->getBarChangeRate(); + vec2_to_luaval(tolua_S, ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.ProgressTimer:getBarChangeRate",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ProgressTimer_getBarChangeRate'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_ProgressTimer_setReverseDirection(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::ProgressTimer* 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.ProgressTimer",0,&tolua_err)) goto tolua_lerror; +#endif + cobj = (cocos2d::ProgressTimer*)tolua_tousertype(tolua_S,1,0); +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ProgressTimer_setReverseDirection'", nullptr); + return 0; + } +#endif + argc = lua_gettop(tolua_S)-1; + do{ + if (argc == 1) { + bool arg0; + ok &= luaval_to_boolean(tolua_S, 2,&arg0, "cc.ProgressTimer:setReverseDirection"); + + if (!ok) { break; } + cobj->setReverseDirection(arg0); + return 0; + } + }while(0); + ok = true; + do{ + if (argc == 1) { + bool arg0; + ok &= luaval_to_boolean(tolua_S, 2,&arg0, "cc.ProgressTimer:setReverseDirection"); + + if (!ok) { break; } + cobj->setReverseProgress(arg0); + return 0; + } + }while(0); + ok = true; + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.ProgressTimer:setReverseProgress",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ProgressTimer_setReverseDirection'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_ProgressTimer_getMidpoint(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::ProgressTimer* 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.ProgressTimer",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::ProgressTimer*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ProgressTimer_getMidpoint'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + return 0; + cocos2d::Vec2 ret = cobj->getMidpoint(); + vec2_to_luaval(tolua_S, ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.ProgressTimer:getMidpoint",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ProgressTimer_getMidpoint'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_ProgressTimer_setPercentage(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::ProgressTimer* 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.ProgressTimer",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::ProgressTimer*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ProgressTimer_setPercentage'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + double arg0; + + ok &= luaval_to_number(tolua_S, 2,&arg0, "cc.ProgressTimer:setPercentage"); + if(!ok) + return 0; + cobj->setPercentage(arg0); + return 0; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.ProgressTimer:setPercentage",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ProgressTimer_setPercentage'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_ProgressTimer_setType(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::ProgressTimer* 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.ProgressTimer",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::ProgressTimer*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ProgressTimer_setType'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + cocos2d::ProgressTimer::Type arg0; + + ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "cc.ProgressTimer:setType"); + if(!ok) + return 0; + cobj->setType(arg0); + return 0; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.ProgressTimer:setType",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ProgressTimer_setType'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_ProgressTimer_create(lua_State* tolua_S) +{ + int argc = 0; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertable(tolua_S,1,"cc.ProgressTimer",0,&tolua_err)) goto tolua_lerror; +#endif + + argc = lua_gettop(tolua_S) - 1; + + if (argc == 1) + { + cocos2d::Sprite* arg0; + ok &= luaval_to_object(tolua_S, 2, "cc.Sprite",&arg0); + if(!ok) + return 0; + cocos2d::ProgressTimer* ret = cocos2d::ProgressTimer::create(arg0); + object_to_luaval(tolua_S, "cc.ProgressTimer",(cocos2d::ProgressTimer*)ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d\n ", "cc.ProgressTimer:create",argc, 1); + return 0; +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ProgressTimer_create'.",&tolua_err); +#endif + return 0; +} +static int lua_cocos2dx_ProgressTimer_finalize(lua_State* tolua_S) +{ + printf("luabindings: finalizing LUA object (ProgressTimer)"); + return 0; +} + +int lua_register_cocos2dx_ProgressTimer(lua_State* tolua_S) +{ + tolua_usertype(tolua_S,"cc.ProgressTimer"); + tolua_cclass(tolua_S,"ProgressTimer","cc.ProgressTimer","cc.Node",nullptr); + + tolua_beginmodule(tolua_S,"ProgressTimer"); + tolua_function(tolua_S,"isReverseDirection",lua_cocos2dx_ProgressTimer_isReverseDirection); + tolua_function(tolua_S,"setBarChangeRate",lua_cocos2dx_ProgressTimer_setBarChangeRate); + tolua_function(tolua_S,"getPercentage",lua_cocos2dx_ProgressTimer_getPercentage); + tolua_function(tolua_S,"setSprite",lua_cocos2dx_ProgressTimer_setSprite); + tolua_function(tolua_S,"getType",lua_cocos2dx_ProgressTimer_getType); + tolua_function(tolua_S,"getSprite",lua_cocos2dx_ProgressTimer_getSprite); + tolua_function(tolua_S,"setMidpoint",lua_cocos2dx_ProgressTimer_setMidpoint); + tolua_function(tolua_S,"getBarChangeRate",lua_cocos2dx_ProgressTimer_getBarChangeRate); + tolua_function(tolua_S,"setReverseDirection",lua_cocos2dx_ProgressTimer_setReverseDirection); + tolua_function(tolua_S,"getMidpoint",lua_cocos2dx_ProgressTimer_getMidpoint); + tolua_function(tolua_S,"setPercentage",lua_cocos2dx_ProgressTimer_setPercentage); + tolua_function(tolua_S,"setType",lua_cocos2dx_ProgressTimer_setType); + tolua_function(tolua_S,"create", lua_cocos2dx_ProgressTimer_create); + tolua_endmodule(tolua_S); + std::string typeName = typeid(cocos2d::ProgressTimer).name(); + g_luaType[typeName] = "cc.ProgressTimer"; + g_typeCast["ProgressTimer"] = "cc.ProgressTimer"; + return 1; +} + int lua_cocos2dx_Sprite_setSpriteFrame(lua_State* tolua_S) { int argc = 0; @@ -46543,618 +46462,6 @@ int lua_register_cocos2dx_Sprite(lua_State* tolua_S) return 1; } -int lua_cocos2dx_ProgressTimer_isReverseDirection(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::ProgressTimer* 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.ProgressTimer",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::ProgressTimer*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ProgressTimer_isReverseDirection'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 0) - { - if(!ok) - return 0; - bool ret = cobj->isReverseDirection(); - tolua_pushboolean(tolua_S,(bool)ret); - return 1; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.ProgressTimer:isReverseDirection",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ProgressTimer_isReverseDirection'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_ProgressTimer_setBarChangeRate(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::ProgressTimer* 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.ProgressTimer",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::ProgressTimer*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ProgressTimer_setBarChangeRate'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 1) - { - cocos2d::Vec2 arg0; - - ok &= luaval_to_vec2(tolua_S, 2, &arg0, "cc.ProgressTimer:setBarChangeRate"); - if(!ok) - return 0; - cobj->setBarChangeRate(arg0); - return 0; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.ProgressTimer:setBarChangeRate",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ProgressTimer_setBarChangeRate'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_ProgressTimer_getPercentage(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::ProgressTimer* 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.ProgressTimer",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::ProgressTimer*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ProgressTimer_getPercentage'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 0) - { - if(!ok) - return 0; - double ret = cobj->getPercentage(); - tolua_pushnumber(tolua_S,(lua_Number)ret); - return 1; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.ProgressTimer:getPercentage",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ProgressTimer_getPercentage'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_ProgressTimer_setSprite(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::ProgressTimer* 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.ProgressTimer",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::ProgressTimer*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ProgressTimer_setSprite'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 1) - { - cocos2d::Sprite* arg0; - - ok &= luaval_to_object(tolua_S, 2, "cc.Sprite",&arg0); - if(!ok) - return 0; - cobj->setSprite(arg0); - return 0; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.ProgressTimer:setSprite",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ProgressTimer_setSprite'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_ProgressTimer_getType(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::ProgressTimer* 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.ProgressTimer",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::ProgressTimer*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ProgressTimer_getType'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 0) - { - if(!ok) - return 0; - int ret = (int)cobj->getType(); - tolua_pushnumber(tolua_S,(lua_Number)ret); - return 1; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.ProgressTimer:getType",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ProgressTimer_getType'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_ProgressTimer_getSprite(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::ProgressTimer* 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.ProgressTimer",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::ProgressTimer*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ProgressTimer_getSprite'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 0) - { - if(!ok) - return 0; - cocos2d::Sprite* ret = cobj->getSprite(); - object_to_luaval(tolua_S, "cc.Sprite",(cocos2d::Sprite*)ret); - return 1; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.ProgressTimer:getSprite",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ProgressTimer_getSprite'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_ProgressTimer_setMidpoint(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::ProgressTimer* 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.ProgressTimer",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::ProgressTimer*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ProgressTimer_setMidpoint'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 1) - { - cocos2d::Vec2 arg0; - - ok &= luaval_to_vec2(tolua_S, 2, &arg0, "cc.ProgressTimer:setMidpoint"); - if(!ok) - return 0; - cobj->setMidpoint(arg0); - return 0; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.ProgressTimer:setMidpoint",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ProgressTimer_setMidpoint'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_ProgressTimer_getBarChangeRate(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::ProgressTimer* 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.ProgressTimer",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::ProgressTimer*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ProgressTimer_getBarChangeRate'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 0) - { - if(!ok) - return 0; - cocos2d::Vec2 ret = cobj->getBarChangeRate(); - vec2_to_luaval(tolua_S, ret); - return 1; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.ProgressTimer:getBarChangeRate",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ProgressTimer_getBarChangeRate'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_ProgressTimer_setReverseDirection(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::ProgressTimer* 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.ProgressTimer",0,&tolua_err)) goto tolua_lerror; -#endif - cobj = (cocos2d::ProgressTimer*)tolua_tousertype(tolua_S,1,0); -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ProgressTimer_setReverseDirection'", nullptr); - return 0; - } -#endif - argc = lua_gettop(tolua_S)-1; - do{ - if (argc == 1) { - bool arg0; - ok &= luaval_to_boolean(tolua_S, 2,&arg0, "cc.ProgressTimer:setReverseDirection"); - - if (!ok) { break; } - cobj->setReverseDirection(arg0); - return 0; - } - }while(0); - ok = true; - do{ - if (argc == 1) { - bool arg0; - ok &= luaval_to_boolean(tolua_S, 2,&arg0, "cc.ProgressTimer:setReverseDirection"); - - if (!ok) { break; } - cobj->setReverseProgress(arg0); - return 0; - } - }while(0); - ok = true; - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.ProgressTimer:setReverseProgress",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ProgressTimer_setReverseDirection'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_ProgressTimer_getMidpoint(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::ProgressTimer* 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.ProgressTimer",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::ProgressTimer*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ProgressTimer_getMidpoint'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 0) - { - if(!ok) - return 0; - cocos2d::Vec2 ret = cobj->getMidpoint(); - vec2_to_luaval(tolua_S, ret); - return 1; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.ProgressTimer:getMidpoint",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ProgressTimer_getMidpoint'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_ProgressTimer_setPercentage(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::ProgressTimer* 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.ProgressTimer",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::ProgressTimer*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ProgressTimer_setPercentage'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 1) - { - double arg0; - - ok &= luaval_to_number(tolua_S, 2,&arg0, "cc.ProgressTimer:setPercentage"); - if(!ok) - return 0; - cobj->setPercentage(arg0); - return 0; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.ProgressTimer:setPercentage",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ProgressTimer_setPercentage'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_ProgressTimer_setType(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::ProgressTimer* 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.ProgressTimer",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::ProgressTimer*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ProgressTimer_setType'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 1) - { - cocos2d::ProgressTimer::Type arg0; - - ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "cc.ProgressTimer:setType"); - if(!ok) - return 0; - cobj->setType(arg0); - return 0; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.ProgressTimer:setType",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ProgressTimer_setType'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_ProgressTimer_create(lua_State* tolua_S) -{ - int argc = 0; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertable(tolua_S,1,"cc.ProgressTimer",0,&tolua_err)) goto tolua_lerror; -#endif - - argc = lua_gettop(tolua_S) - 1; - - if (argc == 1) - { - cocos2d::Sprite* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Sprite",&arg0); - if(!ok) - return 0; - cocos2d::ProgressTimer* ret = cocos2d::ProgressTimer::create(arg0); - object_to_luaval(tolua_S, "cc.ProgressTimer",(cocos2d::ProgressTimer*)ret); - return 1; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d\n ", "cc.ProgressTimer:create",argc, 1); - return 0; -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ProgressTimer_create'.",&tolua_err); -#endif - return 0; -} -static int lua_cocos2dx_ProgressTimer_finalize(lua_State* tolua_S) -{ - printf("luabindings: finalizing LUA object (ProgressTimer)"); - return 0; -} - -int lua_register_cocos2dx_ProgressTimer(lua_State* tolua_S) -{ - tolua_usertype(tolua_S,"cc.ProgressTimer"); - tolua_cclass(tolua_S,"ProgressTimer","cc.ProgressTimer","cc.Node",nullptr); - - tolua_beginmodule(tolua_S,"ProgressTimer"); - tolua_function(tolua_S,"isReverseDirection",lua_cocos2dx_ProgressTimer_isReverseDirection); - tolua_function(tolua_S,"setBarChangeRate",lua_cocos2dx_ProgressTimer_setBarChangeRate); - tolua_function(tolua_S,"getPercentage",lua_cocos2dx_ProgressTimer_getPercentage); - tolua_function(tolua_S,"setSprite",lua_cocos2dx_ProgressTimer_setSprite); - tolua_function(tolua_S,"getType",lua_cocos2dx_ProgressTimer_getType); - tolua_function(tolua_S,"getSprite",lua_cocos2dx_ProgressTimer_getSprite); - tolua_function(tolua_S,"setMidpoint",lua_cocos2dx_ProgressTimer_setMidpoint); - tolua_function(tolua_S,"getBarChangeRate",lua_cocos2dx_ProgressTimer_getBarChangeRate); - tolua_function(tolua_S,"setReverseDirection",lua_cocos2dx_ProgressTimer_setReverseDirection); - tolua_function(tolua_S,"getMidpoint",lua_cocos2dx_ProgressTimer_getMidpoint); - tolua_function(tolua_S,"setPercentage",lua_cocos2dx_ProgressTimer_setPercentage); - tolua_function(tolua_S,"setType",lua_cocos2dx_ProgressTimer_setType); - tolua_function(tolua_S,"create", lua_cocos2dx_ProgressTimer_create); - tolua_endmodule(tolua_S); - std::string typeName = typeid(cocos2d::ProgressTimer).name(); - g_luaType[typeName] = "cc.ProgressTimer"; - g_typeCast["ProgressTimer"] = "cc.ProgressTimer"; - return 1; -} - int lua_cocos2dx_Image_hasPremultipliedAlpha(lua_State* tolua_S) { int argc = 0; @@ -56761,6 +56068,699 @@ int lua_register_cocos2dx_TiledGrid3D(lua_State* tolua_S) return 1; } +int lua_cocos2dx_GLProgram_getFragmentShaderLog(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::GLProgram* 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.GLProgram",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::GLProgram*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_GLProgram_getFragmentShaderLog'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + return 0; + std::string ret = cobj->getFragmentShaderLog(); + tolua_pushcppstring(tolua_S,ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.GLProgram:getFragmentShaderLog",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgram_getFragmentShaderLog'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_GLProgram_initWithByteArrays(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::GLProgram* 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.GLProgram",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::GLProgram*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_GLProgram_initWithByteArrays'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 2) + { + const char* arg0; + const char* arg1; + + std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp, "cc.GLProgram:initWithByteArrays"); arg0 = arg0_tmp.c_str(); + + std::string arg1_tmp; ok &= luaval_to_std_string(tolua_S, 3, &arg1_tmp, "cc.GLProgram:initWithByteArrays"); arg1 = arg1_tmp.c_str(); + if(!ok) + return 0; + bool ret = cobj->initWithByteArrays(arg0, arg1); + tolua_pushboolean(tolua_S,(bool)ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.GLProgram:initWithByteArrays",argc, 2); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgram_initWithByteArrays'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_GLProgram_initWithFilenames(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::GLProgram* 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.GLProgram",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::GLProgram*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_GLProgram_initWithFilenames'", 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.GLProgram:initWithFilenames"); + + ok &= luaval_to_std_string(tolua_S, 3,&arg1, "cc.GLProgram:initWithFilenames"); + if(!ok) + return 0; + bool ret = cobj->initWithFilenames(arg0, arg1); + tolua_pushboolean(tolua_S,(bool)ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.GLProgram:initWithFilenames",argc, 2); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgram_initWithFilenames'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_GLProgram_use(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::GLProgram* 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.GLProgram",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::GLProgram*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_GLProgram_use'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + return 0; + cobj->use(); + return 0; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.GLProgram:use",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgram_use'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_GLProgram_getVertexShaderLog(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::GLProgram* 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.GLProgram",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::GLProgram*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_GLProgram_getVertexShaderLog'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + return 0; + std::string ret = cobj->getVertexShaderLog(); + tolua_pushcppstring(tolua_S,ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.GLProgram:getVertexShaderLog",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgram_getVertexShaderLog'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_GLProgram_setUniformsForBuiltins(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::GLProgram* 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.GLProgram",0,&tolua_err)) goto tolua_lerror; +#endif + cobj = (cocos2d::GLProgram*)tolua_tousertype(tolua_S,1,0); +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_GLProgram_setUniformsForBuiltins'", nullptr); + return 0; + } +#endif + argc = lua_gettop(tolua_S)-1; + do{ + if (argc == 1) { + cocos2d::Mat4 arg0; + ok &= luaval_to_mat4(tolua_S, 2, &arg0, "cc.GLProgram:setUniformsForBuiltins"); + + if (!ok) { break; } + cobj->setUniformsForBuiltins(arg0); + return 0; + } + }while(0); + ok = true; + do{ + if (argc == 0) { + cobj->setUniformsForBuiltins(); + return 0; + } + }while(0); + ok = true; + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.GLProgram:setUniformsForBuiltins",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgram_setUniformsForBuiltins'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_GLProgram_updateUniforms(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::GLProgram* 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.GLProgram",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::GLProgram*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_GLProgram_updateUniforms'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + return 0; + cobj->updateUniforms(); + return 0; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.GLProgram:updateUniforms",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgram_updateUniforms'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_GLProgram_setUniformLocationWith1i(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::GLProgram* 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.GLProgram",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::GLProgram*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_GLProgram_setUniformLocationWith1i'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 2) + { + int arg0; + int arg1; + + ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "cc.GLProgram:setUniformLocationWith1i"); + + ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1, "cc.GLProgram:setUniformLocationWith1i"); + if(!ok) + return 0; + cobj->setUniformLocationWith1i(arg0, arg1); + return 0; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.GLProgram:setUniformLocationWith1i",argc, 2); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgram_setUniformLocationWith1i'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_GLProgram_reset(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::GLProgram* 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.GLProgram",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::GLProgram*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_GLProgram_reset'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + return 0; + cobj->reset(); + return 0; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.GLProgram:reset",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgram_reset'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_GLProgram_bindAttribLocation(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::GLProgram* 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.GLProgram",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::GLProgram*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_GLProgram_bindAttribLocation'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 2) + { + std::string arg0; + unsigned int arg1; + + ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.GLProgram:bindAttribLocation"); + + ok &= luaval_to_uint32(tolua_S, 3,&arg1, "cc.GLProgram:bindAttribLocation"); + if(!ok) + return 0; + cobj->bindAttribLocation(arg0, arg1); + return 0; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.GLProgram:bindAttribLocation",argc, 2); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgram_bindAttribLocation'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_GLProgram_getAttribLocation(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::GLProgram* 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.GLProgram",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::GLProgram*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_GLProgram_getAttribLocation'", 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.GLProgram:getAttribLocation"); + if(!ok) + return 0; + int ret = cobj->getAttribLocation(arg0); + tolua_pushnumber(tolua_S,(lua_Number)ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.GLProgram:getAttribLocation",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgram_getAttribLocation'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_GLProgram_link(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::GLProgram* 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.GLProgram",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::GLProgram*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_GLProgram_link'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + return 0; + bool ret = cobj->link(); + tolua_pushboolean(tolua_S,(bool)ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.GLProgram:link",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgram_link'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_GLProgram_createWithByteArrays(lua_State* tolua_S) +{ + int argc = 0; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertable(tolua_S,1,"cc.GLProgram",0,&tolua_err)) goto tolua_lerror; +#endif + + argc = lua_gettop(tolua_S) - 1; + + if (argc == 2) + { + const char* arg0; + const char* arg1; + std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp, "cc.GLProgram:createWithByteArrays"); arg0 = arg0_tmp.c_str(); + std::string arg1_tmp; ok &= luaval_to_std_string(tolua_S, 3, &arg1_tmp, "cc.GLProgram:createWithByteArrays"); arg1 = arg1_tmp.c_str(); + if(!ok) + return 0; + cocos2d::GLProgram* ret = cocos2d::GLProgram::createWithByteArrays(arg0, arg1); + object_to_luaval(tolua_S, "cc.GLProgram",(cocos2d::GLProgram*)ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d\n ", "cc.GLProgram:createWithByteArrays",argc, 2); + return 0; +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgram_createWithByteArrays'.",&tolua_err); +#endif + return 0; +} +int lua_cocos2dx_GLProgram_createWithFilenames(lua_State* tolua_S) +{ + int argc = 0; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertable(tolua_S,1,"cc.GLProgram",0,&tolua_err)) goto tolua_lerror; +#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.GLProgram:createWithFilenames"); + ok &= luaval_to_std_string(tolua_S, 3,&arg1, "cc.GLProgram:createWithFilenames"); + if(!ok) + return 0; + cocos2d::GLProgram* ret = cocos2d::GLProgram::createWithFilenames(arg0, arg1); + object_to_luaval(tolua_S, "cc.GLProgram",(cocos2d::GLProgram*)ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d\n ", "cc.GLProgram:createWithFilenames",argc, 2); + return 0; +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgram_createWithFilenames'.",&tolua_err); +#endif + return 0; +} +int lua_cocos2dx_GLProgram_constructor(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::GLProgram* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + return 0; + cobj = new cocos2d::GLProgram(); + cobj->autorelease(); + int ID = (int)cobj->_ID ; + int* luaID = &cobj->_luaID ; + toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)cobj,"cc.GLProgram"); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.GLProgram:GLProgram",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_GLProgram_constructor'.",&tolua_err); +#endif + + return 0; +} + +static int lua_cocos2dx_GLProgram_finalize(lua_State* tolua_S) +{ + printf("luabindings: finalizing LUA object (GLProgram)"); + return 0; +} + +int lua_register_cocos2dx_GLProgram(lua_State* tolua_S) +{ + tolua_usertype(tolua_S,"cc.GLProgram"); + tolua_cclass(tolua_S,"GLProgram","cc.GLProgram","cc.Ref",nullptr); + + tolua_beginmodule(tolua_S,"GLProgram"); + tolua_function(tolua_S,"new",lua_cocos2dx_GLProgram_constructor); + tolua_function(tolua_S,"getFragmentShaderLog",lua_cocos2dx_GLProgram_getFragmentShaderLog); + tolua_function(tolua_S,"initWithByteArrays",lua_cocos2dx_GLProgram_initWithByteArrays); + tolua_function(tolua_S,"initWithFilenames",lua_cocos2dx_GLProgram_initWithFilenames); + tolua_function(tolua_S,"use",lua_cocos2dx_GLProgram_use); + tolua_function(tolua_S,"getVertexShaderLog",lua_cocos2dx_GLProgram_getVertexShaderLog); + tolua_function(tolua_S,"setUniformsForBuiltins",lua_cocos2dx_GLProgram_setUniformsForBuiltins); + tolua_function(tolua_S,"updateUniforms",lua_cocos2dx_GLProgram_updateUniforms); + tolua_function(tolua_S,"setUniformLocationI32",lua_cocos2dx_GLProgram_setUniformLocationWith1i); + tolua_function(tolua_S,"reset",lua_cocos2dx_GLProgram_reset); + tolua_function(tolua_S,"bindAttribLocation",lua_cocos2dx_GLProgram_bindAttribLocation); + tolua_function(tolua_S,"getAttribLocation",lua_cocos2dx_GLProgram_getAttribLocation); + tolua_function(tolua_S,"link",lua_cocos2dx_GLProgram_link); + tolua_function(tolua_S,"createWithByteArrays", lua_cocos2dx_GLProgram_createWithByteArrays); + tolua_function(tolua_S,"createWithFilenames", lua_cocos2dx_GLProgram_createWithFilenames); + tolua_endmodule(tolua_S); + std::string typeName = typeid(cocos2d::GLProgram).name(); + g_luaType[typeName] = "cc.GLProgram"; + g_typeCast["GLProgram"] = "cc.GLProgram"; + return 1; +} + int lua_cocos2dx_GLProgramCache_addGLProgram(lua_State* tolua_S) { int argc = 0; @@ -64711,7 +64711,7 @@ TOLUA_API int register_all_cocos2dx(lua_State* tolua_S) lua_register_cocos2dx_Grid3DAction(tolua_S); lua_register_cocos2dx_FadeTo(tolua_S); lua_register_cocos2dx_FadeIn(tolua_S); - lua_register_cocos2dx_ShakyTiles3D(tolua_S); + lua_register_cocos2dx_GLProgramState(tolua_S); lua_register_cocos2dx_EventListenerCustom(tolua_S); lua_register_cocos2dx_FlipX3D(tolua_S); lua_register_cocos2dx_FlipY3D(tolua_S); @@ -64765,7 +64765,7 @@ TOLUA_API int register_all_cocos2dx(lua_State* tolua_S) lua_register_cocos2dx_RepeatForever(tolua_S); lua_register_cocos2dx_Place(tolua_S); lua_register_cocos2dx_EventListenerAcceleration(tolua_S); - lua_register_cocos2dx_GLProgram(tolua_S); + lua_register_cocos2dx_TiledGrid3D(tolua_S); lua_register_cocos2dx_EaseBounceOut(tolua_S); lua_register_cocos2dx_RenderTexture(tolua_S); lua_register_cocos2dx_TintBy(tolua_S); @@ -64786,7 +64786,7 @@ TOLUA_API int register_all_cocos2dx(lua_State* tolua_S) lua_register_cocos2dx_TMXLayerInfo(tolua_S); lua_register_cocos2dx_EaseSineIn(tolua_S); lua_register_cocos2dx_EaseBounceIn(tolua_S); - lua_register_cocos2dx_TiledGrid3D(tolua_S); + lua_register_cocos2dx_GLProgram(tolua_S); lua_register_cocos2dx_ParticleGalaxy(tolua_S); lua_register_cocos2dx_Twirl(tolua_S); lua_register_cocos2dx_MenuItemLabel(tolua_S); @@ -64830,7 +64830,7 @@ TOLUA_API int register_all_cocos2dx(lua_State* tolua_S) lua_register_cocos2dx_ScaleTo(tolua_S); lua_register_cocos2dx_Spawn(tolua_S); lua_register_cocos2dx_EaseQuarticActionInOut(tolua_S); - lua_register_cocos2dx_GLProgramState(tolua_S); + lua_register_cocos2dx_ShakyTiles3D(tolua_S); lua_register_cocos2dx_PageTurn3D(tolua_S); lua_register_cocos2dx_TransitionSlideInL(tolua_S); lua_register_cocos2dx_TransitionSlideInT(tolua_S); diff --git a/cocos/scripting/lua-bindings/manual/network/lua_xml_http_request.cpp b/cocos/scripting/lua-bindings/manual/network/lua_xml_http_request.cpp index 1056a570ed..35e0626334 100644 --- a/cocos/scripting/lua-bindings/manual/network/lua_xml_http_request.cpp +++ b/cocos/scripting/lua-bindings/manual/network/lua_xml_http_request.cpp @@ -233,7 +233,7 @@ void LuaMinXmlHttpRequest::_sendRequest() free((void*) concatHeader); free((void*) concatenated); - // call back lua function --TODO + // TODO: call back lua function int handler = cocos2d::ScriptHandlerMgr::getInstance()->getObjectHandler((void*)this, cocos2d::ScriptHandlerMgr::HandlerType::XMLHTTPREQUEST_READY_STATE_CHANGE ); if (0 != handler) diff --git a/extensions/GUI/CCControlExtension/CCControlColourPicker.cpp b/extensions/GUI/CCControlExtension/CCControlColourPicker.cpp index bf58314a16..e046e6ae5c 100644 --- a/extensions/GUI/CCControlExtension/CCControlColourPicker.cpp +++ b/extensions/GUI/CCControlExtension/CCControlColourPicker.cpp @@ -119,7 +119,7 @@ ControlColourPicker* ControlColourPicker::create() void ControlColourPicker::setColor(const Color3B& color) { - // XXX fixed me if not correct + // FIXME: fixed me if not correct Control::setColor(color); RGBA rgba; @@ -167,7 +167,7 @@ void ControlColourPicker::hueSliderValueChanged(Ref * sender, Control::EventType // Update the value RGBA rgb = ControlUtils::RGBfromHSV(_hsv); - // XXX fixed me if not correct + // FIXME: fixed me if not correct Control::setColor(Color3B((GLubyte)(rgb.r * 255.0f), (GLubyte)(rgb.g * 255.0f), (GLubyte)(rgb.b * 255.0f))); // Send Control callback @@ -183,7 +183,7 @@ void ControlColourPicker::colourSliderValueChanged(Ref * sender, Control::EventT // Update the value RGBA rgb = ControlUtils::RGBfromHSV(_hsv); - // XXX fixed me if not correct + // FIXME: fixed me if not correct Control::setColor(Color3B((GLubyte)(rgb.r * 255.0f), (GLubyte)(rgb.g * 255.0f), (GLubyte)(rgb.b * 255.0f))); // Send Control callback diff --git a/extensions/GUI/CCEditBox/CCEditBoxImplIOS.mm b/extensions/GUI/CCEditBox/CCEditBoxImplIOS.mm index f2dfe57687..0c0be51a6d 100644 --- a/extensions/GUI/CCEditBox/CCEditBoxImplIOS.mm +++ b/extensions/GUI/CCEditBox/CCEditBoxImplIOS.mm @@ -74,7 +74,8 @@ static const int CC_EDIT_BOX_PADDING = 5; self.textField = [[[CCCustomUITextField alloc] initWithFrame: frameRect] autorelease]; [textField_ setTextColor:[UIColor whiteColor]]; - textField_.font = [UIFont systemFontOfSize:frameRect.size.height*2/3]; //TODO need to delete hard code here. + //TODO: need to delete hard code here. + textField_.font = [UIFont systemFontOfSize:frameRect.size.height*2/3]; textField_.contentVerticalAlignment = UIControlContentVerticalAlignmentCenter; textField_.backgroundColor = [UIColor clearColor]; textField_.borderStyle = UITextBorderStyleNone; @@ -404,7 +405,7 @@ void EditBoxImplIOS::setFontColor(const Color3B& color) void EditBoxImplIOS::setPlaceholderFont(const char* pFontName, int fontSize) { - // TODO need to be implemented. + // TODO: need to be implemented. } void EditBoxImplIOS::setPlaceholderFontColor(const Color3B& color) diff --git a/extensions/GUI/CCEditBox/CCEditBoxImplMac.mm b/extensions/GUI/CCEditBox/CCEditBoxImplMac.mm index 47063b2907..3668a7f134 100644 --- a/extensions/GUI/CCEditBox/CCEditBoxImplMac.mm +++ b/extensions/GUI/CCEditBox/CCEditBoxImplMac.mm @@ -73,7 +73,8 @@ self.textField = [[[NSTextField alloc] initWithFrame:frameRect] autorelease]; self.secureTextField = [[[NSSecureTextField alloc] initWithFrame:frameRect] autorelease]; - NSFont *font = [NSFont systemFontOfSize:frameRect.size.height*2/3]; //TODO need to delete hard code here. + //TODO: need to delete hard code here. + NSFont *font = [NSFont systemFontOfSize:frameRect.size.height*2/3]; textField_.font = font; secureTextField_.font = font; diff --git a/extensions/GUI/CCScrollView/CCTableViewCell.cpp b/extensions/GUI/CCScrollView/CCTableViewCell.cpp index 3222775cbb..149179a347 100644 --- a/extensions/GUI/CCScrollView/CCTableViewCell.cpp +++ b/extensions/GUI/CCScrollView/CCTableViewCell.cpp @@ -24,7 +24,6 @@ ****************************************************************************/ #include "CCTableViewCell.h" -#include "base/ccCArray.h" NS_CC_EXT_BEGIN diff --git a/extensions/assets-manager/AssetsManager.cpp b/extensions/assets-manager/AssetsManager.cpp index bed33101ad..241243199b 100644 --- a/extensions/assets-manager/AssetsManager.cpp +++ b/extensions/assets-manager/AssetsManager.cpp @@ -22,7 +22,6 @@ THE SOFTWARE. ****************************************************************************/ #include "AssetsManager.h" -#include "cocos2d.h" #include #include @@ -37,6 +36,10 @@ #include #endif +#include "base/CCDirector.h" +#include "base/CCScheduler.h" +#include "base/CCUserDefault.h" +#include "platform/CCFileUtils.h" #include "unzip.h" diff --git a/extensions/assets-manager/AssetsManager.h b/extensions/assets-manager/AssetsManager.h index 7032d381a7..f8221883b7 100644 --- a/extensions/assets-manager/AssetsManager.h +++ b/extensions/assets-manager/AssetsManager.h @@ -29,7 +29,7 @@ #include -#include "cocos2d.h" +#include "2d/CCNode.h" #include "extensions/ExtensionMacros.h" #include "extensions/ExtensionExport.h" diff --git a/extensions/physics-nodes/CCPhysicsDebugNode.cpp b/extensions/physics-nodes/CCPhysicsDebugNode.cpp index 0d7d502184..eb4bb84836 100644 --- a/extensions/physics-nodes/CCPhysicsDebugNode.cpp +++ b/extensions/physics-nodes/CCPhysicsDebugNode.cpp @@ -171,7 +171,7 @@ static void DrawConstraint(cpConstraint *constraint, DrawNode *renderer) } else if (klass == cpDampedSpringGetClass()) { - // TODO + // TODO: uninplemented } else { diff --git a/external/chipmunk/src/cpArbiter.c b/external/chipmunk/src/cpArbiter.c index ef6f09809c..9d170ad9e1 100644 --- a/external/chipmunk/src/cpArbiter.c +++ b/external/chipmunk/src/cpArbiter.c @@ -38,7 +38,7 @@ cpContactInit(cpContact *con, cpVect p, cpVect n, cpFloat dist, cpHashValue hash return con; } -// TODO make this generic so I can reuse it for constraints also. +// TODO: make this generic so I can reuse it for constraints also. static inline void unthreadHelper(cpArbiter *arb, cpBody *body) { @@ -309,7 +309,7 @@ cpArbiterApplyCachedImpulse(cpArbiter *arb, cpFloat dt_coef) } } -// TODO is it worth splitting velocity/position correction? +// TODO: is it worth splitting velocity/position correction? void cpArbiterApplyImpulse(cpArbiter *arb) diff --git a/templates/cocos2dx_files.json b/templates/cocos2dx_files.json index 0263e2997e..25d6d414cb 100644 --- a/templates/cocos2dx_files.json +++ b/templates/cocos2dx_files.json @@ -779,6 +779,8 @@ "cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxTypefaces.java", "cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxVideoHelper.java", "cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxVideoView.java", + "cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxWebView.java", + "cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxWebViewHelper.java", "cocos/platform/android/java/src/org/cocos2dx/lib/GameControllerAdapter.java", "cocos/platform/android/java/src/org/cocos2dx/lib/GameControllerDelegate.java", "cocos/platform/android/java/src/org/cocos2dx/lib/GameControllerUtils.java", @@ -1036,6 +1038,14 @@ "cocos/ui/UIVideoPlayer.h", "cocos/ui/UIVideoPlayerAndroid.cpp", "cocos/ui/UIVideoPlayerIOS.mm", + "cocos/ui/UIWebView-inl.h", + "cocos/ui/UIWebView.cpp", + "cocos/ui/UIWebView.h", + "cocos/ui/UIWebView.mm", + "cocos/ui/UIWebViewImpl_android.cpp", + "cocos/ui/UIWebViewImpl_android.h", + "cocos/ui/UIWebViewImpl_iOS.h", + "cocos/ui/UIWebViewImpl_iOS.mm", "cocos/ui/UIWidget.cpp", "cocos/ui/UIWidget.h", "cocos/ui/proj.wp8/libGUI.vcxproj", diff --git a/tests/cpp-tests/Classes/AppDelegate.cpp b/tests/cpp-tests/Classes/AppDelegate.cpp index a35cccdbc2..707872191c 100644 --- a/tests/cpp-tests/Classes/AppDelegate.cpp +++ b/tests/cpp-tests/Classes/AppDelegate.cpp @@ -57,8 +57,8 @@ void AppDelegate::initGLContextAttrs() bool AppDelegate::applicationDidFinishLaunching() { // As an example, load config file - // XXX: This should be loaded before the Director is initialized, - // XXX: but at this point, the director is already initialized + // FIXME:: This should be loaded before the Director is initialized, + // FIXME:: but at this point, the director is already initialized Configuration::getInstance()->loadConfigFile("configs/config-example.plist"); // initialize director diff --git a/tests/cpp-tests/Classes/NewRendererTest/NewRendererTest.cpp b/tests/cpp-tests/Classes/NewRendererTest/NewRendererTest.cpp index 3245ba26b7..719007e2ca 100644 --- a/tests/cpp-tests/Classes/NewRendererTest/NewRendererTest.cpp +++ b/tests/cpp-tests/Classes/NewRendererTest/NewRendererTest.cpp @@ -357,7 +357,7 @@ NewClippingNodeTest::NewClippingNodeTest() clipper->runAction(RepeatForever::create(RotateBy::create(1, 45))); this->addChild(clipper); - //TODO Fix draw node as clip node + // TODO: Fix draw node as clip node // auto stencil = NewDrawNode::create(); // Vec2 rectangle[4]; // rectangle[0] = Vec2(0, 0); diff --git a/tests/cpp-tests/Classes/NodeTest/NodeTest.cpp b/tests/cpp-tests/Classes/NodeTest/NodeTest.cpp index 7ab2d2182d..dc4bad49dd 100644 --- a/tests/cpp-tests/Classes/NodeTest/NodeTest.cpp +++ b/tests/cpp-tests/Classes/NodeTest/NodeTest.cpp @@ -52,8 +52,7 @@ static int sceneIdx = -1; static std::function createFunctions[] = { CL(CameraTest1), - //Camera has been removed from CCNode - //todo add new feature to support it + // TODO: Camera has been removed from CCNode, add new feature to support it // CL(CameraTest2), CL(CameraCenterTest), CL(Test2), @@ -66,8 +65,7 @@ static std::function createFunctions[] = CL(NodeToWorld3D), CL(SchedulerTest1), CL(CameraOrbitTest), - //Camera has been removed from CCNode - //todo add new feature to support it + // TODO: Camera has been removed from CCNode, add new feature to support it //CL(CameraZoomTest), CL(ConvertToNode), CL(NodeOpaqueTest), diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CocosGUIScene.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CocosGUIScene.cpp index 615f472d4d..6905ba7701 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CocosGUIScene.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CocosGUIScene.cpp @@ -51,7 +51,7 @@ g_guisTests[] = UISceneManager* sceneManager = UISceneManager::sharedUISceneManager(); sceneManager->setCurrentUISceneId(KUIFocusTest_HBox); sceneManager->setMinUISceneId(KUIFocusTest_HBox); - //TODO: improve ListView focus + // TODO: improve ListView focus sceneManager->setMaxUISceneId(KUIFocusTest_NestedLayout3); Scene* scene = sceneManager->currentUIScene(); Director::getInstance()->replaceScene(scene); diff --git a/tools/bindings-generator b/tools/bindings-generator index ee16f69272..c1db553615 160000 --- a/tools/bindings-generator +++ b/tools/bindings-generator @@ -1 +1 @@ -Subproject commit ee16f692722f6bbb7d485032751f9b826ec9e926 +Subproject commit c1db553615789a1545d495d0d0fd6f620547f99d diff --git a/tools/cocos2d-console b/tools/cocos2d-console index fb44ec8cf7..305f090f26 160000 --- a/tools/cocos2d-console +++ b/tools/cocos2d-console @@ -1 +1 @@ -Subproject commit fb44ec8cf77f6f51503987c3a1a0964580b5d88f +Subproject commit 305f090f260a0b8766c3fd09a3d4d2072910bfd9