Use C++ code in C++ comments.

Removed Hungarian notation from parts of the code.
This commit is contained in:
Timothy Qiu 2013-08-01 16:39:42 +08:00
parent 08807cb5f5
commit 978fc634be
15 changed files with 33 additions and 33 deletions

View File

@ -465,7 +465,7 @@ protected:
nextScene is a weak reference. */ nextScene is a weak reference. */
Scene *_nextScene; Scene *_nextScene;
/* If YES, then "old" scene will receive the cleanup message */ /* If true, then "old" scene will receive the cleanup message */
bool _sendCleanupToScene; bool _sendCleanupToScene;
/* scheduled scenes */ /* scheduled scenes */

View File

@ -140,7 +140,7 @@ public:
void update(float dt); void update(float dt);
/** The scheduled method will be called every 'interval' seconds. /** The scheduled method will be called every 'interval' seconds.
If paused is YES, then it won't be called until it is resumed. If paused is true, then it won't be called until it is resumed.
If 'interval' is 0, it will be called every frame, but if so, it's recommended to use 'scheduleUpdateForTarget:' instead. If 'interval' is 0, it will be called every frame, but if so, it's recommended to use 'scheduleUpdateForTarget:' instead.
If the selector is already scheduled, then only the interval parameter will be updated without re-scheduling it again. If the selector is already scheduled, then only the interval parameter will be updated without re-scheduling it again.
repeat let the action be repeated repeat + 1 times, use kRepeatForever to let the action run continuously repeat let the action be repeated repeat + 1 times, use kRepeatForever to let the action run continuously
@ -195,7 +195,7 @@ public:
void unscheduleAllWithMinPriority(int nMinPriority); void unscheduleAllWithMinPriority(int nMinPriority);
/** The scheduled script callback will be called every 'interval' seconds. /** The scheduled script callback will be called every 'interval' seconds.
If paused is YES, then it won't be called until it is resumed. If paused is true, then it won't be called until it is resumed.
If 'interval' is 0, it will be called every frame. If 'interval' is 0, it will be called every frame.
return schedule script entry ID, used for unscheduleScriptFunc(). return schedule script entry ID, used for unscheduleScriptFunc().
*/ */

View File

@ -46,15 +46,15 @@ public:
ActionTween is an action that lets you update any property of an object. ActionTween is an action that lets you update any property of an object.
For example, if you want to modify the "width" property of a target from 200 to 300 in 2 seconds, then: For example, if you want to modify the "width" property of a target from 200 to 300 in 2 seconds, then:
id modifyWidth = [ActionTween actionWithDuration:2 key:@"width" from:200 to:300]; auto modifyWidth = ActionTween::create(2, "width", 200, 300);
[target runAction:modifyWidth]; target->runAction(modifyWidth);
Another example: ScaleTo action could be rewritten using PropertyAction: Another example: ScaleTo action could be rewritten using PropertyAction:
// scaleA and scaleB are equivalents // scaleA and scaleB are equivalents
id scaleA = [ScaleTo actionWithDuration:2 scale:3]; auto scaleA = ScaleTo::create(2, 3); // (duration, to)
id scaleB = [ActionTween actionWithDuration:2 key:@"scale" from:1 to:3]; auto scaleB = ActionTween::create(2, "scale", 1, 3); // (duration, key, from, to)
@since v0.99.2 @since v0.99.2

View File

@ -271,7 +271,7 @@ public:
float *S, float *T); float *S, float *T);
/* /*
returns YES if Segment A-B intersects with segment C-D returns true if Segment A-B intersects with segment C-D
@since v3.0 @since v3.0
*/ */
static bool isSegmentIntersect(const Point& A, const Point& B, const Point& C, const Point& D); static bool isSegmentIntersect(const Point& A, const Point& B, const Point& C, const Point& D);

View File

@ -357,7 +357,7 @@ CC_DEPRECATED_ATTRIBUTE static inline bool ccpLineIntersect(const Point& p1, con
} }
/* /*
ccpSegmentIntersect returns YES if Segment A-B intersects with segment C-D ccpSegmentIntersect returns true if Segment A-B intersects with segment C-D
@since v1.0.0 @since v1.0.0
*/ */
CC_DEPRECATED_ATTRIBUTE static inline bool ccpSegmentIntersect(const Point& A, const Point& B, const Point& C, const Point& D) CC_DEPRECATED_ATTRIBUTE static inline bool ccpSegmentIntersect(const Point& A, const Point& B, const Point& C, const Point& D)

View File

@ -302,7 +302,7 @@ public:
bool initWithColor(const Color4B& start, const Color4B& end, const Point& v); bool initWithColor(const Color4B& start, const Color4B& end, const Point& v);
/** Whether or not the interpolation will be compressed in order to display all the colors of the gradient both in canonical and non canonical vectors /** Whether or not the interpolation will be compressed in order to display all the colors of the gradient both in canonical and non canonical vectors
Default: YES Default: true
*/ */
void setCompressedInterpolation(bool bCompressedInterpolation); void setCompressedInterpolation(bool bCompressedInterpolation);
bool isCompressedInterpolation() const; bool isCompressedInterpolation() const;
@ -385,11 +385,11 @@ public:
void addLayer(Layer* layer); void addLayer(Layer* layer);
/** switches to a certain layer indexed by n. /** switches to a certain layer indexed by n.
The current (old) layer will be removed from it's parent with 'cleanup:YES'. The current (old) layer will be removed from it's parent with 'cleanup=true'.
*/ */
void switchTo(unsigned int n); void switchTo(unsigned int n);
/** release the current layer and switches to another layer indexed by n. /** release the current layer and switches to another layer indexed by n.
The current (old) layer will be removed from it's parent with 'cleanup:YES'. The current (old) layer will be removed from it's parent with 'cleanup=true'.
*/ */
void switchToAndReleaseMe(unsigned int n); void switchToAndReleaseMe(unsigned int n);

View File

@ -76,9 +76,9 @@ public:
GLfloat getAlphaThreshold() const; GLfloat getAlphaThreshold() const;
void setAlphaThreshold(GLfloat fAlphaThreshold); void setAlphaThreshold(GLfloat fAlphaThreshold);
/** Inverted. If this is set to YES, /** Inverted. If this is set to true,
the stencil is inverted, so the content is drawn where the stencil is NOT drawn. the stencil is inverted, so the content is drawn where the stencil is NOT drawn.
This default to NO. This default to false.
*/ */
bool isInverted() const; bool isInverted() const;
void setInverted(bool bInverted); void setInverted(bool bInverted);

View File

@ -106,12 +106,12 @@ public:
CC_DEPRECATED_ATTRIBUTE Image* newCCImage(bool flipImage = true) { return newImage(flipImage); }; CC_DEPRECATED_ATTRIBUTE Image* newCCImage(bool flipImage = true) { return newImage(flipImage); };
/** saves the texture into a file using JPEG format. The file will be saved in the Documents folder. /** saves the texture into a file using JPEG format. The file will be saved in the Documents folder.
Returns YES if the operation is successful. Returns true if the operation is successful.
*/ */
bool saveToFile(const char *szFilePath); bool saveToFile(const char *szFilePath);
/** saves the texture into a file. The format could be JPG or PNG. The file will be saved in the Documents folder. /** saves the texture into a file. The format could be JPG or PNG. The file will be saved in the Documents folder.
Returns YES if the operation is successful. Returns true if the operation is successful.
*/ */
bool saveToFile(const char *name, Image::Format format); bool saveToFile(const char *name, Image::Format format);
@ -125,7 +125,7 @@ public:
*/ */
void listenToForeground(Object *obj); void listenToForeground(Object *obj);
/** Valid flags: GL_COLOR_BUFFER_BIT, GL_DEPTH_BUFFER_BIT, GL_STENCIL_BUFFER_BIT. They can be OR'ed. Valid when "autoDraw is YES. */ /** Valid flags: GL_COLOR_BUFFER_BIT, GL_DEPTH_BUFFER_BIT, GL_STENCIL_BUFFER_BIT. They can be OR'ed. Valid when "autoDraw" is true. */
inline unsigned int getClearFlags() const { return _clearFlags; }; inline unsigned int getClearFlags() const { return _clearFlags; };
inline void setClearFlags(unsigned int clearFlags) { _clearFlags = clearFlags; }; inline void setClearFlags(unsigned int clearFlags) { _clearFlags = clearFlags; };
@ -133,11 +133,11 @@ public:
inline const Color4F& getClearColor() const { return _clearColor; }; inline const Color4F& getClearColor() const { return _clearColor; };
inline void setClearColor(const Color4F &clearColor) { _clearColor = clearColor; }; inline void setClearColor(const Color4F &clearColor) { _clearColor = clearColor; };
/** Value for clearDepth. Valid only when autoDraw is true. */ /** Value for clearDepth. Valid only when "autoDraw" is true. */
inline float getClearDepth() const { return _clearDepth; }; inline float getClearDepth() const { return _clearDepth; };
inline void setClearDepth(float clearDepth) { _clearDepth = clearDepth; }; inline void setClearDepth(float clearDepth) { _clearDepth = clearDepth; };
/** Value for clear Stencil. Valid only when autoDraw is true */ /** Value for clear Stencil. Valid only when "autoDraw" is true */
inline int getClearStencil() const { return _clearStencil; }; inline int getClearStencil() const { return _clearStencil; };
inline void setClearStencil(int clearStencil) { _clearStencil = clearStencil; }; inline void setClearStencil(int clearStencil) { _clearStencil = clearStencil; };

View File

@ -73,7 +73,7 @@ public:
void initTexCoordsWithRect(const Rect& rect); void initTexCoordsWithRect(const Rect& rect);
/** Sets a new SpriteFrame as particle. /** Sets a new SpriteFrame as particle.
WARNING: this method is experimental. Use setTexture:withRect instead. WARNING: this method is experimental. Use setTextureWithRect instead.
@since v0.99.4 @since v0.99.4
*/ */
void setDisplayFrame(SpriteFrame *spriteFrame); void setDisplayFrame(SpriteFrame *spriteFrame);

View File

@ -111,7 +111,7 @@ protected:
The Animation object contains AnimationFrame objects, and a possible delay between the frames. The Animation object contains AnimationFrame objects, and a possible delay between the frames.
You can animate a Animation object by using the Animate action. Example: You can animate a Animation object by using the Animate action. Example:
[sprite runAction:[Animate actionWithAnimation:animation]]; sprite->runAction(Animate::create(animation));
*/ */
class CC_DLL Animation : public Object, public Clonable class CC_DLL Animation : public Object, public Clonable

View File

@ -294,7 +294,7 @@ public:
/** /**
* Updates the texture rect of the Sprite in points. * Updates the texture rect of the Sprite in points.
* It will call setTextureRect:rotated:untrimmedSize with rotated = NO, and utrimmedSize = rect.size. * It will call setTextureRect(const Rect& rect, bool rotated, const Size& untrimmedSize) with \p rotated = false, and \p utrimmedSize = rect.size.
*/ */
virtual void setTextureRect(const Rect& rect); virtual void setTextureRect(const Rect& rect);

View File

@ -81,9 +81,9 @@ public:
public: public:
/** Adds multiple Sprite Frames from a plist file. /** Adds multiple Sprite Frames from a plist file.
* A texture will be loaded automatically. The texture name will composed by replacing the .plist suffix with .png * A texture will be loaded automatically. The texture name will composed by replacing the .plist suffix with .png
* If you want to use another texture, you should use the addSpriteFramesWithFile:texture method. * If you want to use another texture, you should use the addSpriteFramesWithFile(const char *plist, const char *textureFileName) method.
*/ */
void addSpriteFramesWithFile(const char *pszPlist); void addSpriteFramesWithFile(const char *plist);
/** Adds multiple Sprite Frames from a plist file. The texture will be associated with the created sprite frames. /** Adds multiple Sprite Frames from a plist file. The texture will be associated with the created sprite frames.
@since v0.99.5 @since v0.99.5
@ -91,12 +91,12 @@ public:
void addSpriteFramesWithFile(const char* plist, const char* textureFileName); void addSpriteFramesWithFile(const char* plist, const char* textureFileName);
/** Adds multiple Sprite Frames from a plist file. The texture will be associated with the created sprite frames. */ /** Adds multiple Sprite Frames from a plist file. The texture will be associated with the created sprite frames. */
void addSpriteFramesWithFile(const char *pszPlist, Texture2D *pobTexture); void addSpriteFramesWithFile(const char *plist, Texture2D *texture);
/** Adds an sprite frame with a given name. /** Adds an sprite frame with a given name.
If the name already exists, then the contents of the old name will be replaced with the new one. If the name already exists, then the contents of the old name will be replaced with the new one.
*/ */
void addSpriteFrame(SpriteFrame *pobFrame, const char *pszFrameName); void addSpriteFrame(SpriteFrame *frame, const char *frameName);
/** Purges the dictionary of loaded sprite frames. /** Purges the dictionary of loaded sprite frames.
* Call this method if you receive the "Memory Warning". * Call this method if you receive the "Memory Warning".
@ -113,7 +113,7 @@ public:
void removeUnusedSpriteFrames(void); void removeUnusedSpriteFrames(void);
/** Deletes an sprite frame from the sprite frame cache. */ /** Deletes an sprite frame from the sprite frame cache. */
void removeSpriteFrameByName(const char *pszName); void removeSpriteFrameByName(const char *name);
/** Removes multiple Sprite Frames from a plist file. /** Removes multiple Sprite Frames from a plist file.
* Sprite Frames stored in this file will be removed. * Sprite Frames stored in this file will be removed.
@ -140,7 +140,7 @@ public:
private: private:
/*Adds multiple Sprite Frames with a dictionary. The texture will be associated with the created sprite frames. /*Adds multiple Sprite Frames with a dictionary. The texture will be associated with the created sprite frames.
*/ */
void addSpriteFramesWithDictionary(Dictionary* pobDictionary, Texture2D *pobTexture); void addSpriteFramesWithDictionary(Dictionary* dictionary, Texture2D *texture);
/** Removes multiple Sprite Frames from Dictionary. /** Removes multiple Sprite Frames from Dictionary.
* @since v0.99.5 * @since v0.99.5

View File

@ -29,7 +29,7 @@ using namespace std;
NS_CC_BEGIN NS_CC_BEGIN
//#pragma mark - Profiling Categories //#pragma mark - Profiling Categories
/* set to NO the categories that you don't want to profile */ /* set to false the categories that you don't want to profile */
bool kProfilerCategorySprite = false; bool kProfilerCategorySprite = false;
bool kProfilerCategoryBatchSprite = false; bool kProfilerCategoryBatchSprite = false;
bool kProfilerCategoryParticles = false; bool kProfilerCategoryParticles = false;

View File

@ -129,8 +129,8 @@ public:
/** resize the capacity of the TextureAtlas. /** resize the capacity of the TextureAtlas.
* The new capacity can be lower or higher than the current one * The new capacity can be lower or higher than the current one
* It returns YES if the resize was successful. * It returns true if the resize was successful.
* If it fails to resize the capacity it will return NO with a new capacity of 0. * If it fails to resize the capacity it will return false with a new capacity of 0.
*/ */
bool resizeCapacity(int capacity); bool resizeCapacity(int capacity);

View File

@ -70,7 +70,7 @@ public:
Using this type of delegate results in two benefits: Using this type of delegate results in two benefits:
- 1. You don't need to deal with Sets, the dispatcher does the job of splitting - 1. You don't need to deal with Sets, the dispatcher does the job of splitting
them. You get exactly one UITouch per call. them. You get exactly one UITouch per call.
- 2. You can *claim* a UITouch by returning YES in ccTouchBegan. Updates of claimed - 2. You can *claim* a UITouch by returning true in ccTouchBegan. Updates of claimed
touches are sent only to the delegate(s) that claimed them. So if you get a move/ touches are sent only to the delegate(s) that claimed them. So if you get a move/
ended/canceled update you're sure it's your touch. This frees you from doing a ended/canceled update you're sure it's your touch. This frees you from doing a
lot of checks when doing multi-touch. lot of checks when doing multi-touch.
@ -82,7 +82,7 @@ public:
class CC_DLL TargetedTouchDelegate : public TouchDelegate class CC_DLL TargetedTouchDelegate : public TouchDelegate
{ {
public: public:
/** Return YES to claim the touch. /** Return true to claim the touch.
@since v0 @since v0
*/ */
virtual bool ccTouchBegan(Touch *pTouch, Event *pEvent) { CC_UNUSED_PARAM(pTouch); CC_UNUSED_PARAM(pEvent);return false;}; virtual bool ccTouchBegan(Touch *pTouch, Event *pEvent) { CC_UNUSED_PARAM(pTouch); CC_UNUSED_PARAM(pEvent);return false;};