diff --git a/CHANGELOG b/CHANGELOG index d309ef169e..5398d4b2df 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -4,6 +4,7 @@ cocos2d-x-3.5 Mar.23 2015 [FIX] AutoRelasePool: memory leak if adding an element into pool when releasing auto release pool [FIX] FileUtils: getWritablePath() does not return correct writable path on Mac & Windows [FIX] HttpAsynConnection: can not get error content if response code less than 200 or response code greater or equal than 300 + [FIX] HttpResponse: reference count error causes assert error cocos2d-x-3.5rc0 Mar.13 2015 [NEW] CocosStudio: add callback when loading a CSB file diff --git a/cocos/2d/CCComponent.h b/cocos/2d/CCComponent.h index c52db45b3c..90d6de8ca3 100644 --- a/cocos/2d/CCComponent.h +++ b/cocos/2d/CCComponent.h @@ -1,5 +1,5 @@ /**************************************************************************** -Copyright (c) 2013-2014 Chukong Technologies Inc. +Copyright (c) 2013-2015 Chukong Technologies Inc. http://www.cocos2d-x.org @@ -25,6 +25,8 @@ THE SOFTWARE. #ifndef __CC_FRAMEWORK_COMPONENT_H__ #define __CC_FRAMEWORK_COMPONENT_H__ +/// @cond DO_NOT_SHOW + #include "base/CCRef.h" #include "base/CCScriptSupport.h" #include @@ -80,4 +82,5 @@ protected: NS_CC_END +/// @endcond #endif // __FUNDATION__CCCOMPONENT_H__ diff --git a/cocos/2d/CCComponentContainer.h b/cocos/2d/CCComponentContainer.h index 94677c73f0..48fde89775 100644 --- a/cocos/2d/CCComponentContainer.h +++ b/cocos/2d/CCComponentContainer.h @@ -1,5 +1,5 @@ /**************************************************************************** -Copyright (c) 2013-2014 Chukong Technologies Inc. +Copyright (c) 2013-2015 Chukong Technologies Inc. http://www.cocos2d-x.org @@ -25,6 +25,8 @@ THE SOFTWARE. #ifndef __CC_FRAMEWORK_COMCONTAINER_H__ #define __CC_FRAMEWORK_COMCONTAINER_H__ +/// @cond DO_NOT_SHOW + #include "base/CCMap.h" #include @@ -68,4 +70,5 @@ private: NS_CC_END +/// @endcond #endif // __FUNDATION__CCCOMPONENT_H__ diff --git a/cocos/2d/CCFont.h b/cocos/2d/CCFont.h index d0b389579a..a23119f986 100644 --- a/cocos/2d/CCFont.h +++ b/cocos/2d/CCFont.h @@ -26,6 +26,8 @@ #ifndef _CCFont_h_ #define _CCFont_h_ +/// @cond DO_NOT_SHOW + #include #include "2d/CCLabel.h" @@ -33,8 +35,6 @@ NS_CC_BEGIN class FontAtlas; -/// @cond - class CC_DLL Font : public Ref { public: @@ -65,8 +65,7 @@ protected: }; -/// @endcond - NS_CC_END +/// @endcond #endif diff --git a/cocos/2d/CCFontAtlas.h b/cocos/2d/CCFontAtlas.h index 578fba6e67..b769f0944e 100644 --- a/cocos/2d/CCFontAtlas.h +++ b/cocos/2d/CCFontAtlas.h @@ -22,9 +22,12 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ + #ifndef _CCFontAtlas_h_ #define _CCFontAtlas_h_ +/// @cond DO_NOT_SHOW + #include #include @@ -34,14 +37,11 @@ NS_CC_BEGIN -//fwd class Font; class Texture2D; class EventCustom; class EventListenerCustom; -/// @cond - struct FontLetterDefinition { unsigned short letteCharUTF16; @@ -130,9 +130,7 @@ protected: bool _antialiasEnabled; }; -/// @endcond - NS_CC_END - +/// @endcond #endif /* defined(__cocos2d_libs__CCFontAtlas__) */ diff --git a/cocos/2d/CCFontAtlasCache.h b/cocos/2d/CCFontAtlasCache.h index a45bc1ef11..2bdd93ad3d 100644 --- a/cocos/2d/CCFontAtlasCache.h +++ b/cocos/2d/CCFontAtlasCache.h @@ -26,6 +26,8 @@ #ifndef _CCFontAtlasCache_h_ #define _CCFontAtlasCache_h_ +/// @cond DO_NOT_SHOW + #include #include "2d/CCLabel.h" @@ -34,8 +36,6 @@ NS_CC_BEGIN class FontAtlas; -/// @cond - class CC_DLL FontAtlasCache { public: @@ -58,8 +58,7 @@ private: static std::unordered_map _atlasMap; }; -/// @endcond - NS_CC_END +/// @endcond #endif diff --git a/cocos/2d/CCFontCharMap.h b/cocos/2d/CCFontCharMap.h index 8412aa2a84..78ad9abbd9 100644 --- a/cocos/2d/CCFontCharMap.h +++ b/cocos/2d/CCFontCharMap.h @@ -26,12 +26,12 @@ #ifndef _CCFontCharMap_h_ #define _CCFontCharMap_h_ +/// @cond DO_NOT_SHOW + #include "2d/CCFont.h" NS_CC_BEGIN -/// @cond - class FontCharMap : public Font { public: diff --git a/cocos/2d/CCFontFNT.h b/cocos/2d/CCFontFNT.h index 5a7a8a9be4..d2b83e9886 100644 --- a/cocos/2d/CCFontFNT.h +++ b/cocos/2d/CCFontFNT.h @@ -26,14 +26,14 @@ #ifndef _CCFontFNT_h_ #define _CCFontFNT_h_ +/// @cond DO_NOT_SHOW + #include "CCFont.h" NS_CC_BEGIN class BMFontConfiguration; -/// @cond FontFNT - class CC_DLL FontFNT : public Font { diff --git a/cocos/2d/CCFontFreeType.h b/cocos/2d/CCFontFreeType.h index 4ea7e29129..8b65baab0e 100644 --- a/cocos/2d/CCFontFreeType.h +++ b/cocos/2d/CCFontFreeType.h @@ -26,6 +26,8 @@ #ifndef _FontFreetype_h_ #define _FontFreetype_h_ +/// @cond DO_NOT_SHOW + #include "CCFont.h" #include @@ -46,8 +48,6 @@ NS_CC_BEGIN -/// @cond - class CC_DLL FontFreeType : public Font { public: diff --git a/cocos/2d/CCGLBufferedNode.h b/cocos/2d/CCGLBufferedNode.h index 0fdd30d0fb..2ad537f3dc 100644 --- a/cocos/2d/CCGLBufferedNode.h +++ b/cocos/2d/CCGLBufferedNode.h @@ -40,18 +40,21 @@ public: */ virtual ~GLBufferedNode(); - /** + /**@{ * Load the given data into this Node's GL Buffer. Needed for WebGL, as it does not support client-side arrays. */ void setGLBufferData(void *buf, GLuint bufSize, int slot); void setGLIndexData(void *buf, GLuint bufSize, int slot); - - // We allocate 4 buffer objs per node, and index into them as slots. -#define BUFFER_SLOTS 4 + /**@}*/ + /** Allocate 4 buffer objs per node, and index into them as slots.*/ + #define BUFFER_SLOTS 4 + /**Handle for vertex buffers.*/ GLuint _bufferObject[BUFFER_SLOTS]; + /**Size in bytes for vertex buffers.*/ GLuint _bufferSize[BUFFER_SLOTS]; - + /**Handle for index buffers.*/ GLuint _indexBufferObject[BUFFER_SLOTS]; + /**Size in bytes for index buffers.*/ GLuint _indexBufferSize[BUFFER_SLOTS]; }; #endif // __CC_GL_BUFFERED_NODE__ diff --git a/cocos/2d/CCGrabber.h b/cocos/2d/CCGrabber.h index f7830225f5..65f3fe3ab3 100644 --- a/cocos/2d/CCGrabber.h +++ b/cocos/2d/CCGrabber.h @@ -43,17 +43,21 @@ class Grabber : public Ref { public: /** + Constructor. * @js ctor */ Grabber(void); /** + Destructor. * @js NA * @lua NA */ ~Grabber(void); - + /**Init the grab structure, will set the texture as the FBO color attachment.*/ void grab(Texture2D *texture); + /**Begin capture the screen, which will save the old FBO, clear color, and set the new FBO, clear the background.*/ void beforeRender(Texture2D *texture); + /**After capture, will reset the old FBO and clear color.*/ void afterRender(Texture2D *texture); protected: diff --git a/cocos/2d/CCGrid.h b/cocos/2d/CCGrid.h index 4ff1f8c066..7e43bed725 100644 --- a/cocos/2d/CCGrid.h +++ b/cocos/2d/CCGrid.h @@ -42,7 +42,7 @@ class Node; * @{ */ -/** Base class for other +/** Base class for Other grid. */ class CC_DLL GridBase : public Ref { @@ -52,42 +52,70 @@ public: /** create one Grid */ static GridBase* create(const Size& gridSize); /** + Destructor. * @js NA * @lua NA */ virtual ~GridBase(void); + /**@{ + Init the Grid base. + @param gridSize the size of the grid. + @param texture The texture used for grab. + @param flipped whether or not the grab texture should be flip by Y or not. + */ bool initWithSize(const Size& gridSize, Texture2D *texture, bool flipped); bool initWithSize(const Size& gridSize); - - /** whether or not the grid is active */ + /**@}*/ + /** @{ + Getter and setter of the active state of the grid. + */ inline bool isActive(void) const { return _active; } void setActive(bool active); + /**@}*/ - /** number of times that the grid will be reused */ + /** Get number of times that the grid will be reused. */ inline int getReuseGrid(void) const { return _reuseGrid; } + /** Set number of times that the grid will be reused. */ inline void setReuseGrid(int reuseGrid) { _reuseGrid = reuseGrid; } - /** size of the grid */ + /** Size of the grid. */ inline const Size& getGridSize(void) const { return _gridSize; } + /**Set the size of the grid.*/ inline void setGridSize(const Size& gridSize) { _gridSize = gridSize; } - /** pixels between the grids */ + /** Pixels between the grids. */ inline const Vec2& getStep(void) const { return _step; } + /**Get the pixels between the grids.*/ inline void setStep(const Vec2& step) { _step = step; } - /** is texture flipped */ + /** is texture flipped. */ inline bool isTextureFlipped(void) const { return _isTextureFlipped; } + /**Set the texture flipped or not.*/ void setTextureFlipped(bool flipped); - + + /**@{ + Init and reset the status when render effects by using the grid. + */ void beforeDraw(void); void afterDraw(Node *target); + /**@}*/ + + /**@{ + Interface for custom action when before or after draw. + */ virtual void beforeBlit() {} virtual void afterBlit() {} + /**@}*/ + + /**Interface used to blit the texture with grid to screen.*/ virtual void blit(void); + /**Interface, Reuse the grid vertices.*/ virtual void reuse(void); + /**Interface, Calculate the vertices used for the blit.*/ virtual void calculateVertexPoints(void); - + + /**Change projection to 2D for grabbing.*/ void set2DProjection(void); protected: @@ -108,21 +136,23 @@ protected: class CC_DLL Grid3D : public GridBase { public: - /** create one Grid */ + /** create one Grid. */ static Grid3D* create(const Size& gridSize, Texture2D *texture, bool flipped); - /** create one Grid */ + /** create one Grid. */ static Grid3D* create(const Size& gridSize); /** + Constructor. * @js ctor */ Grid3D(); /** + Destructor. * @js NA * @lua NA */ ~Grid3D(void); - /** returns the vertex at a given position + /** Returns the vertex at a given position. * @js NA * @lua NA */ @@ -132,7 +162,7 @@ public: * @lua NA */ CC_DEPRECATED_ATTRIBUTE Vec3 vertex(const Vec2& pos) const { return getVertex(pos); } - /** returns the original (non-transformed) vertex at a given position + /** Returns the original (non-transformed) vertex at a given position. * @js NA * @lua NA */ @@ -143,21 +173,27 @@ public: */ CC_DEPRECATED_ATTRIBUTE Vec3 originalVertex(const Vec2& pos) const { return getOriginalVertex(pos); } - /** sets a new vertex at a given position + /** Sets a new vertex at a given position. * @js NA * @lua NA */ void setVertex(const Vec2& pos, const Vec3& vertex); - + /**@{ + Implementations for interfaces in base calss. + */ virtual void beforeBlit() override; virtual void afterBlit() override; - // Overrides virtual void blit() override; virtual void reuse() override; virtual void calculateVertexPoints() override; + /**@}*/ + /**@{ + Getter and Setter for depth test state when blit. + */ void setNeedDepthTestForBlit( bool neededDepthTest) { _needDepthTestForBlit = neededDepthTest; } bool getNeedDepthTestForBlit() const { return _needDepthTestForBlit; } + /**@}*/ protected: GLvoid *_texCoordinates; GLvoid *_vertices; @@ -175,21 +211,23 @@ protected: class CC_DLL TiledGrid3D : public GridBase { public: - /** create one Grid */ + /** Create one Grid. */ static TiledGrid3D* create(const Size& gridSize, Texture2D *texture, bool flipped); - /** create one Grid */ + /** Create one Grid. */ static TiledGrid3D* create(const Size& gridSize); /** + Constructor. * @js ctor */ TiledGrid3D(); /** + Destructor. * @js NA * @lua NA */ ~TiledGrid3D(); - /** returns the tile at the given position + /** Returns the tile at the given position. * @js NA * @lua NA */ @@ -199,7 +237,7 @@ public: * @lua NA */ CC_DEPRECATED_ATTRIBUTE Quad3 tile(const Vec2& pos) const { return getTile(pos); } - /** returns the original tile (untransformed) at the given position + /** Returns the original tile (untransformed) at the given position. * @js NA * @lua NA */ @@ -210,17 +248,19 @@ public: */ CC_DEPRECATED_ATTRIBUTE Quad3 originalTile(const Vec2& pos) const { return getOriginalTile(pos); } - /** sets a new tile + /** Sets a new tile. * @js NA * @lua NA */ void setTile(const Vec2& pos, const Quad3& coords); - // Overrides + /**@{ + Implementations for interfaces in base calss. + */ virtual void blit() override; virtual void reuse() override; virtual void calculateVertexPoints() override; - + /**@}*/ protected: GLvoid *_texCoordinates; GLvoid *_vertices; diff --git a/cocos/2d/CCLabel.h b/cocos/2d/CCLabel.h index 5cee707e57..80d2e1f4a5 100644 --- a/cocos/2d/CCLabel.h +++ b/cocos/2d/CCLabel.h @@ -40,6 +40,8 @@ NS_CC_BEGIN /** * @brief Possible GlyphCollection used by Label. * + * Specify a collections of characters to be load when Label created. + * Consider using DYNAMIC. */ enum class GlyphCollection { DYNAMIC, @@ -61,14 +63,16 @@ enum class LabelEffect { /** * @struct TTFConfig - * + * @see `GlyphCollection` */ typedef struct _ttfConfig { std::string fontFilePath; int fontSize; - GlyphCollection glyphs; + + GlyphCollection glyphs; const char *customGlyphs; + bool distanceFieldEnabled; int outlineSize; diff --git a/cocos/2d/CCLabelBMFont.h b/cocos/2d/CCLabelBMFont.h index 472021fc88..2034b6528b 100644 --- a/cocos/2d/CCLabelBMFont.h +++ b/cocos/2d/CCLabelBMFont.h @@ -34,6 +34,8 @@ Use any of these editors to generate BMFonts: #ifndef __CCBITMAP_FONT_ATLAS_H__ #define __CCBITMAP_FONT_ATLAS_H__ +/// @cond DO_NOT_SHOW + #include "2d/CCLabel.h" #if CC_LABELBMFONT_DEBUG_DRAW #include "renderer/CCCustomCommand.h" @@ -42,8 +44,6 @@ Use any of these editors to generate BMFonts: NS_CC_BEGIN -/// @cond - #if defined(__GNUC__) && ((__GNUC__ >= 4) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1))) #pragma GCC diagnostic ignored "-Wdeprecated-declarations" #elif _MSC_VER >= 1400 //vs 2005 or higher @@ -157,8 +157,7 @@ private: #pragma warning (pop) #endif -/// @endcond - NS_CC_END +/// @endcond #endif //__CCBITMAP_FONT_ATLAS_H__ diff --git a/cocos/2d/CCLabelTTF.h b/cocos/2d/CCLabelTTF.h index 1275413d06..c4313a961f 100644 --- a/cocos/2d/CCLabelTTF.h +++ b/cocos/2d/CCLabelTTF.h @@ -23,9 +23,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. ****************************************************************************/ + #ifndef __CCLABELTTF_H__ #define __CCLABELTTF_H__ +/// @cond DO_NOT_SHOW + #include "2d/CCNode.h" NS_CC_BEGIN @@ -171,9 +174,8 @@ protected: #pragma warning (pop) #endif -/// @endcond - NS_CC_END +/// @endcond #endif //__CCLABEL_H__ diff --git a/cocos/2d/CCLabelTextFormatter.h b/cocos/2d/CCLabelTextFormatter.h index 73f07fe7fb..8efdb19dc0 100644 --- a/cocos/2d/CCLabelTextFormatter.h +++ b/cocos/2d/CCLabelTextFormatter.h @@ -26,13 +26,14 @@ #ifndef _CCLabelTextFormatter_h_ #define _CCLabelTextFormatter_h_ +/// @cond DO_NOT_SHOW + #include "platform/CCPlatformMacros.h" NS_CC_BEGIN class Label; -/// @cond class CC_DLL LabelTextFormatter { public: @@ -43,8 +44,7 @@ public: }; -/// @endcond - NS_CC_END +/// @endcond #endif diff --git a/cocos/2d/CCTMXXMLParser.h b/cocos/2d/CCTMXXMLParser.h index 6c011a25c2..83009f2da7 100644 --- a/cocos/2d/CCTMXXMLParser.h +++ b/cocos/2d/CCTMXXMLParser.h @@ -2,7 +2,7 @@ Copyright (c) 2009-2010 Ricardo Quesada Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2011 Zynga Inc. -Copyright (c) 2013-2014 Chukong Technologies Inc. +Copyright (c) 2013-2015 Chukong Technologies Inc. http://www.cocos2d-x.org @@ -29,6 +29,8 @@ THE SOFTWARE. #ifndef __CC_TM_XML_PARSER__ #define __CC_TM_XML_PARSER__ +/// @cond DO_NOT_SHOW + #include "math/CCGeometry.h" #include "platform/CCSAXParser.h" #include "base/CCVector.h" @@ -323,5 +325,5 @@ protected: NS_CC_END +/// @endcond #endif - diff --git a/cocos/2d/CCTweenFunction.h b/cocos/2d/CCTweenFunction.h index dc5d6eeb31..e917d083b7 100644 --- a/cocos/2d/CCTweenFunction.h +++ b/cocos/2d/CCTweenFunction.h @@ -1,5 +1,5 @@ /**************************************************************************** -Copyright (c) 2013-2014 Chukong Technologies Inc. +Copyright (c) 2013-2015 Chukong Technologies Inc. http://www.cocos2d-x.org @@ -25,6 +25,8 @@ THE SOFTWARE. #ifndef __CCTWEENFUNCTION_H__ #define __CCTWEENFUNCTION_H__ +/// @cond DO_NOT_SHOW + #include "platform/CCPlatformMacros.h" NS_CC_BEGIN @@ -293,4 +295,5 @@ namespace tweenfunc { NS_CC_END +/// @endcond #endif /*__CCTWEENFUNCTION_H__*/ diff --git a/cocos/3d/cocos3d.h b/cocos/3d/cocos3d.h index 87b4575980..ac56179ed9 100755 --- a/cocos/3d/cocos3d.h +++ b/cocos/3d/cocos3d.h @@ -1,5 +1,5 @@ /**************************************************************************** - Copyright (c) 2014 Chukong Technologies Inc. + Copyright (c) 2014-2015 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/base/CCConfiguration.h b/cocos/base/CCConfiguration.h index 960da0e16b..8441b72024 100644 --- a/cocos/base/CCConfiguration.h +++ b/cocos/base/CCConfiguration.h @@ -36,7 +36,7 @@ THE SOFTWARE. NS_CC_BEGIN /** - * @addtogroup global + * @addtogroup base * @{ */ /** @class Configuration @@ -234,7 +234,7 @@ protected: ValueMap _valueDict; }; -// end of global group +// end of base group /// @} NS_CC_END diff --git a/cocos/base/CCConsole.h b/cocos/base/CCConsole.h index 85cb33ee7f..2ab3fc93b3 100644 --- a/cocos/base/CCConsole.h +++ b/cocos/base/CCConsole.h @@ -1,5 +1,5 @@ /**************************************************************************** - Copyright (c) 2013-2014 Chukong Technologies Inc. + Copyright (c) 2013-2015 Chukong Technologies Inc. http://www.cocos2d-x.org @@ -22,9 +22,9 @@ THE SOFTWARE. ****************************************************************************/ - #ifndef __CCCONSOLE_H__ #define __CCCONSOLE_H__ +/// @cond DO_NOT_SHOW #if defined(_MSC_VER) || defined(__MINGW32__) #include @@ -158,4 +158,5 @@ private: NS_CC_END +/// @endcond #endif /* defined(__CCCONSOLE_H__) */ diff --git a/cocos/base/CCDataVisitor.h b/cocos/base/CCDataVisitor.h index 42c51736d7..2b089e0b05 100644 --- a/cocos/base/CCDataVisitor.h +++ b/cocos/base/CCDataVisitor.h @@ -1,5 +1,5 @@ /**************************************************************************** - Copyright (c) 2013-2014 Chukong Technologies Inc. + Copyright (c) 2013-2015 Chukong Technologies Inc. http://www.cocos2d-x.org @@ -24,6 +24,7 @@ #ifndef __CCDATAVISITOR_H__ #define __CCDATAVISITOR_H__ +/// @cond DO_NOT_SHOW #include "platform/CCPlatformMacros.h" #include @@ -40,10 +41,6 @@ class __Array; class __Dictionary; class __Set; -/** - * @cond - */ - /** * Visitor that helps to perform action that depends on polymorphic object type * @@ -111,4 +108,5 @@ private: NS_CC_END +/// @endcond #endif // __CCDATAVISITOR_H__ diff --git a/cocos/base/CCEvent.h b/cocos/base/CCEvent.h index ccd49010c2..33cb49e1a8 100644 --- a/cocos/base/CCEvent.h +++ b/cocos/base/CCEvent.h @@ -29,6 +29,11 @@ #include "base/CCRef.h" #include "platform/CCPlatformMacros.h" +/** + * @addtogroup base + * @{ + */ + NS_CC_BEGIN class Node; @@ -96,5 +101,7 @@ protected: NS_CC_END +// end of base group +/// @} #endif // __CCEVENT_H__ diff --git a/cocos/base/CCEventAcceleration.h b/cocos/base/CCEventAcceleration.h index 1b6013f572..226ab50b99 100644 --- a/cocos/base/CCEventAcceleration.h +++ b/cocos/base/CCEventAcceleration.h @@ -28,6 +28,11 @@ #include "base/CCEvent.h" #include "base/ccTypes.h" +/** + * @addtogroup base + * @{ + */ + NS_CC_BEGIN /** @class EventAcceleration @@ -47,6 +52,9 @@ private: friend class EventListenerAcceleration; }; +// end of base group +/// @} + NS_CC_END #endif /* defined(__cocos2d_libs__CCAccelerometerEvent__) */ diff --git a/cocos/base/CCEventController.h b/cocos/base/CCEventController.h index e83cb03794..d0b34fc992 100644 --- a/cocos/base/CCEventController.h +++ b/cocos/base/CCEventController.h @@ -29,15 +29,24 @@ #include "platform/CCPlatformMacros.h" #include "base/CCEvent.h" +/** + * @addtogroup base + * @{ + */ + NS_CC_BEGIN /// @cond EventController class Controller; class EventListenerController; +/** @class EventController + * @brief Controller event. + */ class EventController : public Event { public: + /** ControllerEventType Controller event type.*/ enum class ControllerEventType { CONNECTION, @@ -45,16 +54,46 @@ public: AXIS_STATUS_CHANGED, }; + /** Create a EventController with controller event type, contrlloer and key code. + * + * @param type A given controller event type. + * @param controller A given controller pointer. + * @param keyCode A given key code. + * @return An autoreleased EventController object. + */ EventController(ControllerEventType type, Controller* controller, int keyCode); + /** Create a EventController with controller event type, contrlloer and whether or not is connected. + * + * @param type A given controller event type. + * @param controller A given controller pointer. + * @param isConnected True if it is connected. + * @return An autoreleased EventController object. + */ EventController(ControllerEventType type, Controller* controller, bool isConnected); + /** Gets the event type of the controller. + * + * @return The event type of the controller. + */ ControllerEventType getControllerEventType() const { return _controllerEventType; } Controller* getController() const { return _controller; } + /** Gets the key code of the controller. + * + * @return The key code of the controller. + */ int getKeyCode() const{ return _keyCode; } void setKeyCode(int keyCode) { _keyCode = keyCode;} + /** Sets the connect status. + * + * @param True if it's connected. + */ void setConnectStatus(bool isConnected) {_isConnected = isConnected;} + /** Gets the connect status. + * + * @return True if it's connected. + */ bool isConnected() const { return _isConnected; } protected: @@ -68,4 +107,7 @@ protected: /// @endcond EventController NS_CC_END +// end of base group +/// @} + #endif /* defined(__cocos2d_libs__EventController__) */ diff --git a/cocos/base/CCEventCustom.h b/cocos/base/CCEventCustom.h index 94602b7c43..8747c03776 100644 --- a/cocos/base/CCEventCustom.h +++ b/cocos/base/CCEventCustom.h @@ -28,6 +28,11 @@ #include #include "base/CCEvent.h" +/** + * @addtogroup base + * @{ + */ + NS_CC_BEGIN /** @class EventCustom @@ -39,6 +44,7 @@ public: /** Constructor. * * @param eventName A given name of the custom event. + * @js ctor */ EventCustom(const std::string& eventName); @@ -66,4 +72,7 @@ protected: NS_CC_END +// end of base group +/// @} + #endif /* defined(__cocos2d_libs__CCCustomEvent__) */ diff --git a/cocos/base/CCEventDispatcher.h b/cocos/base/CCEventDispatcher.h index 0016c6f910..aed0ca830d 100644 --- a/cocos/base/CCEventDispatcher.h +++ b/cocos/base/CCEventDispatcher.h @@ -36,6 +36,11 @@ #include "base/CCEvent.h" #include "platform/CCStdC.h" +/** + * @addtogroup base + * @{ + */ + NS_CC_BEGIN class Event; @@ -52,6 +57,7 @@ The EventListener list is managed in such a way that event listeners can be added and removed even from within an EventListener, while events are being dispatched. +@js NA */ class CC_DLL EventDispatcher : public Ref { @@ -320,5 +326,7 @@ protected: NS_CC_END +// end of base group +/// @} #endif // __CC_EVENT_DISPATCHER_H__ diff --git a/cocos/base/CCEventFocus.h b/cocos/base/CCEventFocus.h index e63ee3669c..e824a7ed70 100644 --- a/cocos/base/CCEventFocus.h +++ b/cocos/base/CCEventFocus.h @@ -28,6 +28,10 @@ #include "base/CCEvent.h" +/** + * @addtogroup base + * @{ + */ NS_CC_BEGIN @@ -45,6 +49,7 @@ public: * * @param widgetLoseFocus The widget which lose focus. * @param widgetGetFocus The widget which get focus. + * @js ctor */ EventFocus(ui::Widget* widgetLoseFocus, ui::Widget* widgetGetFocus); @@ -58,4 +63,7 @@ private: NS_CC_END +// end of base group +/// @} + #endif /* defined(__cocos2d_libs__CCEventFocus__) */ diff --git a/cocos/base/CCEventKeyboard.h b/cocos/base/CCEventKeyboard.h index 78999f0fe5..6f2765c686 100644 --- a/cocos/base/CCEventKeyboard.h +++ b/cocos/base/CCEventKeyboard.h @@ -28,6 +28,11 @@ #include "base/CCEvent.h" +/** + * @addtogroup base + * @{ + */ + NS_CC_BEGIN /** @class EventKeyboard @@ -38,6 +43,7 @@ class CC_DLL EventKeyboard : public Event public: /** * KeyCode The key (code). + * @js NA */ enum class KeyCode { @@ -217,6 +223,7 @@ public: * * @param keyCode A given keycode. * @param isPressed True if the key is pressed. + * @js ctor */ EventKeyboard(KeyCode keyCode, bool isPressed); @@ -229,4 +236,7 @@ private: NS_CC_END +// end of base group +/// @} + #endif /* defined(__cocos2d_libs__CCKeyboardEvent__) */ diff --git a/cocos/base/CCEventListener.h b/cocos/base/CCEventListener.h index aa0f276f48..aeeb6b1bb2 100644 --- a/cocos/base/CCEventListener.h +++ b/cocos/base/CCEventListener.h @@ -32,6 +32,11 @@ #include "platform/CCPlatformMacros.h" #include "base/CCRef.h" +/** + * @addtogroup base + * @{ + */ + NS_CC_BEGIN class Event; @@ -62,13 +67,20 @@ public: typedef std::string ListenerID; CC_CONSTRUCTOR_ACCESS: - /** Constructor */ + /** + * Constructor + * @js ctor + */ EventListener(); - /** Initializes event with type and callback function */ + /** + * Initializes event with type and callback function + * @js NA + */ bool init(Type t, const ListenerID& listenerID, const std::function& callback); public: /** Destructor. + * @js NA */ virtual ~EventListener(); @@ -166,4 +178,7 @@ protected: NS_CC_END +// end of base group +/// @} + #endif // __CCEVENTLISTENER_H__ diff --git a/cocos/base/CCEventListenerAcceleration.h b/cocos/base/CCEventListenerAcceleration.h index c9f226d8cb..b9bbcb0c6e 100644 --- a/cocos/base/CCEventListenerAcceleration.h +++ b/cocos/base/CCEventListenerAcceleration.h @@ -28,10 +28,16 @@ #include "base/CCEventListener.h" #include "base/ccTypes.h" +/** + * @addtogroup base + * @{ + */ + NS_CC_BEGIN /** @class EventListenerAcceleration * @brief Acceleration event listener. + * @js NA */ class CC_DLL EventListenerAcceleration : public EventListener { @@ -66,4 +72,7 @@ private: NS_CC_END +// end of base group +/// @} + #endif /* defined(__cocos2d_libs__CCAccelerometerListener__) */ diff --git a/cocos/base/CCEventListenerController.h b/cocos/base/CCEventListenerController.h index c6e1032489..cf032ec989 100644 --- a/cocos/base/CCEventListenerController.h +++ b/cocos/base/CCEventListenerController.h @@ -29,6 +29,11 @@ #include "platform/CCPlatformMacros.h" #include "base/CCEventListener.h" +/** + * @addtogroup base + * @{ + */ + NS_CC_BEGIN class Event; @@ -36,6 +41,7 @@ class Controller; /** @class EventListenerController * @param Controller event listener. + * @js NA */ class EventListenerController : public EventListener { @@ -67,4 +73,7 @@ protected: NS_CC_END +// end of base group +/// @} + #endif /* defined(__cocos2d_libs__EventListenerController__) */ diff --git a/cocos/base/CCEventListenerCustom.h b/cocos/base/CCEventListenerCustom.h index 6cdb17df4c..11ad60c06d 100644 --- a/cocos/base/CCEventListenerCustom.h +++ b/cocos/base/CCEventListenerCustom.h @@ -27,6 +27,11 @@ #include "base/CCEventListener.h" +/** + * @addtogroup base + * @{ + */ + NS_CC_BEGIN class EventCustom; @@ -49,6 +54,7 @@ class EventCustom; * Removes a listener * * dispatcher->removeEventListener(listener); + * @js cc._EventListenerCustom */ class CC_DLL EventListenerCustom : public EventListener { @@ -79,4 +85,7 @@ protected: NS_CC_END +// end of base group +/// @} + #endif /* defined(__cocos2d_libs__CCCustomEventListener__) */ diff --git a/cocos/base/CCEventListenerFocus.h b/cocos/base/CCEventListenerFocus.h index e2486c1db9..e7ec0aad2c 100644 --- a/cocos/base/CCEventListenerFocus.h +++ b/cocos/base/CCEventListenerFocus.h @@ -28,6 +28,10 @@ #include "base/CCEventListener.h" +/** + * @addtogroup base + * @{ + */ NS_CC_BEGIN @@ -50,6 +54,7 @@ public: static EventListenerFocus* create(); /** Destructor. + * @js NA */ virtual ~EventListenerFocus(); @@ -68,8 +73,9 @@ CC_CONSTRUCTOR_ACCESS: friend class EventDispatcher; }; - - NS_CC_END +// end of base group +/// @} + #endif /* defined(__cocos2d_libs__CCEventListenerFocus__) */ diff --git a/cocos/base/CCEventListenerKeyboard.h b/cocos/base/CCEventListenerKeyboard.h index 7a63529f88..65c191887b 100644 --- a/cocos/base/CCEventListenerKeyboard.h +++ b/cocos/base/CCEventListenerKeyboard.h @@ -29,12 +29,18 @@ #include "base/CCEventListener.h" #include "base/CCEventKeyboard.h" +/** + * @addtogroup base + * @{ + */ + NS_CC_BEGIN class Event; /** @class EventListenerKeyboard * @brief Keyboard event listener. + * @js cc._EventListenerKeyboard */ class CC_DLL EventListenerKeyboard : public EventListener { @@ -60,4 +66,7 @@ CC_CONSTRUCTOR_ACCESS: NS_CC_END +// end of base group +/// @} + #endif /* defined(__cocos2d_libs__CCKeyboardEventListener__) */ diff --git a/cocos/base/CCEventListenerMouse.h b/cocos/base/CCEventListenerMouse.h index b1e0a83c67..49a185d719 100644 --- a/cocos/base/CCEventListenerMouse.h +++ b/cocos/base/CCEventListenerMouse.h @@ -29,12 +29,18 @@ #ifndef __cocos2d_libs__CCMouseEventListener__ #define __cocos2d_libs__CCMouseEventListener__ +/** + * @addtogroup base + * @{ + */ + NS_CC_BEGIN class Event; /** @class EventListenerMouse * @brief Mouse event listener. + * @js cc._EventListenerMouse */ class CC_DLL EventListenerMouse : public EventListener { @@ -63,4 +69,7 @@ CC_CONSTRUCTOR_ACCESS: NS_CC_END +// end of base group +/// @} + #endif /* defined(__cocos2d_libs__CCMouseEventListener__) */ diff --git a/cocos/base/CCEventListenerTouch.h b/cocos/base/CCEventListenerTouch.h index 33b662609d..fa318cbf51 100644 --- a/cocos/base/CCEventListenerTouch.h +++ b/cocos/base/CCEventListenerTouch.h @@ -27,15 +27,20 @@ #define __cocos2d_libs__CCTouchEventListener__ #include "base/CCEventListener.h" - #include +/** + * @addtogroup base + * @{ + */ + NS_CC_BEGIN class Touch; /** @class EventListenerTouchOneByOne * @brief Single touch event listener. + * @js cc._EventListenerTouchOneByOne */ class CC_DLL EventListenerTouchOneByOne : public EventListener { @@ -46,7 +51,10 @@ public: */ static EventListenerTouchOneByOne* create(); - /** Destructor. */ + /** + * Destructor. + * @js NA + */ virtual ~EventListenerTouchOneByOne(); /** Whether or not to swall touches. @@ -100,6 +108,7 @@ public: */ static EventListenerTouchAllAtOnce* create(); /** Destructor. + * @js NA */ virtual ~EventListenerTouchAllAtOnce(); @@ -126,4 +135,7 @@ private: NS_CC_END +// end of base group +/// @} + #endif /* defined(__cocos2d_libs__CCTouchEventListener__) */ diff --git a/cocos/base/CCEventMouse.h b/cocos/base/CCEventMouse.h index a1f4fc39a3..4f0980abda 100644 --- a/cocos/base/CCEventMouse.h +++ b/cocos/base/CCEventMouse.h @@ -38,6 +38,11 @@ #define MOUSE_BUTTON_7 6 #define MOUSE_BUTTON_8 7 +/** + * @addtogroup base + * @{ + */ + NS_CC_BEGIN /** @class EventMouse @@ -48,6 +53,7 @@ class CC_DLL EventMouse : public Event public: /** * MouseEventType Different types of MouseEvent. + * @js NA */ enum class MouseEventType { @@ -61,6 +67,7 @@ public: /** Constructor. * * @param mouseEventCode A given mouse event type. + * @js ctor */ EventMouse(MouseEventType mouseEventCode); @@ -85,6 +92,7 @@ public: * * @param x The x coordinate of cursor position. * @param y The y coordinate of cursor position. + * @js setLocation */ inline void setCursorPosition(float x, float y) { _x = x; @@ -102,21 +110,25 @@ public: /** Set mouse button. * * @param button a given mouse button. + * @js setButton */ inline void setMouseButton(int button) { _mouseButton = button; }; /** Get mouse button. * * @return The mouse button. + * @js getButton */ inline int getMouseButton() { return _mouseButton; }; /** Get the cursor position of x axis. * * @return The x coordinate of cursor position. + * @js getLocationX */ inline float getCursorX() { return _x; }; /** Get the cursor position of y axis. * * @return The y coordinate of cursor position. + * @js getLocationY */ inline float getCursorY() { return _y; }; @@ -128,11 +140,13 @@ public: /** Returns the previous touch location in OpenGL coordinates. * * @return The previous touch location in OpenGL coordinates. + * @js NA */ Vec2 getPreviousLocation() const; /** Returns the start touch location in OpenGL coordinates. * * @return The start touch location in OpenGL coordinates. + * @js NA */ Vec2 getStartLocation() const; /** Returns the delta of 2 current touches locations in screen coordinates. @@ -148,11 +162,13 @@ public: /** Returns the previous touch location in screen coordinates. * * @return The previous touch location in screen coordinates. + * @js NA */ Vec2 getPreviousLocationInView() const; /** Returns the start touch location in screen coordinates. * * @return The start touch location in screen coordinates. + * @js NA */ Vec2 getStartLocationInView() const; @@ -175,4 +191,7 @@ private: NS_CC_END +// end of base group +/// @} + #endif /* defined(__cocos2d_libs__CCMouseEvent__) */ diff --git a/cocos/base/CCEventTouch.h b/cocos/base/CCEventTouch.h index 50292fe547..a76453b7ed 100644 --- a/cocos/base/CCEventTouch.h +++ b/cocos/base/CCEventTouch.h @@ -28,6 +28,11 @@ #include "base/CCEvent.h" #include +/** + * @addtogroup base + * @{ + */ + NS_CC_BEGIN class Touch; @@ -51,7 +56,10 @@ public: CANCELLED }; - /** Constructor.*/ + /** + * Constructor. + * @js NA + */ EventTouch(); /** Get event code. @@ -89,4 +97,7 @@ private: NS_CC_END +// end of base group +/// @} + #endif /* defined(__cocos2d_libs__TouchEvent__) */ diff --git a/cocos/base/CCEventType.h b/cocos/base/CCEventType.h index ab2c4350d5..8d6d9e80c1 100644 --- a/cocos/base/CCEventType.h +++ b/cocos/base/CCEventType.h @@ -1,5 +1,5 @@ /**************************************************************************** - Copyright (c) 2013-2014 Chukong Technologies Inc. + Copyright (c) 2013-2015 Chukong Technologies Inc. http://www.cocos2d-x.org @@ -24,6 +24,7 @@ #ifndef __CCEVENT_TYPE_H__ #define __CCEVENT_TYPE_H__ +/// @cond DO_NOT_SHOW /** * This header is used for defining event types using in NotificationCenter @@ -43,4 +44,5 @@ // This message is posted in cocos/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxRenderer.cpp and cocos\platform\wp8-xaml\cpp\Cocos2dRenderer.cpp. #define EVENT_COME_TO_BACKGROUND "event_come_to_background" +/// @endcond #endif // __CCEVENT_TYPE_H__ diff --git a/cocos/base/CCGameController.h b/cocos/base/CCGameController.h index fbc93bce17..4358c41cf2 100644 --- a/cocos/base/CCGameController.h +++ b/cocos/base/CCGameController.h @@ -1,6 +1,5 @@ /**************************************************************************** - Copyright (c) 2014 cocos2d-x.org - Copyright (c) 2014 Chukong Technologies Inc. + Copyright (c) 2014-2015 Chukong Technologies Inc. http://www.cocos2d-x.org @@ -25,9 +24,11 @@ #ifndef __cocos2d_libs__CCGameController__ #define __cocos2d_libs__CCGameController__ +/// @cond DO_NOT_SHOW #include "base/CCController.h" #include "base/CCEventController.h" #include "base/CCEventListenerController.h" +/// @endcond #endif /* defined(__cocos2d_libs__CCGameController__) */ diff --git a/cocos/base/CCProfiling.h b/cocos/base/CCProfiling.h index 63625f6702..ffb99e190a 100644 --- a/cocos/base/CCProfiling.h +++ b/cocos/base/CCProfiling.h @@ -1,7 +1,7 @@ /**************************************************************************** Copyright (c) 2010 Stuart Carnie Copyright (c) 2010-2012 cocos2d-x.org -Copyright (c) 2013-2014 Chukong Technologies Inc. +Copyright (c) 2013-2015 Chukong Technologies Inc. http://www.cocos2d-x.org @@ -23,8 +23,10 @@ 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. ****************************************************************************/ + #ifndef __SUPPORT_CCPROFILING_H__ #define __SUPPORT_CCPROFILING_H__ +/// @cond DO_NOT_SHOW #include #include @@ -161,4 +163,5 @@ extern bool kProfilerCategoryParticles; NS_CC_END +/// @endcond #endif // __SUPPORT_CCPROFILING_H__ diff --git a/cocos/base/CCProtocols.h b/cocos/base/CCProtocols.h index b12daa781f..337b8876c0 100644 --- a/cocos/base/CCProtocols.h +++ b/cocos/base/CCProtocols.h @@ -1,7 +1,7 @@ /**************************************************************************** Copyright (c) 2008-2010 Ricardo Quesada Copyright (c) 2010-2012 cocos2d-x.org -Copyright (c) 2013-2014 Chukong Technologies Inc. +Copyright (c) 2013-2015 Chukong Technologies Inc. http://www.cocos2d-x.org @@ -26,6 +26,7 @@ THE SOFTWARE. #ifndef __BASE_CCPROTOCOLS_H__ #define __BASE_CCPROTOCOLS_H__ +/// @cond DO_NOT_SHOW #include @@ -268,4 +269,5 @@ public: NS_CC_END +/// @endcond #endif // __BASE_CCPROTOCOLS_H__ diff --git a/cocos/base/CCRefPtr.h b/cocos/base/CCRefPtr.h index a9a7339444..60f833f1be 100644 --- a/cocos/base/CCRefPtr.h +++ b/cocos/base/CCRefPtr.h @@ -1,6 +1,6 @@ /**************************************************************************** - Copyright (c) 2014 PlayFirst Inc. - Copyright (c) 2014 Chukong Technologies Inc. + Copyright (c) 2014 PlayFirst Inc. + Copyright (c) 2014-2015 Chukong Technologies Inc. http://www.cocos2d-x.org @@ -25,6 +25,7 @@ #ifndef __CC_REF_PTR_H__ #define __CC_REF_PTR_H__ +/// @cond DO_NOT_SHOW #include "base/CCRef.h" #include "base/ccMacros.h" @@ -33,8 +34,6 @@ NS_CC_BEGIN /** - * @cond DO_NOT_SHOW - * * Utility/support macros. Defined to enable RefPtr to contain types like 'const T' because we do not * regard retain()/release() as affecting mutability of state. */ @@ -307,8 +306,7 @@ template RefPtr dynamic_pointer_cast(const RefPtr & r) #undef CC_REF_PTR_SAFE_RELEASE #undef CC_REF_PTR_SAFE_RELEASE_NULL -/** @} */ - NS_CC_END +/// @endcond #endif // __CC_REF_PTR_H__ diff --git a/cocos/base/TGAlib.h b/cocos/base/TGAlib.h index 987826dd8f..3f51088d00 100644 --- a/cocos/base/TGAlib.h +++ b/cocos/base/TGAlib.h @@ -1,6 +1,6 @@ /**************************************************************************** Copyright (c) 2010-2012 cocos2d-x.org -Copyright (c) 2013-2014 Chukong Technologies Inc. +Copyright (c) 2013-2015 Chukong Technologies Inc. http://www.cocos2d-x.org @@ -25,6 +25,7 @@ THE SOFTWARE. #ifndef __SUPPORT_DATA_SUPPORT_TGALIB_H__ #define __SUPPORT_DATA_SUPPORT_TGALIB_H__ +/// @cond DO_NOT_SHOW namespace cocos2d { @@ -73,4 +74,5 @@ void tgaDestroy(tImageTGA *info); }//namespace cocos2d +/// @endcond #endif // __SUPPORT_DATA_SUPPORT_TGALIB_H__ diff --git a/cocos/base/ZipUtils.h b/cocos/base/ZipUtils.h index a8db2e6029..310a51ffdb 100644 --- a/cocos/base/ZipUtils.h +++ b/cocos/base/ZipUtils.h @@ -22,8 +22,10 @@ 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. ****************************************************************************/ + #ifndef __SUPPORT_ZIPUTILS_H__ #define __SUPPORT_ZIPUTILS_H__ +/// @cond DO_NOT_SHOW #include #include "platform/CCPlatformConfig.h" @@ -294,5 +296,5 @@ typedef struct unz_file_info_s unz_file_info; // end group /// @} +/// @endcond #endif // __SUPPORT_ZIPUTILS_H__ - diff --git a/cocos/base/allocator/CCAllocatorBase.h b/cocos/base/allocator/CCAllocatorBase.h index 720d4ed936..3282e2557c 100644 --- a/cocos/base/allocator/CCAllocatorBase.h +++ b/cocos/base/allocator/CCAllocatorBase.h @@ -25,7 +25,7 @@ #ifndef CC_ALLOCATOR_BASE_H #define CC_ALLOCATOR_BASE_H -/// @cond +/// @cond DO_NOT_SHOW #include @@ -113,5 +113,4 @@ NS_CC_ALLOCATOR_END NS_CC_END /// @endcond - #endif//CC_ALLOCATOR_BASE_H diff --git a/cocos/base/allocator/CCAllocatorDiagnostics.h b/cocos/base/allocator/CCAllocatorDiagnostics.h index ccab120f18..f9ea712ca0 100644 --- a/cocos/base/allocator/CCAllocatorDiagnostics.h +++ b/cocos/base/allocator/CCAllocatorDiagnostics.h @@ -25,7 +25,7 @@ #ifndef CC_ALLOCATOR_DIAGNOSTICS_H #define CC_ALLOCATOR_DIAGNOSTICS_H -/// @cond +/// @cond DO_NOT_SHOW #include @@ -59,5 +59,4 @@ NS_CC_ALLOCATOR_END NS_CC_END /// @endcond - #endif//CC_ALLOCATOR_DIAGNOSTICS_H diff --git a/cocos/base/allocator/CCAllocatorGlobal.h b/cocos/base/allocator/CCAllocatorGlobal.h index 24e63db160..0491f34fd8 100644 --- a/cocos/base/allocator/CCAllocatorGlobal.h +++ b/cocos/base/allocator/CCAllocatorGlobal.h @@ -25,7 +25,7 @@ #ifndef CC_ALLOCATOR_GLOBAL_H #define CC_ALLOCATOR_GLOBAL_H -/// @cond +/// @cond DO_NOT_SHOW #include "base/allocator/CCAllocatorMacros.h" #include "base/allocator/CCAllocatorStrategyDefault.h" @@ -40,5 +40,4 @@ NS_CC_ALLOCATOR_END NS_CC_END /// @endcond - #endif//CC_ALLOCATOR_GLOBAL_H diff --git a/cocos/base/allocator/CCAllocatorMacros.h b/cocos/base/allocator/CCAllocatorMacros.h index 4ec2da588a..be1cbcd9d0 100644 --- a/cocos/base/allocator/CCAllocatorMacros.h +++ b/cocos/base/allocator/CCAllocatorMacros.h @@ -25,7 +25,7 @@ #ifndef CC_ALLOCATOR_MACROS_H #define CC_ALLOCATOR_MACROS_H -/// @cond +/// @cond DO_NOT_SHOW #include "base/ccConfig.h" #include "platform/CCPlatformMacros.h" @@ -128,5 +128,4 @@ } /// @endcond - #endif//CC_ALLOCATOR_MACROS_H diff --git a/cocos/base/allocator/CCAllocatorMutex.h b/cocos/base/allocator/CCAllocatorMutex.h index a1937fd02e..778549f872 100644 --- a/cocos/base/allocator/CCAllocatorMutex.h +++ b/cocos/base/allocator/CCAllocatorMutex.h @@ -25,7 +25,7 @@ #ifndef CC_ALLOCATOR_MUTEX_H #define CC_ALLOCATOR_MUTEX_H -/// @cond +/// @cond DO_NOT_SHOW #include "platform/CCPlatformMacros.h" @@ -122,5 +122,4 @@ NS_CC_ALLOCATOR_END NS_CC_END /// @endcond - #endif//CC_ALLOCATOR_MUTEX_H diff --git a/cocos/base/allocator/CCAllocatorStrategyDefault.h b/cocos/base/allocator/CCAllocatorStrategyDefault.h index 6888d14b2b..8c864e43a7 100644 --- a/cocos/base/allocator/CCAllocatorStrategyDefault.h +++ b/cocos/base/allocator/CCAllocatorStrategyDefault.h @@ -25,7 +25,7 @@ #ifndef CC_ALLOCATOR_STRATEGY_DEFAULT_H #define CC_ALLOCATOR_STRATEGY_DEFAULT_H -/// @cond +/// @cond DO_NOT_SHOW #include "base/allocator/CCAllocatorMacros.h" #include "base/allocator/CCAllocatorBase.h" @@ -56,5 +56,4 @@ NS_CC_ALLOCATOR_END NS_CC_END /// @endcond - #endif//CC_ALLOCATOR_STRATEGY_DEFAULT_H diff --git a/cocos/base/allocator/CCAllocatorStrategyFixedBlock.h b/cocos/base/allocator/CCAllocatorStrategyFixedBlock.h index 076d0277ed..8bc111c6ee 100644 --- a/cocos/base/allocator/CCAllocatorStrategyFixedBlock.h +++ b/cocos/base/allocator/CCAllocatorStrategyFixedBlock.h @@ -25,7 +25,7 @@ #ifndef CC_ALLOCATOR_STRATEGY_FIXED_BLOCK_H #define CC_ALLOCATOR_STRATEGY_FIXED_BLOCK_H -/// @cond +/// @cond DO_NOT_SHOW /**************************************************************************** WARNING! @@ -274,5 +274,4 @@ NS_CC_ALLOCATOR_END NS_CC_END /// @endcond - #endif//CC_ALLOCATOR_STRATEGY_FIXED_BLOCK_H diff --git a/cocos/base/allocator/CCAllocatorStrategyGlobalSmallBlock.h b/cocos/base/allocator/CCAllocatorStrategyGlobalSmallBlock.h index a460ce20af..4be9cdfc48 100644 --- a/cocos/base/allocator/CCAllocatorStrategyGlobalSmallBlock.h +++ b/cocos/base/allocator/CCAllocatorStrategyGlobalSmallBlock.h @@ -25,7 +25,7 @@ #ifndef CC_ALLOCATOR_STRATEGY_GLOBAL_SMALL_BLOCK_H #define CC_ALLOCATOR_STRATEGY_GLOBAL_SMALL_BLOCK_H -/// @cond +/// @cond DO_NOT_SHOW /**************************************************************************** WARNING! @@ -316,5 +316,4 @@ NS_CC_ALLOCATOR_END NS_CC_END /// @endcond - #endif//CC_ALLOCATOR_STRATEGY_GLOBAL_SMALL_BLOCK_H diff --git a/cocos/base/allocator/CCAllocatorStrategyPool.h b/cocos/base/allocator/CCAllocatorStrategyPool.h index 6651633292..44b66de7f0 100644 --- a/cocos/base/allocator/CCAllocatorStrategyPool.h +++ b/cocos/base/allocator/CCAllocatorStrategyPool.h @@ -25,7 +25,7 @@ #ifndef CC_ALLOCATOR_STRATEGY_POOL_H #define CC_ALLOCATOR_STRATEGY_POOL_H -/// @cond +/// @cond DO_NOT_SHOW #include #include @@ -169,5 +169,4 @@ NS_CC_ALLOCATOR_END NS_CC_END /// @endcond - #endif//CC_ALLOCATOR_STRATEGY_POOL_H diff --git a/cocos/base/atitc.h b/cocos/base/atitc.h index 77fdf1ebb5..3ef8ae5b5a 100644 --- a/cocos/base/atitc.h +++ b/cocos/base/atitc.h @@ -1,5 +1,5 @@ /**************************************************************************** - Copyright (c) 2013 Chukong Technologies Inc. + Copyright (c) 2013-2015 Chukong Technologies Inc. http://www.cocos2d-x.org @@ -22,9 +22,9 @@ THE SOFTWARE. ****************************************************************************/ - #ifndef COCOS2DX_PLATFORM_THIRDPARTY_ATITC_ #define COCOS2DX_PLATFORM_THIRDPARTY_ATITC_ +/// @cond DO_NOT_SHOW #include "platform/CCStdC.h" @@ -43,6 +43,5 @@ void atitc_decode(uint8_t *encode_data, ATITCDecodeFlag decodeFlag ); - +/// @endcond #endif /* defined(COCOS2DX_PLATFORM_THIRDPARTY_ATITC_) */ - diff --git a/cocos/base/base64.h b/cocos/base/base64.h index 2e0d9e7b51..8ee97f5605 100644 --- a/cocos/base/base64.h +++ b/cocos/base/base64.h @@ -1,6 +1,6 @@ /**************************************************************************** Copyright (c) 2010-2012 cocos2d-x.org -Copyright (c) 2013-2014 Chukong Technologies Inc. +Copyright (c) 2013-2015 Chukong Technologies Inc. http://www.cocos2d-x.org @@ -25,6 +25,7 @@ THE SOFTWARE. #ifndef __SUPPORT_BASE64_H__ #define __SUPPORT_BASE64_H__ +/// @cond DO_NOT_SHOW #include "platform/CCPlatformMacros.h" @@ -64,4 +65,5 @@ int CC_DLL base64Encode(const unsigned char *in, unsigned int inLength, char **o } #endif +/// @endcond #endif // __SUPPORT_BASE64_H__ diff --git a/cocos/base/ccCArray.h b/cocos/base/ccCArray.h index 4d0dddaf08..4bf1fb4584 100644 --- a/cocos/base/ccCArray.h +++ b/cocos/base/ccCArray.h @@ -1,7 +1,7 @@ /**************************************************************************** Copyright (c) 2007 Scott Lembcke Copyright (c) 2010-2012 cocos2d-x.org -Copyright (c) 2013-2014 Chukong Technologies Inc. +Copyright (c) 2013-2015 Chukong Technologies Inc. http://www.cocos2d-x.org @@ -42,6 +42,7 @@ THE SOFTWARE. #ifndef CC_ARRAY_H #define CC_ARRAY_H +/// @cond DO_NOT_SHOW #include "base/ccMacros.h" #include "base/CCRef.h" @@ -203,4 +204,5 @@ void ccCArrayFullRemoveArray(ccCArray *arr, ccCArray *minusArr); NS_CC_END +/// @endcond #endif // CC_ARRAY_H diff --git a/cocos/base/ccFPSImages.h b/cocos/base/ccFPSImages.h index 02fd5a83dd..9e0c96eaf7 100644 --- a/cocos/base/ccFPSImages.h +++ b/cocos/base/ccFPSImages.h @@ -1,29 +1,31 @@ -/* - * cocos2d for iPhone: http://www.cocos2d-iphone.org - * - * Copyright (c) 2012 Zynga Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * 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. - */ +/**************************************************************************** +Copyright (c) 2012 Zynga Inc. +Copyright (c) 2013-2015 Chukong Technologies Inc. + +http://www.cocos2d-x.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +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. +****************************************************************************/ #ifndef __BASE_CCFPSIMAGES__H #define __BASE_CCFPSIMAGES__H +/// @cond DO_NOT_SHOW #ifdef __cplusplus extern "C" { @@ -36,4 +38,5 @@ unsigned int cc_fps_images_len(void); } #endif +/// @endcond #endif // __BASE_CCFPSIMAGES__H diff --git a/cocos/base/etc1.h b/cocos/base/etc1.h index 0d389052b7..c6faf177e0 100644 --- a/cocos/base/etc1.h +++ b/cocos/base/etc1.h @@ -14,6 +14,7 @@ #ifndef __etc1_h__ #define __etc1_h__ +/// @cond DO_NOT_SHOW #define ETC1_ENCODED_BLOCK_SIZE 8 #define ETC1_DECODED_BLOCK_SIZE 48 @@ -103,4 +104,5 @@ etc1_uint32 etc1_pkm_get_height(const etc1_byte* pHeader); } #endif +/// @endcond #endif diff --git a/cocos/base/firePngData.h b/cocos/base/firePngData.h index 8c5f220915..aa8e6ced8c 100644 --- a/cocos/base/firePngData.h +++ b/cocos/base/firePngData.h @@ -1,3 +1,5 @@ +/// @cond DO_NOT_SHOW + const unsigned char __firePngData[] = { 0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, 0x00, 0x00, 0x00, 0x0D, 0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x20, 0x08, 0x06, 0x00, 0x00, 0x00, 0x73, 0x7A, 0x7A, @@ -46,3 +48,5 @@ const unsigned char __firePngData[] = { 0x72, 0x89, 0x08, 0x10, 0x07, 0x7D, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4E, 0x44, 0xAE, 0x42, 0x60, 0x82 }; + +/// @endcond diff --git a/cocos/base/s3tc.h b/cocos/base/s3tc.h index 1c3638e353..a9f2286040 100644 --- a/cocos/base/s3tc.h +++ b/cocos/base/s3tc.h @@ -1,5 +1,5 @@ /**************************************************************************** - Copyright (c) 2013-2014 Chukong Technologies + Copyright (c) 2013-2015 Chukong Technologies http://www.cocos2d-x.org @@ -22,9 +22,9 @@ THE SOFTWARE. ****************************************************************************/ - #ifndef COCOS2DX_PLATFORM_THIRDPARTY_S3TC_ #define COCOS2DX_PLATFORM_THIRDPARTY_S3TC_ +/// @cond DO_NOT_SHOW #include "platform/CCStdC.h" @@ -43,6 +43,5 @@ enum class S3TCDecodeFlag S3TCDecodeFlag decodeFlag ); - + /// @endcond #endif /* defined(COCOS2DX_PLATFORM_THIRDPARTY_S3TC_) */ - diff --git a/cocos/base/uthash.h b/cocos/base/uthash.h index 909cb0ac05..ea6dc5b366 100644 --- a/cocos/base/uthash.h +++ b/cocos/base/uthash.h @@ -23,6 +23,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef UTHASH_H #define UTHASH_H +/// @cond DO_NOT_SHOW #include /* memcmp,strlen */ #include /* ptrdiff_t */ @@ -937,4 +938,5 @@ typedef struct UT_hash_handle { unsigned hashv; /* result of hash-fcn(key) */ } UT_hash_handle; +/// @endcond #endif /* UTHASH_H */ diff --git a/cocos/base/utlist.h b/cocos/base/utlist.h index 6bccec7ada..80286cc61a 100644 --- a/cocos/base/utlist.h +++ b/cocos/base/utlist.h @@ -23,6 +23,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef UTLIST_H #define UTLIST_H +/// @cond DO_NOT_SHOW #define UTLIST_VERSION 1.9.8 @@ -724,5 +725,5 @@ do { } \ } while (0) \ +/// @endcond #endif /* UTLIST_H */ - diff --git a/cocos/deprecated/CCArray.h b/cocos/deprecated/CCArray.h index 1ed3a597c3..b75fd45b6a 100644 --- a/cocos/deprecated/CCArray.h +++ b/cocos/deprecated/CCArray.h @@ -1,7 +1,7 @@ /**************************************************************************** Copyright (c) 2010 ForzeField Studios S.L. http://forzefield.com Copyright (c) 2010-2012 cocos2d-x.org -Copyright (c) 2013-2014 Chukong Technologies Inc. +Copyright (c) 2013-2015 Chukong Technologies Inc. http://www.cocos2d-x.org @@ -23,8 +23,10 @@ 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. ****************************************************************************/ + #ifndef __CCARRAY_H__ #define __CCARRAY_H__ +/// @cond DO_NOT_SHOW #define CC_USE_ARRAY_VECTOR 0 @@ -556,4 +558,5 @@ public: NS_CC_END +/// @endcond #endif // __CCARRAY_H__ diff --git a/cocos/deprecated/CCBool.h b/cocos/deprecated/CCBool.h index 641466d8a2..cfc76776d2 100644 --- a/cocos/deprecated/CCBool.h +++ b/cocos/deprecated/CCBool.h @@ -1,6 +1,6 @@ /**************************************************************************** Copyright (c) 2010-2012 cocos2d-x.org -Copyright (c) 2013-2014 Chukong Technologies Inc. +Copyright (c) 2013-2015 Chukong Technologies Inc. http://www.cocos2d-x.org @@ -25,6 +25,7 @@ Copyright (c) 2013-2014 Chukong Technologies Inc. #ifndef __CCBOOL_H__ #define __CCBOOL_H__ +/// @cond DO_NOT_SHOW #include "base/CCRef.h" #include "base/CCDataVisitor.h" @@ -69,4 +70,5 @@ private: NS_CC_END +/// @endcond #endif /* __CCBOOL_H__ */ diff --git a/cocos/deprecated/CCDeprecated.h b/cocos/deprecated/CCDeprecated.h index b1837b6d17..f2fa88eabb 100644 --- a/cocos/deprecated/CCDeprecated.h +++ b/cocos/deprecated/CCDeprecated.h @@ -1,6 +1,6 @@ /**************************************************************************** Copyright (c) 2013 cocos2d-x.org - Copyright (c) 2013-2014 Chukong Technologies Inc. + Copyright (c) 2013-2015 Chukong Technologies Inc. http://www.cocos2d-x.org @@ -23,6 +23,8 @@ THE SOFTWARE. ****************************************************************************/ +/// @cond DO_NOT_SHOW + /** Add deprecated global functions and variables here */ @@ -1155,5 +1157,5 @@ CC_DEPRECATED_ATTRIBUTE CC_DLL Vec4* kmVec4Transform(Vec4* pOut, const Vec4* pV, NS_CC_END - +/// @endcond #endif // __COCOS2D_CCDEPRECATED_H__ diff --git a/cocos/deprecated/CCDictionary.h b/cocos/deprecated/CCDictionary.h index 5bd701c10a..f4b36ea7c7 100644 --- a/cocos/deprecated/CCDictionary.h +++ b/cocos/deprecated/CCDictionary.h @@ -1,6 +1,6 @@ /**************************************************************************** Copyright (c) 2012 cocos2d-x.org - opyright (c) 2013-2014 Chukong Technologies Inc. + opyright (c) 2013-2015 Chukong Technologies Inc. http://www.cocos2d-x.org @@ -25,6 +25,7 @@ THE SOFTWARE. #ifndef __CCDICTIONARY_H__ #define __CCDICTIONARY_H__ +/// @cond DO_NOT_SHOW #include "base/uthash.h" #include "base/CCRef.h" @@ -456,4 +457,5 @@ private: NS_CC_END +/// @endcond #endif /* __CCDICTIONARY_H__ */ diff --git a/cocos/deprecated/CCDouble.h b/cocos/deprecated/CCDouble.h index cb0742487c..5069f99551 100644 --- a/cocos/deprecated/CCDouble.h +++ b/cocos/deprecated/CCDouble.h @@ -1,5 +1,5 @@ /**************************************************************************** - Copyright (c) 2013-2014 Chukong Technologies + Copyright (c) 2013-2015 Chukong Technologies http://www.cocos2d-x.org @@ -24,6 +24,7 @@ #ifndef __CCDOUBLE_H__ #define __CCDOUBLE_H__ +/// @cond DO_NOT_SHOW #include "base/CCRef.h" #include "base/CCDataVisitor.h" @@ -68,4 +69,5 @@ private: NS_CC_END +/// @endcond #endif /* __CCDOUBLE_H__ */ diff --git a/cocos/deprecated/CCFloat.h b/cocos/deprecated/CCFloat.h index f467acfbe5..e4e78e8049 100644 --- a/cocos/deprecated/CCFloat.h +++ b/cocos/deprecated/CCFloat.h @@ -1,5 +1,5 @@ /**************************************************************************** - Copyright (c) 2013-2014 Chukong Technologies + Copyright (c) 2013-2015 Chukong Technologies http://www.cocos2d-x.org @@ -24,6 +24,7 @@ #ifndef __CCFLOAT_H__ #define __CCFLOAT_H__ +/// @cond DO_NOT_SHOW #include "base/CCRef.h" #include "base/CCDataVisitor.h" @@ -69,4 +70,5 @@ private: NS_CC_END +/// @endcond #endif /* __CCFLOAT_H__ */ diff --git a/cocos/deprecated/CCInteger.h b/cocos/deprecated/CCInteger.h index 0725f72759..aeecce26bc 100644 --- a/cocos/deprecated/CCInteger.h +++ b/cocos/deprecated/CCInteger.h @@ -1,5 +1,5 @@ /**************************************************************************** - Copyright (c) 2013-2014 Chukong Technologies + Copyright (c) 2013-2015 Chukong Technologies http://www.cocos2d-x.org @@ -24,6 +24,7 @@ #ifndef __CCINTEGER_H__ #define __CCINTEGER_H__ +/// @cond DO_NOT_SHOW #include "base/CCRef.h" #include "base/CCConsole.h" @@ -78,4 +79,5 @@ private: NS_CC_END +/// @endcond #endif /* __CCINTEGER_H__ */ diff --git a/cocos/deprecated/CCNotificationCenter.h b/cocos/deprecated/CCNotificationCenter.h index 44b88ca17b..2bf1db86e0 100644 --- a/cocos/deprecated/CCNotificationCenter.h +++ b/cocos/deprecated/CCNotificationCenter.h @@ -1,7 +1,7 @@ /**************************************************************************** Copyright (c) 2011 Erawppa Copyright (c) 2010-2012 cocos2d-x.org -Copyright (c) 2013-2014 Chukong Technologies Inc. +Copyright (c) 2013-2015 Chukong Technologies Inc. http://www.cocos2d-x.org @@ -26,6 +26,7 @@ THE SOFTWARE. #ifndef __CCNOTIFICATIONCENTER_H__ #define __CCNOTIFICATIONCENTER_H__ +/// @cond DO_NOT_SHOW #include "base/CCRef.h" #include "base/ccTypes.h" @@ -208,4 +209,5 @@ private: NS_CC_END +/// @endcond #endif//__CCNOTIFICATIONCENTER_H__ diff --git a/cocos/deprecated/CCSet.h b/cocos/deprecated/CCSet.h index 838f59ff20..0c5bc96291 100644 --- a/cocos/deprecated/CCSet.h +++ b/cocos/deprecated/CCSet.h @@ -1,6 +1,6 @@ /**************************************************************************** Copyright (c) 2010-2012 cocos2d-x.org -Copyright (c) 2013-2014 Chukong Technologies +Copyright (c) 2013-2015 Chukong Technologies http://www.cocos2d-x.org @@ -25,6 +25,7 @@ THE SOFTWARE. #ifndef __CC_SET_H__ #define __CC_SET_H__ +/// @cond DO_NOT_SHOW #include #include "base/CCRef.h" @@ -117,5 +118,5 @@ private: NS_CC_END +/// @endcond #endif // __CC_SET_H__ - diff --git a/cocos/deprecated/CCString.h b/cocos/deprecated/CCString.h index 18d2002a56..d9f1e8861a 100644 --- a/cocos/deprecated/CCString.h +++ b/cocos/deprecated/CCString.h @@ -1,6 +1,6 @@ /**************************************************************************** Copyright (c) 2010-2012 cocos2d-x.org -Copyright (c) 2013-2014 Chukong Technologies +Copyright (c) 2013-2015 Chukong Technologies http://www.cocos2d-x.org @@ -22,8 +22,10 @@ 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. ****************************************************************************/ + #ifndef __CCSTRING_H__ #define __CCSTRING_H__ +/// @cond DO_NOT_SHOW #if (CC_TARGET_PLATFORM == CC_PLATFORM_BLACKBERRY) #include @@ -224,4 +226,5 @@ std::string CC_DLL format(const char* format, ...) CC_FORMAT_PRINTF(1, 2); NS_CC_END +/// @endcond #endif //__CCSTRING_H__ diff --git a/cocos/editor-support/cocostudio/ActionTimeline/CCFrame.cpp b/cocos/editor-support/cocostudio/ActionTimeline/CCFrame.cpp index 4c80abdc2c..654fa1dfc4 100644 --- a/cocos/editor-support/cocostudio/ActionTimeline/CCFrame.cpp +++ b/cocos/editor-support/cocostudio/ActionTimeline/CCFrame.cpp @@ -83,7 +83,10 @@ VisibleFrame::VisibleFrame() void VisibleFrame::onEnter(Frame *nextFrame, int currentFrameIndex) { - _node->setVisible(_visible); + if (_node) + { + _node->setVisible(_visible); + } } @@ -170,6 +173,11 @@ RotationFrame::RotationFrame() void RotationFrame::onEnter(Frame *nextFrame, int currentFrameIndex) { + if (_node == nullptr) + { + return; + } + _node->setRotation(_rotation); if(_tween) @@ -180,7 +188,7 @@ void RotationFrame::onEnter(Frame *nextFrame, int currentFrameIndex) void RotationFrame::apply(float percent) { - if (_tween && _betwennRotation != 0) + if (_node && _tween && _betwennRotation != 0) { float rotation = _rotation + percent * _betwennRotation; _node->setRotation(rotation); @@ -220,6 +228,11 @@ SkewFrame::SkewFrame() void SkewFrame::onEnter(Frame *nextFrame, int currentFrameIndex) { + if (_node == nullptr) + { + return; + } + _node->setSkewX(_skewX); _node->setSkewY(_skewY); @@ -232,7 +245,7 @@ void SkewFrame::onEnter(Frame *nextFrame, int currentFrameIndex) void SkewFrame::apply(float percent) { - if (_tween && (_betweenSkewX != 0 || _betweenSkewY != 0)) + if (_node && _tween && (_betweenSkewX != 0 || _betweenSkewY != 0)) { float skewx = _skewX + percent * _betweenSkewX; float skewy = _skewY + percent * _betweenSkewY; @@ -275,6 +288,11 @@ RotationSkewFrame::RotationSkewFrame() void RotationSkewFrame::onEnter(Frame *nextFrame, int currentFrameIndex) { + if (_node == nullptr) + { + return; + } + _node->setRotationSkewX(_skewX); _node->setRotationSkewY(_skewY); @@ -287,7 +305,7 @@ void RotationSkewFrame::onEnter(Frame *nextFrame, int currentFrameIndex) void RotationSkewFrame::apply(float percent) { - if (_tween && (_betweenSkewX != 0 || _betweenSkewY != 0)) + if (_node && _tween && (_betweenSkewX != 0 || _betweenSkewY != 0)) { float skewx = _skewX + percent * _betweenSkewX; float skewy = _skewY + percent * _betweenSkewY; @@ -329,6 +347,11 @@ PositionFrame::PositionFrame() void PositionFrame::onEnter(Frame *nextFrame, int currentFrameIndex) { + if (_node == nullptr) + { + return; + } + _node->setPosition(_position); if(_tween) @@ -340,7 +363,7 @@ void PositionFrame::onEnter(Frame *nextFrame, int currentFrameIndex) void PositionFrame::apply(float percent) { - if (_tween && (_betweenX != 0 || _betweenY != 0)) + if (_node && _tween && (_betweenX != 0 || _betweenY != 0)) { Point p; p.x = _position.x + _betweenX * percent; @@ -382,6 +405,11 @@ ScaleFrame::ScaleFrame() void ScaleFrame::onEnter(Frame *nextFrame, int currentFrameIndex) { + if (_node == nullptr) + { + return; + } + _node->setScaleX(_scaleX); _node->setScaleY(_scaleY); @@ -394,7 +422,7 @@ void ScaleFrame::onEnter(Frame *nextFrame, int currentFrameIndex) void ScaleFrame::apply(float percent) { - if (_tween && (_betweenScaleX != 0 || _betweenScaleY != 0)) + if (_node && _tween && (_betweenScaleX != 0 || _betweenScaleY != 0)) { float scaleX = _scaleX + _betweenScaleX * percent; float scaleY = _scaleY + _betweenScaleY * percent; @@ -436,6 +464,11 @@ AnchorPointFrame::AnchorPointFrame() void AnchorPointFrame::onEnter(Frame *nextFrame, int currentFrameIndex) { + if (_node == nullptr) + { + return; + } + _node->setAnchorPoint(_anchorPoint); } @@ -480,6 +513,11 @@ InnerActionFrame::InnerActionFrame() void InnerActionFrame::onEnter(Frame *nextFrame, int currentFrameIndex) { + if (_node == nullptr) + { + return; + } + auto innerActiontimeline = static_cast(_node->getActionByTag(_node->getTag())); if( nullptr == innerActiontimeline) return; @@ -601,6 +639,10 @@ ColorFrame::ColorFrame() void ColorFrame::onEnter(Frame *nextFrame, int currentFrameIndex) { + if (_node == nullptr) + { + return; + } _node->setColor(_color); if(_tween) @@ -614,7 +656,7 @@ void ColorFrame::onEnter(Frame *nextFrame, int currentFrameIndex) void ColorFrame::apply(float percent) { - if (_tween && (_betweenRed != 0 || _betweenGreen != 0 || _betweenBlue != 0)) + if (_node && _tween && (_betweenRed != 0 || _betweenGreen != 0 || _betweenBlue != 0)) { Color3B color; color.r = _color.r+ _betweenRed * percent; @@ -655,6 +697,11 @@ AlphaFrame::AlphaFrame() void AlphaFrame::onEnter(Frame *nextFrame, int currentFrameIndex) { + if (_node == nullptr) + { + return; + } + _node->setOpacity(_alpha); if (_tween) @@ -665,7 +712,7 @@ void AlphaFrame::onEnter(Frame *nextFrame, int currentFrameIndex) void AlphaFrame::apply(float percent) { - if (_tween) + if (_node && _tween) { GLubyte alpha = _alpha + _betweenAlpha * percent; _node->setOpacity(alpha); diff --git a/cocos/math/CCAffineTransform.h b/cocos/math/CCAffineTransform.h index 83164ff2e3..86d23df392 100644 --- a/cocos/math/CCAffineTransform.h +++ b/cocos/math/CCAffineTransform.h @@ -33,6 +33,17 @@ THE SOFTWARE. NS_CC_BEGIN +/**@{ + Affine transform + a b 0 + c d 0 + tx ty 1 + + Identity + 1 0 0 + 0 1 0 + 0 0 1 + */ struct CC_DLL AffineTransform { float a, b, c, d; float tx, ty; @@ -40,28 +51,57 @@ struct CC_DLL AffineTransform { static const AffineTransform IDENTITY; }; +/**@}*/ + +/**Make affine transform.*/ CC_DLL AffineTransform __CCAffineTransformMake(float a, float b, float c, float d, float tx, float ty); #define AffineTransformMake __CCAffineTransformMake +/**Multiply point (x,y,1) by a affine tranform.*/ CC_DLL Vec2 __CCPointApplyAffineTransform(const Vec2& point, const AffineTransform& t); #define PointApplyAffineTransform __CCPointApplyAffineTransform +/**Multiply size (width,height,0) by a affine tranform.*/ CC_DLL Size __CCSizeApplyAffineTransform(const Size& size, const AffineTransform& t); #define SizeApplyAffineTransform __CCSizeApplyAffineTransform - +/**Make identity affine transform.*/ CC_DLL AffineTransform AffineTransformMakeIdentity(); +/**Transform Rect, which will transform the four vertice of the point.*/ CC_DLL Rect RectApplyAffineTransform(const Rect& rect, const AffineTransform& anAffineTransform); - +/**@{ + Transform vec2 and Rect by Mat4. + */ CC_DLL Rect RectApplyTransform(const Rect& rect, const Mat4& transform); CC_DLL Vec2 PointApplyTransform(const Vec2& point, const Mat4& transform); - +/**@}*/ +/** + Translation, equals + 1 0 1 + 0 1 0 * affinetransform + tx ty 1 + */ CC_DLL AffineTransform AffineTransformTranslate(const AffineTransform& t, float tx, float ty); +/** + Rotation, equals + cos(angle) sin(angle) 0 + -sin(angle) cos(angle) 0 * AffineTransform + 0 0 1 + */ CC_DLL AffineTransform AffineTransformRotate(const AffineTransform& aTransform, float anAngle); +/** + Scale, equals + sx 0 0 + 0 sy 0 * affineTransform + 0 0 1 + */ CC_DLL AffineTransform AffineTransformScale(const AffineTransform& t, float sx, float sy); +/**Concat two affine transform, t1 * t2*/ CC_DLL AffineTransform AffineTransformConcat(const AffineTransform& t1, const AffineTransform& t2); +/**Compare affine transform.*/ CC_DLL bool AffineTransformEqualToTransform(const AffineTransform& t1, const AffineTransform& t2); +/**Get the inverse of affine transform.*/ CC_DLL AffineTransform AffineTransformInvert(const AffineTransform& t); - +/**Concat Mat4, return t1 * t2.*/ CC_DLL Mat4 TransformConcat(const Mat4& t1, const Mat4& t2); extern CC_DLL const AffineTransform AffineTransformIdentity; diff --git a/cocos/math/CCGeometry.h b/cocos/math/CCGeometry.h index d2ad7d6c45..d271b9cf1c 100644 --- a/cocos/math/CCGeometry.h +++ b/cocos/math/CCGeometry.h @@ -42,9 +42,12 @@ NS_CC_BEGIN class CC_DLL Size { public: + /**Width of the Size.*/ float width; + /**Height of the Size.*/ float height; public: + /**Conversion from Vec2 to Size.*/ operator Vec2() const { return Vec2(width, height); @@ -52,23 +55,19 @@ public: public: /** - * @js NA + @{ + Constructor. + @param width Width of the size. + @param height Height of the size. + @param other Copy constructor. + @param point Conversion from a point. */ Size(); - /** - * @js NA - */ Size(float width, float height); - /** - * @js NA - * @lua NA - */ Size(const Size& other); - /** - * @js NA - * @lua NA - */ explicit Size(const Vec2& point); + /**@}*/ + /** * @js NA * @lua NA @@ -100,34 +99,42 @@ public: */ Size operator/(float a) const; /** + Set the width and height of Size. * @js NA * @lua NA */ void setSize(float width, float height); /** + Check if two size is the same. * @js NA */ bool equals(const Size& target) const; - + /**Size(0,0).*/ static const Size ZERO; }; +/**Rectangle area.*/ class CC_DLL Rect { public: + /**Low left point of rect.*/ Vec2 origin; + /**Width and height of the rect.*/ Size size; public: /** + Constructor an empty Rect. * @js NA */ Rect(); /** + Constructor a rect. * @js NA */ Rect(float x, float y, float width, float height); /** + Copy constructor. * @js NA * @lua NA */ @@ -138,54 +145,65 @@ public: */ Rect& operator= (const Rect& other); /** + Set the x, y, width and height of Rect. * @js NA * @lua NA */ void setRect(float x, float y, float width, float height); /** + Get the left of the rect. * @js NA */ float getMinX() const; /// return the leftmost x-value of current rect /** + Get the X coordinate of center point. * @js NA */ float getMidX() const; /// return the midpoint x-value of current rect /** + Get the right of rect. * @js NA */ float getMaxX() const; /// return the rightmost x-value of current rect /** + Get the bottom of rect. * @js NA */ float getMinY() const; /// return the bottommost y-value of current rect /** + Get the Y coordinate of center point. * @js NA */ float getMidY() const; /// return the midpoint y-value of current rect /** + Get top of rect. * @js NA */ float getMaxY() const; /// return the topmost y-value of current rect /** + Compare two rects. * @js NA */ bool equals(const Rect& rect) const; /** + Check if the points is contained in the rect. * @js NA */ bool containsPoint(const Vec2& point) const; /** + Check the intersect status of two rects. * @js NA */ bool intersectsRect(const Rect& rect) const; /** + Get the min rect which can contain this and rect. * @js NA * @lua NA */ Rect unionWithRect(const Rect & rect) const; - + /**Compute the min rect which can contain this and rect, assign it to this.*/ void merge(const Rect& rect); - + /**An empty Rect.*/ static const Rect ZERO; }; diff --git a/cocos/math/Mat4.h b/cocos/math/Mat4.h index 48224665b8..cbdbf392a5 100644 --- a/cocos/math/Mat4.h +++ b/cocos/math/Mat4.h @@ -1,5 +1,6 @@ /** Copyright 2013 BlackBerry Inc. + Copyright (c) 2014-2015 Chukong Technologies Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/cocos/math/MathUtil.h b/cocos/math/MathUtil.h index 64d80ad4c3..36b13e9ce8 100644 --- a/cocos/math/MathUtil.h +++ b/cocos/math/MathUtil.h @@ -1,5 +1,6 @@ /** Copyright 2013 BlackBerry Inc. + Copyright (c) 2014-2015 Chukong Technologies Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/cocos/math/Quaternion.h b/cocos/math/Quaternion.h index c1188456ce..7e82c4a047 100644 --- a/cocos/math/Quaternion.h +++ b/cocos/math/Quaternion.h @@ -1,6 +1,7 @@ /** Copyright 2013 BlackBerry Inc. - + Copyright (c) 2014-2015 Chukong Technologies + Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/cocos/network/HttpAsynConnection.h b/cocos/network/HttpAsynConnection.h index 21e7f5cd1e..1ae43c96d5 100644 --- a/cocos/network/HttpAsynConnection.h +++ b/cocos/network/HttpAsynConnection.h @@ -1,5 +1,5 @@ /**************************************************************************** - Copyright (c) 2013-2014 Chukong Technologies Inc. + Copyright (c) 2013-2015 Chukong Technologies Inc. http://www.cocos2d-x.org @@ -21,8 +21,10 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ + #ifndef __HTTPASYNCONNECTION_H__ #define __HTTPASYNCONNECTION_H__ +/// @cond DO_NOT_SHOW #import #import @@ -58,5 +60,6 @@ -(void) startRequest:(NSURLRequest*)request; @end + /// @endcond #endif //__HTTPASYNCONNECTION_H__ diff --git a/cocos/network/HttpCookie.h b/cocos/network/HttpCookie.h index be57a97f1a..737035e14f 100644 --- a/cocos/network/HttpCookie.h +++ b/cocos/network/HttpCookie.h @@ -1,5 +1,5 @@ /**************************************************************************** - Copyright (c) 2013-2014 Chukong Technologies Inc. + Copyright (c) 2013-2015 Chukong Technologies Inc. http://www.cocos2d-x.org @@ -24,6 +24,7 @@ #ifndef HTTP_COOKIE_H #define HTTP_COOKIE_H +/// @cond DO_NOT_SHOW struct CookiesInfo { @@ -53,4 +54,5 @@ private: std::vector _cookies; }; +/// @endcond #endif /* HTTP_COOKIE_H */ diff --git a/cocos/platform/CCApplication.h b/cocos/platform/CCApplication.h index 4581bdaaf8..56bee474fd 100644 --- a/cocos/platform/CCApplication.h +++ b/cocos/platform/CCApplication.h @@ -1,6 +1,6 @@ /**************************************************************************** Copyright (c) 2010-2012 cocos2d-x.org -Copyright (c) 2013-2014 Chukong Technologies Inc. +Copyright (c) 2013-2015 Chukong Technologies Inc. http://www.cocos2d-x.org @@ -25,6 +25,7 @@ THE SOFTWARE. #ifndef __PLATFORM_CCAPPLICATION_H__ #define __PLATFORM_CCAPPLICATION_H__ +/// @cond DO_NOT_SHOW #include "platform/CCPlatformConfig.h" @@ -42,4 +43,5 @@ THE SOFTWARE. #include "platform/linux/CCApplication-linux.h" #endif +/// @endcond #endif /* __PLATFORM_CCAPPLICATION_H__*/ diff --git a/cocos/platform/CCCommon.h b/cocos/platform/CCCommon.h index b2707d2e8b..df72d4d50f 100644 --- a/cocos/platform/CCCommon.h +++ b/cocos/platform/CCCommon.h @@ -1,6 +1,6 @@ /**************************************************************************** Copyright (c) 2010-2012 cocos2d-x.org -Copyright (c) 2013-2014 Chukong Technologies Inc. +Copyright (c) 2013-2015 Chukong Technologies Inc. http://www.cocos2d-x.org @@ -25,6 +25,7 @@ THE SOFTWARE. #ifndef __CC_COMMON_H__ #define __CC_COMMON_H__ +/// @cond DO_NOT_SHOW #include "platform/CCPlatformMacros.h" @@ -76,4 +77,5 @@ enum class LanguageType NS_CC_END +/// @endcond #endif // __CC_COMMON_H__ diff --git a/cocos/platform/CCGL.h b/cocos/platform/CCGL.h index 141f3639bf..e42f7128f4 100644 --- a/cocos/platform/CCGL.h +++ b/cocos/platform/CCGL.h @@ -1,6 +1,6 @@ /**************************************************************************** Copyright (c) 2010-2012 cocos2d-x.org -Copyright (c) 2013-2014 Chukong Technologies Inc. +Copyright (c) 2013-2015 Chukong Technologies Inc. http://www.cocos2d-x.org @@ -25,6 +25,7 @@ THE SOFTWARE. #ifndef __PLATFORM_CCGL_H__ #define __PLATFORM_CCGL_H__ +/// @cond DO_NOT_SHOW #include "platform/CCPlatformConfig.h" @@ -42,4 +43,5 @@ THE SOFTWARE. #include "platform/linux/CCGL-linux.h" #endif +/// @endcond #endif /* __PLATFORM_CCPLATFORMDEFINE_H__*/ diff --git a/cocos/platform/CCImage.h b/cocos/platform/CCImage.h index c2883c1cbf..6abedd5c57 100644 --- a/cocos/platform/CCImage.h +++ b/cocos/platform/CCImage.h @@ -1,6 +1,6 @@ /**************************************************************************** Copyright (c) 2010-2012 cocos2d-x.org -Copyright (c) 2013-2014 Chukong Technologies Inc. +Copyright (c) 2013-2015 Chukong Technologies Inc. http://www.cocos2d-x.org @@ -25,6 +25,7 @@ THE SOFTWARE. #ifndef __CC_IMAGE_H__ #define __CC_IMAGE_H__ +/// @cond DO_NOT_SHOW #include "base/CCRef.h" #include "renderer/CCTexture2D.h" @@ -217,4 +218,5 @@ protected: NS_CC_END +/// @endcond #endif // __CC_IMAGE_H__ diff --git a/cocos/platform/CCPlatformConfig.h b/cocos/platform/CCPlatformConfig.h index dee092326c..caceecb548 100644 --- a/cocos/platform/CCPlatformConfig.h +++ b/cocos/platform/CCPlatformConfig.h @@ -1,6 +1,6 @@ /**************************************************************************** Copyright (c) 2010-2012 cocos2d-x.org -Copyright (c) 2013-2014 Chukong Technologies +Copyright (c) 2013-2015 Chukong Technologies http://www.cocos2d-x.org @@ -25,6 +25,7 @@ THE SOFTWARE. #ifndef __BASE_CC_PLATFORM_CONFIG_H__ #define __BASE_CC_PLATFORM_CONFIG_H__ +/// @cond DO_NOT_SHOW /** Config of cocos2d-x project, per target platform. @@ -156,5 +157,5 @@ THE SOFTWARE. #endif #endif // CC_PLATFORM_WIN32 +/// @endcond #endif // __BASE_CC_PLATFORM_CONFIG_H__ - diff --git a/cocos/platform/CCPlatformDefine.h b/cocos/platform/CCPlatformDefine.h index 4a581ddb8a..a336e99a38 100644 --- a/cocos/platform/CCPlatformDefine.h +++ b/cocos/platform/CCPlatformDefine.h @@ -1,6 +1,6 @@ /**************************************************************************** Copyright (c) 2010-2012 cocos2d-x.org -Copyright (c) 2013-2014 Chukong Technologies Inc. +Copyright (c) 2013-2015 Chukong Technologies Inc. http://www.cocos2d-x.org @@ -25,6 +25,7 @@ THE SOFTWARE. #ifndef __PLATFORM_CCPLATFORMDEFINE_H__ #define __PLATFORM_CCPLATFORMDEFINE_H__ +/// @cond DO_NOT_SHOW #include "platform/CCPlatformConfig.h" @@ -42,4 +43,5 @@ THE SOFTWARE. #include "platform/linux/CCPlatformDefine-linux.h" #endif +/// @endcond #endif /* __PLATFORM_CCPLATFORMDEFINE_H__*/ diff --git a/cocos/platform/CCPlatformMacros.h b/cocos/platform/CCPlatformMacros.h index 8a50b7a5ba..f150a1a490 100644 --- a/cocos/platform/CCPlatformMacros.h +++ b/cocos/platform/CCPlatformMacros.h @@ -1,6 +1,6 @@ /**************************************************************************** Copyright (c) 2010-2012 cocos2d-x.org -Copyright (c) 2013-2014 Chukong Technologies +Copyright (c) 2013-2015 Chukong Technologies http://www.cocos2d-x.org @@ -22,19 +22,21 @@ Copyright (c) 2013-2014 Chukong Technologies OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ + #ifndef __CC_PLATFORM_MACROS_H__ #define __CC_PLATFORM_MACROS_H__ /** - * define some platform specific macros + * Define some platform specific macros. */ #include "base/ccConfig.h" #include "platform/CCPlatformConfig.h" #include "platform/CCPlatformDefine.h" -/** - * define a create function for a specific type, such as Layer - * @param \__TYPE__ class type to add create(), such as Layer +/** @def CREATE_FUNC(__TYPE__) + * Define a create function for a specific type, such as Layer. + * + * @param __TYPE__ class type to add create(), such as Layer. */ #define CREATE_FUNC(__TYPE__) \ static __TYPE__* create() \ @@ -53,9 +55,10 @@ static __TYPE__* create() \ } \ } -/** - * define a node function for a specific type, such as Layer - * @param \__TYPE__ class type to add node(), such as Layer +/** @def NODE_FUNC(__TYPE__) + * Define a node function for a specific type, such as Layer. + * + * @param __TYPE__ class type to add node(), such as Layer. * @deprecated This interface will be deprecated sooner or later. */ #define NODE_FUNC(__TYPE__) \ @@ -76,12 +79,12 @@ CC_DEPRECATED_ATTRIBUTE static __TYPE__* node() \ } /** @def CC_ENABLE_CACHE_TEXTURE_DATA -Enable it if you want to cache the texture data. -Not enabling for Emscripten any more -- doesn't seem necessary and don't want -to be different from other platforms unless there's a good reason. - -It's new in cocos2d-x since v0.99.5 -*/ + * Enable it if you want to cache the texture data. + * Not enabling for Emscripten any more -- doesn't seem necessary and don't want + * to be different from other platforms unless there's a good reason. + * + * @since v0.99.5 + */ #if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) || (CC_TARGET_PLATFORM == CC_PLATFORM_WP8) || (CC_TARGET_PLATFORM == CC_PLATFORM_WINRT) #define CC_ENABLE_CACHE_TEXTURE_DATA 1 #else @@ -89,17 +92,18 @@ It's new in cocos2d-x since v0.99.5 #endif #if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) || (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) || (CC_TARGET_PLATFORM == CC_PLATFORM_EMSCRIPTEN) - /* Application will crash in glDrawElements function on some win32 computers and some android devices. - Indices should be bound again while drawing to avoid this bug. + /** Application will crash in glDrawElements function on some win32 computers and some android devices. + * Indices should be bound again while drawing to avoid this bug. */ #define CC_REBIND_INDICES_BUFFER 1 #else #define CC_REBIND_INDICES_BUFFER 0 #endif -// generic macros +// Generic macros -// namespace cocos2d {} +/// @name namespace cocos2d +/// @{ #ifdef __cplusplus #define NS_CC_BEGIN namespace cocos2d { #define NS_CC_END } @@ -111,15 +115,18 @@ It's new in cocos2d-x since v0.99.5 #define USING_NS_CC #define NS_CC #endif +// end of namespace group +/// @} -/** CC_PROPERTY_READONLY is used to declare a protected variable. - We can use getter to read the variable. - @param varType the type of variable. - @param varName variable name. - @param funName "get + funName" will be the name of the getter. - @warning The getter is a public virtual function, you should rewrite it first. - The variables and methods declared after CC_PROPERTY_READONLY are all public. - If you need protected or private, please declare. +/** @def CC_PROPERTY_READONLY + * It is used to declare a protected variable. We can use getter to read the variable. + * + * @param varType the type of variable. + * @param varName variable name. + * @param funName "get + funName" will be the name of the getter. + * @warning The getter is a public virtual function, you should rewrite it first. + * The variables and methods declared after CC_PROPERTY_READONLY are all public. + * If you need protected or private, please declare. */ #define CC_PROPERTY_READONLY(varType, varName, funName)\ protected: varType varName;\ @@ -129,15 +136,17 @@ public: virtual varType get##funName(void) const; protected: varType varName;\ public: virtual const varType& get##funName(void) const; -/** CC_PROPERTY is used to declare a protected variable. - We can use getter to read the variable, and use the setter to change the variable. - @param varType the type of variable. - @param varName variable name. - @param funName "get + funName" will be the name of the getter. - "set + funName" will be the name of the setter. - @warning The getter and setter are public virtual functions, you should rewrite them first. - The variables and methods declared after CC_PROPERTY are all public. - If you need protected or private, please declare. +/** @def CC_PROPERTY + * It is used to declare a protected variable. + * We can use getter to read the variable, and use the setter to change the variable. + * + * @param varType The type of variable. + * @param varName Variable name. + * @param funName "get + funName" will be the name of the getter. + * "set + funName" will be the name of the setter. + * @warning The getter and setter are public virtual functions, you should rewrite them first. + * The variables and methods declared after CC_PROPERTY are all public. + * If you need protected or private, please declare. */ #define CC_PROPERTY(varType, varName, funName)\ protected: varType varName;\ @@ -149,14 +158,15 @@ protected: varType varName;\ public: virtual const varType& get##funName(void) const;\ public: virtual void set##funName(const varType& var); -/** CC_SYNTHESIZE_READONLY is used to declare a protected variable. - We can use getter to read the variable. - @param varType the type of variable. - @param varName variable name. - @param funName "get + funName" will be the name of the getter. - @warning The getter is a public inline function. - The variables and methods declared after CC_SYNTHESIZE_READONLY are all public. - If you need protected or private, please declare. +/** @def CC_SYNTHESIZE_READONLY + * It is used to declare a protected variable. We can use getter to read the variable. + * + * @param varType The type of variable. + * @param varName Variable name. + * @param funName "get + funName" will be the name of the getter. + * @warning The getter is a public inline function. + * The variables and methods declared after CC_SYNTHESIZE_READONLY are all public. + * If you need protected or private, please declare. */ #define CC_SYNTHESIZE_READONLY(varType, varName, funName)\ protected: varType varName;\ @@ -166,15 +176,17 @@ public: virtual varType get##funName(void) const { return varName; } protected: varType varName;\ public: virtual const varType& get##funName(void) const { return varName; } -/** CC_SYNTHESIZE is used to declare a protected variable. - We can use getter to read the variable, and use the setter to change the variable. - @param varType the type of variable. - @param varName variable name. - @param funName "get + funName" will be the name of the getter. - "set + funName" will be the name of the setter. - @warning The getter and setter are public inline functions. - The variables and methods declared after CC_SYNTHESIZE are all public. - If you need protected or private, please declare. +/** @def CC_SYNTHESIZE + * It is used to declare a protected variable. + * We can use getter to read the variable, and use the setter to change the variable. + * + * @param varType The type of variable. + * @param varName Variable name. + * @param funName "get + funName" will be the name of the getter. + * "set + funName" will be the name of the setter. + * @warning The getter and setter are public inline functions. + * The variables and methods declared after CC_SYNTHESIZE are all public. + * If you need protected or private, please declare. */ #define CC_SYNTHESIZE(varType, varName, funName)\ protected: varType varName;\ @@ -210,7 +222,8 @@ public: virtual void set##funName(varType var) \ #define __CCLOGWITHFUNCTION(s, ...) \ log("%s : %s",__FUNCTION__, StringUtils::format(s, ##__VA_ARGS__).c_str()) -// cocos2d debug +/// @name Cocos2d debug +/// @{ #if !defined(COCOS2D_DEBUG) || COCOS2D_DEBUG == 0 #define CCLOG(...) do {} while (0) #define CCLOGINFO(...) do {} while (0) @@ -230,15 +243,20 @@ public: virtual void set##funName(varType var) \ #define CCLOGWARN(...) __CCLOGWITHFUNCTION(__VA_ARGS__) #endif // COCOS2D_DEBUG -// Lua engine debug +/** Lua engine debug */ #if !defined(COCOS2D_DEBUG) || COCOS2D_DEBUG == 0 || CC_LUA_ENGINE_DEBUG == 0 #define LUALOG(...) #else #define LUALOG(format, ...) cocos2d::log(format, ##__VA_ARGS__) #endif // Lua engine debug -// A macro to disallow the copy constructor and operator= functions -// This should be used in the private: declarations for a class +// end of debug group +/// @} + +/** @def CC_DISALLOW_COPY_AND_ASSIGN(TypeName) + * A macro to disallow the copy constructor and operator= functions. + * This should be used in the private: declarations for a class + */ #if defined(__GNUC__) && ((__GNUC__ >= 5) || ((__GNUG__ == 4) && (__GNUC_MINOR__ >= 4))) \ || (defined(__clang__) && (__clang_major__ >= 3)) || (_MSC_VER >= 1800) #define CC_DISALLOW_COPY_AND_ASSIGN(TypeName) \ @@ -250,18 +268,20 @@ public: virtual void set##funName(varType var) \ TypeName &operator =(const TypeName &); #endif -// A macro to disallow all the implicit constructors, namely the -// default constructor, copy constructor and operator= functions. -// -// This should be used in the private: declarations for a class -// that wants to prevent anyone from instantiating it. This is -// especially useful for classes containing only static methods. +/** @def CC_DISALLOW_IMPLICIT_CONSTRUCTORS(TypeName) + * A macro to disallow all the implicit constructors, namely the + * default constructor, copy constructor and operator= functions. + * + * This should be used in the private: declarations for a class + * that wants to prevent anyone from instantiating it. This is + * especially useful for classes containing only static methods. + */ #define CC_DISALLOW_IMPLICIT_CONSTRUCTORS(TypeName) \ TypeName(); \ CC_DISALLOW_COPY_AND_ASSIGN(TypeName) -/* - * only certain compilers support __attribute__((deprecated)) +/** @def CC_DEPRECATED_ATTRIBUTE + * Only certain compilers support __attribute__((deprecated)). */ #if defined(__GNUC__) && ((__GNUC__ >= 4) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1))) #define CC_DEPRECATED_ATTRIBUTE __attribute__((deprecated)) @@ -271,17 +291,18 @@ public: virtual void set##funName(varType var) \ #define CC_DEPRECATED_ATTRIBUTE #endif -/* - * macro to mark things deprecated as of a particular version - * can be used with artibrary parameters which are thrown away +/** @def CC_DEPRECATED(...) + * Macro to mark things deprecated as of a particular version + * can be used with artibrary parameters which are thrown away. * e.g. CC_DEPRECATED(4.0) or CC_DEPRECATED(4.0, "not going to need this anymore") etc. */ #define CC_DEPRECATED(...) CC_DEPRECATED_ATTRIBUTE -/* - * only certain compiler support __attribute__((format)) - * formatPos - 1-based position of format string argument - * argPos - 1-based position of first format-dependent argument +/** @def CC_FORMAT_PRINTF(formatPos, argPos) + * Only certain compiler support __attribute__((format)) + * + * @param formatPos 1-based position of format string argument. + * @param argPos 1-based position of first format-dependent argument. */ #if defined(__GNUC__) && (__GNUC__ >= 4) #define CC_FORMAT_PRINTF(formatPos, argPos) __attribute__((__format__(printf, formatPos, argPos))) @@ -305,9 +326,9 @@ public: virtual void set##funName(varType var) \ #define CC_UNUSED #endif -// -// CC_REQUIRES_NULL_TERMINATION -// +/** @def CC_REQUIRES_NULL_TERMINATION + * + */ #if !defined(CC_REQUIRES_NULL_TERMINATION) #if defined(__APPLE_CC__) && (__APPLE_CC__ >= 5549) #define CC_REQUIRES_NULL_TERMINATION __attribute__((sentinel(0,1))) diff --git a/cocos/platform/CCSAXParser.h b/cocos/platform/CCSAXParser.h index 222affb538..bc2cfa3317 100644 --- a/cocos/platform/CCSAXParser.h +++ b/cocos/platform/CCSAXParser.h @@ -23,6 +23,7 @@ #ifndef __CCSAXPARSER_H__ #define __CCSAXPARSER_H__ +/// @cond DO_NOT_SHOW #include "platform/CCPlatformConfig.h" #include "platform/CCCommon.h" @@ -115,4 +116,5 @@ public: NS_CC_END +/// @endcond #endif //__CCSAXPARSER_H__ diff --git a/cocos/platform/CCStdC.h b/cocos/platform/CCStdC.h index 8700aec3c0..e821fa1a3a 100644 --- a/cocos/platform/CCStdC.h +++ b/cocos/platform/CCStdC.h @@ -1,6 +1,6 @@ /**************************************************************************** Copyright (c) 2010-2012 cocos2d-x.org -Copyright (c) 2013-2014 Chukong Technologies Inc. +Copyright (c) 2013-2015 Chukong Technologies Inc. http://www.cocos2d-x.org diff --git a/cocos/platform/CCThread.h b/cocos/platform/CCThread.h index 0598adcf97..a371eef663 100644 --- a/cocos/platform/CCThread.h +++ b/cocos/platform/CCThread.h @@ -1,6 +1,6 @@ /**************************************************************************** Copyright (c) 2010-2012 cocos2d-x.org -Copyright (c) 2013-2014 Chukong Technologies Inc. +Copyright (c) 2013-2015 Chukong Technologies Inc. http://www.cocos2d-x.org @@ -25,6 +25,7 @@ THE SOFTWARE. #ifndef __CC_PLATFORM_THREAD_H__ #define __CC_PLATFORM_THREAD_H__ +/// @cond DO_NOT_SHOW #include "platform/CCPlatformMacros.h" @@ -61,4 +62,5 @@ public: NS_CC_END +/// @endcond #endif // __CC_PLATFORM_THREAD_H__ diff --git a/cocos/renderer/CCRenderCommandPool.h b/cocos/renderer/CCRenderCommandPool.h index 157ff8c2c3..15d04228e1 100644 --- a/cocos/renderer/CCRenderCommandPool.h +++ b/cocos/renderer/CCRenderCommandPool.h @@ -1,5 +1,5 @@ /**************************************************************************** - Copyright (c) 2013-2014 Chukong Technologies Inc. + Copyright (c) 2013-2015 Chukong Technologies Inc. http://www.cocos2d-x.org @@ -22,9 +22,9 @@ THE SOFTWARE. ****************************************************************************/ - #ifndef __CC_RENDERCOMMANDPOOL_H__ #define __CC_RENDERCOMMANDPOOL_H__ +/// @cond DO_NOT_SHOW #include @@ -98,4 +98,5 @@ private: NS_CC_END +/// @endcond #endif diff --git a/cocos/renderer/ccGLStateCache.h b/cocos/renderer/ccGLStateCache.h index 07b25bfe3d..fdb2effc2a 100644 --- a/cocos/renderer/ccGLStateCache.h +++ b/cocos/renderer/ccGLStateCache.h @@ -2,7 +2,7 @@ Copyright (c) 2011 Ricardo Quesada Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2011 Zynga Inc. - Copyright (C) 2013-2014 Chukong Technologies Inc. + Copyright (C) 2013-2015 Chukong Technologies Inc. http://www.cocos2d-x.org @@ -36,7 +36,7 @@ THE SOFTWARE. NS_CC_BEGIN /** - * @addtogroup shaders + * @addtogroup support * @{ */ @@ -44,7 +44,7 @@ class GLProgram; namespace GL { -/** vertex attrib flags */ +/** Vertex attrib flags. */ enum { VERTEX_ATTRIB_FLAG_NONE = 0, @@ -58,95 +58,116 @@ enum { VERTEX_ATTRIB_FLAG_POS_COLOR_TEX = (VERTEX_ATTRIB_FLAG_POSITION | VERTEX_ATTRIB_FLAG_COLOR | VERTEX_ATTRIB_FLAG_TEX_COORD), }; -/** @file ccGLStateCache.h -*/ - -/** Invalidates the GL state cache. - If CC_ENABLE_GL_STATE_CACHE it will reset the GL state cache. - @since v2.0.0 +/** + * Invalidates the GL state cache. + * + * If CC_ENABLE_GL_STATE_CACHE it will reset the GL state cache. + * @since v2.0.0 */ void CC_DLL invalidateStateCache(void); -/** Uses the GL program in case program is different than the current one. - If CC_ENABLE_GL_STATE_CACHE is disabled, it will the glUseProgram() directly. - @since v2.0.0 +/** + * Uses the GL program in case program is different than the current one. + + * If CC_ENABLE_GL_STATE_CACHE is disabled, it will the glUseProgram() directly. + * @since v2.0.0 */ void CC_DLL useProgram(GLuint program); -/** Deletes the GL program. If it is the one that is being used, it invalidates it. - If CC_ENABLE_GL_STATE_CACHE is disabled, it will the glDeleteProgram() directly. - @since v2.0.0 +/** + * Deletes the GL program. If it is the one that is being used, it invalidates it. + * + * If CC_ENABLE_GL_STATE_CACHE is disabled, it will the glDeleteProgram() directly. + * @since v2.0.0 */ void CC_DLL deleteProgram(GLuint program); -/** Uses a blending function in case it not already used. - If CC_ENABLE_GL_STATE_CACHE is disabled, it will the glBlendFunc() directly. - @since v2.0.0 +/** + * Uses a blending function in case it not already used. + * + * If CC_ENABLE_GL_STATE_CACHE is disabled, it will the glBlendFunc() directly. + * @since v2.0.0 */ void CC_DLL blendFunc(GLenum sfactor, GLenum dfactor); -/** Resets the blending mode back to the cached state in case you used glBlendFuncSeparate() or glBlendEquation(). - If CC_ENABLE_GL_STATE_CACHE is disabled, it will just set the default blending mode using GL_FUNC_ADD. - @since v2.0.0 +/** + * Resets the blending mode back to the cached state in case you used glBlendFuncSeparate() or glBlendEquation(). + * + * If CC_ENABLE_GL_STATE_CACHE is disabled, it will just set the default blending mode using GL_FUNC_ADD. + * @since v2.0.0 */ void CC_DLL blendResetToCache(void); -/** sets the projection matrix as dirty - @since v2.0.0 +/** + * Sets the projection matrix as dirty. + * @since v2.0.0 */ void CC_DLL setProjectionMatrixDirty(void); -/** Will enable the vertex attribs that are passed as flags. - Possible flags: - - * VERTEX_ATTRIB_FLAG_POSITION - * VERTEX_ATTRIB_FLAG_COLOR - * VERTEX_ATTRIB_FLAG_TEX_COORDS - - These flags can be ORed. The flags that are not present, will be disabled. - - @since v2.0.0 +/** + * Will enable the vertex attribs that are passed as flags. + * Possible flags: + * + * * VERTEX_ATTRIB_FLAG_POSITION + * * VERTEX_ATTRIB_FLAG_COLOR + * * VERTEX_ATTRIB_FLAG_TEX_COORDS + * + * These flags can be ORed. The flags that are not present, will be disabled. + * + * @since v2.0.0 */ void CC_DLL enableVertexAttribs(uint32_t flags); -/** If the texture is not already bound to texture unit 0, it binds it. - If CC_ENABLE_GL_STATE_CACHE is disabled, it will call glBindTexture() directly. - @since v2.0.0 +/** + * If the texture is not already bound to texture unit 0, it binds it. + * + * If CC_ENABLE_GL_STATE_CACHE is disabled, it will call glBindTexture() directly. + * @since v2.0.0 */ void CC_DLL bindTexture2D(GLuint textureId); -/** If the texture is not already bound to a given unit, it binds it. - If CC_ENABLE_GL_STATE_CACHE is disabled, it will call glBindTexture() directly. - @since v2.1.0 +/** + * If the texture is not already bound to a given unit, it binds it. + * + * If CC_ENABLE_GL_STATE_CACHE is disabled, it will call glBindTexture() directly. + * @since v2.1.0 */ void CC_DLL bindTexture2DN(GLuint textureUnit, GLuint textureId); -/** It will delete a given texture. If the texture was bound, it will invalidate the cached. - If CC_ENABLE_GL_STATE_CACHE is disabled, it will call glDeleteTextures() directly. - @since v2.0.0 +/** + * It will delete a given texture. If the texture was bound, it will invalidate the cached. + * + * If CC_ENABLE_GL_STATE_CACHE is disabled, it will call glDeleteTextures() directly. + * @since v2.0.0 */ void CC_DLL deleteTexture(GLuint textureId); -/** It will delete a given texture. If the texture was bound, it will invalidate the cached for the given texture unit. - If CC_ENABLE_GL_STATE_CACHE is disabled, it will call glDeleteTextures() directly. - @since v2.1.0 +/** + * It will delete a given texture. If the texture was bound, it will invalidate the cached for the given texture unit. + * + * If CC_ENABLE_GL_STATE_CACHE is disabled, it will call glDeleteTextures() directly. + * @since v2.1.0 */ CC_DEPRECATED_ATTRIBUTE void CC_DLL deleteTextureN(GLuint textureUnit, GLuint textureId); -/** Select active texture unit. - If CC_ENABLE_GL_STATE_CACHE is disabled, it will call glActiveTexture() directly. - @since v3.0 +/** + * Select active texture unit. + * + * If CC_ENABLE_GL_STATE_CACHE is disabled, it will call glActiveTexture() directly. + * @since v3.0 */ void CC_DLL activeTexture(GLenum texture); -/** If the vertex array is not already bound, it binds it. - If CC_ENABLE_GL_STATE_CACHE is disabled, it will call glBindVertexArray() directly. - @since v2.0.0 +/** + * If the vertex array is not already bound, it binds it. + * + * If CC_ENABLE_GL_STATE_CACHE is disabled, it will call glBindVertexArray() directly. + * @since v2.0.0 */ void CC_DLL bindVAO(GLuint vaoId); -// end of shaders group +// end of support group /// @} } // Namespace GL diff --git a/cocos/renderer/ccShaders.h b/cocos/renderer/ccShaders.h index eaea82f202..74b11bb09b 100644 --- a/cocos/renderer/ccShaders.h +++ b/cocos/renderer/ccShaders.h @@ -1,7 +1,7 @@ /**************************************************************************** Copyright (c) 2011 Zynga Inc. Copyright (c) 2012 cocos2d-x.org -Copyright (c) 2013-2014 Chukong Technologies Inc. +Copyright (c) 2013-2015 Chukong Technologies Inc. http://www.cocos2d-x.org @@ -23,8 +23,10 @@ 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. ****************************************************************************/ + #ifndef __CCSHADER_H__ #define __CCSHADER_H__ +/// @cond DO_NOT_SHOW #include "platform/CCGL.h" #include "platform/CCPlatformMacros.h" @@ -87,4 +89,5 @@ extern CC_DLL const GLchar * cc3D_Particle_color_frag; NS_CC_END +/// @endcond #endif /* __CCSHADER_H__ */ diff --git a/cocos/scripting/lua-bindings/manual/LuaBasicConversions.cpp b/cocos/scripting/lua-bindings/manual/LuaBasicConversions.cpp index 49ec382d9b..73001af2c9 100644 --- a/cocos/scripting/lua-bindings/manual/LuaBasicConversions.cpp +++ b/cocos/scripting/lua-bindings/manual/LuaBasicConversions.cpp @@ -1925,7 +1925,7 @@ bool luaval_to_mesh_vertex_attrib(lua_State* L, int lo, cocos2d::MeshVertexAttri ret->type = (GLenum)lua_tonumber(L, -1); lua_pop(L,1); - lua_pushstring(L, "vertexAttrib"); /* L: paramStack key */ + lua_pushstring(L, "attribSizeBytes"); /* L: paramStack key */ lua_gettable(L,lo); /* L: paramStack paramStack[lo][key] */ ret->type = (GLenum)lua_tonumber(L, -1); lua_pop(L,1); @@ -2304,10 +2304,10 @@ void affinetransform_to_luaval(lua_State* L,const AffineTransform& inValue) lua_pushnumber(L, (lua_Number) inValue.d); /* L: table key value*/ lua_rawset(L, -3); /* table[key] = value, L: table */ lua_pushstring(L, "tx"); /* L: table key */ - lua_pushnumber(L, (lua_Number) inValue.d); /* L: table key value*/ + lua_pushnumber(L, (lua_Number) inValue.tx); /* L: table key value*/ lua_rawset(L, -3); /* table[key] = value, L: table */ lua_pushstring(L, "ty"); /* L: table key */ - lua_pushnumber(L, (lua_Number) inValue.d); /* L: table key value*/ + lua_pushnumber(L, (lua_Number) inValue.ty); /* L: table key value*/ lua_rawset(L, -3); /* table[key] = value, L: table */ } diff --git a/cocos/scripting/lua-bindings/manual/LuaBasicConversions.h b/cocos/scripting/lua-bindings/manual/LuaBasicConversions.h index 3266148d13..14b5b1dd33 100644 --- a/cocos/scripting/lua-bindings/manual/LuaBasicConversions.h +++ b/cocos/scripting/lua-bindings/manual/LuaBasicConversions.h @@ -45,43 +45,489 @@ cocos2d::log("lua: ERROR: File %s: Line: %d, Function: %s", __FILE__, __LINE__, cocos2d::log(__VA_ARGS__); \ } \ +/** + * If the typename of userdata at the given accepteable index of stack is equal to type it return true,otherwise return false . + * If def != 0, lo could greater than the top index of stack, return value is true. + * If the value of the given index is nil, retrun value also is true. + * + * @param L the current lua_State. + * @param lo the given accpetable index of stack. + * @param type the typename used to judge. + * @int def whether has default value. + * @return Return true if the typename of userdata at the given accepteable index of stack is equal to type, otherwise return false. + * @lua NA + * @js NA + */ extern bool luaval_is_usertype(lua_State* L,int lo,const char* type, int def); // to native +/** + * @name luaval_to_native + * The following function are all used to convert the Lua values at the given acceptable index to the corresponding c++ values. + * If the Lua values can be converted the return value is true, otherwise return false. + * If it happens error during the conversion process, it outputs the error msg in the console to provide infromation about the name of calling function, the typename of value at the given acceptable index, and so on. + * @{ + **/ + +/** + * Get a unsigned long value from the given accpetable index of stack. + * If the value at the given accpetable index of stack is a number or a string convertible to a number it returns true, otherwise returns false . + * + * @param L the current lua_State. + * @param lo the given accpetable index of stack. + * @param outValue the pointer to store the value converted from the Lua value. + * @param funcName the name of calling function, it is used for error output in the debug model. + * @return Return true if the value at the given accpetable index of stack is a number or a string convertible to a number, otherwise return false. + * @lua NA + * @js NA + */ extern bool luaval_to_ulong(lua_State* L,int lo, unsigned long* outValue, const char* funcName=""); + +/** + * Get a unsigned short value from the given accpetable index of stack. + * If the value at the given accpetable index of stack is a number or a string convertible to a number it returns true, otherwise returns false . + * + * @param L the current lua_State. + * @param lo the given accpetable index of stack. + * @param outValue the pointer to store the unsigned short value converted from the Lua value. + * @param funcName the name of calling function, it is used for error output in the debug model. + * @return Return true if the value at the given accpetable index of stack is a number or a string convertible to a number, otherwise return false. + * @lua NA + * @js NA + */ extern bool luaval_to_ushort(lua_State* L, int lo, unsigned short* outValue, const char* funcName = ""); + +/** + * Get a int value from the given accpetable index of stack. + * If the value at the given accpetable index of stack is a number or a string convertible to a number it returns true, otherwise returns false . + * + * @param L the current lua_State. + * @param lo the given accpetable index of stack. + * @param outValue the pointer to store the int value converted from the Lua value. + * @param funcName the name of calling function, it is used for error output in the debug model. + * @return Return true if the value at the given accpetable index of stack is a number or a string convertible to a number, otherwise return false. + * @lua NA + * @js NA + */ extern bool luaval_to_int32(lua_State* L,int lo,int* outValue, const char* funcName = ""); + +/** + * Get a unsigned int value from the given accpetable index of stack. + * If the value at the given accpetable index of stack is a number or a string convertible to a number it returns true, otherwise returns false . + * + * @param L the current lua_State. + * @param lo the given accpetable index of stack. + * @param outValue the pointer to store the unsigned int value converted from the Lua value. + * @param funcName the name of calling function, it is used for error output in the debug model. + * @return Return true if the value at the given accpetable index of stack is a number or a string convertible to a number, otherwise return false. + * @lua NA + * @js NA + */ extern bool luaval_to_uint32(lua_State* L, int lo, unsigned int* outValue, const char* funcName = ""); + +/** + * Get a uint16_t value from the given accpetable index of stack. + * If the value at the given accpetable index of stack is a number or a string convertible to a number it returns true, otherwise returns false . + * + * @param L the current lua_State. + * @param lo the given accpetable index of stack. + * @param outValue the pointer to store the uint16_t value converted from the Lua value. + * @param funcName the name of calling function, it is used for error output in the debug model. + * @return Return true if the value at the given accpetable index of stack is a number or a string convertible to a number, otherwise return false. + * @lua NA + * @js NA + */ extern bool luaval_to_uint16(lua_State* L,int lo,uint16_t* outValue, const char* funcName = ""); + +/** + * Get a boolean value from the given accpetable index of stack. + * If the value at the given accpetable index of stack has type boolean it returns true, otherwise returns false. + * Any Lua value is different from false and nil, the value of conversion is true, otherwise the value is false. + * If the lo is non-valid index, the value of coversion also is false. + * + * @param L the current lua_State. + * @param lo the given accpetable index of stack. + * @param outValue the pointer to store the boolean value converted from the Lua value. + * @param funcName the name of calling function, it is used for error output in the debug model. + * @return Return true if the value at the given accpetable index of stack is a number or a string convertible to a number, otherwise return false. + * @lua NA + * @js NA + */ extern bool luaval_to_boolean(lua_State* L,int lo,bool* outValue, const char* funcName = ""); + +/** + * Get a double value from the given accpetable index of stack. + * If the value at the given accpetable index of stack is a number or a string convertible to a number it returns true, otherwise returns false. + * + * @param L the current lua_State. + * @param lo the given accpetable index of stack. + * @param outValue the pointer to store the double value converted from the Lua value. + * @param funcName the name of calling function, it is used for error output in the debug model. + * @return Return true if the value at the given accpetable index of stack is a number or a string convertible to a number, otherwise return false. + * @lua NA + * @js NA + */ extern bool luaval_to_number(lua_State* L,int lo,double* outValue, const char* funcName = ""); + +/** + * Get a long long value from the given accpetable index of stack. + * If the value at the given accpetable index of stack is a number or a string convertible to a number it returns true, otherwise returns false. + * + * @param L the current lua_State. + * @param lo the given accpetable index of stack. + * @param outValue the pointer to store the long long value converted from the Lua value. + * @param funcName the name of calling function, it is used for error output in the debug model. + * @return Return true if the value at the given accpetable index of stack is a number or a string convertible to a number, otherwise return false. + * @lua NA + * @js NA + */ extern bool luaval_to_long_long(lua_State* L,int lo,long long* outValue, const char* funcName = ""); + +/** + * Get a std::string value from the given accpetable index of stack. + * If the value at the given accpetable index of stack is a string or a number convertible to a string it returns true, otherwise returns false. + * + * @param L the current lua_State. + * @param lo the given accpetable index of stack. + * @param outValue the pointer to store std::string value converted from the Lua value. + * @param funcName the name of calling function, it is used for error output in the debug model. + * @return Return true if the value at the given accpetable index of stack is is a string or a number convertible to a string, otherwise return false. + * @lua NA + * @js NA + */ extern bool luaval_to_std_string(lua_State* L, int lo, std::string* outValue, const char* funcName = ""); + +/** + * Get a long value from the given accpetable index of stack. + * If the value at the given accpetable index of stack is a number or a string convertible to a number it returns true, otherwise returns false. + * + * @param L the current lua_State. + * @param lo the given accpetable index of stack. + * @param outValue the pointer to store the long value converted from the Lua value. + * @param funcName the name of calling function, it is used for error output in the debug model. + * @return Return true if the value at the given accpetable index of stack is a number or a string convertible to a number, otherwise return false. + * @lua NA + * @js NA + */ extern bool luaval_to_long(lua_State* L,int lo, long* outValue, const char* funcName = ""); + +/** + * Get a ssize_t value from the given accpetable index of stack. + * If the value at the given accpetable index of stack is a number or a string convertible to a number it returns true, otherwise returns false. + * + * @param L the current lua_State. + * @param lo the given accpetable index of stack. + * @param outValue the pointer to store the ssize_t value converted from the Lua value. + * @param funcName the name of calling function, it is used for error output in the debug model. + * @return Return true if the value at the given accpetable index of stack is a number or a string convertible to a number, otherwise return false. + * @lua NA + * @js NA + */ extern bool luaval_to_ssize(lua_State* L,int lo, ssize_t* outValue, const char* funcName = ""); + +/** + * Get a Size object value from the given accpetable index of stack. + * If the value at the given accpetable index of stack is a table it returns true, otherwise returns false. + * If the table has the `width` and `height` key and the corresponding values are not nil, this function would assign the values to the corresponding members of outValue. Otherwise, the value of members of outValue would be 0. + * + * @param L the current lua_State. + * @param lo the given accpetable index of stack. + * @param outValue the pointer to a Size object which stores the values from the Lua table. + * @param funcName the name of calling function, it is used for error output in the debug model. + * @return Return true if the value at the given accpetable index of stack is a table, otherwise return false. + * @lua NA + * @js NA + */ extern bool luaval_to_size(lua_State* L,int lo,Size* outValue, const char* funcName = ""); + +/** + * Get a Rect object value from the given accpetable index of stack. + * If the value at the given accpetable index of stack is a table it returns true, otherwise returns false. + * If the table has the `x`,`y`,`width` and `height` keys and the corresponding values are not nil, this function would assign the values to the corresponding members of outValue. Otherwise, the value of members of outValue would be 0. + * + * @param L the current lua_State. + * @param lo the given accpetable index of stack. + * @param outValue the pointer to a Rect object which stores the values from the Lua table. + * @param funcName the name of calling function, it is used for error output in the debug model. + * @return Return true if the value at the given accpetable index of stack is a table, otherwise return false. + * @lua NA + * @js NA + */ extern bool luaval_to_rect(lua_State* L,int lo,Rect* outValue, const char* funcName = ""); + +/** + * Get a Color3B object value from the given accpetable index of stack. + * If the value at the given accpetable index of stack is a table it returns true, otherwise returns false. + * If the table has the `r`,`g` and `b` keys and the corresponding values are not nil, this function would assign the values to the corresponding members of outValue. Otherwise, the value of members of outValue would be 0. + * + * @param L the current lua_State. + * @param lo the given accpetable index of stack. + * @param outValue the pointer to a Color3B object which stores the values from the Lua table. + * @param funcName the name of calling function, it is used for error output in the debug model. + * @return Return true if the value at the given accpetable index of stack is a table, otherwise return false. + * @lua NA + * @js NA + */ extern bool luaval_to_color3b(lua_State* L,int lo,Color3B* outValue, const char* funcName = ""); + +/** + * Get a Color4B object value from the given accpetable index of stack. + * If the value at the given accpetable index of stack is a table it returns true, otherwise returns false. + * If the table has the `r`,`g`, `b` and 'a' keys and the corresponding values are not nil, this function would assign the values to the corresponding members of outValue. Otherwise, the value of members of outValue would be 0. + * + * @param L the current lua_State. + * @param lo the given accpetable index of stack. + * @param outValue the pointer to a Color4B object which stores the values from the Lua table. + * @param funcName the name of calling function, it is used for error output in the debug model. + * @return Return true if the value at the given accpetable index of stack is a table, otherwise return false. + * @lua NA + * @js NA + */ extern bool luaval_to_color4b(lua_State* L,int lo,Color4B* outValue, const char* funcName = ""); + +/** + * Get a Color4F object value from the given accpetable index of stack. + * If the value at the given accpetable index of stack is a table it returns true, otherwise returns false. + * If the table has the `r`,`g`, `b` and 'a' keys and the corresponding values are not nil, this function would assign the values to the corresponding members of outValue. Otherwise, the value of members of outValue would be 0. + * + * @param L the current lua_State. + * @param lo the given accpetable index of stack. + * @param outValue the pointer to a Color4F object which stores the values from the Lua table. + * @param funcName the name of calling function, it is used for error output in the debug model. + * @return Return true if the value at the given accpetable index of stack is a table, otherwise return false. + * @lua NA + * @js NA + */ extern bool luaval_to_color4f(lua_State* L,int lo,Color4F* outValue, const char* funcName = ""); #if CC_USE_PHYSICS + +/** + * Get a PhysicsMaterial object value from the given accpetable index of stack. + * If the value at the given accpetable index of stack is a table it returns true, otherwise returns false. + * If the table has the `density`,`restitution` and 'friction' keys and the corresponding values are not nil, this function would assign the values to the corresponding members of outValue. Otherwise, the value of members of outValue would be 0. + * + * @param L the current lua_State. + * @param lo the given accpetable index of stack. + * @param outValue the pointer to a cocos2d::PhysicsMaterial object which stores the values from the Lua table. + * @param funcName the name of calling function, it is used for error output in the debug model. + * @return Return true if the value at the given accpetable index of stack is a table, otherwise return false. + * @lua NA + * @js NA + */ extern bool luaval_to_physics_material(lua_State* L,int lo, cocos2d::PhysicsMaterial* outValue, const char* funcName = ""); #endif //#if CC_USE_PHYSICS + +/** + * If the value at the given accpetable index of stack is a table it returns true, otherwise returns false. + * If the table has the `a`, `b`, `c`, `d` , `tx` and `ty` keys and the corresponding values are not nil, this function would assign the values to the corresponding members of outValue. Otherwise, the value of members of outValue would be 0. + * + * @param L the current lua_State. + * @param lo the given accpetable index of stack. + * @param outValue the pointer to a AffineTransform object which stores the values from the Lua table. + * @param funcName the name of calling function, it is used for error output in the debug model. + * @return Return true if the value at the given accpetable index of stack is a table, otherwise return false. + * @lua NA + * @js NA + */ extern bool luaval_to_affinetransform(lua_State* L,int lo, AffineTransform* outValue, const char* funcName = ""); + +/** + * Get a FontDefinition object value from the given accpetable index of stack. + * If the value at the given accpetable index of stack is a table it returns true, otherwise returns false. + * If the table has the `fontName`, `fontSize`, `fontAlignmentH`, `fontAlignmentV` , `fontFillColor` ,`fontDimensions`, `shadowEnabled` and `strokeEnabled` keys and the corresponding values are not nil, this function would assign the values to the corresponding members of outValue. Otherwise, the value of members of outValue would be 0. + * If the values about `shadowEnabled` and `strokeEnabled` are true, there would be more keys such as `shadowOffset`, `shadowBlur` ,`shadowOpacity`, `strokeColor`, and `strokeSize`. + * @param L the current lua_State. + * @param lo the given accpetable index of stack. + * @param outValue the pointer to a FontDefinition object which stores the values from the Lua table. + * @param funcName the name of calling function, it is used for error output in the debug model. + * @return Return true if the value at the given accpetable index of stack is a table, otherwise return false. + * @lua NA + * @js NA + */ extern bool luaval_to_fontdefinition(lua_State* L, int lo, FontDefinition* outValue , const char* funcName = ""); + +/** + * Get a Mat object value from the given accpetable index of stack. + * If the value at the given accpetable index of stack is a table it returns true, otherwise returns false. + * The table is array-table which begin the index starts at 1. + * + * @param L the current lua_State. + * @param lo the given accpetable index of stack. + * @param outValue the pointer to a Mat object which stores the values from the Lua table. + * @param funcName the name of calling function, it is used for error output in the debug model. + * @return Return true if the value at the given accpetable index of stack is a table, otherwise return false. + * @lua NA + * @js NA + */ extern bool luaval_to_mat4(lua_State* L, int lo, cocos2d::Mat4* outValue , const char* funcName = ""); + +/** + * Get a __Array object value frome the given accpetable index of stack. + * Because __Array is deprecated, so this function would be not called anymore. + * + * @lua NA + * @js NA + */ extern bool luaval_to_array(lua_State* L,int lo, __Array** outValue, const char* funcName = ""); + +/** + * Get a __Dictionary object value from the given accpetable index of stack. + * Because __Dictionary is deprecated, so this function would be not called anymore. + * + * @lua NA + * @js NA + */ extern bool luaval_to_dictionary(lua_State* L,int lo, __Dictionary** outValue, const char* funcName = ""); + +/** + * Get a array of Vec2 object from the given accpetable index of stack. + * If the value at the given accpetable index of stack is a table it returns true, otherwise returns false. + * + * @param L the current lua_State. + * @param lo the given accpetable index of stack. + * @param points the pointer to a array of Vec2 object which stores the values from the Lua table. + * @param numPoints a int pointer to store the size of a Vec2 object array. + * @param funcName the name of calling function, it is used for error output in the debug model. + * @return Return true if the value at the given accpetable index of stack is a table, otherwise return false. + * @lua NA + * @js NA + */ extern bool luaval_to_array_of_vec2(lua_State* L,int lo,cocos2d::Vec2 **points, int *numPoints, const char* funcName = ""); + +/** + * Get a __Array object value by the argc numbers of Lua values in the stack. + * Because __Array is deprecated, so this function would be not called anymore. + * + * @lua NA + * @js NA + */ extern bool luavals_variadic_to_array(lua_State* L,int argc, __Array** ret); + +/** + * Get a cocos2d::ValueVector object value by the argc numbers of Lua values in the stack. + * + * @param L the current lua_State. + * @param argc the numbers of Lua values in the stack. + * @param ret the pointer to a ValueVector object which stores the values from the Lua table. + * @return Return false if argc equal to 0 or L equal to nullptr, otherwise return true. + * @lua NA + * @js NA + */ extern bool luavals_variadic_to_ccvaluevector(lua_State* L, int argc, cocos2d::ValueVector* ret); + +/** + * Get a Vec2 object value from the given accpetable index of stack. + * If the value at the given accpetable index of stack is a table it returns true, otherwise returns false. + * If the table has the `x`,and 'y' keys and the corresponding values are not nil, this function would assign the values to the corresponding members of outValue. Otherwise, the value of members of outValue would be 0. + * + * @param L the current lua_State. + * @param lo the given accpetable index of stack. + * @param outValue the pointer to a Vec2 object which stores the values from the Lua table. + * @param funcName the name of calling function, it is used for error output in the debug model. + * @return Return true if the value at the given accpetable index of stack is a table, otherwise return false. + * @lua NA + * @js NA + */ extern bool luaval_to_vec2(lua_State* L,int lo,cocos2d::Vec2* outValue, const char* funcName = ""); + +/** + * Get a Vec3 object value from the given accpetable index of stack. + * If the value at the given accpetable index of stack is a table it returns true, otherwise returns false. + * If the table has the `x`, 'y' and `z` keys and the corresponding values are not nil, this function would assign the values to the corresponding members of outValue. Otherwise, the value of members of outValue would be 0. + * + * @param L the current lua_State. + * @param lo the given accpetable index of stack. + * @param outValue the pointer to a Vec3 object which stores the values from the Lua table. + * @param funcName the name of calling function, it is used for error output in the debug model. + * @return Return true if the value at the given accpetable index of stack is a table, otherwise return false. + * @lua NA + * @js NA + */ extern bool luaval_to_vec3(lua_State* L,int lo,cocos2d::Vec3* outValue, const char* funcName = ""); + +/** + * Get a Vec4 object value from the given accpetable index of stack. + * If the value at the given accpetable index of stack is a table it returns true, otherwise returns false. + * If the table has the `x`, 'y', `z` and `w` keys and the corresponding values are not nil, this function would assign the values to the corresponding members of outValue. Otherwise, the value of members of outValue would be 0. + * + * @param L the current lua_State. + * @param lo the given accpetable index of stack. + * @param outValue the pointer to a Vec4 object which stores the values from the Lua table. + * @param funcName the name of calling function, it is used for error output in the debug model. + * @return Return true if the value at the given accpetable index of stack is a table, otherwise return false. + * @lua NA + * @js NA + */ extern bool luaval_to_vec4(lua_State* L,int lo,cocos2d::Vec4* outValue, const char* funcName = ""); + +/** + * Get a BlendFunc object value from the given accpetable index of stack. + * If the value at the given accpetable index of stack is a table it returns true, otherwise returns false. + * If the table has the `src` and 'dst' keys and the corresponding values are not nil, this function would assign the values to the corresponding members of outValue. Otherwise, the value of members of outValue would be 0. + * + * @param L the current lua_State. + * @param lo the given accpetable index of stack. + * @param outValue the pointer to a BlendFunc object which stores the values from the Lua table. + * @param funcName the name of calling function, it is used for error output in the debug model. + * @return Return true if the value at the given accpetable index of stack is a table, otherwise return false. + * @lua NA + * @js NA + */ extern bool luaval_to_blendfunc(lua_State* L, int lo, cocos2d::BlendFunc* outValue, const char* funcName = ""); + +/** + * Get a TTFConfig object value from the given accpetable index of stack. + * If the value at the given accpetable index of stack is a table it returns true, otherwise returns false. + * If the table has the `fontFilePath`, `fontSize`, `glyphs`, `customGlyphs`, `distanceFieldEnabled` and 'outlineSize' keys and the corresponding values are not nil, this function would assign the values to the corresponding members of outValue. Otherwise, the value of members of outValue would be given the default value. + * + * @param L the current lua_State. + * @param lo the given accpetable index of stack. + * @param outValue the pointer to a TTFConfig object which stores the values from the Lua table. + * @param funcName the name of calling function, it is used for error output in the debug model. + * @return Return true if the value at the given accpetable index of stack is a table, otherwise return false. + * @lua NA + * @js NA + */ extern bool luaval_to_ttfconfig(lua_State* L, int lo, cocos2d::TTFConfig* outValue, const char* funcName = ""); + +/** + * Get a Uniform object value from the given accpetable index of stack. + * If the value at the given accpetable index of stack is a table it returns true, otherwise returns false. + * If the table has the `location`, `size`, `type` and `name` keys and the corresponding values are not nil, this function would assign the values to the corresponding members of outValue. Otherwise, the value of members of outValue would be given the default value. + * + * @param L the current lua_State. + * @param lo the given accpetable index of stack. + * @param outValue the pointer to a Uniform object which stores the values from the Lua table. + * @param funcName the name of calling function, it is used for error output in the debug model. + * @return Return true if the value at the given accpetable index of stack is a table, otherwise return false. + * @lua NA + * @js NA + */ extern bool luaval_to_uniform(lua_State* L, int lo, cocos2d::Uniform* outValue, const char* funcName = ""); + +/** + * Get a VertexAttrib object value from the given accpetable index of stack. + * If the value at the given accpetable index of stack is a table it returns true, otherwise returns false. + * If the table has the `index`, `size`, `type` and `name` keys and the corresponding values are not nil, this function would assign the values to the corresponding members of outValue. Otherwise, the value of members of outValue would be given the default value. + * + * @param L the current lua_State. + * @param lo the given accpetable index of stack. + * @param outValue the pointer to a VertexAttrib object which stores the values from the Lua table. + * @param funcName the name of calling function, it is used for error output in the debug model. + * @return Return true if the value at the given accpetable index of stack is a table, otherwise return false. + * @lua NA + * @js NA + */ extern bool luaval_to_vertexattrib(lua_State* L, int lo, cocos2d::VertexAttrib* outValue, const char* funcName = ""); + +/** + * Get a Vec2 object value from the given accpetable index of stack. + * At current, the Point is typedef of Vec2. + * @see luaval_to_vec2 + * + * @lua NA + * @js NA + */ static inline bool luaval_to_point(lua_State* L,int lo,cocos2d::Vec2* outValue, const char* funcName = "") { return luaval_to_vec2(L, lo, outValue); @@ -96,7 +542,16 @@ CC_DEPRECATED_ATTRIBUTE static inline bool luaval_to_array_of_Point(lua_State* L return luaval_to_array_of_vec2(L, lo, points, numPoints); } - +/** + * Get a cocos2d::Vector of type T objects by the argc numbers of Lua values in the stack. + * + * @param L the current lua_State. + * @param argc the numbers of Lua values in the stack. + * @param ret a cocos2d::Vector of type T objects. + * @return Return false if argc equal to 0 , L equal to nullptr or the Lua userdata at the index isn't `cc.Ref` type, otherwise return true. + * @lua NA + * @js NA + */ template bool luavals_variadic_to_ccvector( lua_State* L, int argc, cocos2d::Vector* ret) { @@ -124,6 +579,18 @@ bool luavals_variadic_to_ccvector( lua_State* L, int argc, cocos2d::Vector* r return ok; } + +/** + * Get a cocos2d::Vector of type T objects from a Lua table in the stack. + * + * @param L the current lua_State. + * @param lo the given accpetable index of stack. + * @param ret a cocos2d::Vector of type T objects. + * @param funcName the name of calling function, it is used for error output in the debug model. + * @return Return true if the value at the given accpetable index of stack is a table, otherwise return false. + * @lua NA + * @js NA + */ template bool luaval_to_ccvector(lua_State* L, int lo , cocos2d::Vector* ret, const char* funcName = "") { @@ -162,9 +629,44 @@ bool luaval_to_ccvector(lua_State* L, int lo , cocos2d::Vector* ret, const ch return ok; } +/** + * Get a pointer points to a std::vector from a Lua array table in the stack. + * + * @param L the current lua_State. + * @param lo the given accpetable index of stack. + * @param ret a pointer points to a std::vector. + * @param funcName the name of calling function, it is used for error output in the debug model. + * @return Return true if the value at the given accpetable index of stack is a table, otherwise return false. + * @lua NA + * @js NA + */ bool luaval_to_std_vector_string(lua_State* L, int lo, std::vector* ret, const char* funcName = ""); + +/** + * Get a pointer points to a std::vector from a Lua array table in the stack. + * + * @param L the current lua_State. + * @param lo the given accpetable index of stack. + * @param ret a pointer points to a std::vector. + * @param funcName the name of calling function, it is used for error output in the debug model. + * @return Return true if the value at the given accpetable index of stack is a table, otherwise return false. + * @lua NA + * @js NA + */ bool luaval_to_std_vector_int(lua_State* L, int lo, std::vector* ret, const char* funcName = ""); + +/** + * Get a pointer points to a cocos2d::Map whose key/value pair is string value and T object from a Lua hash-map table in the stack. + * + * @param L the current lua_State. + * @param lo the given accpetable index of stack. + * @param ret a pointer points to a cocos2d::Map whose key/value pair is string value and T object. + * @param funcName the name of calling function, it is used for error output in the debug model. + * @return Return true if the value at the given accpetable index of stack is a table, otherwise return false. + * @lua NA + * @js NA + */ template bool luaval_to_ccmap_string_key(lua_State* L, int lo, cocos2d::Map* ret, const char* funcName = "") { @@ -211,12 +713,74 @@ bool luaval_to_ccmap_string_key(lua_State* L, int lo, cocos2d::Map bool luaval_to_object(lua_State* L, int lo, const char* type, T** ret) { @@ -234,46 +798,311 @@ bool luaval_to_object(lua_State* L, int lo, const char* type, T** ret) return true; } +/** + * Get a cocos2d::MeshVertexAttrib object value from the given accpetable index of stack. + * If the value at the given accpetable index of stack is a table it returns true, otherwise returns false. + * If the table has the `size`, `type`, `vertexAttrib`, `vertexAttrib` and `attribSizeBytes` keys and the corresponding values are not nil, this function would assign the values to the corresponding members of outValue. + * @param L the current lua_State. + * @param lo the given accpetable index of stack. + * @param ret the pointer to a cocos2d::MeshVertexAttrib object which stores the values from the Lua table. + * @param funcName the name of calling function, it is used for error output in the debug model. + * @return Return true if the value at the given accpetable index of stack is a table, otherwise return false. + * @lua NA + * @js NA + */ extern bool luaval_to_mesh_vertex_attrib(lua_State* L, int lo, cocos2d::MeshVertexAttrib* ret, const char* funcName = ""); + +/** + * Get a pointer points to a std::vector from a Lua array table in the stack. + * + * @param L the current lua_State. + * @param lo the given accpetable index of stack. + * @param ret a pointer points to a std::vector. + * @param funcName the name of calling function, it is used for error output in the debug model. + * @return Return true if the value at the given accpetable index of stack is a table, otherwise return false. + * @lua NA + * @js NA + */ extern bool luaval_to_std_vector_float(lua_State* L, int lo, std::vector* ret, const char* funcName = ""); + +/** + * Get a pointer points to a std::vector from a Lua array table in the stack. + * + * @param L the current lua_State. + * @param lo the given accpetable index of stack. + * @param ret a pointer points to a std::vector. + * @param funcName the name of calling function, it is used for error output in the debug model. + * @return Return true if the value at the given accpetable index of stack is a table, otherwise return false. + * @lua NA + * @js NA + */ extern bool luaval_to_std_vector_ushort(lua_State* L, int lo, std::vector* ret, const char* funcName = ""); + +/** + * Get a cocos2d::Quaternion object value from the given accpetable index of stack. + * If the value at the given accpetable index of stack is a table it returns true, otherwise returns false. + * If the table has the `x`, `y`, `z` and `w` keys and the corresponding values are not nil, this function would assign the values to the corresponding members of outValue.Otherwise, the value of members of outValue would be 0. + * @param L the current lua_State. + * @param lo the given accpetable index of stack. + * @param ret the pointer to a cocos2d::Quaternion object which stores the values from the Lua table. + * @param funcName the name of calling function, it is used for error output in the debug model. + * @return Return true if the value at the given accpetable index of stack is a table, otherwise return false. + * @lua NA + * @js NA + */ extern bool luaval_to_quaternion(lua_State* L,int lo,cocos2d::Quaternion* outValue, const char* funcName = ""); +/**@}**/ + // from native + +/** + * @name native_to_luaval + * The following function are all used to convert native c++ values to the the corresponding Lua values,then push it into the Lua stack. + * + * @{ + **/ + +/** + * Push a table converted from a cocos2d::Vec2 object into the Lua stack. + * The format of table as follows: {x=numberValue1, y=numberValue2} + * + * @param L the current lua_State. + * @param vec2 a cocos2d::Vec2 object. + * @lua NA + * @js NA + */ extern void vec2_to_luaval(lua_State* L,const cocos2d::Vec2& vec2); + +/** + * Push a table converted from a cocos2d::Vec3 object into the Lua stack. + * The format of table as follows: {x=numberValue1, y=numberValue2, z=numberValue3} + * + * @param L the current lua_State. + * @param vec3 a cocos2d::Vec3 object. + * @lua NA + * @js NA + */ extern void vec3_to_luaval(lua_State* L,const cocos2d::Vec3& vec3); + +/** + * Push a table converted from a cocos2d::Vec4 object into the Lua stack. + * The format of table as follows: {x=numberValue1, y=numberValue2, z=numberValue3, w=numberValue4} + * + * @param L the current lua_State. + * @param vec3 a cocos2d::Vec4 object. + * @lua NA + * @js NA + */ extern void vec4_to_luaval(lua_State* L,const cocos2d::Vec4& vec4); + +/** + * Push a table converted from a cocos2d::Vec2 array into the Lua stack. + * The table size is count. + * The format of table as follows: {vec2_table1,vec2_table2,...,vec2_tableCount}. + * + * @param L the current lua_State. + * @param points a pointer points to a cocos2d::Vec2 array. + * @int count the number of cocos2d::Vec2 object should be converted to a Lua table and push into the Lua stack. + * @lua NA + * @js NA + */ extern void vec2_array_to_luaval(lua_State* L,const cocos2d::Vec2* points, int count); + +/** + * Push a table converted from a cocos2d::Size object into the Lua stack. + * The format of table as follows: {width=numberValue1, height=numberValue2} + * + * @param L the current lua_State. + * @param sz a cocos2d::Size object. + * @lua NA + * @js NA + */ extern void size_to_luaval(lua_State* L,const Size& sz); + +/** + * Push a table converted from a cocos2d::Rect object into the Lua stack. + * The format of table as follows: {x=numberValue1, y=numberValue2, width=numberValue3, height=numberValue4} + * + * @param L the current lua_State. + * @param sz a cocos2d::Rect object. + * @lua NA + * @js NA + */ extern void rect_to_luaval(lua_State* L,const Rect& rt); + +/** + * Push a table converted from a cocos2d::Color3B object into the Lua stack. + * The format of table as follows: {r=numberValue1, g=numberValue2, b=numberValue3} + * + * @param L the current lua_State. + * @param cc a cocos2d::Color3B object. + * @lua NA + * @js NA + */ extern void color3b_to_luaval(lua_State* L,const Color3B& cc); + +/** + * Push a table converted from a cocos2d::Color4B object into the Lua stack. + * The format of table as follows: {r=numberValue1, g=numberValue2, b=numberValue3, a=numberValue4} + * + * @param L the current lua_State. + * @param cc a cocos2d::Color4B object. + * @lua NA + * @js NA + */ extern void color4b_to_luaval(lua_State* L,const Color4B& cc); + +/** + * Push a table converted from a cocos2d::Color4F object into the Lua stack. + * The format of table as follows: {r=numberValue1, g=numberValue2, b=numberValue3, a=numberValue4} + * + * @param L the current lua_State. + * @param cc a cocos2d::Color4F object. + * @lua NA + * @js NA + */ extern void color4f_to_luaval(lua_State* L,const Color4F& cc); #if CC_USE_PHYSICS + +/** + * Push a table converted from a cocos2d::PhysicsMaterial object into the Lua stack. + * The format of table as follows: {density=numberValue1, restitution=numberValue2, friction=numberValue3} + * + * @param L the current lua_State. + * @param pm a cocos2d::PhysicsMaterial object. + * @lua NA + * @js NA + */ extern void physics_material_to_luaval(lua_State* L,const PhysicsMaterial& pm); + +/** + * Push a table converted from a cocos2d::PhysicsRayCastInfo object into the Lua stack. + * The format of table as follows: {shape=userdata, start=vec2_table1, ended=vec2_table2, contact=vec2_table3, normal=vec2_table4, fraction=numberValue} + * + * @param L the current lua_State. + * @param info a cocos2d::PhysicsRayCastInfo object. + * @lua NA + * @js NA + */ extern void physics_raycastinfo_to_luaval(lua_State* L, const PhysicsRayCastInfo& info); + +/** + * Push a table converted from a cocos2d::PhysicsContactData object into the Lua stack. + * The format of table as follows: {points=vec2_array_table, normal=vec2_table, POINT_MAX=numberValue} + * + * @param L the current lua_State. + * @param data a cocos2d::PhysicsContactData object. + * @lua NA + * @js NA + */ extern void physics_contactdata_to_luaval(lua_State* L, const PhysicsContactData* data); #endif //#if CC_USE_PHYSICS + +/** + * Push a table converted from a cocos2d::AffineTransform object into the Lua stack. + * The format of table as follows: {a=numberValue1, b=numberValue2, c=numberValue3, d=numberValue4,tx=numberValue5, ty=numberValue6} + * + * @param L the current lua_State. + * @param inValue a cocos2d::AffineTransform object. + * @lua NA + * @js NA + */ extern void affinetransform_to_luaval(lua_State* L,const AffineTransform& inValue); + +/** + * Push a table converted from a cocos2d::FontDefinition object into the Lua stack. + * The format of table as follows: {fontName=stringValue1, fontSize=numberValue1, fontAlignmentH=numberValue2, fontAlignmentV=numberValue3,fontFillColor=color3b_table1, fontDimensions=size_table1, shadowEnabled=booleanValue1, shadowOffset=size_table2, shadowBlur=numberValue4, shadowOpacity=numberValue5, shadowEnabled=booleanValue2, strokeColor=color3b_table2, strokeSize=size_table3} + * + * @param L the current lua_State. + * @param inValue a cocos2d::FontDefinition object. + * @lua NA + * @js NA + */ extern void fontdefinition_to_luaval(lua_State* L,const FontDefinition& inValue); +/// @cond extern void array_to_luaval(lua_State* L, __Array* inValue); extern void dictionary_to_luaval(lua_State* L, __Dictionary* dict); +/// @endcond + +/** + * Push a table converted from a cocos2d::Mat4 object into the Lua stack. + * The format of table as follows: {numberValue1, numberValue2, ..., numberValue16} + * + * @param L the current lua_State. + * @param mat a cocos2d::Mat4 object. + * @lua NA + * @js NA + */ extern void mat4_to_luaval(lua_State* L, const cocos2d::Mat4& mat); + +/** + * Push a table converted from a cocos2d::BlendFunc object into the Lua stack. + * The format of table as follows: {src=numberValue1, dst=numberValue2} + * + * @param L the current lua_State. + * @param func a cocos2d::BlendFunc object. + * @lua NA + * @js NA + */ extern void blendfunc_to_luaval(lua_State* L, const cocos2d::BlendFunc& func); + +/** + * Push a table converted from a cocos2d::TTFConfig object into the Lua stack. + * The format of table as follows: {fontFilePath=stringValue1, fontSize=numberValue1, glyphs=numberValue2, customGlyphs=stringValue2,distanceFieldEnabled=booleanValue1, outlineSize=numberValue3} + * + * @param L the current lua_State. + * @param config a cocos2d::TTFConfig object. + * @lua NA + * @js NA + */ extern void ttfconfig_to_luaval(lua_State* L, const cocos2d::TTFConfig& config); + +/** + * Push a table converted from a cocos2d::Uniform object into the Lua stack. + * The format of table as follows: {location=numberValue1, size=numberValue2, type=numberValue3, name=stringValue1} + * + * @param L the current lua_State. + * @param uniform a cocos2d::Uniform object. + * @lua NA + * @js NA + */ extern void uniform_to_luaval(lua_State* L, const cocos2d::Uniform& uniform); + +/** + * Push a table converted from a cocos2d::VertexAttrib object into the Lua stack. + * The format of table as follows: {index=numberValue1, size=numberValue2, type=numberValue3, name=stringValue1} + * + * @param L the current lua_State. + * @param verAttrib a cocos2d::VertexAttrib object. + * @lua NA + * @js NA + */ extern void vertexattrib_to_luaval(lua_State* L, const cocos2d::VertexAttrib& verAttrib); +/// @cond static inline void point_to_luaval(lua_State* L,const cocos2d::Vec2& pt) { vec2_to_luaval(L, pt); } + CC_DEPRECATED_ATTRIBUTE static inline void points_to_luaval(lua_State* L,const cocos2d::Vec2* points, int count) { vec2_array_to_luaval(L, points, count); } +/// @endcond +/** + * Push a table converted from a cocos2d::Vector object into the Lua stack. + * The format of table as follows: {userdata1, userdata2, ..., userdataVectorSize} + * The object in the cocos2d::Vector which would be pushed into the table should be Ref type. + * + * @param L the current lua_State. + * @param verAttrib a cocos2d::Vector object. + * @lua NA + * @js NA + */ template void ccvector_to_luaval(lua_State* L,const cocos2d::Vector& inValue) { @@ -306,6 +1135,16 @@ void ccvector_to_luaval(lua_State* L,const cocos2d::Vector& inValue) } } +/** + * Push a table converted from a cocos2d::Map object into the Lua stack. + * The format of table as follows: {name1=userdata1, name2=userdata2, ..., nameMapSize=userdataMapSize} + * The object in the cocos2d::Map which would be pushed into the table should be Ref type. + * + * @param L the current lua_State. + * @param verAttrib a cocos2d::Map object. + * @lua NA + * @js NA + */ template void ccmap_string_key_to_luaval(lua_State* L, const cocos2d::Map& v) { @@ -334,13 +1173,66 @@ void ccmap_string_key_to_luaval(lua_State* L, const cocos2d::Map } } +/** + * Push a Lua value converted from a cocos2d::Value object into the Lua stack. + * Different cocos2d::Value type, different Lua value pushed into the Lua stack. + * Value::Type::BOOLEAN -> push a boolean value into the Lua stack. + * Value::Type::FLOAT,Value::Type::DOUBLE -> push a number value into the Lua stack. + * Value::Type::INTEGER -> push a integer value into the Lua stack. + * Value::Type::STRING -> push a string value into the Lua stack. + * Value::Type::VECTOR -> push a array table into the Lua stack. + * Value::Type::MAP -> push a hash table into the Lua stack. + * Value::Type::INT_KEY_MAP -> push a hash table into the Lua stack. + * + * @param L the current lua_State. + * @param verAttrib a cocos2d::Value object. + * @lua NA + * @js NA + */ void ccvalue_to_luaval(lua_State* L,const cocos2d::Value& inValue); -void ccvaluemap_to_luaval(lua_State* L,const cocos2d::ValueMap& inValue); -void ccvaluemapintkey_to_luaval(lua_State* L, const cocos2d::ValueMapIntKey& inValue); -void ccvaluevector_to_luaval(lua_State* L, const cocos2d::ValueVector& inValue); /** - Because all override functions wouldn't be bound,so we must use `typeid` to get the real class name + * Push a Lua hash table converted from a cocos2d::ValueMap object into the Lua stack. + * The type of value of the key/value pair would be boolean,number, integer, string, array table, hash table. + * + * @param L the current lua_State. + * @param verAttrib a cocos2d::ValueMap object. + * @lua NA + * @js NA + */ +void ccvaluemap_to_luaval(lua_State* L,const cocos2d::ValueMap& inValue); + +/** + * Push a Lua hash table converted from a cocos2d::ValueMapIntKey object into the Lua stack. + * The type of value of the key/value pair would be boolean,number, integer, string, array table, hash table. + * + * @param L the current lua_State. + * @param verAttrib a cocos2d::Map object. + * @lua NA + * @js NA + */ +void ccvaluemapintkey_to_luaval(lua_State* L, const cocos2d::ValueMapIntKey& inValue); + +/** + * Push a Lua array table converted from a cocos2d::ValueVector object into the Lua stack. + * The type of value of the key/value pair would be boolean,number, integer, string, array table, hash table. + * + * @param L the current lua_State. + * @param verAttrib a cocos2d::ValueVector object. + * @lua NA + * @js NA + */ +void ccvaluevector_to_luaval(lua_State* L, const cocos2d::ValueVector& inValue); + +/**@}**/ + +/** + * Get the real typename for the specified typename. + * Because all override functions wouldn't be bound,so we must use `typeid` to get the real class name. + * + * @param T the pointer points to a object. + * @param type the string pointer points to specified typename. + * @return return the pointer points to the real typename, or nullptr. */ template const char* getLuaTypeName(T* ret,const char* type) @@ -362,6 +1254,13 @@ const char* getLuaTypeName(T* ret,const char* type) return nullptr; } +/** + * Push the native object by userdata format into the Lua stack by typename. + * + * @param L the current lua_State. + * @param type the string pointer points to the typename. + * @param ret the native object pointer. + */ template void object_to_luaval(lua_State* L,const char* type, T* ret) { @@ -386,11 +1285,69 @@ void object_to_luaval(lua_State* L,const char* type, T* ret) } } +/** + * Push a table converted from a cocos2d::MeshVertexAttrib object into the Lua stack. + * The format of table as follows: {size=numberValue1, type=numberValue2, vertexAttrib=numberValue3, attribSizeBytes=numberValue4} + * + * @param L the current lua_State. + * @param inValue a cocos2d::MeshVertexAttrib object. + * @lua NA + * @js NA + */ void mesh_vertex_attrib_to_luaval(lua_State* L, const cocos2d::MeshVertexAttrib& inValue); -void ccvector_std_string_to_luaval(lua_State* L, const std::vector& inValue); -void ccvector_int_to_luaval(lua_State* L, const std::vector& inValue); -void ccvector_float_to_luaval(lua_State* L, const std::vector& inValue); -void ccvector_ushort_to_luaval(lua_State* L, const std::vector& inValue); -void quaternion_to_luaval(lua_State* L,const cocos2d::Quaternion& inValue); +/** + * Push a Lua array table converted from a std::vector into the Lua stack. + * The format of table as follows: {stringValue1, stringValue2, ..., stringVectorSize} + * + * @param L the current lua_State. + * @param inValue a std::vector value. + * @lua NA + * @js NA + */ +void ccvector_std_string_to_luaval(lua_State* L, const std::vector& inValue); + +/** + * Push a Lua array table converted from a std::vector into the Lua stack. + * The format of table as follows: {numberValue1, numberValue2, ..., numberVectorSize} + * + * @param L the current lua_State. + * @param inValue a std::vector vaule. + * @lua NA + * @js NA + */ +void ccvector_int_to_luaval(lua_State* L, const std::vector& inValue); + +/** + * Push a Lua array table converted from a std::vector into the Lua stack. + * The format of table as follows: {numberValue1, numberValue2, ..., numberVectorSize} + * + * @param L the current lua_State. + * @param inValue a std::vector vaule. + * @lua NA + * @js NA + */ +void ccvector_float_to_luaval(lua_State* L, const std::vector& inValue); + +/** + * Push a Lua array table converted from a std::vector into the Lua stack. + * The format of table as follows: {numberValue1, numberValue2, ..., numberVectorSize} + * + * @param L the current lua_State. + * @param inValue a std::vector vaule. + * @lua NA + * @js NA + */ +void ccvector_ushort_to_luaval(lua_State* L, const std::vector& inValue); + +/** + * Push a table converted from a cocos2d::Quaternion object into the Lua stack. + * The format of table as follows: {x=numberValue1, y=numberValue2, z=numberValue3, w=numberValue4} + * + * @param L the current lua_State. + * @param inValue a cocos2d::Quaternion object. + * @lua NA + * @js NA + */ +void quaternion_to_luaval(lua_State* L,const cocos2d::Quaternion& inValue); #endif //__COCOS2DX_SCRIPTING_LUA_COCOS2DXSUPPORT_LUABAISCCONVERSIONS_H__ diff --git a/cocos/scripting/lua-bindings/manual/cocosbuilder/lua_cocos2dx_cocosbuilder_manual.h b/cocos/scripting/lua-bindings/manual/cocosbuilder/lua_cocos2dx_cocosbuilder_manual.h index 78554e784d..94da5b1448 100644 --- a/cocos/scripting/lua-bindings/manual/cocosbuilder/lua_cocos2dx_cocosbuilder_manual.h +++ b/cocos/scripting/lua-bindings/manual/cocosbuilder/lua_cocos2dx_cocosbuilder_manual.h @@ -33,6 +33,17 @@ extern "C" { #endif TOLUA_API int register_all_cocos2dx_cocosbuilder_manual(lua_State* tolua_S); + +/** + * Call this function can import the lua bindings for the cocosbuilder module. + * After registering, we could call the related cocosbuilder code conveniently in the lua.eg,.cc.CCBProxy:create(). + * If you don't want to use the cocosbuilder module in the lua, you only don't call this registering function. + * If you don't register the cocosbuilder module, the package size would become smaller . + * The current mechanism,this registering function is called in the lua_module_register.h + * + * @lua NA + * @js NA + */ TOLUA_API int register_cocosbuilder_module(lua_State* tolua_S); #endif // #ifndef COCOS_SCRIPTING_LUA_BINDINGS_MANUAL_LUA_COCOS2DX_COCOSBUILDER_H diff --git a/cocos/scripting/lua-bindings/manual/cocosdenshion/lua_cocos2dx_cocosdenshion_manual.h b/cocos/scripting/lua-bindings/manual/cocosdenshion/lua_cocos2dx_cocosdenshion_manual.h index 2df23521f4..d9e3732ee0 100644 --- a/cocos/scripting/lua-bindings/manual/cocosdenshion/lua_cocos2dx_cocosdenshion_manual.h +++ b/cocos/scripting/lua-bindings/manual/cocosdenshion/lua_cocos2dx_cocosdenshion_manual.h @@ -32,6 +32,17 @@ extern "C" { } #endif +/** + * Call this function can import the lua bindings for the cocosdenshion module. + * After registering, we could call the related cocosdenshion code conveniently in the lua.eg,.cc.SimpleAudioEngine:getInstance():stopAllEffects(). + * In current mechanism, most bindings function of SimpleAudioEngine are wrapped in the Lua script file named AudioEngine.lua by more friednly modes. + * If you don't want to use the cocosdenshion module in the lua, you only don't call this registering function. + * If you don't register the cocosdenshion module, the package size would become smaller . + * The current mechanism,this registering function is called in the lua_module_register.h + * + * @lua NA + * @js NA + */ TOLUA_API int register_cocosdenshion_module(lua_State* L); diff --git a/cocos/scripting/lua-bindings/manual/extension/lua_cocos2dx_extension_manual.h b/cocos/scripting/lua-bindings/manual/extension/lua_cocos2dx_extension_manual.h index fc88b2626f..04b8cd8cbc 100644 --- a/cocos/scripting/lua-bindings/manual/extension/lua_cocos2dx_extension_manual.h +++ b/cocos/scripting/lua-bindings/manual/extension/lua_cocos2dx_extension_manual.h @@ -32,9 +32,20 @@ extern "C" { } #endif -TOLUA_API int register_all_cocos2dx_extension_manual(lua_State* tolua_S); +/** + * Call this function can import the lua bindings for classes in the `cocos2d::extension` namespace like cocos2d::extension::Control, cocos2d::extension::ControlHuePicker, and so on. + * After registering, we could call the related cocosbuilder code conveniently in the lua.eg,.cc.Control:create(). + * If you don't want to use the extension module in the lua, you only don't call this registering function. + * If you don't register the extension module, the package size would become smaller . + * The current mechanism,this registering function is called in the lua_module_register.h + * + * @lua NA + * @js NA + */ TOLUA_API int register_extension_module(lua_State* tolua_S); +TOLUA_API int register_all_cocos2dx_extension_manual(lua_State* tolua_S); + struct LuaAssetsManagerEventData { int value; diff --git a/cocos/scripting/lua-bindings/manual/network/Lua_web_socket.h b/cocos/scripting/lua-bindings/manual/network/Lua_web_socket.h index 0f0a7f4a6d..1a85155ae6 100644 --- a/cocos/scripting/lua-bindings/manual/network/Lua_web_socket.h +++ b/cocos/scripting/lua-bindings/manual/network/Lua_web_socket.h @@ -35,6 +35,8 @@ extern "C" { #endif #include "network/WebSocket.h" + +///@cond class LuaWebSocket: public cocos2d::network::WebSocket,public cocos2d::network::WebSocket::Delegate { public: @@ -55,6 +57,7 @@ public: TOLUA_API int tolua_web_socket_open(lua_State* tolua_S); TOLUA_API int register_web_socket_manual(lua_State* tolua_S); +///@endcond #endif //(CC_TARGET_PLATFORM == CC_PLATFORM_IOS ... diff --git a/cocos/scripting/lua-bindings/manual/network/lua_cocos2dx_network_manual.h b/cocos/scripting/lua-bindings/manual/network/lua_cocos2dx_network_manual.h index 1112a5b1b5..454815468d 100644 --- a/cocos/scripting/lua-bindings/manual/network/lua_cocos2dx_network_manual.h +++ b/cocos/scripting/lua-bindings/manual/network/lua_cocos2dx_network_manual.h @@ -32,6 +32,16 @@ extern "C" { } #endif +/** + * Call this function can import the lua bindings for the network module. + * After registering, we could call the related network code conveniently in the lua.eg,.cc.WebSocket:create("ws://echo.websocket.org"). + * If you don't want to use the network module in the lua, you only don't call this registering function. + * If you don't register the network module, the package size would become smaller . + * The current mechanism,this registering function is called in the lua_module_register.h + * + * @lua NA + * @js NA + */ TOLUA_API int register_network_module(lua_State* L); #endif //#ifndef __COCOS_SCRIPTING_LUA_BINDINGS_MANUAL_NETWORK_LUA_COCOS2DX_NETWORK_MANUAL_H__ diff --git a/cocos/scripting/lua-bindings/manual/network/lua_extensions.h b/cocos/scripting/lua-bindings/manual/network/lua_extensions.h index 67727f057f..979ff18141 100644 --- a/cocos/scripting/lua-bindings/manual/network/lua_extensions.h +++ b/cocos/scripting/lua-bindings/manual/network/lua_extensions.h @@ -14,7 +14,9 @@ extern "C" { #include "lauxlib.h" +/// @cond void LUA_EXTENSIONS_DLL luaopen_lua_extensions(lua_State *L); +/// @endcond #if __cplusplus } diff --git a/cocos/scripting/lua-bindings/manual/network/lua_xml_http_request.h b/cocos/scripting/lua-bindings/manual/network/lua_xml_http_request.h index 6018af022a..e2aceea3d0 100644 --- a/cocos/scripting/lua-bindings/manual/network/lua_xml_http_request.h +++ b/cocos/scripting/lua-bindings/manual/network/lua_xml_http_request.h @@ -37,6 +37,7 @@ extern "C" { #include "network/HttpClient.h" +///@cond class LuaMinXmlHttpRequest : public cocos2d::Ref { public: @@ -129,5 +130,5 @@ private: }; TOLUA_API int register_xml_http_request(lua_State* L); - +///@endcond #endif //#ifndef __COCOS_SCRIPTING_LUA_BINDINGS_LUA_XML_HTTP_REQUEST_H__ diff --git a/cocos/scripting/lua-bindings/manual/spine/LuaSkeletonAnimation.h b/cocos/scripting/lua-bindings/manual/spine/LuaSkeletonAnimation.h index a498d716db..f13359657e 100644 --- a/cocos/scripting/lua-bindings/manual/spine/LuaSkeletonAnimation.h +++ b/cocos/scripting/lua-bindings/manual/spine/LuaSkeletonAnimation.h @@ -27,6 +27,7 @@ #define LUASKELETONANIMATION_H_ #include "spine-cocos2dx.h" +/// @cond class LuaSkeletonAnimation: public spine::SkeletonAnimation { public: static LuaSkeletonAnimation* createWithFile (const char* skeletonDataFile, const char* atlasFile, float scale = 1); @@ -35,5 +36,5 @@ public: virtual ~LuaSkeletonAnimation(); }; - +/// @endcond #endif /* LUASKELETONANIMATION_H_ */ diff --git a/cocos/ui/UIDeprecated.h b/cocos/ui/UIDeprecated.h index 508322d061..14686a7093 100644 --- a/cocos/ui/UIDeprecated.h +++ b/cocos/ui/UIDeprecated.h @@ -1,5 +1,5 @@ /**************************************************************************** - Copyright (c) 2013-2014 Chukong Technologies Inc. + Copyright (c) 2013-2015 Chukong Technologies Inc. http://www.cocos2d-x.org @@ -24,6 +24,7 @@ #ifndef cocos2d_libs_UIDeprecated_h #define cocos2d_libs_UIDeprecated_h +/// @cond DO_NOT_SHOW #include "platform/CCPlatformMacros.h" #include "ui/UIWidget.h" @@ -161,4 +162,5 @@ CC_DEPRECATED_ATTRIBUTE extern const Margin MarginZero; NS_CC_END +/// @endcond #endif diff --git a/cocos/ui/UISlider.h b/cocos/ui/UISlider.h index 1262cea4e3..7a99d1ffee 100644 --- a/cocos/ui/UISlider.h +++ b/cocos/ui/UISlider.h @@ -30,6 +30,11 @@ THE SOFTWARE. NS_CC_BEGIN +/** + * @addtogroup ui + * @{ + */ + class Sprite; namespace ui { @@ -43,36 +48,47 @@ typedef enum typedef void (Ref::*SEL_SlidPercentChangedEvent)(Ref*,SliderEventType); #define sliderpercentchangedselector(_SELECTOR) (SEL_SlidPercentChangedEvent)(&_SELECTOR) -/** -* @js NA -* @lua NA -*/ +/** @class Slider + * @brief UI Slider widget. + * @js NA + * @lua NA + */ class CC_GUI_DLL Slider : public Widget { DECLARE_CLASS_GUI_INFO public: + /** EventType Slider event type. + */ enum class EventType { ON_PERCENTAGE_CHANGED }; typedef std::function ccSliderCallback; /** - * Default constructor + * Default constructor. */ Slider(); /** - * Default destructor + * Default destructor. */ virtual ~Slider(); - /** - * Allocates and initializes. + /** Create a slider widget. + * + * @return An autoreleased Slider object. */ static Slider* create(); + /** Create a slider widget with bar texture, ball texture and texture resource type. + * + * @param barTextureName Bar texture file name. + * @param normalBallTextureName Ball texture file name. + * @param resType Texture resource type. + * @return An autoreleased Slider object. + */ static Slider* create(const std::string& barTextureName, const std::string& normalBallTextureName, TextureResType resType = TextureResType::LOCAL); @@ -80,56 +96,60 @@ public: /** * Load texture for slider bar. * - * @param fileName file name of texture. - * - * @param texType @see TextureResType + * @param fileName File name of texture. + * @param resType @see TextureResType . */ void loadBarTexture(const std::string& fileName,TextureResType resType = TextureResType::LOCAL); /** * Sets if slider is using scale9 renderer. - * - * @param true that using scale9 renderer, false otherwise. + * @param able True that using scale9 renderer, false otherwise. */ void setScale9Enabled(bool able); + /** + * Gets If slider is using scale9 renderer. + * @return True that using scale9 renderer, false otherwise. + */ bool isScale9Enabled()const; /** * Sets capinsets for slider, if slider is using scale9 renderer. - * - * @param capInsets capinsets for slider + * @param capInsets Capinsets for slider. */ void setCapInsets(const Rect &capInsets); /** - * Sets capinsets for slider, if slider is using scale9 renderer. - * - * @param capInsets capinsets for slider + * Sets capinsets for bar slider, if slider is using scale9 renderer. + * @param capInsets Capinsets for bar slider. */ void setCapInsetsBarRenderer(const Rect &capInsets); + /** + * Gets capinsets for bar slider, if slider is using scale9 renderer. + * @return capInsets Capinsets for bar slider. + */ const Rect& getCapInsetsBarRenderer()const; /** - * Sets capinsets for slider, if slider is using scale9 renderer. - * - * @param capInsets capinsets for slider + * Sets capinsets for progress bar slider, if slider is using scale9 renderer. + * @param capInsets Capinsets for progress bar slider. */ void setCapInsetProgressBarRebderer(const Rect &capInsets); + /** + * Gets capinsets for progress bar slider, if slider is using scale9 renderer. + * @return Capinsets for progress bar slider. + */ const Rect& getCapInsetsProgressBarRebderer()const; /** * Load textures for slider ball. * - * @param slider ball normal normal state texture. - * - * @param slider ball selected selected state texture. - * - * @param slider ball disabled dark state texture. - * - * @param texType @see TextureResType + * @param normal Normal state texture. + * @param pressed Pressed state texture. + * @param disabled Disabled state texture. + * @param texType @see TextureResType . */ void loadSlidBallTextures(const std::string& normal, const std::string& pressed = "", @@ -139,55 +159,52 @@ public: /** * Load normal state texture for slider ball. * - * @param normal normal state texture. - * - * @param texType @see TextureResType + * @param normal Normal state texture. + * @param resType @see TextureResType . */ void loadSlidBallTextureNormal(const std::string& normal,TextureResType resType = TextureResType::LOCAL); /** - * Load selected state texture for slider ball. + * Load pressed state texture for slider ball. * - * @param selected selected state texture. - * - * @param texType @see TextureResType + * @param pressed Pressed state texture. + * @param resType @see TextureResType . */ void loadSlidBallTexturePressed(const std::string& pressed,TextureResType resType = TextureResType::LOCAL); /** - * Load dark state texture for slider ball. + * Load disabled state texture for slider ball. * - * @param disabled dark state texture. - * - * @param texType @see TextureResType + * @param disabled Disabled state texture. + * @param resType @see TextureResType . */ void loadSlidBallTextureDisabled(const std::string& disabled,TextureResType resType = TextureResType::LOCAL); /** * Load dark state texture for slider progress bar. * - * @param fileName file path of texture. - * - * @param texType @see TextureResType + * @param fileName File path of texture. + * @param resType @see TextureResType . */ void loadProgressBarTexture(const std::string& fileName, TextureResType resType = TextureResType::LOCAL); /** * Changes the progress direction of slider. - * - * @param percent percent value from 1 to 100. + * @param percent Percent value from 1 to 100. */ void setPercent(int percent); /** * Gets the progress direction of slider. * - * @return percent percent value from 1 to 100. + * @return percent Percent value from 1 to 100. */ int getPercent()const; /** * Add call back function called when slider's percent has changed to slider. + * + * @param callback An given call back function called when slider's percent has changed to slider. */ CC_DEPRECATED_ATTRIBUTE void addEventListenerSlider(Ref* target,SEL_SlidPercentChangedEvent selector); void addEventListener(const ccSliderCallback& callback); @@ -298,6 +315,10 @@ protected: }; } + +// end of ui group +/// @} + NS_CC_END #endif /* defined(__CocoGUI__Slider__) */ diff --git a/cocos/ui/UIText.h b/cocos/ui/UIText.h index 0f0eceed44..aecfd09ef3 100644 --- a/cocos/ui/UIText.h +++ b/cocos/ui/UIText.h @@ -28,6 +28,11 @@ THE SOFTWARE. #include "ui/UIWidget.h" #include "ui/GUIExport.h" +/** + * @addtogroup ui + * @{ + */ + NS_CC_BEGIN class Label; @@ -45,31 +50,40 @@ class CC_GUI_DLL Text : public Widget DECLARE_CLASS_GUI_INFO public: + /** Type Text type. + */ enum class Type { SYSTEM, TTF }; /** - * Default constructor + * Default constructor. */ Text(); /** - * Default destructor + * Default destructor. */ virtual ~Text(); /** - * Allocates and initializes. + * Create a Text object. + * + * @return An autoreleased Text object. */ static Text* create(); /** - * create a Text object with textContent, fontName and fontSize - * the fontName could be a system font name or a TTF file path. - * Usage: Text *text = Text::create("Hello", "Arial", 20); //create a system font UIText - * Text *text = Text::create("Hello", "xxx\xxx.ttf", 20); //create a TTF font UIText + * Create a Text object with textContent, fontName and fontSize. + * The fontName could be a system font name or a TTF file path. + * Usage: Text *text = Text::create("Hello", "Arial", 20); //create a system font UIText. + * Text *text = Text::create("Hello", "xxx\xxx.ttf", 20); //create a TTF font UIText. + * + * @param textContent Text content string. + * @param fontName A given font name. + * @param fontSize A given font size. + * @return An autoreleased Text object. */ static Text* create(const std::string& textContent, const std::string& fontName, @@ -78,7 +92,7 @@ public: /** * Changes the string value of label. * - * @param text string value. + * @param text String value. */ CC_DEPRECATED_ATTRIBUTE void setText(const std::string& text){this->setString(text);} void setString(const std::string& text); @@ -86,7 +100,7 @@ public: /** * Gets the string value of label. * - * @return string value. + * @return String value. */ CC_DEPRECATED_ATTRIBUTE const std::string& getStringValue(){ return this->getString();} const std::string& getString()const; @@ -94,19 +108,24 @@ public: /** * Gets the string length of the label. * Note: This length will be larger than the raw string length, - * if you want to get the raw string length, you should call this->getString().size() instead + * if you want to get the raw string length, you should call this->getString().size() instead. * - * @return string length. + * @return String length. */ ssize_t getStringLength()const; /** * Sets the font size of label. * - * @param size font size. + * @param size The font size. */ void setFontSize(int size); + /** + * Gets the font size of label. + * + * @return The font size. + */ int getFontSize()const; /** @@ -116,25 +135,32 @@ public: * Usage: Text *text = Text::create("Hello", "Arial", 20); //create a system font UIText * text->setFontName("Marfelt"); // it will change the font to system font no matter the previous font type is TTF or system font * text->setFontName("xxxx/xxx.ttf"); //it will change the font to TTF font no matter the previous font type is TTF or system font - * @param name font name. + * @param name Font name. */ void setFontName(const std::string& name); + /** Gets the font name. + * + * @return Font name. + */ const std::string& getFontName()const; + /** Gets the font type. + * @return The font type. + */ Type getType() const; /** * Sets the touch scale enabled of label. * - * @param enabled touch scale enabled of label. + * @param enabled Touch scale enabled of label. */ void setTouchScaleChangeEnabled(bool enabled); /** * Gets the touch scale enabled of label. * - * @return touch scale enabled of label. + * @return Touch scale enabled of label. */ bool isTouchScaleChangeEnabled()const; @@ -144,6 +170,10 @@ public: //override "getVirtualRenderer" method of widget. virtual Node* getVirtualRenderer() override; + /** Gets the render size in auto mode. + * + * @return The size of render size in auto mode. + */ virtual Size getAutoRenderSize(); /** @@ -152,45 +182,85 @@ public: virtual std::string getDescription() const override; /** - * Set the rendering size of the text, you should call this method + * Sets the rendering size of the text, you should call this method * along with calling `ignoreContentAdaptWithSize(false)`, otherwise the text area - * size is caculated by the real size of the text content - * @param size The text rendering area size + * size is caculated by the real size of the text content. + * + * @param size The text rendering area size. * */ void setTextAreaSize(const Size &size); + /** Return the text rendering area size. + * + * @return The text rendering area size. + */ const Size& getTextAreaSize()const; + /** Sets text horizontal alignment. + * + * @param alignment Horizontal text alignment type + */ void setTextHorizontalAlignment(TextHAlignment alignment); + /** Gets text horizontal alignment. + * + * @return Horizontal text alignment type + */ TextHAlignment getTextHorizontalAlignment()const; + /** Sets text vertical alignment. + * + * @param alignment vertical text alignment type + */ void setTextVerticalAlignment(TextVAlignment alignment); + /** Gets text vertical alignment. + * + * @return Vertical text alignment type + */ TextVAlignment getTextVerticalAlignment()const; + /** Sets text color. + * + * @param color Text color. + */ void setTextColor(const Color4B color); + /** Gets text color. + * + * @return Text color. + */ const Color4B& getTextColor() const; /** - * Enable shadow for the label + * Enable shadow for the label. * * @todo support blur for shadow effect + * + * @param shadowColor The color of shadow effect. + * @param offset The offset of shadow effect. + * @param blurRadius The blur radius of shadow effect. */ void enableShadow(const Color4B& shadowColor = Color4B::BLACK,const Size &offset = Size(2,-2), int blurRadius = 0); /** - * Enable outline for the label - * It only works on IOS and Android when you use System fonts + * Enable outline for the label. + * It only works on IOS and Android when you use System fonts. + * + * @param outlineColor The color of outline. + * @param outlineSize The size of outline. */ void enableOutline(const Color4B& outlineColor,int outlineSize = 1); - /** only support for TTF */ + /** Only support for TTF. + * + * @param glowColor The color of glow. + */ void enableGlow(const Color4B& glowColor); - /** disable shadow/outline/glow rendering */ + /** Disable shadow/outline/glow rendering. + */ void disableEffect(); CC_CONSTRUCTOR_ACCESS: @@ -226,4 +296,7 @@ protected: NS_CC_END +// end of ui group +/// @} + #endif /* defined(__CocoGUI__Label__) */ diff --git a/cocos/ui/UITextAtlas.h b/cocos/ui/UITextAtlas.h index 905d3c2603..8f9eb824be 100644 --- a/cocos/ui/UITextAtlas.h +++ b/cocos/ui/UITextAtlas.h @@ -30,13 +30,19 @@ THE SOFTWARE. NS_CC_BEGIN +/** + * @addtogroup ui + * @{ + */ + class Label; namespace ui { -/** - * @js NA - * @lua NA +/** @class TextAtlas + * @brief UI TextAtlas widget. + * @js NA + * @lua NA */ class CC_GUI_DLL TextAtlas : public Widget { @@ -45,22 +51,31 @@ class CC_GUI_DLL TextAtlas : public Widget public: /** - * Default constructor + * Default constructor. */ TextAtlas(); /** - * Default destructor + * Default destructor. */ virtual ~TextAtlas(); /** - * Allocates and initializes. + * Create a TexAtlas object. + * + * @return An autoreleased TextAtlas object. */ static TextAtlas* create(); /** - * create a LabelAtlas from a char map file + * Create a LabelAtlas from a char map file. + * + * @param stringValue A given string needs to be displayed. + * @param charMapFile A given char map file name. + * @param itemWidth The element width. + * @param itemHeight The element height. + * @param startCharMap The starting char of the atlas. + * @return An autoreleased TextAtlas object. */ static TextAtlas* create(const std::string& stringValue, const std::string& charMapFile, @@ -68,18 +83,32 @@ public: int itemHeight, const std::string& startCharMap); - /** initializes the LabelAtlas with a string, a char map file(the atlas), the width and height of each element and the starting char of the atlas */ + /** Initializes the LabelAtlas with a string, a char map file(the atlas), the width and height of each element and the starting char of the atlas. + * + * @param stringValue A given string needs to be displayed. + * @param charMapFile A given char map file name. + * @param itemWidth The element width. + * @param itemHeight The element height. + * @param startCharMap The starting char of the atlas. + */ + void setProperty(const std::string& stringValue, const std::string& charMapFile, int itemWidth, int itemHeight, const std::string& startCharMap); - //set string value for labelatlas. + /**Set string value for labelatlas. + * + * @param value A given string needs to be displayed. + */ CC_DEPRECATED_ATTRIBUTE void setStringValue(const std::string& value){this->setString(value);} void setString(const std::string& value); - //get string value for labelatlas. + /**Get string value for labelatlas. + * + * @return The string value of TextAtlas. + */ CC_DEPRECATED_ATTRIBUTE const std::string& getStringValue() const{return this->getString();} const std::string& getString() const; @@ -122,6 +151,10 @@ protected: }; } + +// end of ui group +/// @} + NS_CC_END #endif /* defined(__CocoGUI__LabelAtlas__) */ diff --git a/cocos/ui/UIWebView-inl.h b/cocos/ui/UIWebView-inl.h index 326558e704..7edb3c5420 100644 --- a/cocos/ui/UIWebView-inl.h +++ b/cocos/ui/UIWebView-inl.h @@ -1,5 +1,5 @@ /**************************************************************************** - Copyright (c) 2014 Chukong Technologies Inc. + Copyright (c) 2014-2015 Chukong Technologies Inc. http://www.cocos2d-x.org @@ -22,14 +22,13 @@ THE SOFTWARE. ****************************************************************************/ +/// @cond DO_NOT_SHOW #include "UIWebView.h" #include "platform/CCGLView.h" #include "base/CCDirector.h" #include "platform/CCFileUtils.h" - - NS_CC_BEGIN namespace experimental{ namespace ui{ @@ -202,3 +201,4 @@ namespace experimental{ } // namespace experimental } //namespace cocos2d +/// @endcond diff --git a/cocos/ui/UIWebViewImpl-android.h b/cocos/ui/UIWebViewImpl-android.h index 3e6c875b46..1f0567a953 100644 --- a/cocos/ui/UIWebViewImpl-android.h +++ b/cocos/ui/UIWebViewImpl-android.h @@ -1,5 +1,5 @@ /**************************************************************************** - Copyright (c) 2014 Chukong Technologies Inc. + Copyright (c) 2014-2015 Chukong Technologies Inc. http://www.cocos2d-x.org @@ -24,6 +24,7 @@ #ifndef __COCOS2D__UI__WEBVIEWIMPL_ANDROID_H_ #define __COCOS2D__UI__WEBVIEWIMPL_ANDROID_H_ +/// @cond DO_NOT_SHOW #ifdef __ANDROID__ @@ -97,4 +98,5 @@ namespace cocos2d { #endif // __ANDROID__ +/// @endcond #endif /* __COCOS2D__UI__WEBVIEWIMPL_ANDROID_H_ */ diff --git a/cocos/ui/UIWebViewImpl-ios.h b/cocos/ui/UIWebViewImpl-ios.h index 6d65a83f52..00a993c159 100644 --- a/cocos/ui/UIWebViewImpl-ios.h +++ b/cocos/ui/UIWebViewImpl-ios.h @@ -1,5 +1,5 @@ /**************************************************************************** - Copyright (c) 2014 Chukong Technologies Inc. + Copyright (c) 2014-2015 Chukong Technologies Inc. http://www.cocos2d-x.org @@ -24,6 +24,7 @@ #ifndef __COCOS2D_UI_WEBVIEWIMPL_IOS_H_ #define __COCOS2D_UI_WEBVIEWIMPL_IOS_H_ +/// @cond DO_NOT_SHOW #include @@ -88,4 +89,5 @@ private: } // namespace experimental }//namespace cocos2d +/// @endcond #endif /* __COCOS2D_UI_WEBVIEWIMPL_IOS_H_ */ diff --git a/tools/jenkins-scripts/slave-scripts/win32-vs2012-build.bat b/tools/jenkins-scripts/slave-scripts/win32-vs2012-build.bat index 25c74c6276..339d000880 100755 --- a/tools/jenkins-scripts/slave-scripts/win32-vs2012-build.bat +++ b/tools/jenkins-scripts/slave-scripts/win32-vs2012-build.bat @@ -1,2 +1,2 @@ call "%VS120COMNTOOLS%vsvars32.bat" -msbuild build\cocos2d-win32.vc2012.sln /t:Build /p:Platform="Win32" /p:Configuration="Debug" /m +msbuild build\cocos2d-win32.vc2012.sln /t:Build /p:Platform="Win32" /p:Configuration="Release" /m diff --git a/tools/jenkins-scripts/slave-scripts/win32-vs2013-build.bat b/tools/jenkins-scripts/slave-scripts/win32-vs2013-build.bat index 41df6423d1..945812c170 100755 --- a/tools/jenkins-scripts/slave-scripts/win32-vs2013-build.bat +++ b/tools/jenkins-scripts/slave-scripts/win32-vs2013-build.bat @@ -1,2 +1,2 @@ call "%VS120COMNTOOLS%vsvars32.bat" -msbuild build\cocos2d-win32.vc2013.sln /t:Build /p:Platform="Win32" /p:Configuration="Debug" /m +msbuild build\cocos2d-win32.vc2013.sln /t:Build /p:Platform="Win32" /p:Configuration="Release" /m diff --git a/tools/jenkins-scripts/slave-scripts/windows-universal-v3.bat b/tools/jenkins-scripts/slave-scripts/windows-universal-v3.bat index 5426a05611..7959cc3aed 100755 --- a/tools/jenkins-scripts/slave-scripts/windows-universal-v3.bat +++ b/tools/jenkins-scripts/slave-scripts/windows-universal-v3.bat @@ -1,2 +1,2 @@ call "%VS120COMNTOOLS%vsvars32.bat" -msbuild build\cocos2d-win8.1-universal.sln /t:Build /p:Platform="Win32" /p:Configuration="Debug" /m +msbuild build\cocos2d-win8.1-universal.sln /t:Build /p:Platform="Win32" /p:Configuration="Release" /m diff --git a/tools/jenkins-scripts/slave-scripts/windows-universal.bat b/tools/jenkins-scripts/slave-scripts/windows-universal.bat index 5426a05611..7959cc3aed 100755 --- a/tools/jenkins-scripts/slave-scripts/windows-universal.bat +++ b/tools/jenkins-scripts/slave-scripts/windows-universal.bat @@ -1,2 +1,2 @@ call "%VS120COMNTOOLS%vsvars32.bat" -msbuild build\cocos2d-win8.1-universal.sln /t:Build /p:Platform="Win32" /p:Configuration="Debug" /m +msbuild build\cocos2d-win8.1-universal.sln /t:Build /p:Platform="Win32" /p:Configuration="Release" /m diff --git a/tools/jenkins-scripts/slave-scripts/wp8-v3.bat b/tools/jenkins-scripts/slave-scripts/wp8-v3.bat index 7aaf7c10e6..ac0b6ebf26 100755 --- a/tools/jenkins-scripts/slave-scripts/wp8-v3.bat +++ b/tools/jenkins-scripts/slave-scripts/wp8-v3.bat @@ -1,2 +1,2 @@ call "%VS120COMNTOOLS%vsvars32.bat" -msbuild build\cocos2d-wp8.sln /t:Build /p:Platform="Win32" /p:Configuration="Debug" /m +msbuild build\cocos2d-wp8.sln /t:Build /p:Platform="Win32" /p:Configuration="Release" /m