mirror of https://github.com/axmolengine/axmol.git
Use C++ code in C++ comments.
Removed Hungarian notation from parts of the code.
This commit is contained in:
parent
08807cb5f5
commit
978fc634be
|
@ -465,7 +465,7 @@ protected:
|
|||
nextScene is a weak reference. */
|
||||
Scene *_nextScene;
|
||||
|
||||
/* If YES, then "old" scene will receive the cleanup message */
|
||||
/* If true, then "old" scene will receive the cleanup message */
|
||||
bool _sendCleanupToScene;
|
||||
|
||||
/* scheduled scenes */
|
||||
|
|
|
@ -140,7 +140,7 @@ public:
|
|||
void update(float dt);
|
||||
|
||||
/** 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 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
|
||||
|
@ -195,7 +195,7 @@ public:
|
|||
void unscheduleAllWithMinPriority(int nMinPriority);
|
||||
|
||||
/** 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.
|
||||
return schedule script entry ID, used for unscheduleScriptFunc().
|
||||
*/
|
||||
|
|
|
@ -46,15 +46,15 @@ public:
|
|||
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:
|
||||
|
||||
id modifyWidth = [ActionTween actionWithDuration:2 key:@"width" from:200 to:300];
|
||||
[target runAction:modifyWidth];
|
||||
auto modifyWidth = ActionTween::create(2, "width", 200, 300);
|
||||
target->runAction(modifyWidth);
|
||||
|
||||
|
||||
Another example: ScaleTo action could be rewritten using PropertyAction:
|
||||
|
||||
// scaleA and scaleB are equivalents
|
||||
id scaleA = [ScaleTo actionWithDuration:2 scale:3];
|
||||
id scaleB = [ActionTween actionWithDuration:2 key:@"scale" from:1 to:3];
|
||||
auto scaleA = ScaleTo::create(2, 3); // (duration, to)
|
||||
auto scaleB = ActionTween::create(2, "scale", 1, 3); // (duration, key, from, to)
|
||||
|
||||
|
||||
@since v0.99.2
|
||||
|
|
|
@ -271,7 +271,7 @@ public:
|
|||
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
|
||||
*/
|
||||
static bool isSegmentIntersect(const Point& A, const Point& B, const Point& C, const Point& D);
|
||||
|
|
|
@ -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
|
||||
*/
|
||||
CC_DEPRECATED_ATTRIBUTE static inline bool ccpSegmentIntersect(const Point& A, const Point& B, const Point& C, const Point& D)
|
||||
|
|
|
@ -302,7 +302,7 @@ public:
|
|||
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
|
||||
Default: YES
|
||||
Default: true
|
||||
*/
|
||||
void setCompressedInterpolation(bool bCompressedInterpolation);
|
||||
bool isCompressedInterpolation() const;
|
||||
|
@ -385,11 +385,11 @@ public:
|
|||
void addLayer(Layer* layer);
|
||||
|
||||
/** 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);
|
||||
/** 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);
|
||||
|
||||
|
|
|
@ -76,9 +76,9 @@ public:
|
|||
GLfloat getAlphaThreshold() const;
|
||||
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.
|
||||
This default to NO.
|
||||
This default to false.
|
||||
*/
|
||||
bool isInverted() const;
|
||||
void setInverted(bool bInverted);
|
||||
|
|
|
@ -106,12 +106,12 @@ public:
|
|||
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.
|
||||
Returns YES if the operation is successful.
|
||||
Returns true if the operation is successful.
|
||||
*/
|
||||
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.
|
||||
Returns YES if the operation is successful.
|
||||
Returns true if the operation is successful.
|
||||
*/
|
||||
bool saveToFile(const char *name, Image::Format format);
|
||||
|
||||
|
@ -125,7 +125,7 @@ public:
|
|||
*/
|
||||
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 void setClearFlags(unsigned int clearFlags) { _clearFlags = clearFlags; };
|
||||
|
||||
|
@ -133,11 +133,11 @@ public:
|
|||
inline const Color4F& getClearColor() const { return _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 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 void setClearStencil(int clearStencil) { _clearStencil = clearStencil; };
|
||||
|
||||
|
|
|
@ -73,7 +73,7 @@ public:
|
|||
void initTexCoordsWithRect(const Rect& rect);
|
||||
|
||||
/** 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
|
||||
*/
|
||||
void setDisplayFrame(SpriteFrame *spriteFrame);
|
||||
|
|
|
@ -111,7 +111,7 @@ protected:
|
|||
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:
|
||||
|
||||
[sprite runAction:[Animate actionWithAnimation:animation]];
|
||||
sprite->runAction(Animate::create(animation));
|
||||
|
||||
*/
|
||||
class CC_DLL Animation : public Object, public Clonable
|
||||
|
|
|
@ -294,7 +294,7 @@ public:
|
|||
|
||||
/**
|
||||
* 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);
|
||||
|
||||
|
|
|
@ -81,9 +81,9 @@ public:
|
|||
public:
|
||||
/** 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
|
||||
* 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.
|
||||
@since v0.99.5
|
||||
|
@ -91,12 +91,12 @@ public:
|
|||
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. */
|
||||
void addSpriteFramesWithFile(const char *pszPlist, Texture2D *pobTexture);
|
||||
void addSpriteFramesWithFile(const char *plist, Texture2D *texture);
|
||||
|
||||
/** 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.
|
||||
*/
|
||||
void addSpriteFrame(SpriteFrame *pobFrame, const char *pszFrameName);
|
||||
void addSpriteFrame(SpriteFrame *frame, const char *frameName);
|
||||
|
||||
/** Purges the dictionary of loaded sprite frames.
|
||||
* Call this method if you receive the "Memory Warning".
|
||||
|
@ -113,7 +113,7 @@ public:
|
|||
void removeUnusedSpriteFrames(void);
|
||||
|
||||
/** 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.
|
||||
* Sprite Frames stored in this file will be removed.
|
||||
|
@ -140,7 +140,7 @@ public:
|
|||
private:
|
||||
/*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.
|
||||
* @since v0.99.5
|
||||
|
|
|
@ -29,7 +29,7 @@ using namespace std;
|
|||
NS_CC_BEGIN
|
||||
|
||||
//#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 kProfilerCategoryBatchSprite = false;
|
||||
bool kProfilerCategoryParticles = false;
|
||||
|
|
|
@ -129,8 +129,8 @@ public:
|
|||
|
||||
/** resize the capacity of the TextureAtlas.
|
||||
* The new capacity can be lower or higher than the current one
|
||||
* It returns YES if the resize was successful.
|
||||
* If it fails to resize the capacity it will return NO with a new capacity of 0.
|
||||
* It returns true if the resize was successful.
|
||||
* If it fails to resize the capacity it will return false with a new capacity of 0.
|
||||
*/
|
||||
bool resizeCapacity(int capacity);
|
||||
|
||||
|
|
|
@ -70,7 +70,7 @@ public:
|
|||
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
|
||||
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/
|
||||
ended/canceled update you're sure it's your touch. This frees you from doing a
|
||||
lot of checks when doing multi-touch.
|
||||
|
@ -82,7 +82,7 @@ public:
|
|||
class CC_DLL TargetedTouchDelegate : public TouchDelegate
|
||||
{
|
||||
public:
|
||||
/** Return YES to claim the touch.
|
||||
/** Return true to claim the touch.
|
||||
@since v0
|
||||
*/
|
||||
virtual bool ccTouchBegan(Touch *pTouch, Event *pEvent) { CC_UNUSED_PARAM(pTouch); CC_UNUSED_PARAM(pEvent);return false;};
|
||||
|
|
Loading…
Reference in New Issue