mirror of https://github.com/axmolengine/axmol.git
Minor English Spelling Corrections. A few grammar corrections.
This commit is contained in:
parent
4673977c31
commit
4cbd993091
|
@ -26,7 +26,7 @@
|
|||
* THE SOFTWARE.
|
||||
*
|
||||
*
|
||||
* Orignal code by Radu Gruian: http://www.codeproject.com/Articles/30838/Overhauser-Catmull-Rom-Splines-for-Camera-Animatio.So
|
||||
* Original code by Radu Gruian: http://www.codeproject.com/Articles/30838/Overhauser-Catmull-Rom-Splines-for-Camera-Animatio.So
|
||||
*
|
||||
* Adapted to cocos2d-x by Vit Valentin
|
||||
*
|
||||
|
|
|
@ -320,7 +320,7 @@ protected:
|
|||
|
||||
/**
|
||||
@brief Ease Elastic In action.
|
||||
@warning This action doesn't use a bijective fucntion. Actions like Sequence might have an unexpected result when used with this action.
|
||||
@warning This action doesn't use a bijective function. Actions like Sequence might have an unexpected result when used with this action.
|
||||
@since v0.8.2
|
||||
@ingroup Actions
|
||||
*/
|
||||
|
@ -345,7 +345,7 @@ public:
|
|||
|
||||
/**
|
||||
@brief Ease Elastic Out action.
|
||||
@warning This action doesn't use a bijective fucntion. Actions like Sequence might have an unexpected result when used with this action.
|
||||
@warning This action doesn't use a bijective function. Actions like Sequence might have an unexpected result when used with this action.
|
||||
@since v0.8.2
|
||||
@ingroup Actions
|
||||
*/
|
||||
|
@ -371,7 +371,7 @@ public:
|
|||
|
||||
/**
|
||||
@brief Ease Elastic InOut action.
|
||||
@warning This action doesn't use a bijective fucntion. Actions like Sequence might have an unexpected result when used with this action.
|
||||
@warning This action doesn't use a bijective function. Actions like Sequence might have an unexpected result when used with this action.
|
||||
@since v0.8.2
|
||||
@ingroup Actions
|
||||
*/
|
||||
|
@ -440,7 +440,7 @@ public:
|
|||
|
||||
/**
|
||||
@brief EaseBounceOut action.
|
||||
@warning This action doesn't use a bijective fucntion. Actions like Sequence might have an unexpected result when used with this action.
|
||||
@warning This action doesn't use a bijective function. Actions like Sequence might have an unexpected result when used with this action.
|
||||
@since v0.8.2
|
||||
@ingroup Actions
|
||||
*/
|
||||
|
@ -462,7 +462,7 @@ public:
|
|||
|
||||
/**
|
||||
@brief CCEaseBounceInOut action.
|
||||
@warning This action doesn't use a bijective fucntion. Actions like Sequence might have an unexpected result when used with this action.
|
||||
@warning This action doesn't use a bijective function. Actions like Sequence might have an unexpected result when used with this action.
|
||||
@since v0.8.2
|
||||
@ingroup Actions
|
||||
*/
|
||||
|
@ -484,7 +484,7 @@ public:
|
|||
|
||||
/**
|
||||
@brief CCEaseBackIn action.
|
||||
@warning This action doesn't use a bijective fucntion. Actions like Sequence might have an unexpected result when used with this action.
|
||||
@warning This action doesn't use a bijective function. Actions like Sequence might have an unexpected result when used with this action.
|
||||
@since v0.8.2
|
||||
@ingroup Actions
|
||||
*/
|
||||
|
@ -506,7 +506,7 @@ public:
|
|||
|
||||
/**
|
||||
@brief CCEaseBackOut action.
|
||||
@warning This action doesn't use a bijective fucntion. Actions like Sequence might have an unexpected result when used with this action.
|
||||
@warning This action doesn't use a bijective function. Actions like Sequence might have an unexpected result when used with this action.
|
||||
@since v0.8.2
|
||||
@ingroup Actions
|
||||
*/
|
||||
|
@ -528,7 +528,7 @@ public:
|
|||
|
||||
/**
|
||||
@brief CCEaseBackInOut action.
|
||||
@warning This action doesn't use a bijective fucntion. Actions like Sequence might have an unexpected result when used with this action.
|
||||
@warning This action doesn't use a bijective function. Actions like Sequence might have an unexpected result when used with this action.
|
||||
@since v0.8.2
|
||||
@ingroup Actions
|
||||
*/
|
||||
|
|
|
@ -384,7 +384,7 @@ bool CCRepeat::initWithAction(CCFiniteTimeAction *pAction, unsigned int times)
|
|||
pAction->retain();
|
||||
|
||||
m_bActionInstant = dynamic_cast<CCActionInstant*>(pAction) ? true : false;
|
||||
//a instant action needs to be executed one time less in the update method since it uses startWithTarget to execute the action
|
||||
//an instant action needs to be executed one time less in the update method since it uses startWithTarget to execute the action
|
||||
if (m_bActionInstant)
|
||||
{
|
||||
m_uTimes -=1;
|
||||
|
@ -463,7 +463,7 @@ void CCRepeat::update(float dt)
|
|||
m_uTotal++;
|
||||
}
|
||||
|
||||
// don't set a instantaction back or update it, it has no use because it has no duration
|
||||
// don't set an instant action back or update it, it has no use because it has no duration
|
||||
if (!m_bActionInstant)
|
||||
{
|
||||
if (m_uTotal == m_uTimes)
|
||||
|
|
|
@ -116,7 +116,7 @@ public:
|
|||
@deprecated: This interface will be deprecated sooner or later.
|
||||
*/
|
||||
CC_DEPRECATED_ATTRIBUTE static CCFiniteTimeAction* actions(CCFiniteTimeAction *pAction1, ...);
|
||||
/** helper contructor to create an array of sequenceable actions given an array
|
||||
/** helper constructor to create an array of sequenceable actions given an array
|
||||
@deprecated: This interface will be deprecated sooner or later.
|
||||
*/
|
||||
CC_DEPRECATED_ATTRIBUTE static CCFiniteTimeAction* actionWithArray(CCArray *arrayOfActions);
|
||||
|
@ -127,7 +127,7 @@ public:
|
|||
|
||||
/** helper constructor to create an array of sequenceable actions */
|
||||
static CCFiniteTimeAction* create(CCFiniteTimeAction *pAction1, ...);
|
||||
/** helper contructor to create an array of sequenceable actions given an array */
|
||||
/** helper constructor to create an array of sequenceable actions given an array */
|
||||
static CCFiniteTimeAction* create(CCArray *arrayOfActions);
|
||||
/** creates the action */
|
||||
static CCSequence* createWithTwoActions(CCFiniteTimeAction *pActionOne, CCFiniteTimeAction *pActionTwo);
|
||||
|
@ -257,7 +257,7 @@ public:
|
|||
*/
|
||||
CC_DEPRECATED_ATTRIBUTE static CCFiniteTimeAction* actions(CCFiniteTimeAction *pAction1, ...);
|
||||
|
||||
/** helper contructor to create an array of spawned actions given an array
|
||||
/** helper constructor to create an array of spawned actions given an array
|
||||
@deprecated: This interface will be deprecated sooner or later.
|
||||
*/
|
||||
CC_DEPRECATED_ATTRIBUTE static CCFiniteTimeAction* actionWithArray(CCArray *arrayOfActions);
|
||||
|
@ -270,7 +270,7 @@ public:
|
|||
/** helper constructor to create an array of spawned actions */
|
||||
static CCFiniteTimeAction* create(CCFiniteTimeAction *pAction1, ...);
|
||||
|
||||
/** helper contructor to create an array of spawned actions given an array */
|
||||
/** helper constructor to create an array of spawned actions given an array */
|
||||
static CCFiniteTimeAction* create(CCArray *arrayOfActions);
|
||||
|
||||
/** creates the Spawn action */
|
||||
|
|
|
@ -96,7 +96,7 @@ void CCPageTurn3D::update(float time)
|
|||
p.y = ( R + ay - ( r * (1 - cosBeta) * sinTheta));
|
||||
|
||||
// We scale z here to avoid the animation being
|
||||
// too much bigger than the screen due to perspectve transform
|
||||
// too much bigger than the screen due to perspective transform
|
||||
p.z = (r * ( 1 - cosBeta ) * cosTheta) / 7;// "100" didn't work for
|
||||
|
||||
// Stop z coord from dropping beneath underlying page in a transition
|
||||
|
|
|
@ -50,7 +50,7 @@ public:
|
|||
[target runAction:modifyWidth];
|
||||
|
||||
|
||||
Another example: CCScaleTo action could be rewriten using CCPropertyAction:
|
||||
Another example: CCScaleTo action could be rewritten using CCPropertyAction:
|
||||
|
||||
// scaleA and scaleB are equivalents
|
||||
id scaleA = [CCScaleTo actionWithDuration:2 scale:3];
|
||||
|
|
|
@ -130,7 +130,7 @@ void CCAtlasNode::calculateMaxItems()
|
|||
|
||||
void CCAtlasNode::updateAtlasValues()
|
||||
{
|
||||
CCAssert(false, "CCAtlasNode:Abstract updateAtlasValue not overriden");
|
||||
CCAssert(false, "CCAtlasNode:Abstract updateAtlasValue not overridden");
|
||||
}
|
||||
|
||||
// CCAtlasNode - draw
|
||||
|
|
|
@ -98,7 +98,7 @@ public:
|
|||
bool initWithTileFile(const char* tile, unsigned int tileWidth, unsigned int tileHeight, unsigned int itemsToRender);
|
||||
|
||||
/** updates the Atlas (indexed vertex array).
|
||||
* Shall be overriden in subclasses
|
||||
* Shall be overridden in subclasses
|
||||
*/
|
||||
virtual void updateAtlasValues();
|
||||
|
||||
|
|
|
@ -171,7 +171,7 @@ void CCNode::setZOrder(int z)
|
|||
}
|
||||
}
|
||||
|
||||
/// ertexZ getter
|
||||
/// vertexZ getter
|
||||
float CCNode::getVertexZ()
|
||||
{
|
||||
return m_fVertexZ;
|
||||
|
@ -491,7 +491,7 @@ CCNode* CCNode::getChildByTag(int aTag)
|
|||
}
|
||||
|
||||
/* "add" logic MUST only be on this method
|
||||
* If a class want's to extend the 'addChild' behaviour it only needs
|
||||
* If a class want's to extend the 'addChild' behavior it only needs
|
||||
* to override this method
|
||||
*/
|
||||
void CCNode::addChild(CCNode *child, int zOrder, int tag)
|
||||
|
|
|
@ -25,8 +25,8 @@
|
|||
THE SOFTWARE.
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __PLATFOMR_CCNODE_H__
|
||||
#define __PLATFOMR_CCNODE_H__
|
||||
#ifndef __PLATFORM_CCNODE_H__
|
||||
#define __PLATFORM_CCNODE_H__
|
||||
|
||||
#include "ccMacros.h"
|
||||
#include "cocoa/CCAffineTransform.h"
|
||||
|
@ -65,7 +65,7 @@ enum {
|
|||
kCCNodeOnExitTransitionDidStart
|
||||
};
|
||||
|
||||
/** @brief CCNode is the main element. Anything thats gets drawn or contains things that get drawn is a CCNode.
|
||||
/** @brief CCNode is the main element. Anything that gets drawn or contains things that get drawn is a CCNode.
|
||||
The most popular CCNodes are: CCScene, CCLayer, CCSprite, CCMenu.
|
||||
|
||||
The main features of a CCNode are:
|
||||
|
@ -239,7 +239,7 @@ public:
|
|||
/** A weak reference to the parent */
|
||||
CC_PROPERTY(CCNode *, m_pParent, Parent)
|
||||
|
||||
// If ture, the Anchor Point will be (0,0) when you position the CCNode.
|
||||
// If true, the Anchor Point will be (0,0) when you position the CCNode.
|
||||
// Used by CCLayer and CCScene
|
||||
bool m_bIgnoreAnchorPointForPosition;
|
||||
bool isIgnoreAnchorPointForPosition();
|
||||
|
@ -325,7 +325,7 @@ public:
|
|||
*/
|
||||
static CCNode * create(void);
|
||||
|
||||
//scene managment
|
||||
//scene management
|
||||
|
||||
/** callback that is called every time the CCNode enters the 'stage'.
|
||||
If the CCNode enters the 'stage' with a transition, this callback is called when the transition starts.
|
||||
|
@ -577,7 +577,7 @@ public:
|
|||
*/
|
||||
virtual CCAffineTransform parentToNodeTransform(void);
|
||||
|
||||
/** Retrusn the world affine transform matrix. The matrix is in Pixels.
|
||||
/** Returns the world affine transform matrix. The matrix is in Pixels.
|
||||
@since v0.7.1
|
||||
*/
|
||||
virtual CCAffineTransform nodeToWorldTransform(void);
|
||||
|
@ -611,7 +611,7 @@ public:
|
|||
*/
|
||||
CCPoint convertTouchToNodeSpace(CCTouch * touch);
|
||||
|
||||
/** converts a CCTouch (world coordinates) into a local coordiante. This method is AR (Anchor Relative).
|
||||
/** converts a CCTouch (world coordinates) into a local coordinate. This method is AR (Anchor Relative).
|
||||
@since v0.7.1
|
||||
*/
|
||||
CCPoint convertTouchToNodeSpaceAR(CCTouch * touch);
|
||||
|
@ -622,7 +622,7 @@ public:
|
|||
|
||||
NS_CC_END
|
||||
|
||||
#endif // __PLATFOMR_CCNODE_H__
|
||||
#endif // __PLATFORM_CCNODE_H__
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -414,7 +414,7 @@ void CCArray::reverseObjects()
|
|||
{
|
||||
if (data->num > 1)
|
||||
{
|
||||
//floor it since in case of a oneven number the number of swaps stays the same
|
||||
// floorf(), since in the case of an even number, the number of swaps stays the same
|
||||
int count = (int) floorf(data->num/2.f);
|
||||
unsigned int maxIndex = data->num - 1;
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@ THE SOFTWARE.
|
|||
*/
|
||||
|
||||
/** @def CCARRAY_FOREACH
|
||||
A convience macro to iterate over a CCArray using. It is faster than the "fast enumeration" interface.
|
||||
A convenience macro to iterate over a CCArray using. It is faster than the "fast enumeration" interface.
|
||||
@since v0.99.4
|
||||
*/
|
||||
|
||||
|
@ -139,7 +139,7 @@ public:
|
|||
@brief Generate a CCArray pointer by file
|
||||
@param pFileName The file name of *.plist file
|
||||
@return The CCArray pointer generated from the file
|
||||
@deprecated: Please use createWithContentsOfFile(const char*) intead. This interface will be deprecated sooner or later.
|
||||
@deprecated: Please use createWithContentsOfFile(const char*) instead. This interface will be deprecated sooner or later.
|
||||
*/
|
||||
CC_DEPRECATED_ATTRIBUTE static CCArray* arrayWithContentsOfFile(const char* pFileName);
|
||||
|
||||
|
|
|
@ -264,7 +264,7 @@ void CCDictionary::removeAllObjects()
|
|||
|
||||
CCObject* CCDictionary::copyWithZone(CCZone* pZone)
|
||||
{
|
||||
CCAssert(pZone == NULL, "CCDirctionary should not be inherited.");
|
||||
CCAssert(pZone == NULL, "CCDictionary should not be inherited.");
|
||||
CCDictionary* pNewDict = new CCDictionary();
|
||||
|
||||
CCDictElement* pElement = NULL;
|
||||
|
|
|
@ -50,7 +50,7 @@ static inline void split(std::string src, const char* token, strArray& vect)
|
|||
}
|
||||
|
||||
// first, judge whether the form of the string like this: {x,y}
|
||||
// if the form is right,the string will be splited into the parameter strs;
|
||||
// if the form is right,the string will be split into the parameter strs;
|
||||
// or the parameter strs will be empty.
|
||||
// if the form is right return true,else return false.
|
||||
static bool splitWithForm(const char* pStr, strArray& strs)
|
||||
|
|
|
@ -44,7 +44,7 @@ CCObject::CCObject(void)
|
|||
m_uID = ++uObjectCount;
|
||||
m_nLuaID = 0;
|
||||
|
||||
// when the object is created, the refrence count of it is 1
|
||||
// when the object is created, the reference count of it is 1
|
||||
m_uReference = 1;
|
||||
m_bManaged = false;
|
||||
}
|
||||
|
|
|
@ -53,7 +53,7 @@ public:
|
|||
// Lua reference id
|
||||
int m_nLuaID;
|
||||
protected:
|
||||
// count of refrence
|
||||
// count of references
|
||||
unsigned int m_uReference;
|
||||
// is the object autoreleased
|
||||
bool m_bManaged;
|
||||
|
|
|
@ -45,7 +45,7 @@ public:
|
|||
virtual ~CCSet(void);
|
||||
|
||||
/**
|
||||
*@brief Return a copy of the CCSet, it will copy all the elelments.
|
||||
*@brief Return a copy of the CCSet, it will copy all the elements.
|
||||
*/
|
||||
CCSet* copy();
|
||||
/**
|
||||
|
@ -73,7 +73,7 @@ public:
|
|||
*/
|
||||
CCSetIterator begin();
|
||||
/**
|
||||
*@brief Return the iterator that points to the poisition after the last element.
|
||||
*@brief Return the iterator that points to the position after the last element.
|
||||
*/
|
||||
CCSetIterator end();
|
||||
/**
|
||||
|
|
|
@ -84,7 +84,7 @@ public:
|
|||
virtual CCObject* copyWithZone(CCZone* pZone);
|
||||
virtual bool isEqual(const CCObject* pObject);
|
||||
|
||||
/* static funcitons */
|
||||
/* static functions */
|
||||
/** create a string with c string
|
||||
* @return A CCString pointer which is an autorelease object pointer,
|
||||
* it means that you needn't do a release operation unless you retain it.
|
||||
|
@ -120,7 +120,7 @@ public:
|
|||
*/
|
||||
CC_DEPRECATED_ATTRIBUTE static CCString* stringWithContentsOfFile(const char* pszFileName);
|
||||
|
||||
/** create a string with std string, you can also pass a c string pointer because the default constuctor of std::string can access a c string pointer.
|
||||
/** create a string with std string, you can also pass a c string pointer because the default constructor of std::string can access a c string pointer.
|
||||
* @return A CCString pointer which is an autorelease object pointer,
|
||||
* it means that you needn't do a release operation unless you retain it.
|
||||
*/
|
||||
|
|
|
@ -53,7 +53,7 @@ void CCGrabber::grab(CCTexture2D *pTexture)
|
|||
GLuint status = glCheckFramebufferStatus(GL_FRAMEBUFFER);
|
||||
if (status != GL_FRAMEBUFFER_COMPLETE)
|
||||
{
|
||||
CCAssert(0, "Frame Grabber: could not attach texture to frmaebuffer");
|
||||
CCAssert(0, "Frame Grabber: could not attach texture to framebuffer");
|
||||
}
|
||||
|
||||
glBindFramebuffer(GL_FRAMEBUFFER, m_oldFBO);
|
||||
|
|
|
@ -346,7 +346,7 @@ void CCGrid3D::blit(void)
|
|||
// position
|
||||
glVertexAttribPointer(kCCVertexAttrib_Position, 3, GL_FLOAT, GL_FALSE, 0, m_pVertices);
|
||||
|
||||
// texCoods
|
||||
// texCoords
|
||||
glVertexAttribPointer(kCCVertexAttrib_TexCoords, 2, GL_FLOAT, GL_FALSE, 0, m_pTexCoordinates);
|
||||
|
||||
glDrawElements(GL_TRIANGLES, (GLsizei) n*6, GL_UNSIGNED_SHORT, m_pIndices);
|
||||
|
@ -551,7 +551,7 @@ void CCTiledGrid3D::blit(void)
|
|||
// position
|
||||
glVertexAttribPointer(kCCVertexAttrib_Position, 3, GL_FLOAT, GL_FALSE, 0, m_pVertices);
|
||||
|
||||
// texCoods
|
||||
// texCoords
|
||||
glVertexAttribPointer(kCCVertexAttrib_TexCoords, 2, GL_FLOAT, GL_FALSE, 0, m_pTexCoordinates);
|
||||
|
||||
glDrawElements(GL_TRIANGLES, (GLsizei)n*6, GL_UNSIGNED_SHORT, m_pIndices);
|
||||
|
|
|
@ -51,7 +51,7 @@ class CC_DLL CCGridBase : public CCObject
|
|||
public:
|
||||
virtual ~CCGridBase(void);
|
||||
|
||||
/** wheter or not the grid is active */
|
||||
/** whether or not the grid is active */
|
||||
inline bool isActive(void) { return m_bActive; }
|
||||
void setActive(bool bActive);
|
||||
|
||||
|
|
|
@ -50,7 +50,7 @@ public:
|
|||
virtual GLubyte getOpacity(void) = 0;
|
||||
|
||||
/** sets the opacity.
|
||||
@warning If the the texture has premultiplied alpha then, the R, G and B channels will be modifed.
|
||||
@warning If the the texture has premultiplied alpha then, the R, G and B channels will be modified.
|
||||
Values goes from 0 to 255, where 255 means fully opaque.
|
||||
*/
|
||||
virtual void setOpacity(GLubyte opacity) = 0;
|
||||
|
@ -59,7 +59,7 @@ public:
|
|||
|
||||
/** sets the premultipliedAlphaOpacity property.
|
||||
If set to NO then opacity will be applied as: glColor(R,G,B,opacity);
|
||||
If set to YES then oapcity will be applied as: glColor(opacity, opacity, opacity, opacity );
|
||||
If set to YES then opacity will be applied as: glColor(opacity, opacity, opacity, opacity );
|
||||
Textures with premultiplied alpha will have this property by default on YES. Otherwise the default value is NO
|
||||
@since v0.8
|
||||
*/
|
||||
|
@ -72,7 +72,7 @@ public:
|
|||
};
|
||||
|
||||
/**
|
||||
@brief You can specify the blending fuction.
|
||||
@brief You can specify the blending function.
|
||||
@since v0.99.0
|
||||
*/
|
||||
class CC_DLL CCBlendProtocol
|
||||
|
@ -91,7 +91,7 @@ public:
|
|||
src=GL_ONE dst= GL_ONE_MINUS_SRC_ALPHA
|
||||
else
|
||||
src=GL_SRC_ALPHA dst= GL_ONE_MINUS_SRC_ALPHA
|
||||
But you can change the blending funtion at any time.
|
||||
But you can change the blending function at any time.
|
||||
@since v0.8.0
|
||||
*/
|
||||
class CC_DLL CCTextureProtocol : public CCBlendProtocol
|
||||
|
@ -119,7 +119,7 @@ public:
|
|||
class CC_DLL CCDirectorDelegate
|
||||
{
|
||||
public:
|
||||
/** Called by CCDirector when the porjection is updated, and "custom" projection is used
|
||||
/** Called by CCDirector when the projection is updated, and "custom" projection is used
|
||||
@since v0.99.5
|
||||
*/
|
||||
virtual void updateProjection(void) = 0;
|
||||
|
|
|
@ -36,14 +36,14 @@ THE SOFTWARE.
|
|||
|
||||
/** @def CC_ENABLE_GL_STATE_CACHE
|
||||
If enabled, cocos2d will maintain an OpenGL state cache internally to avoid unnecessary switches.
|
||||
In order to use them, you have to use the following functions, insead of the the GL ones:
|
||||
In order to use them, you have to use the following functions, instead of the the GL ones:
|
||||
- ccGLUseProgram() instead of glUseProgram()
|
||||
- ccGLDeleteProgram() instead of glDeleteProgram()
|
||||
- ccGLBlendFunc() instead of glBlendFunc()
|
||||
|
||||
If this functionality is disabled, then ccGLUseProgram(), ccGLDeleteProgram(), ccGLBlendFunc() will call the GL ones, without using the cache.
|
||||
|
||||
It is recommened to enable whenever possible to improve speed.
|
||||
It is recommended to enable whenever possible to improve speed.
|
||||
If you are migrating your code from GL ES 1.1, then keep it disabled. Once all your code works as expected, turn it on.
|
||||
|
||||
@since v2.0.0
|
||||
|
@ -77,7 +77,7 @@ To enabled set it to 1. Disabled by default.
|
|||
#endif
|
||||
|
||||
/** @def CC_DIRECTOR_FPS_INTERVAL
|
||||
Senconds between FPS updates.
|
||||
Seconds between FPS updates.
|
||||
0.5 seconds, means that the FPS number will be updated every 0.5 seconds.
|
||||
Having a bigger number means a more reliable FPS
|
||||
|
||||
|
@ -190,7 +190,7 @@ Only valid for cocos2d-mac. Not supported on cocos2d-ios.
|
|||
|
||||
/** @def CC_SPRITE_DEBUG_DRAW
|
||||
If enabled, all subclasses of CCSprite will draw a bounding box
|
||||
Useful for debugging purposes only. It is recommened to leave it disabled.
|
||||
Useful for debugging purposes only. It is recommended to leave it disabled.
|
||||
|
||||
To enable set it to a value different than 0. Disabled by default:
|
||||
0 -- disabled
|
||||
|
@ -206,7 +206,7 @@ Only valid for cocos2d-mac. Not supported on cocos2d-ios.
|
|||
|
||||
/** @def CC_SPRITEBATCHNODE_DEBUG_DRAW
|
||||
If enabled, all subclasses of CCSprite that are rendered using an CCSpriteBatchNode draw a bounding box.
|
||||
Useful for debugging purposes only. It is recommened to leave it disabled.
|
||||
Useful for debugging purposes only. It is recommended to leave it disabled.
|
||||
|
||||
To enable set it to a value different than 0. Disabled by default.
|
||||
*/
|
||||
|
@ -216,7 +216,7 @@ To enable set it to a value different than 0. Disabled by default.
|
|||
|
||||
/** @def CC_LABELBMFONT_DEBUG_DRAW
|
||||
If enabled, all subclasses of CCLabelBMFont will draw a bounding box
|
||||
Useful for debugging purposes only. It is recommened to leave it disabled.
|
||||
Useful for debugging purposes only. It is recommended to leave it disabled.
|
||||
|
||||
To enable set it to a value different than 0. Disabled by default.
|
||||
*/
|
||||
|
@ -226,7 +226,7 @@ To enable set it to a value different than 0. Disabled by default.
|
|||
|
||||
/** @def CC_LABELATLAS_DEBUG_DRAW
|
||||
If enabled, all subclasses of LabeltAtlas will draw a bounding box
|
||||
Useful for debugging purposes only. It is recommened to leave it disabled.
|
||||
Useful for debugging purposes only. It is recommended to leave it disabled.
|
||||
|
||||
To enable set it to a value different than 0. Disabled by default.
|
||||
*/
|
||||
|
@ -235,9 +235,9 @@ To enable set it to a value different than 0. Disabled by default.
|
|||
#endif
|
||||
|
||||
/** @def CC_ENABLE_PROFILERS
|
||||
If enabled, will activate various profilers withing cocos2d. This statistical data will be output to the console
|
||||
If enabled, will activate various profilers within cocos2d. This statistical data will be output to the console
|
||||
once per second showing average time (in milliseconds) required to execute the specific routine(s).
|
||||
Useful for debugging purposes only. It is recommened to leave it disabled.
|
||||
Useful for debugging purposes only. It is recommended to leave it disabled.
|
||||
|
||||
To enable set it to a value different than 0. Disabled by default.
|
||||
*/
|
||||
|
|
|
@ -163,7 +163,7 @@ CCSizeMake( (__size_in_points__).width * CC_CONTENT_SCALE_FACTOR(), (__size_in_p
|
|||
void operator=(const TypeName&)
|
||||
|
||||
/**
|
||||
Helper marcos which converts 4-byte little/big endian
|
||||
Helper macros which converts 4-byte little/big endian
|
||||
integral number to the machine native number representation
|
||||
|
||||
It should work same as apples CFSwapInt32LittleToHost(..)
|
||||
|
|
|
@ -254,7 +254,7 @@ typedef struct _ccV3F_C4B_T2F
|
|||
// char __padding2__[4];
|
||||
|
||||
// tex coords (2F)
|
||||
ccTex2F texCoords; // 8 byts
|
||||
ccTex2F texCoords; // 8 bytes
|
||||
} ccV3F_C4B_T2F;
|
||||
|
||||
//! 4 ccVertex2FTex2FColor4B Quad
|
||||
|
@ -305,7 +305,7 @@ typedef struct _ccBlendFunc
|
|||
GLenum dst;
|
||||
} ccBlendFunc;
|
||||
|
||||
// XXX: If any of these enums are edited and/or reordered, udpate CCTexture2D.m
|
||||
// XXX: If any of these enums are edited and/or reordered, update CCTexture2D.m
|
||||
//! Vertical text alignment type
|
||||
typedef enum
|
||||
{
|
||||
|
@ -314,7 +314,7 @@ typedef enum
|
|||
kCCVerticalTextAlignmentBottom,
|
||||
} CCVerticalTextAlignment;
|
||||
|
||||
// XXX: If any of these enums are edited and/or reordered, udpate CCTexture2D.m
|
||||
// XXX: If any of these enums are edited and/or reordered, update CCTexture2D.m
|
||||
//! Horizontal text alignment type
|
||||
typedef enum
|
||||
{
|
||||
|
|
|
@ -35,7 +35,7 @@ extern "C" {
|
|||
#endif
|
||||
|
||||
/**
|
||||
* A struture that represents an axis-aligned
|
||||
* A structure that represents an axis-aligned
|
||||
* bounding box.
|
||||
*/
|
||||
typedef struct kmAABB {
|
||||
|
|
|
@ -32,13 +32,13 @@
|
|||
#endif
|
||||
#endif // __arm__
|
||||
|
||||
// Matrixes are assumed to be stored in column major format according to OpenGL
|
||||
// Matrices are assumed to be stored in column major format according to OpenGL
|
||||
// specification.
|
||||
|
||||
// Multiplies two 4x4 matrices (a,b) outputing a 4x4 matrix (output)
|
||||
// Multiplies two 4x4 matrices (a,b) outputting a 4x4 matrix (output)
|
||||
void NEON_Matrix4Mul(const float* a, const float* b, float* output );
|
||||
|
||||
// Multiplies a 4x4 matrix (m) with a vector 4 (v), outputing a vector 4
|
||||
// Multiplies a 4x4 matrix (m) with a vector 4 (v), outputting a vector 4
|
||||
void NEON_Matrix4Vector4Mul(const float* m, const float* v, float* output);
|
||||
|
||||
|
||||
|
|
|
@ -62,7 +62,7 @@ CC_DLL kmPlane* const kmPlaneFromPoints(kmPlane* pOut, const struct kmVec3* p1,
|
|||
CC_DLL kmVec3* const kmPlaneIntersectLine(struct kmVec3* pOut, const kmPlane* pP, const struct kmVec3* pV1, const struct kmVec3* pV2);
|
||||
CC_DLL kmPlane* const kmPlaneNormalize(kmPlane* pOut, const kmPlane* pP);
|
||||
CC_DLL kmPlane* const kmPlaneScale(kmPlane* pOut, const kmPlane* pP, kmScalar s);
|
||||
CC_DLL const POINT_CLASSIFICATION kmPlaneClassifyPoint(const kmPlane* pIn, const kmVec3* pP); /** Classifys a point against a plane */
|
||||
CC_DLL const POINT_CLASSIFICATION kmPlaneClassifyPoint(const kmPlane* pIn, const kmVec3* pP); /** Classifies a point against a plane */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -100,7 +100,7 @@ void kmGLPushMatrix(void)
|
|||
void kmGLPopMatrix(void)
|
||||
{
|
||||
assert(initialized && "Cannot Pop empty matrix stack");
|
||||
//No need to lazy initialize, you shouldnt be popping first anyway!
|
||||
//No need to lazy initialize, you shouldn't be popping first anyway!
|
||||
km_mat4_stack_pop(current_stack, NULL);
|
||||
}
|
||||
|
||||
|
|
|
@ -55,7 +55,7 @@ const kmScalar kmMat3Determinant(const kmMat3* pIn)
|
|||
m = | 1 4 7 | 1 4 |
|
||||
| 2 5 8 | 2 5 |
|
||||
now sum up the products of the diagonals going to the right (i.e. 0,4,8)
|
||||
and substract the products of the other diagonals (i.e. 2,4,6)
|
||||
and subtract the products of the other diagonals (i.e. 2,4,6)
|
||||
*/
|
||||
|
||||
output = pIn->mat[0] * pIn->mat[4] * pIn->mat[8] + pIn->mat[1] * pIn->mat[5] * pIn->mat[6] + pIn->mat[2] * pIn->mat[3] * pIn->mat[7];
|
||||
|
|
|
@ -41,7 +41,7 @@ public:
|
|||
// The back key clicked
|
||||
virtual void keyBackClicked() {}
|
||||
|
||||
// The menu key clicked. only avialble on wophone & android
|
||||
// The menu key clicked. only available on wophone & android
|
||||
virtual void keyMenuClicked() {};
|
||||
};
|
||||
|
||||
|
|
|
@ -931,7 +931,7 @@ void CCLabelBMFont::createFontChars()
|
|||
// Color MUST be set before opacity, since opacity might change color if OpacityModifyRGB is on
|
||||
fontChar->setColor(m_tColor);
|
||||
|
||||
// only apply opaccity if it is different than 255 )
|
||||
// only apply opacity if it is different than 255 )
|
||||
// to prevent modifying the color too (issue #610)
|
||||
if( m_cOpacity != 255 )
|
||||
{
|
||||
|
|
|
@ -93,7 +93,7 @@ typedef struct _BMFontPadding {
|
|||
*/
|
||||
class CC_DLL CCBMFontConfiguration : public CCObject
|
||||
{
|
||||
// XXX: Creating a public interface so that the bitmapFontArray[] is accesible
|
||||
// XXX: Creating a public interface so that the bitmapFontArray[] is accessible
|
||||
public://@public
|
||||
// BMFont definitions
|
||||
struct _FontDefHashElement* m_pFontDefDictionary;
|
||||
|
@ -142,7 +142,7 @@ Features:
|
|||
- scaled
|
||||
- translated
|
||||
- tinted
|
||||
- chage the opacity
|
||||
- change the opacity
|
||||
- It can be used as part of a menu item.
|
||||
- anchorPoint can be used to align the "label"
|
||||
- Supports AngelCode text format
|
||||
|
@ -202,11 +202,11 @@ public:
|
|||
@since v0.99.3
|
||||
*/
|
||||
static void purgeCachedData();
|
||||
/** creates a bitmap font altas with an initial string and the FNT file
|
||||
/** creates a bitmap font atlas with an initial string and the FNT file
|
||||
@deprecated: This interface will be deprecated sooner or later.
|
||||
*/
|
||||
CC_DEPRECATED_ATTRIBUTE static CCLabelBMFont * labelWithString(const char *str, const char *fntFile, float width = kCCLabelAutomaticWidth, CCTextAlignment alignment = kCCTextAlignmentLeft, CCPoint imageOffset = CCPointZero);
|
||||
/** creates a bitmap font altas with an initial string and the FNT file */
|
||||
/** creates a bitmap font atlas with an initial string and the FNT file */
|
||||
static CCLabelBMFont * create(const char *str, const char *fntFile, float width, CCTextAlignment alignment, CCPoint imageOffset);
|
||||
|
||||
static CCLabelBMFont * create(const char *str, const char *fntFile, float width, CCTextAlignment alignment) {
|
||||
|
@ -231,7 +231,7 @@ public:
|
|||
static CCLabelBMFont * create();
|
||||
|
||||
bool init();
|
||||
/** init a bitmap font altas with an initial string and the FNT file */
|
||||
/** init a bitmap font atlas with an initial string and the FNT file */
|
||||
bool initWithString(const char *str, const char *fntFile, float width = kCCLabelAutomaticWidth, CCTextAlignment alignment = kCCTextAlignmentLeft, CCPoint imageOffset = CCPointZero);
|
||||
|
||||
/** updates the font chars based on the string to render */
|
||||
|
|
|
@ -227,7 +227,7 @@ void CCLabelTTF::setDimensions(const CCSize &dim)
|
|||
{
|
||||
m_tDimensions = dim;
|
||||
|
||||
// Force udpate
|
||||
// Force update
|
||||
if (m_string.size() > 0)
|
||||
{
|
||||
this->updateTexture();
|
||||
|
|
|
@ -247,7 +247,7 @@ void CCLayer::onEnter()
|
|||
pDirector->getAccelerometer()->setDelegate(this);
|
||||
}
|
||||
|
||||
// add this layer to concern the kaypad msg
|
||||
// add this layer to concern the keypad msg
|
||||
if (m_bIsKeypadEnabled)
|
||||
{
|
||||
pDirector->getKeypadDispatcher()->addDelegate(this);
|
||||
|
@ -269,7 +269,7 @@ void CCLayer::onExit()
|
|||
pDirector->getAccelerometer()->setDelegate(NULL);
|
||||
}
|
||||
|
||||
// remove this layer from the delegates who concern the kaypad msg
|
||||
// remove this layer from the delegates who concern the keypad msg
|
||||
if (m_bIsKeypadEnabled)
|
||||
{
|
||||
pDirector->getKeypadDispatcher()->removeDelegate(this);
|
||||
|
|
|
@ -293,7 +293,7 @@ public:
|
|||
|
||||
/**
|
||||
* lua script can not init with undetermined number of variables
|
||||
* so add these functinons to be used with lua.
|
||||
* so add these functions to be used with lua.
|
||||
@deprecated: This interface will be deprecated sooner or later.
|
||||
*/
|
||||
CC_DEPRECATED_ATTRIBUTE static CCLayerMultiplex * layerWithLayer(CCLayer* layer);
|
||||
|
@ -303,7 +303,7 @@ public:
|
|||
|
||||
/**
|
||||
* lua script can not init with undetermined number of variables
|
||||
* so add these functinons to be used with lua.
|
||||
* so add these functions to be used with lua.
|
||||
*/
|
||||
static CCLayerMultiplex * createWithLayer(CCLayer* layer);
|
||||
|
||||
|
|
|
@ -130,7 +130,7 @@ public:
|
|||
/** called after the transition finishes */
|
||||
void finish(void);
|
||||
|
||||
/** used by some transitions to hide the outter scene */
|
||||
/** used by some transitions to hide the outer scene */
|
||||
void hideOutShowIn(void);
|
||||
|
||||
protected:
|
||||
|
@ -266,7 +266,7 @@ public:
|
|||
|
||||
/** initializes the scenes */
|
||||
virtual void initScenes(void);
|
||||
/** returns the action that will be performed by the incomming and outgoing scene */
|
||||
/** returns the action that will be performed by the incoming and outgoing scene */
|
||||
virtual CCActionInterval* action(void);
|
||||
|
||||
virtual void onEnter();
|
||||
|
@ -290,7 +290,7 @@ public:
|
|||
|
||||
/** initializes the scenes */
|
||||
virtual void initScenes(void);
|
||||
/** returns the action that will be performed by the incomming and outgoing scene */
|
||||
/** returns the action that will be performed by the incoming and outgoing scene */
|
||||
virtual CCActionInterval* action(void);
|
||||
|
||||
TRANSITION_CREATE_FUNC(CCTransitionSlideInR);
|
||||
|
@ -310,7 +310,7 @@ public:
|
|||
|
||||
/** initializes the scenes */
|
||||
virtual void initScenes(void);
|
||||
/** returns the action that will be performed by the incomming and outgoing scene */
|
||||
/** returns the action that will be performed by the incoming and outgoing scene */
|
||||
virtual CCActionInterval* action(void);
|
||||
|
||||
TRANSITION_CREATE_FUNC(CCTransitionSlideInB);
|
||||
|
@ -330,7 +330,7 @@ public:
|
|||
|
||||
/** initializes the scenes */
|
||||
virtual void initScenes(void);
|
||||
/** returns the action that will be performed by the incomming and outgoing scene */
|
||||
/** returns the action that will be performed by the incoming and outgoing scene */
|
||||
virtual CCActionInterval* action(void);
|
||||
|
||||
TRANSITION_CREATE_FUNC(CCTransitionSlideInT);
|
||||
|
|
|
@ -59,7 +59,7 @@ protected:
|
|||
|
||||
|
||||
/** CCTransitionRadialCCW transition.
|
||||
A counter colock-wise radial transition to the next scene
|
||||
A counter clock-wise radial transition to the next scene
|
||||
*/
|
||||
class CC_DLL CCTransitionProgressRadialCCW : public CCTransitionProgress
|
||||
{
|
||||
|
@ -73,7 +73,7 @@ protected:
|
|||
|
||||
|
||||
/** CCTransitionRadialCW transition.
|
||||
A counter colock-wise radial transition to the next scene
|
||||
A counter clock-wise radial transition to the next scene
|
||||
*/
|
||||
class CC_DLL CCTransitionProgressRadialCW : public CCTransitionProgress
|
||||
{
|
||||
|
@ -86,7 +86,7 @@ protected:
|
|||
};
|
||||
|
||||
/** CCTransitionProgressHorizontal transition.
|
||||
A colock-wise radial transition to the next scene
|
||||
A clock-wise radial transition to the next scene
|
||||
*/
|
||||
class CC_DLL CCTransitionProgressHorizontal : public CCTransitionProgress
|
||||
{
|
||||
|
|
|
@ -51,7 +51,7 @@ enum {
|
|||
*
|
||||
* Features and Limitation:
|
||||
* - You can add MenuItem objects in runtime using addChild:
|
||||
* - But the only accecpted children are MenuItem objects
|
||||
* - But the only accepted children are MenuItem objects
|
||||
*/
|
||||
class CC_DLL CCMenu : public CCLayer, public CCRGBAProtocol
|
||||
{
|
||||
|
|
|
@ -129,14 +129,14 @@ public:
|
|||
@deprecated: This interface will be deprecated sooner or later.
|
||||
*/
|
||||
CC_DEPRECATED_ATTRIBUTE static CCMenuItemLabel * itemWithLabel(CCNode*label, CCObject* target, SEL_MenuHandler selector);
|
||||
/** creates a CCMenuItemLabel with a Label. Target and selector will be nill
|
||||
/** creates a CCMenuItemLabel with a Label. Target and selector will be nil
|
||||
@deprecated: This interface will be deprecated sooner or later.
|
||||
*/
|
||||
CC_DEPRECATED_ATTRIBUTE static CCMenuItemLabel* itemWithLabel(CCNode *label);
|
||||
|
||||
/** creates a CCMenuItemLabel with a Label, target and selector */
|
||||
static CCMenuItemLabel * create(CCNode*label, CCObject* target, SEL_MenuHandler selector);
|
||||
/** creates a CCMenuItemLabel with a Label. Target and selector will be nill */
|
||||
/** creates a CCMenuItemLabel with a Label. Target and selector will be nil */
|
||||
static CCMenuItemLabel* create(CCNode *label);
|
||||
|
||||
/** initializes a CCMenuItemLabel with a Label, target and selector */
|
||||
|
@ -373,7 +373,7 @@ public:
|
|||
|
||||
/** @brief A CCMenuItemToggle
|
||||
A simple container class that "toggles" it's inner items
|
||||
The inner itmes can be any MenuItem
|
||||
The inner items can be any MenuItem
|
||||
*/
|
||||
class CC_DLL CCMenuItemToggle : public CCMenuItem, public CCRGBAProtocol
|
||||
{
|
||||
|
|
|
@ -299,7 +299,7 @@ void CCMotionStreak::update(float delta)
|
|||
m_pPointVertexes[m_uNuPoints] = m_tPositionR;
|
||||
m_pPointState[m_uNuPoints] = 1.0f;
|
||||
|
||||
// Color asignation
|
||||
// Color assignment
|
||||
const unsigned int offset = m_uNuPoints*8;
|
||||
*((ccColor3B*)(m_pColorPointer + offset)) = m_tColor;
|
||||
*((ccColor3B*)(m_pColorPointer + offset+4)) = m_tColor;
|
||||
|
|
|
@ -87,7 +87,7 @@ public:
|
|||
virtual void setOpacityModifyRGB(bool bValue);
|
||||
virtual bool isOpacityModifyRGB(void);
|
||||
|
||||
/** When fast mode is enbled, new points are added faster but with lower precision */
|
||||
/** When fast mode is enabled, new points are added faster but with lower precision */
|
||||
inline bool isFastMode() { return m_bFastMode; }
|
||||
inline void setFastMode(bool bFastMode) { m_bFastMode = bFastMode; }
|
||||
|
||||
|
|
|
@ -118,7 +118,7 @@ void CCProgressTimer::setSprite(CCSprite *pSprite)
|
|||
m_pSprite = pSprite;
|
||||
setContentSize(m_pSprite->getContentSize());
|
||||
|
||||
// Everytime we set a new sprite, we free the current vertex data
|
||||
// Every time we set a new sprite, we free the current vertex data
|
||||
if (m_pVertexData)
|
||||
{
|
||||
CC_SAFE_FREE(m_pVertexData);
|
||||
|
|
|
@ -45,7 +45,7 @@ typedef enum {
|
|||
} CCProgressTimerType;
|
||||
|
||||
/**
|
||||
@brief CCProgresstimer is a subclass of CCNode.
|
||||
@brief CCProgressTimer is a subclass of CCNode.
|
||||
It renders the inner sprite according to the percentage.
|
||||
The progress can be Radial, Horizontal or vertical.
|
||||
@since v0.99.1
|
||||
|
|
|
@ -431,7 +431,7 @@ CCImage* CCRenderTexture::newCCImage()
|
|||
const CCSize& s = m_pTexture->getContentSizeInPixels();
|
||||
|
||||
// to get the image size to save
|
||||
// if the saving image domain exeeds the buffer texture domain,
|
||||
// if the saving image domain exceeds the buffer texture domain,
|
||||
// it should be cut
|
||||
int nSavedBufferWidth = (int)s.width;
|
||||
int nSavedBufferHeight = (int)s.height;
|
||||
|
@ -458,7 +458,7 @@ CCImage* CCRenderTexture::newCCImage()
|
|||
this->end();
|
||||
|
||||
// to get the actual texture data
|
||||
// #640 the image read from rendertexture is upseted
|
||||
// #640 the image read from rendertexture is dirty
|
||||
for (int i = 0; i < nSavedBufferHeight; ++i)
|
||||
{
|
||||
memcpy(&pBuffer[i * nSavedBufferWidth * 4],
|
||||
|
|
|
@ -44,7 +44,7 @@ typedef enum eImageFormat
|
|||
/**
|
||||
@brief CCRenderTexture is a generic rendering target. To render things into it,
|
||||
simply construct a render target, call begin on it, call visit on any cocos
|
||||
scenes or objects to render them, and call end. For convienience, render texture
|
||||
scenes or objects to render them, and call end. For convenience, render texture
|
||||
adds a sprite as it's display child with the results, so you can simply add
|
||||
the render texture to your scene and treat it like any other CocosNode.
|
||||
There are also functions for saving the render texture to disk in PNG or JPG format.
|
||||
|
|
|
@ -135,7 +135,7 @@ void CCParticleBatchNode::visit()
|
|||
// with the exception that it doesn't call visit on it's children
|
||||
//
|
||||
// The alternative is to have a void CCSprite#visit, but
|
||||
// although this is less mantainable, is faster
|
||||
// although this is less maintainable, is faster
|
||||
//
|
||||
if (!m_bIsVisible)
|
||||
{
|
||||
|
@ -185,7 +185,7 @@ void CCParticleBatchNode::addChild(CCNode * child, int zOrder, int tag)
|
|||
setBlendFunc(pChild->getBlendFunc());
|
||||
}
|
||||
|
||||
CCAssert( m_tBlendFunc.src == pChild->getBlendFunc().src && m_tBlendFunc.dst == pChild->getBlendFunc().dst, "Can't add a PaticleSystem that uses a differnt blending function");
|
||||
CCAssert( m_tBlendFunc.src == pChild->getBlendFunc().src && m_tBlendFunc.dst == pChild->getBlendFunc().dst, "Can't add a PaticleSystem that uses a different blending function");
|
||||
|
||||
//no lazy sorting, so don't call super addChild, call helper instead
|
||||
unsigned int pos = addChildHelper(pChild,zOrder,tag);
|
||||
|
@ -388,7 +388,7 @@ void CCParticleBatchNode::removeChild(CCNode* child, bool cleanup)
|
|||
// after memmove of data, empty the quads at the end of array
|
||||
m_pTextureAtlas->fillWithEmptyQuadsFromIndex(m_pTextureAtlas->getTotalQuads(), pChild->getTotalParticles());
|
||||
|
||||
// paticle could be reused for self rendering
|
||||
// particle could be reused for self rendering
|
||||
pChild->setBatchNode(NULL);
|
||||
|
||||
updateAllAtlasIndexes();
|
||||
|
@ -469,7 +469,7 @@ void CCParticleBatchNode::insertChild(CCParticleSystem* pSystem, unsigned int in
|
|||
m_pTextureAtlas->moveQuadsFromIndex(index, index+pSystem->getTotalParticles());
|
||||
}
|
||||
|
||||
// increase totalParticles here for new particles, update method of particlesystem will fill the quads
|
||||
// increase totalParticles here for new particles, update method of particle-system will fill the quads
|
||||
m_pTextureAtlas->increaseTotalQuadsWith(pSystem->getTotalParticles());
|
||||
|
||||
updateAllAtlasIndexes();
|
||||
|
|
|
@ -263,7 +263,7 @@ bool CCParticleGalaxy::initWithTotalParticles(unsigned int numberOfParticles)
|
|||
modeA.radialAccel = -80;
|
||||
modeA.radialAccelVar = 0;
|
||||
|
||||
// Gravity Mode: tagential
|
||||
// Gravity Mode: tangential
|
||||
modeA.tangentialAccel = 80;
|
||||
modeA.tangentialAccelVar = 0;
|
||||
|
||||
|
@ -337,7 +337,7 @@ bool CCParticleFlower::initWithTotalParticles(unsigned int numberOfParticles)
|
|||
modeA.radialAccel = -60;
|
||||
modeA.radialAccelVar = 0;
|
||||
|
||||
// Gravity Mode: tagential
|
||||
// Gravity Mode: tangential
|
||||
modeA.tangentialAccel = 15;
|
||||
modeA.tangentialAccelVar = 0;
|
||||
|
||||
|
@ -410,7 +410,7 @@ bool CCParticleMeteor::initWithTotalParticles(unsigned int numberOfParticles)
|
|||
modeA.radialAccel = 0;
|
||||
modeA.radialAccelVar = 0;
|
||||
|
||||
// Gravity Mode: tagential
|
||||
// Gravity Mode: tangential
|
||||
modeA.tangentialAccel = 0;
|
||||
modeA.tangentialAccelVar = 0;
|
||||
|
||||
|
@ -484,7 +484,7 @@ bool CCParticleSpiral::initWithTotalParticles(unsigned int numberOfParticles)
|
|||
modeA.radialAccel = -380;
|
||||
modeA.radialAccelVar = 0;
|
||||
|
||||
// Gravity Mode: tagential
|
||||
// Gravity Mode: tangential
|
||||
modeA.tangentialAccel = 45;
|
||||
modeA.tangentialAccelVar = 0;
|
||||
|
||||
|
@ -557,7 +557,7 @@ bool CCParticleExplosion::initWithTotalParticles(unsigned int numberOfParticles)
|
|||
modeA.radialAccel = 0;
|
||||
modeA.radialAccelVar = 0;
|
||||
|
||||
// Gravity Mode: tagential
|
||||
// Gravity Mode: tangential
|
||||
modeA.tangentialAccel = 0;
|
||||
modeA.tangentialAccelVar = 0;
|
||||
|
||||
|
@ -700,7 +700,7 @@ bool CCParticleSnow::initWithTotalParticles(unsigned int numberOfParticles)
|
|||
modeA.radialAccel = 0;
|
||||
modeA.radialAccelVar = 1;
|
||||
|
||||
// Gravity mode: tagential
|
||||
// Gravity mode: tangential
|
||||
modeA.tangentialAccel = 0;
|
||||
modeA.tangentialAccelVar = 1;
|
||||
|
||||
|
@ -768,7 +768,7 @@ bool CCParticleRain::initWithTotalParticles(unsigned int numberOfParticles)
|
|||
modeA.radialAccel = 0;
|
||||
modeA.radialAccelVar = 1;
|
||||
|
||||
// Gravity Mode: tagential
|
||||
// Gravity Mode: tangential
|
||||
modeA.tangentialAccel = 0;
|
||||
modeA.tangentialAccelVar = 1;
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@ THE SOFTWARE.
|
|||
// http://particledesigner.71squared.com/
|
||||
//
|
||||
// IMPORTANT: Particle Designer is supported by cocos2d, but
|
||||
// 'Radius Mode' in Particle Designer uses a fixed emit rate of 30 hz. Since that can't be guarateed in cocos2d,
|
||||
// 'Radius Mode' in Particle Designer uses a fixed emit rate of 30 hz. Since that can't be guaranteed in cocos2d,
|
||||
// cocos2d uses a another approach, but the results are almost identical.
|
||||
//
|
||||
|
||||
|
@ -73,7 +73,7 @@ NS_CC_BEGIN
|
|||
// http://particledesigner.71squared.com/
|
||||
//
|
||||
// IMPORTANT: Particle Designer is supported by cocos2d, but
|
||||
// 'Radius Mode' in Particle Designer uses a fixed emit rate of 30 hz. Since that can't be guarateed in cocos2d,
|
||||
// 'Radius Mode' in Particle Designer uses a fixed emit rate of 30 hz. Since that can't be guaranteed in cocos2d,
|
||||
// cocos2d uses a another approach, but the results are almost identical.
|
||||
//
|
||||
|
||||
|
@ -392,12 +392,12 @@ bool CCParticleSystem::initWithTotalParticles(unsigned int numberOfParticles)
|
|||
|
||||
m_bIsAutoRemoveOnFinish = false;
|
||||
|
||||
// Optimization: compile udpateParticle method
|
||||
// Optimization: compile updateParticle method
|
||||
//updateParticleSel = @selector(updateQuadWithParticle:newPosition:);
|
||||
//updateParticleImp = (CC_UPDATE_PARTICLE_IMP) [self methodForSelector:updateParticleSel];
|
||||
//for batchNode
|
||||
m_bTransformSystemDirty = false;
|
||||
// udpate after action in run!
|
||||
// update after action in run!
|
||||
this->scheduleUpdateWithPriority(1);
|
||||
|
||||
return true;
|
||||
|
@ -734,12 +734,12 @@ void CCParticleSystem::updateQuadWithParticle(tCCParticle* particle, const CCPoi
|
|||
{
|
||||
CC_UNUSED_PARAM(particle);
|
||||
CC_UNUSED_PARAM(newPosition);
|
||||
// should be overriden
|
||||
// should be overridden
|
||||
}
|
||||
|
||||
void CCParticleSystem::postStep()
|
||||
{
|
||||
// should be overriden
|
||||
// should be overridden
|
||||
}
|
||||
|
||||
// ParticleSystem - CCTexture protocol
|
||||
|
|
|
@ -131,7 +131,7 @@ class CCTexture2D;
|
|||
|
||||
/** @brief Particle System base class.
|
||||
Attributes of a Particle System:
|
||||
- emmision rate of the particles
|
||||
- emission rate of the particles
|
||||
- Gravity Mode (Mode A):
|
||||
- gravity
|
||||
- direction
|
||||
|
@ -155,7 +155,7 @@ Attributes of a Particle System:
|
|||
- texture
|
||||
|
||||
cocos2d also supports particles generated by Particle Designer (http://particledesigner.71squared.com/).
|
||||
'Radius Mode' in Particle Designer uses a fixed emit rate of 30 hz. Since that can't be guarateed in cocos2d,
|
||||
'Radius Mode' in Particle Designer uses a fixed emit rate of 30 hz. Since that can't be guaranteed in cocos2d,
|
||||
cocos2d uses a another approach, but the results are almost identical.
|
||||
|
||||
cocos2d supports all the variables used by Particle Designer plus a bit more:
|
||||
|
@ -208,7 +208,7 @@ protected:
|
|||
float endRadius;
|
||||
/** The ending radius variance of the particles. Only available in 'Radius' mode. */
|
||||
float endRadiusVar;
|
||||
/** Number of degress to rotate a particle around the source pos per second. Only available in 'Radius' mode. */
|
||||
/** Number of degrees to rotate a particle around the source pos per second. Only available in 'Radius' mode. */
|
||||
float rotatePerSecond;
|
||||
/** Variance in degrees for rotatePerSecond. Only available in 'Radius' mode. */
|
||||
float rotatePerSecondVar;
|
||||
|
@ -245,7 +245,7 @@ protected:
|
|||
bool m_bIsActive;
|
||||
/** Quantity of particles that are being simulated at the moment */
|
||||
CC_PROPERTY_READONLY(unsigned int, m_uParticleCount, ParticleCount)
|
||||
/** How many seconds the emitter wil run. -1 means 'forever' */
|
||||
/** How many seconds the emitter will run. -1 means 'forever' */
|
||||
CC_PROPERTY(float, m_fDuration, Duration)
|
||||
/** sourcePosition of the emitter */
|
||||
CC_PROPERTY_PASS_BY_REF(CCPoint, m_tSourcePosition, SourcePosition)
|
||||
|
@ -368,7 +368,7 @@ public:
|
|||
CCParticleSystem();
|
||||
virtual ~CCParticleSystem();
|
||||
/** creates an initializes a CCParticleSystem from a plist file.
|
||||
This plist files can be creted manually or with Particle Designer:
|
||||
This plist files can be created manually or with Particle Designer:
|
||||
http://particledesigner.71squared.com/
|
||||
@deprecated: This interface will be deprecated sooner or later.
|
||||
@since v0.99.3
|
||||
|
@ -376,7 +376,7 @@ public:
|
|||
CC_DEPRECATED_ATTRIBUTE static CCParticleSystem * particleWithFile(const char *plistFile);
|
||||
|
||||
/** creates an initializes a CCParticleSystem from a plist file.
|
||||
This plist files can be creted manually or with Particle Designer:
|
||||
This plist files can be created manually or with Particle Designer:
|
||||
http://particledesigner.71squared.com/
|
||||
@since v2.0
|
||||
*/
|
||||
|
@ -388,7 +388,7 @@ public:
|
|||
/** initializes a CCParticleSystem*/
|
||||
bool init();
|
||||
/** initializes a CCParticleSystem from a plist file.
|
||||
This plist files can be creted manually or with Particle Designer:
|
||||
This plist files can be created manually or with Particle Designer:
|
||||
http://particledesigner.71squared.com/
|
||||
@since v0.99.3
|
||||
*/
|
||||
|
@ -412,9 +412,9 @@ public:
|
|||
//! whether or not the system is full
|
||||
bool isFull();
|
||||
|
||||
//! should be overriden by subclasses
|
||||
//! should be overridden by subclasses
|
||||
virtual void updateQuadWithParticle(tCCParticle* particle, const CCPoint& newPosition);
|
||||
//! should be overriden by subclasses
|
||||
//! should be overridden by subclasses
|
||||
virtual void postStep();
|
||||
|
||||
virtual void update(float dt);
|
||||
|
|
|
@ -381,7 +381,7 @@ void CCParticleSystemQuad::draw()
|
|||
|
||||
void CCParticleSystemQuad::setTotalParticles(unsigned int tp)
|
||||
{
|
||||
// If we are setting the total numer of particles to a number higher
|
||||
// If we are setting the total number of particles to a number higher
|
||||
// than what is allocated, we need to allocate new arrays
|
||||
if( tp > m_uAllocatedParticles )
|
||||
{
|
||||
|
|
|
@ -67,20 +67,20 @@ public:
|
|||
virtual ~CCParticleSystemQuad();
|
||||
|
||||
/** creates an initializes a CCParticleSystemQuad from a plist file.
|
||||
This plist files can be creted manually or with Particle Designer:
|
||||
This plist files can be created manually or with Particle Designer:
|
||||
@deprecated: This interface will be deprecated sooner or later.
|
||||
*/
|
||||
CC_DEPRECATED_ATTRIBUTE static CCParticleSystemQuad * particleWithFile(const char *plistFile);
|
||||
|
||||
/** creates an initializes a CCParticleSystemQuad from a plist file.
|
||||
This plist files can be creted manually or with Particle Designer:
|
||||
This plist files can be created manually or with Particle Designer:
|
||||
*/
|
||||
static CCParticleSystemQuad * create(const char *plistFile);
|
||||
|
||||
/** initialices the indices for the vertices*/
|
||||
/** initializes the indices for the vertices*/
|
||||
void setupIndices();
|
||||
|
||||
/** initilizes the texture with a rectangle measured Points */
|
||||
/** initializes the texture with a rectangle measured Points */
|
||||
void initTexCoordsWithRect(const CCRect& rect);
|
||||
|
||||
/** Sets a new CCSpriteFrame as particle.
|
||||
|
|
|
@ -184,8 +184,8 @@ public:
|
|||
/**
|
||||
@brief Execute script code contained in the given string.
|
||||
@param codes holding the valid script code that should be executed.
|
||||
@return 0 if the string is excuted correctly.
|
||||
@return other if the string is excuted wrongly.
|
||||
@return 0 if the string is executed correctly.
|
||||
@return other if the string is executed wrongly.
|
||||
*/
|
||||
virtual int executeString(const char* codes) = 0;
|
||||
|
||||
|
@ -220,7 +220,7 @@ public:
|
|||
/** execute a schedule function */
|
||||
virtual int executeSchedule(CCTimer* pTimer, float dt, CCNode* pNode = NULL) = 0;
|
||||
|
||||
/** functions for excute touch event */
|
||||
/** functions for execute touch event */
|
||||
virtual int executeLayerTouchesEvent(CCLayer* pLayer, int eventType, CCSet *pTouches) = 0;
|
||||
virtual int executeLayerTouchEvent(CCLayer* pLayer, int eventType, CCTouch *pTouch) = 0;
|
||||
};
|
||||
|
|
|
@ -134,7 +134,7 @@ void CCShaderCache::loadDefaultShaders()
|
|||
p->release();
|
||||
|
||||
//
|
||||
// Position and 1 color passed as a uniform (to similate glColor4ub )
|
||||
// Position and 1 color passed as a uniform (to simulate glColor4ub )
|
||||
//
|
||||
p = new CCGLProgram();
|
||||
loadDefaultShader(p, kCCShaderType_Position_uColor);
|
||||
|
@ -186,7 +186,7 @@ void CCShaderCache::reloadDefaultShaders()
|
|||
loadDefaultShader(p, kCCShaderType_PositionTextureA8Color);
|
||||
|
||||
//
|
||||
// Position and 1 color passed as a uniform (to similate glColor4ub )
|
||||
// Position and 1 color passed as a uniform (to simulate glColor4ub )
|
||||
//
|
||||
p = programForKey(kCCShader_Position_uColor);
|
||||
p->reset();
|
||||
|
|
|
@ -67,7 +67,7 @@ public:
|
|||
/** how many units of time the frame takes */
|
||||
CC_SYNTHESIZE(float, m_fDelayUnits, DelayUnits)
|
||||
|
||||
/** A CCAnimationFrameDisplayedNotification notification will be broadcasted when the frame is displayed with this dictionary as UserInfo. If UserInfo is nil, then no notification will be broadcasted. */
|
||||
/** A CCAnimationFrameDisplayedNotification notification will be broadcast when the frame is displayed with this dictionary as UserInfo. If UserInfo is nil, then no notification will be broadcast. */
|
||||
CC_SYNTHESIZE_RETAIN(CCDictionary*, m_pUserInfo, UserInfo)
|
||||
};
|
||||
|
||||
|
|
|
@ -52,7 +52,7 @@ class CC_DLL CCAnimationCache : public CCObject
|
|||
public:
|
||||
CCAnimationCache();
|
||||
~CCAnimationCache();
|
||||
/** Retruns ths shared instance of the Animation cache */
|
||||
/** Returns the shared instance of the Animation cache */
|
||||
static CCAnimationCache* sharedAnimationCache(void);
|
||||
|
||||
/** Purges the cache. It releases all the CCAnimation objects and the shared instance.
|
||||
|
|
|
@ -304,7 +304,7 @@ bool CCSprite::initWithSpriteFrameName(const char *pszSpriteFrameName)
|
|||
CCSprite* CCSprite::initWithCGImage(CGImageRef pImage)
|
||||
{
|
||||
// todo
|
||||
// because it is deprecated, so we do not impelment it
|
||||
// because it is deprecated, so we do not implement it
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
@ -482,7 +482,7 @@ void CCSprite::updateTransform(void)
|
|||
{
|
||||
CCAssert(m_pobBatchNode, "updateTransform is only valid when CCSprite is being rendered using an CCSpriteBatchNode");
|
||||
|
||||
// recaculate matrix only if it is dirty
|
||||
// recalculate matrix only if it is dirty
|
||||
if( isDirty() ) {
|
||||
|
||||
// If it is not visible, or one of its ancestors is not visible, then do nothing:
|
||||
|
|
|
@ -50,7 +50,7 @@ struct transformValues_;
|
|||
* @{
|
||||
*/
|
||||
|
||||
#define CCSpriteIndexNotInitialized 0xffffffff /// CCSprite invalid index on the CCSpriteBatchode
|
||||
#define CCSpriteIndexNotInitialized 0xffffffff /// CCSprite invalid index on the CCSpriteBatchNode
|
||||
|
||||
|
||||
/** CCSprite is a 2d image ( http://en.wikipedia.org/wiki/Sprite_(computer_graphics) )
|
||||
|
|
|
@ -139,7 +139,7 @@ void CCSpriteBatchNode::visit(void)
|
|||
// with the exception that it doesn't call visit on it's children
|
||||
//
|
||||
// The alternative is to have a void CCSprite#visit, but
|
||||
// although this is less mantainable, is faster
|
||||
// although this is less maintainable, is faster
|
||||
//
|
||||
if (! m_bIsVisible)
|
||||
{
|
||||
|
@ -280,7 +280,7 @@ void CCSpriteBatchNode::sortAllChildren()
|
|||
|
||||
CCObject* pObj = NULL;
|
||||
//fast dispatch, give every child a new atlasIndex based on their relative zOrder (keep parent -> child relations intact)
|
||||
// and at the same time reorder descedants and the quads to the right index
|
||||
// and at the same time reorder descendants and the quads to the right index
|
||||
CCARRAY_FOREACH(m_pChildren, pObj)
|
||||
{
|
||||
CCSprite* pChild = (CCSprite*)pObj;
|
||||
|
@ -424,7 +424,7 @@ void CCSpriteBatchNode::increaseAtlasCapacity(void)
|
|||
{
|
||||
// serious problems
|
||||
CCLOGWARN("cocos2d: WARNING: Not enough memory to resize the atlas");
|
||||
CCAssert(false, "Not enough memory to resize the atla");
|
||||
CCAssert(false, "Not enough memory to resize the atlas");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -157,12 +157,12 @@ public:
|
|||
virtual void draw(void);
|
||||
|
||||
protected:
|
||||
/* IMPORTANT XXX IMPORTNAT:
|
||||
/* IMPORTANT XXX IMPORTANT:
|
||||
* These 2 methods can't be part of CCTMXLayer since they call [super add...], and CCSpriteSheet#add SHALL not be called
|
||||
*/
|
||||
|
||||
/* Adds a quad into the texture atlas but it won't be added into the children array.
|
||||
This method should be called only when you are dealing with very big AtlasSrite and when most of the CCSprite won't be updated.
|
||||
This method should be called only when you are dealing with very big AtlasSprite and when most of the CCSprite won't be updated.
|
||||
For example: a tile map (CCTMXMap) or a label with lots of characters (BitmapFontAtlas)
|
||||
*/
|
||||
void addQuadFromSprite(CCSprite *sprite, unsigned int index);
|
||||
|
@ -180,7 +180,7 @@ protected:
|
|||
CCTextureAtlas *m_pobTextureAtlas;
|
||||
ccBlendFunc m_blendFunc;
|
||||
|
||||
// all descendants: chlidren, gran children, etc...
|
||||
// all descendants: children, gran children, etc...
|
||||
CCArray* m_pobDescendants;
|
||||
};
|
||||
|
||||
|
|
|
@ -405,7 +405,7 @@ CCSpriteFrame* CCSpriteFrameCache::spriteFrameByName(const char *pszName)
|
|||
frame = (CCSpriteFrame*)m_pSpriteFrames->objectForKey(key->getCString());
|
||||
if (! frame)
|
||||
{
|
||||
CCLOG("cocos2d: CCSpriteFrameCahce: Frame '%s' not found", pszName);
|
||||
CCLOG("cocos2d: CCSpriteFrameCache: Frame '%s' not found", pszName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -104,7 +104,7 @@ public:
|
|||
|
||||
/** Removes multiple Sprite Frames from a plist file.
|
||||
* Sprite Frames stored in this file will be removed.
|
||||
* It is convinient to call this method when a specific texture needs to be removed.
|
||||
* It is convenient to call this method when a specific texture needs to be removed.
|
||||
* @since v0.99.5
|
||||
*/
|
||||
void removeSpriteFramesFromFile(const char* plist);
|
||||
|
@ -116,7 +116,7 @@ private:
|
|||
void removeSpriteFramesFromDictionary(CCDictionary* dictionary);
|
||||
public:
|
||||
/** Removes all Sprite Frames associated with the specified textures.
|
||||
* It is convinient to call this method when a specific texture needs to be removed.
|
||||
* It is convenient to call this method when a specific texture needs to be removed.
|
||||
* @since v0.995.
|
||||
*/
|
||||
void removeSpriteFramesFromTexture(CCTexture2D* texture);
|
||||
|
|
|
@ -272,7 +272,7 @@ CCPoint CC_DLL ccpLerp(const CCPoint& a, const CCPoint& b, float alpha);
|
|||
bool CC_DLL ccpFuzzyEqual(const CCPoint& a, const CCPoint& b, float variance);
|
||||
|
||||
|
||||
/** Multiplies a nd b components, a.x*b.x, a.y*b.y
|
||||
/** Multiplies a and b components, a.x*b.x, a.y*b.y
|
||||
@returns a component-wise multiplication
|
||||
@since v0.99.1
|
||||
*/
|
||||
|
|
|
@ -118,7 +118,7 @@ static void setValueForKey(const char* pKey, const char* pValue)
|
|||
if (rootNode)
|
||||
{
|
||||
// the node doesn't exist, add a new one
|
||||
// libxml in android donesn't support xmlNewTextChild, so use this approach
|
||||
// libxml in android doesn't support xmlNewTextChild, so use this approach
|
||||
xmlNodePtr tmpNode = xmlNewNode(NULL, BAD_CAST pKey);
|
||||
xmlNodePtr content = xmlNewText(BAD_CAST pValue);
|
||||
xmlAddChild(rootNode, tmpNode);
|
||||
|
@ -227,7 +227,7 @@ string CCUserDefault::getStringForKey(const char* pKey, const std::string & defa
|
|||
|
||||
void CCUserDefault::setBoolForKey(const char* pKey, bool value)
|
||||
{
|
||||
// save bool value as sring
|
||||
// save bool value as string
|
||||
|
||||
if (true == value)
|
||||
{
|
||||
|
@ -292,7 +292,7 @@ CCUserDefault* CCUserDefault::sharedUserDefault()
|
|||
initXMLFilePath();
|
||||
|
||||
// only create xml file one time
|
||||
// the file exists after the programe exit
|
||||
// the file exists after the program exit
|
||||
if ((! isXMLFileExist()) && (! createXMLFile()))
|
||||
{
|
||||
return NULL;
|
||||
|
|
|
@ -39,7 +39,7 @@ NS_CC_BEGIN
|
|||
/** converts a line to a polygon */
|
||||
void CC_DLL ccVertexLineToPolygon(CCPoint *points, float stroke, ccVertex2F *vertices, unsigned int offset, unsigned int nuPoints);
|
||||
|
||||
/** returns wheter or not the line intersects */
|
||||
/** returns whether or not the line intersects */
|
||||
bool CC_DLL ccVertexLineIntersect(float Ax, float Ay,
|
||||
float Bx, float By,
|
||||
float Cx, float Cy,
|
||||
|
|
|
@ -97,7 +97,7 @@ void ccArrayShrink(ccArray *arr)
|
|||
}
|
||||
}
|
||||
|
||||
/** Returns index of first occurence of object, CC_INVALID_INDEX if object not found. */
|
||||
/** Returns index of first occurrence of object, CC_INVALID_INDEX if object not found. */
|
||||
unsigned int ccArrayGetIndexOfObject(ccArray *arr, CCObject* object)
|
||||
{
|
||||
for(unsigned int i = 0; i < arr->num; i++)
|
||||
|
@ -114,7 +114,7 @@ bool ccArrayContainsObject(ccArray *arr, CCObject* object)
|
|||
return ccArrayGetIndexOfObject(arr, object) != CC_INVALID_INDEX;
|
||||
}
|
||||
|
||||
/** Appends an object. Bahaviour undefined if array doesn't have enough capacity. */
|
||||
/** Appends an object. Behavior undefined if array doesn't have enough capacity. */
|
||||
void ccArrayAppendObject(ccArray *arr, CCObject* object)
|
||||
{
|
||||
CCAssert(object != NULL, "Invalid parameter!");
|
||||
|
@ -130,7 +130,7 @@ void ccArrayAppendObjectWithResize(ccArray *arr, CCObject* object)
|
|||
ccArrayAppendObject(arr, object);
|
||||
}
|
||||
|
||||
/** Appends objects from plusArr to arr. Behaviour undefined if arr doesn't have
|
||||
/** Appends objects from plusArr to arr. Behavior undefined if arr doesn't have
|
||||
enough capacity. */
|
||||
void ccArrayAppendArray(ccArray *arr, ccArray *plusArr)
|
||||
{
|
||||
|
@ -188,7 +188,7 @@ void ccArrayRemoveAllObjects(ccArray *arr)
|
|||
}
|
||||
|
||||
/** Removes object at specified index and pushes back all subsequent objects.
|
||||
Behaviour undefined if index outside [0, num-1]. */
|
||||
Behavior undefined if index outside [0, num-1]. */
|
||||
void ccArrayRemoveObjectAtIndex(ccArray *arr, unsigned int index, bool bReleaseObj/* = true*/)
|
||||
{
|
||||
CCAssert(arr && arr->num > 0 && index < arr->num, "Invalid index. Out of bounds");
|
||||
|
@ -208,7 +208,7 @@ void ccArrayRemoveObjectAtIndex(ccArray *arr, unsigned int index, bool bReleaseO
|
|||
|
||||
/** Removes object at specified index and fills the gap with the last object,
|
||||
thereby avoiding the need to push back subsequent objects.
|
||||
Behaviour undefined if index outside [0, num-1]. */
|
||||
Behavior undefined if index outside [0, num-1]. */
|
||||
void ccArrayFastRemoveObjectAtIndex(ccArray *arr, unsigned int index)
|
||||
{
|
||||
CC_SAFE_RELEASE(arr->arr[index]);
|
||||
|
@ -225,7 +225,7 @@ void ccArrayFastRemoveObject(ccArray *arr, CCObject* object)
|
|||
}
|
||||
}
|
||||
|
||||
/** Searches for the first occurance of object and removes it. If object is not
|
||||
/** Searches for the first occurrence of object and removes it. If object is not
|
||||
found the function has no effect. */
|
||||
void ccArrayRemoveObject(ccArray *arr, CCObject* object, bool bReleaseObj/* = true*/)
|
||||
{
|
||||
|
@ -313,7 +313,7 @@ void ccCArrayEnsureExtraCapacity(ccCArray *arr, unsigned int extra)
|
|||
ccArrayEnsureExtraCapacity((ccArray*)arr,extra);
|
||||
}
|
||||
|
||||
/** Returns index of first occurence of value, CC_INVALID_INDEX if value not found. */
|
||||
/** Returns index of first occurrence of value, CC_INVALID_INDEX if value not found. */
|
||||
unsigned int ccCArrayGetIndexOfValue(ccCArray *arr, void* value)
|
||||
{
|
||||
unsigned int i;
|
||||
|
@ -331,7 +331,7 @@ bool ccCArrayContainsValue(ccCArray *arr, void* value)
|
|||
return ccCArrayGetIndexOfValue(arr, value) != CC_INVALID_INDEX;
|
||||
}
|
||||
|
||||
/** Inserts a value at a certain position. Behaviour undefined if aray doesn't have enough capacity */
|
||||
/** Inserts a value at a certain position. Behavior undefined if array doesn't have enough capacity */
|
||||
void ccCArrayInsertValueAtIndex( ccCArray *arr, void* value, unsigned int index)
|
||||
{
|
||||
CCAssert( index < arr->max, "ccCArrayInsertValueAtIndex: invalid index");
|
||||
|
@ -352,7 +352,7 @@ void ccCArrayInsertValueAtIndex( ccCArray *arr, void* value, unsigned int index)
|
|||
arr->arr[index] = value;
|
||||
}
|
||||
|
||||
/** Appends an value. Bahaviour undefined if array doesn't have enough capacity. */
|
||||
/** Appends an value. Behavior undefined if array doesn't have enough capacity. */
|
||||
void ccCArrayAppendValue(ccCArray *arr, void* value)
|
||||
{
|
||||
arr->arr[arr->num] = value;
|
||||
|
@ -373,7 +373,7 @@ void ccCArrayAppendValueWithResize(ccCArray *arr, void* value)
|
|||
}
|
||||
|
||||
|
||||
/** Appends values from plusArr to arr. Behaviour undefined if arr doesn't have
|
||||
/** Appends values from plusArr to arr. Behavior undefined if arr doesn't have
|
||||
enough capacity. */
|
||||
void ccCArrayAppendArray(ccCArray *arr, ccCArray *plusArr)
|
||||
{
|
||||
|
@ -399,7 +399,7 @@ void ccCArrayRemoveAllValues(ccCArray *arr)
|
|||
}
|
||||
|
||||
/** Removes value at specified index and pushes back all subsequent values.
|
||||
Behaviour undefined if index outside [0, num-1].
|
||||
Behavior undefined if index outside [0, num-1].
|
||||
@since v0.99.4
|
||||
*/
|
||||
void ccCArrayRemoveValueAtIndex(ccCArray *arr, unsigned int index)
|
||||
|
@ -414,7 +414,7 @@ void ccCArrayRemoveValueAtIndex(ccCArray *arr, unsigned int index)
|
|||
|
||||
/** Removes value at specified index and fills the gap with the last value,
|
||||
thereby avoiding the need to push back subsequent values.
|
||||
Behaviour undefined if index outside [0, num-1].
|
||||
Behavior undefined if index outside [0, num-1].
|
||||
@since v0.99.4
|
||||
*/
|
||||
void ccCArrayFastRemoveValueAtIndex(ccCArray *arr, unsigned int index)
|
||||
|
@ -423,7 +423,7 @@ void ccCArrayFastRemoveValueAtIndex(ccCArray *arr, unsigned int index)
|
|||
arr->arr[index] = arr->arr[last];
|
||||
}
|
||||
|
||||
/** Searches for the first occurance of value and removes it. If value is not found the function has no effect.
|
||||
/** Searches for the first occurrence of value and removes it. If value is not found the function has no effect.
|
||||
@since v0.99.4
|
||||
*/
|
||||
void ccCArrayRemoveValue(ccCArray *arr, void* value)
|
||||
|
|
|
@ -35,7 +35,7 @@ THE SOFTWARE.
|
|||
- comparisons are done using pointer equality instead of isEqual
|
||||
|
||||
There are 2 kind of functions:
|
||||
- ccArray functions that manipulates objective-c objects (retain and release are performanced)
|
||||
- ccArray functions that manipulates objective-c objects (retain and release are performed)
|
||||
- ccCArray functions that manipulates values like if they were standard C structures (no retain/release is performed)
|
||||
*/
|
||||
|
||||
|
@ -78,20 +78,20 @@ void ccArrayEnsureExtraCapacity(ccArray *arr, unsigned int extra);
|
|||
/** shrinks the array so the memory footprint corresponds with the number of items */
|
||||
void ccArrayShrink(ccArray *arr);
|
||||
|
||||
/** Returns index of first occurence of object, NSNotFound if object not found. */
|
||||
/** Returns index of first occurrence of object, NSNotFound if object not found. */
|
||||
unsigned int ccArrayGetIndexOfObject(ccArray *arr, CCObject* object);
|
||||
|
||||
/** Returns a Boolean value that indicates whether object is present in array. */
|
||||
bool ccArrayContainsObject(ccArray *arr, CCObject* object);
|
||||
|
||||
/** Appends an object. Bahaviour undefined if array doesn't have enough capacity. */
|
||||
/** Appends an object. Behavior undefined if array doesn't have enough capacity. */
|
||||
void ccArrayAppendObject(ccArray *arr, CCObject* object);
|
||||
|
||||
/** Appends an object. Capacity of arr is increased if needed. */
|
||||
void ccArrayAppendObjectWithResize(ccArray *arr, CCObject* object);
|
||||
|
||||
/** Appends objects from plusArr to arr.
|
||||
Behaviour undefined if arr doesn't have enough capacity. */
|
||||
Behavior undefined if arr doesn't have enough capacity. */
|
||||
void ccArrayAppendArray(ccArray *arr, ccArray *plusArr);
|
||||
|
||||
/** Appends objects from plusArr to arr. Capacity of arr is increased if needed. */
|
||||
|
@ -107,17 +107,17 @@ void ccArraySwapObjectsAtIndexes(ccArray *arr, unsigned int index1, unsigned int
|
|||
void ccArrayRemoveAllObjects(ccArray *arr);
|
||||
|
||||
/** Removes object at specified index and pushes back all subsequent objects.
|
||||
Behaviour undefined if index outside [0, num-1]. */
|
||||
Behavior undefined if index outside [0, num-1]. */
|
||||
void ccArrayRemoveObjectAtIndex(ccArray *arr, unsigned int index, bool bReleaseObj = true);
|
||||
|
||||
/** Removes object at specified index and fills the gap with the last object,
|
||||
thereby avoiding the need to push back subsequent objects.
|
||||
Behaviour undefined if index outside [0, num-1]. */
|
||||
Behavior undefined if index outside [0, num-1]. */
|
||||
void ccArrayFastRemoveObjectAtIndex(ccArray *arr, unsigned int index);
|
||||
|
||||
void ccArrayFastRemoveObject(ccArray *arr, CCObject* object);
|
||||
|
||||
/** Searches for the first occurance of object and removes it. If object is not
|
||||
/** Searches for the first occurrence of object and removes it. If object is not
|
||||
found the function has no effect. */
|
||||
void ccArrayRemoveObject(ccArray *arr, CCObject* object, bool bReleaseObj = true);
|
||||
|
||||
|
@ -149,22 +149,22 @@ void ccCArrayDoubleCapacity(ccCArray *arr);
|
|||
/** Increases array capacity such that max >= num + extra. */
|
||||
void ccCArrayEnsureExtraCapacity(ccCArray *arr, unsigned int extra);
|
||||
|
||||
/** Returns index of first occurence of value, NSNotFound if value not found. */
|
||||
/** Returns index of first occurrence of value, NSNotFound if value not found. */
|
||||
unsigned int ccCArrayGetIndexOfValue(ccCArray *arr, void* value);
|
||||
|
||||
/** Returns a Boolean value that indicates whether value is present in the C array. */
|
||||
bool ccCArrayContainsValue(ccCArray *arr, void* value);
|
||||
|
||||
/** Inserts a value at a certain position. Behaviour undefined if aray doesn't have enough capacity */
|
||||
/** Inserts a value at a certain position. Behavior undefined if array doesn't have enough capacity */
|
||||
void ccCArrayInsertValueAtIndex( ccCArray *arr, void* value, unsigned int index);
|
||||
|
||||
/** Appends an value. Bahaviour undefined if array doesn't have enough capacity. */
|
||||
/** Appends an value. Behavior undefined if array doesn't have enough capacity. */
|
||||
void ccCArrayAppendValue(ccCArray *arr, void* value);
|
||||
|
||||
/** Appends an value. Capacity of arr is increased if needed. */
|
||||
void ccCArrayAppendValueWithResize(ccCArray *arr, void* value);
|
||||
|
||||
/** Appends values from plusArr to arr. Behaviour undefined if arr doesn't have
|
||||
/** Appends values from plusArr to arr. Behavior undefined if arr doesn't have
|
||||
enough capacity. */
|
||||
void ccCArrayAppendArray(ccCArray *arr, ccCArray *plusArr);
|
||||
|
||||
|
@ -175,19 +175,19 @@ void ccCArrayAppendArrayWithResize(ccCArray *arr, ccCArray *plusArr);
|
|||
void ccCArrayRemoveAllValues(ccCArray *arr);
|
||||
|
||||
/** Removes value at specified index and pushes back all subsequent values.
|
||||
Behaviour undefined if index outside [0, num-1].
|
||||
Behavior undefined if index outside [0, num-1].
|
||||
@since v0.99.4
|
||||
*/
|
||||
void ccCArrayRemoveValueAtIndex(ccCArray *arr, unsigned int index);
|
||||
|
||||
/** Removes value at specified index and fills the gap with the last value,
|
||||
thereby avoiding the need to push back subsequent values.
|
||||
Behaviour undefined if index outside [0, num-1].
|
||||
Behavior undefined if index outside [0, num-1].
|
||||
@since v0.99.4
|
||||
*/
|
||||
void ccCArrayFastRemoveValueAtIndex(ccCArray *arr, unsigned int index);
|
||||
|
||||
/** Searches for the first occurance of value and removes it. If value is not found the function has no effect.
|
||||
/** Searches for the first occurrence of value and removes it. If value is not found the function has no effect.
|
||||
@since v0.99.4
|
||||
*/
|
||||
void ccCArrayRemoveValue(ccCArray *arr, void* value);
|
||||
|
|
|
@ -62,7 +62,7 @@ do {
|
|||
} while(0)
|
||||
#endif
|
||||
|
||||
/* uint32_t next definded will conflict with other libraries and an "error C2872: 'uint32_t' : ambiguous symbol" will appear.
|
||||
/* uint32_t next defined will conflict with other libraries and an "error C2872: 'uint32_t' : ambiguous symbol" will appear.
|
||||
so we replace all uint32_t with 'unsigned int'.
|
||||
*/
|
||||
/* a number of the hash function use uint32_t which isn't defined on win32 */
|
||||
|
|
|
@ -275,14 +275,14 @@ tImageTGA * tgaLoad(const char *pszFilename)
|
|||
return info;
|
||||
}
|
||||
|
||||
// converts RGB to greyscale
|
||||
// converts RGB to grayscale
|
||||
void tgaRGBtogreyscale(tImageTGA *psInfo) {
|
||||
|
||||
int mode,i,j;
|
||||
|
||||
unsigned char *newImageData;
|
||||
|
||||
// if the image is already greyscale do nothing
|
||||
// if the image is already grayscale do nothing
|
||||
if (psInfo->pixelDepth == 8)
|
||||
return;
|
||||
|
||||
|
@ -296,7 +296,7 @@ void tgaRGBtogreyscale(tImageTGA *psInfo) {
|
|||
return;
|
||||
}
|
||||
|
||||
// convert pixels: greyscale = o.30 * R + 0.59 * G + 0.11 * B
|
||||
// convert pixels: grayscale = o.30 * R + 0.59 * G + 0.11 * B
|
||||
for (i = 0,j = 0; j < psInfo->width * psInfo->height; i +=mode, j++)
|
||||
newImageData[j] =
|
||||
(unsigned char)(0.30 * psInfo->imageData[i] +
|
||||
|
@ -310,7 +310,7 @@ void tgaRGBtogreyscale(tImageTGA *psInfo) {
|
|||
// reassign pixelDepth and type according to the new image type
|
||||
psInfo->pixelDepth = 8;
|
||||
psInfo->type = 3;
|
||||
// reassing imageData to the new array.
|
||||
// reassigning imageData to the new array.
|
||||
psInfo->imageData = newImageData;
|
||||
}
|
||||
|
||||
|
|
|
@ -61,7 +61,7 @@ bool tgaLoadImageData(unsigned char *Buffer, unsigned long bufSize, tImageTGA *p
|
|||
/// this is the function to call when we want to load an image
|
||||
tImageTGA * tgaLoad(const char *pszFilename);
|
||||
|
||||
// /converts RGB to greyscale
|
||||
// /converts RGB to grayscale
|
||||
void tgaRGBtogreyscale(tImageTGA *psInfo);
|
||||
|
||||
/// releases the memory used for the image
|
||||
|
|
|
@ -33,7 +33,7 @@ namespace cocos2d
|
|||
unsigned char sig[4]; // signature. Should be 'CCZ!' 4 bytes
|
||||
unsigned short compression_type; // should 0
|
||||
unsigned short version; // should be 2 (although version type==1 is also supported)
|
||||
unsigned int reserved; // Reserverd for users.
|
||||
unsigned int reserved; // Reserved for users.
|
||||
unsigned int len; // size of the uncompressed file
|
||||
};
|
||||
|
||||
|
@ -51,7 +51,7 @@ namespace cocos2d
|
|||
* Inflates either zlib or gzip deflated memory. The inflated memory is
|
||||
* expected to be freed by the caller.
|
||||
*
|
||||
* It will allocate 256k for the destination buffer. If it is not enought it will multiply the previous buffer size per 2, until there is enough memory.
|
||||
* It will allocate 256k for the destination buffer. If it is not enough it will multiply the previous buffer size per 2, until there is enough memory.
|
||||
* @returns the length of the deflated buffer
|
||||
*
|
||||
@since v0.8.1
|
||||
|
|
|
@ -80,7 +80,7 @@ namespace cocos2d {
|
|||
#include "mz64conf.h"
|
||||
#endif
|
||||
|
||||
/* a type choosen by DEFINE */
|
||||
/* a type chosen by DEFINE */
|
||||
#ifdef HAVE_64BIT_INT_CUSTOM
|
||||
typedef 64BIT_INT_CUSTOM_TYPE ZPOS64_T;
|
||||
#else
|
||||
|
|
|
@ -53,8 +53,8 @@
|
|||
Oct-2009 - Mathias Svensson - Fixed problem if uncompressed size was > 4G and compressed size was <4G
|
||||
should only read the compressed/uncompressed size from the Zip64 format if
|
||||
the size from normal header was 0xFFFFFFFF
|
||||
Oct-2009 - Mathias Svensson - Applied some bug fixes from paches recived from Gilles Vollant
|
||||
Oct-2009 - Mathias Svensson - Applied support to unzip files with compression mathod BZIP2 (bzip2 lib is required)
|
||||
Oct-2009 - Mathias Svensson - Applied some bug fixes from patches received from Gilles Vollant
|
||||
Oct-2009 - Mathias Svensson - Applied support to unzip files with compression method BZIP2 (bzip2 lib is required)
|
||||
Patch created by Daniel Borca
|
||||
|
||||
Jan-2010 - back to unzip and minizip 1.0 name scheme, with compatibility layer
|
||||
|
@ -142,7 +142,7 @@ typedef struct
|
|||
#endif
|
||||
|
||||
ZPOS64_T pos_in_zipfile; /* position in byte on the zipfile, for fseek*/
|
||||
uLong stream_initialised; /* flag set if stream structure is initialised*/
|
||||
uLong stream_initialised; /* flag set if stream structure is initialized*/
|
||||
|
||||
ZPOS64_T offset_local_extrafield;/* offset of the local extra field */
|
||||
uInt size_local_extrafield;/* size of the local extra field */
|
||||
|
@ -154,7 +154,7 @@ typedef struct
|
|||
ZPOS64_T rest_read_compressed; /* number of byte to be decompressed */
|
||||
ZPOS64_T rest_read_uncompressed;/*number of byte to be obtained after decomp*/
|
||||
zlib_filefunc64_32_def z_filefunc;
|
||||
voidpf filestream; /* io structore of the zipfile */
|
||||
voidpf filestream; /* io structure of the zipfile */
|
||||
uLong compression_method; /* compression method (0==store) */
|
||||
ZPOS64_T byte_before_the_zipfile;/* byte before the zipfile, (>0 for sfx)*/
|
||||
int raw;
|
||||
|
@ -167,7 +167,7 @@ typedef struct
|
|||
{
|
||||
zlib_filefunc64_32_def z_filefunc;
|
||||
int is64bitOpenFunction;
|
||||
voidpf filestream; /* io structore of the zipfile */
|
||||
voidpf filestream; /* io structure of the zipfile */
|
||||
unz_global_info64 gi; /* public global information */
|
||||
ZPOS64_T byte_before_the_zipfile;/* byte before the zipfile, (>0 for sfx)*/
|
||||
ZPOS64_T num_file; /* number of the current file in the zipfile*/
|
||||
|
@ -201,7 +201,7 @@ typedef struct
|
|||
/* ===========================================================================
|
||||
Read a byte from a gz_stream; update next_in and avail_in. Return EOF
|
||||
for end of file.
|
||||
IN assertion: the stream s has been sucessfully opened for reading.
|
||||
IN assertion: the stream s has been successfully opened for reading.
|
||||
*/
|
||||
|
||||
|
||||
|
@ -381,10 +381,10 @@ local int strcmpcasenosensitive_internal (const char* fileName1, const char* fil
|
|||
|
||||
/*
|
||||
Compare two filename (fileName1,fileName2).
|
||||
If iCaseSenisivity = 1, comparision is case sensitivity (like strcmp)
|
||||
If iCaseSenisivity = 2, comparision is not case sensitivity (like strcmpi
|
||||
If iCaseSenisivity = 1, comparison is case sensitivity (like strcmp)
|
||||
If iCaseSenisivity = 2, comparison is not case sensitivity (like strcmpi
|
||||
or strcasecmp)
|
||||
If iCaseSenisivity = 0, case sensitivity is defaut of your operating system
|
||||
If iCaseSenisivity = 0, case sensitivity is default of your operating system
|
||||
(like 1 on Unix, 2 on Windows)
|
||||
|
||||
*/
|
||||
|
@ -592,9 +592,9 @@ local unzFile unzOpenInternal (const void *path,
|
|||
uLong uL;
|
||||
|
||||
uLong number_disk; /* number of the current dist, used for
|
||||
spaning ZIP, unsupported, always 0*/
|
||||
spanning ZIP, unsupported, always 0*/
|
||||
uLong number_disk_with_CD; /* number the the disk with central dir, used
|
||||
for spaning ZIP, unsupported, always 0*/
|
||||
for spanning ZIP, unsupported, always 0*/
|
||||
ZPOS64_T number_entry_CD; /* total number of entries in
|
||||
the central dir
|
||||
(same than number_entry on nospan) */
|
||||
|
@ -848,7 +848,7 @@ int ZEXPORT unzGetGlobalInfo (unzFile file, unz_global_info* pglobal_info32)
|
|||
return UNZ_OK;
|
||||
}
|
||||
/*
|
||||
Translate date/time from Dos format to tm_unz (readable more easilty)
|
||||
Translate date/time from Dos format to tm_unz (readable more easily)
|
||||
*/
|
||||
local void unz64local_DosDateToTmuDate (ZPOS64_T ulDosDate, tm_unz* ptm)
|
||||
{
|
||||
|
@ -1677,7 +1677,7 @@ ZPOS64_T ZEXPORT unzGetCurrentFileZStreamPos64( unzFile file)
|
|||
buf contain buffer where data must be copied
|
||||
len the size of buf.
|
||||
|
||||
return the number of byte copied if somes bytes are copied
|
||||
return the number of byte copied if some bytes are copied
|
||||
return 0 if the end of file was reached
|
||||
return <0 with error code if there is an error
|
||||
(UNZ_ERRNO for IO error, or zLib error for uncompress error)
|
||||
|
|
|
@ -153,10 +153,10 @@ int ZEXPORT unzStringFileNameCompare OF ((const char* fileName1,
|
|||
int iCaseSensitivity));
|
||||
/*
|
||||
Compare two filename (fileName1,fileName2).
|
||||
If iCaseSenisivity = 1, comparision is case sensitivity (like strcmp)
|
||||
If iCaseSenisivity = 2, comparision is not case sensitivity (like strcmpi
|
||||
If iCaseSenisivity = 1, comparison is case sensitivity (like strcmp)
|
||||
If iCaseSenisivity = 2, comparison is not case sensitivity (like strcmpi
|
||||
or strcasecmp)
|
||||
If iCaseSenisivity = 0, case sensitivity is defaut of your operating system
|
||||
If iCaseSenisivity = 0, case sensitivity is default of your operating system
|
||||
(like 1 on Unix, 2 on Windows)
|
||||
*/
|
||||
|
||||
|
@ -302,9 +302,9 @@ int ZEXPORT unzGetCurrentFileInfo OF((unzFile file,
|
|||
uLong commentBufferSize));
|
||||
/*
|
||||
Get Info about the current file
|
||||
if pfile_info!=NULL, the *pfile_info structure will contain somes info about
|
||||
if pfile_info!=NULL, the *pfile_info structure will contain some info about
|
||||
the current file
|
||||
if szFileName!=NULL, the filemane string will be copied in szFileName
|
||||
if szFileName!=NULL, the filename string will be copied in szFileName
|
||||
(fileNameBufferSize is the size of the buffer)
|
||||
if extraField!=NULL, the extra field information will be copied in extraField
|
||||
(extraFieldBufferSize is the size of the buffer).
|
||||
|
@ -382,7 +382,7 @@ int ZEXPORT unzReadCurrentFile OF((unzFile file,
|
|||
buf contain buffer where data must be copied
|
||||
len the size of buf.
|
||||
|
||||
return the number of byte copied if somes bytes are copied
|
||||
return the number of byte copied if some bytes are copied
|
||||
return 0 if the end of file was reached
|
||||
return <0 with error code if there is an error
|
||||
(UNZ_ERRNO for IO error, or zLib error for uncompress error)
|
||||
|
|
|
@ -36,8 +36,8 @@ NS_CC_BEGIN
|
|||
|
||||
typedef struct
|
||||
{
|
||||
CCRect begin; // the soft keyboard rectangle when animatin begin
|
||||
CCRect end; // the soft keyboard rectangle when animatin end
|
||||
CCRect begin; // the soft keyboard rectangle when animation begins
|
||||
CCRect end; // the soft keyboard rectangle when animation ends
|
||||
float duration; // the soft keyboard animation duration
|
||||
} CCIMEKeyboardNotificationInfo;
|
||||
|
||||
|
@ -56,38 +56,38 @@ protected:
|
|||
friend class CCIMEDispatcher;
|
||||
|
||||
/**
|
||||
@brief Decide the delegate instance is ready for receive ime message or not.
|
||||
@brief Decide if the delegate instance is ready to receive an IME message.
|
||||
|
||||
Called by CCIMEDispatcher.
|
||||
*/
|
||||
virtual bool canAttachWithIME() { return false; }
|
||||
/**
|
||||
@brief When the delegate detach with IME, this method call by CCIMEDispatcher.
|
||||
@brief When the delegate detaches from the IME, this method is called by CCIMEDispatcher.
|
||||
*/
|
||||
virtual void didAttachWithIME() {}
|
||||
|
||||
/**
|
||||
@brief Decide the delegate instance can stop receive ime message or not.
|
||||
@brief Decide if the delegate instance can stop receiving IME messages.
|
||||
*/
|
||||
virtual bool canDetachWithIME() { return false; }
|
||||
|
||||
/**
|
||||
@brief When the delegate detach with IME, this method call by CCIMEDispatcher.
|
||||
@brief When the delegate detaches from the IME, this method is called by CCIMEDispatcher.
|
||||
*/
|
||||
virtual void didDetachWithIME() {}
|
||||
|
||||
/**
|
||||
@brief Called by CCIMEDispatcher when some text input from IME.
|
||||
@brief Called by CCIMEDispatcher when text input received from the IME.
|
||||
*/
|
||||
virtual void insertText(const char * text, int len) {CC_UNUSED_PARAM(text);CC_UNUSED_PARAM(len);}
|
||||
|
||||
/**
|
||||
@brief Called by CCIMEDispatcher when user clicked the backward key.
|
||||
@brief Called by CCIMEDispatcher after the user clicks the backward key.
|
||||
*/
|
||||
virtual void deleteBackward() {}
|
||||
|
||||
/**
|
||||
@brief Called by CCIMEDispatcher for get text which delegate already has.
|
||||
@brief Called by CCIMEDispatcher for text stored in delegate.
|
||||
*/
|
||||
virtual const char * getContentText() { return 0; }
|
||||
|
||||
|
|
|
@ -160,7 +160,7 @@ bool CCIMEDispatcher::attachDelegateWithIME(CCIMEDelegate * pDelegate)
|
|||
break;
|
||||
}
|
||||
|
||||
// havn't delegate attached with IME yet
|
||||
// delegate hasn't attached to IME yet
|
||||
CC_BREAK_IF(! pDelegate->canAttachWithIME());
|
||||
|
||||
m_pImpl->m_DelegateWithIme = *iter;
|
||||
|
@ -177,7 +177,7 @@ bool CCIMEDispatcher::detachDelegateWithIME(CCIMEDelegate * pDelegate)
|
|||
{
|
||||
CC_BREAK_IF(! m_pImpl || ! pDelegate);
|
||||
|
||||
// if pDelegate is not the current delegate attached with ime, return
|
||||
// if pDelegate is not the current delegate attached to IME, return
|
||||
CC_BREAK_IF(m_pImpl->m_DelegateWithIme != pDelegate);
|
||||
|
||||
CC_BREAK_IF(! pDelegate->canDetachWithIME());
|
||||
|
@ -219,7 +219,7 @@ void CCIMEDispatcher::dispatchInsertText(const char * pText, int nLen)
|
|||
{
|
||||
CC_BREAK_IF(! m_pImpl || ! pText || nLen <= 0);
|
||||
|
||||
// there is no delegate attach with ime
|
||||
// there is no delegate attached to IME
|
||||
CC_BREAK_IF(! m_pImpl->m_DelegateWithIme);
|
||||
|
||||
m_pImpl->m_DelegateWithIme->insertText(pText, nLen);
|
||||
|
@ -232,7 +232,7 @@ void CCIMEDispatcher::dispatchDeleteBackward()
|
|||
{
|
||||
CC_BREAK_IF(! m_pImpl);
|
||||
|
||||
// there is no delegate attach with ime
|
||||
// there is no delegate attached to IME
|
||||
CC_BREAK_IF(! m_pImpl->m_DelegateWithIme);
|
||||
|
||||
m_pImpl->m_DelegateWithIme->deleteBackward();
|
||||
|
|
|
@ -48,22 +48,22 @@ public:
|
|||
static CCIMEDispatcher* sharedDispatcher();
|
||||
|
||||
// /**
|
||||
// @brief Release all CCIMEDelegates from shared dispatcher.
|
||||
// @brief Releases all CCIMEDelegates from the shared dispatcher.
|
||||
// */
|
||||
// static void purgeSharedDispatcher();
|
||||
|
||||
/**
|
||||
@brief dispatch the input text from ime
|
||||
@brief Dispatches the input text from IME.
|
||||
*/
|
||||
void dispatchInsertText(const char * pText, int nLen);
|
||||
|
||||
/**
|
||||
@brief dispatch the delete backward operation
|
||||
@brief Dispatches the delete-backward operation.
|
||||
*/
|
||||
void dispatchDeleteBackward();
|
||||
|
||||
/**
|
||||
@brief get the content text, which current CCIMEDelegate which attached with IME has.
|
||||
@brief Get the content text from CCIMEDelegate, retrieved previously from IME.
|
||||
*/
|
||||
const char * getContentText();
|
||||
|
||||
|
@ -79,20 +79,20 @@ protected:
|
|||
friend class CCIMEDelegate;
|
||||
|
||||
/**
|
||||
@brief add delegate to concern ime msg
|
||||
@brief Add delegate to receive IME messages.
|
||||
*/
|
||||
void addDelegate(CCIMEDelegate * pDelegate);
|
||||
|
||||
/**
|
||||
@brief attach the pDeleate with ime.
|
||||
@return If the old delegate can detattach with ime and the new delegate
|
||||
can attach with ime, return true, otherwise return false.
|
||||
@brief Attach the pDelegate to the IME.
|
||||
@return If the old delegate can detach from the IME, and the new delegate
|
||||
can attach to the IME, return true, otherwise false.
|
||||
*/
|
||||
bool attachDelegateWithIME(CCIMEDelegate * pDelegate);
|
||||
bool detachDelegateWithIME(CCIMEDelegate * pDelegate);
|
||||
|
||||
/**
|
||||
@brief remove the delegate from the delegates who concern ime msg
|
||||
@brief Remove the delegate from the delegates which receive IME messages.
|
||||
*/
|
||||
void removeDelegate(CCIMEDelegate * pDelegate);
|
||||
|
||||
|
|
|
@ -184,7 +184,7 @@ void CCTextFieldTTF::insertText(const char * text, int len)
|
|||
{
|
||||
if (m_pDelegate && m_pDelegate->onTextFieldInsertText(this, sInsert.c_str(), len))
|
||||
{
|
||||
// delegate doesn't want insert text
|
||||
// delegate doesn't want to insert text
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -198,13 +198,13 @@ void CCTextFieldTTF::insertText(const char * text, int len)
|
|||
return;
|
||||
}
|
||||
|
||||
// '\n' has inserted, let delegate process first
|
||||
// '\n' inserted, let delegate process first
|
||||
if (m_pDelegate && m_pDelegate->onTextFieldInsertText(this, "\n", 1))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// if delegate hasn't process, detach with ime as default
|
||||
// if delegate hasn't processed, detach from IME by default
|
||||
detachWithIME();
|
||||
}
|
||||
|
||||
|
@ -227,11 +227,11 @@ void CCTextFieldTTF::deleteBackward()
|
|||
|
||||
if (m_pDelegate && m_pDelegate->onTextFieldDeleteBackward(this, m_pInputText->c_str() + nStrLen - nDeleteLen, nDeleteLen))
|
||||
{
|
||||
// delegate don't wan't delete backward
|
||||
// delegate doesn't wan't to delete backwards
|
||||
return;
|
||||
}
|
||||
|
||||
// if delete all text, show space holder string
|
||||
// if all text deleted, show placeholder string
|
||||
if (nStrLen <= nDeleteLen)
|
||||
{
|
||||
CC_SAFE_DELETE(m_pInputText);
|
||||
|
|
|
@ -42,7 +42,7 @@ class CC_DLL CCTextFieldDelegate
|
|||
{
|
||||
public:
|
||||
/**
|
||||
@brief If the sender doesn't want to attach with IME, return true;
|
||||
@brief If the sender doesn't want to attach to the IME, return true;
|
||||
*/
|
||||
virtual bool onTextFieldAttachWithIME(CCTextFieldTTF * sender)
|
||||
{
|
||||
|
@ -51,7 +51,7 @@ public:
|
|||
}
|
||||
|
||||
/**
|
||||
@brief If the sender doesn't want to detach with IME, return true;
|
||||
@brief If the sender doesn't want to detach from the IME, return true;
|
||||
*/
|
||||
virtual bool onTextFieldDetachWithIME(CCTextFieldTTF * sender)
|
||||
{
|
||||
|
@ -82,7 +82,7 @@ public:
|
|||
}
|
||||
|
||||
/**
|
||||
@brief If doesn't want draw sender as default, return true.
|
||||
@brief If the sender doesn't want to draw, return true.
|
||||
*/
|
||||
virtual bool onDraw(CCTextFieldTTF * sender)
|
||||
{
|
||||
|
@ -117,7 +117,7 @@ public:
|
|||
virtual bool attachWithIME();
|
||||
|
||||
/**
|
||||
@brief End text input and close keyboard.
|
||||
@brief End text input and close keyboard.
|
||||
*/
|
||||
virtual bool detachWithIME();
|
||||
|
||||
|
@ -166,4 +166,4 @@ private:
|
|||
|
||||
NS_CC_END
|
||||
|
||||
#endif // __CC_TEXT_FIELD_H__
|
||||
#endif // __CC_TEXT_FIELD_H__
|
||||
|
|
|
@ -163,7 +163,7 @@ void CCTexture2D::releaseData(void *data)
|
|||
void* CCTexture2D::keepData(void *data, unsigned int length)
|
||||
{
|
||||
CC_UNUSED_PARAM(length);
|
||||
//The texture data mustn't be saved becuase it isn't a mutable texture.
|
||||
//The texture data mustn't be saved because it isn't a mutable texture.
|
||||
return data;
|
||||
}
|
||||
|
||||
|
@ -600,7 +600,7 @@ void CCTexture2D::PVRImagesHavePremultipliedAlpha(bool haveAlphaPremultiplied)
|
|||
|
||||
void CCTexture2D::generateMipmap()
|
||||
{
|
||||
CCAssert( m_uPixelsWide == ccNextPOT(m_uPixelsWide) && m_uPixelsHigh == ccNextPOT(m_uPixelsHigh), "Mimpap texture only works in POT textures");
|
||||
CCAssert( m_uPixelsWide == ccNextPOT(m_uPixelsWide) && m_uPixelsHigh == ccNextPOT(m_uPixelsHigh), "Mipmap texture only works in POT textures");
|
||||
ccGLBindTexture2D( m_uName );
|
||||
glGenerateMipmap(GL_TEXTURE_2D);
|
||||
m_bHasMipmaps = true;
|
||||
|
@ -703,7 +703,7 @@ const char* CCTexture2D::stringForFormat()
|
|||
return "PVRTC2";
|
||||
|
||||
default:
|
||||
CCAssert(false , "unrecognised pixel format");
|
||||
CCAssert(false , "unrecognized pixel format");
|
||||
CCLOG("stringForFormat: %ld, cannot give useful result", (long)m_ePixelFormat);
|
||||
break;
|
||||
}
|
||||
|
@ -766,7 +766,7 @@ unsigned int CCTexture2D::bitsPerPixelForFormat(CCTexture2DPixelFormat format)
|
|||
break;
|
||||
default:
|
||||
ret = -1;
|
||||
CCAssert(false , "unrecognised pixel format");
|
||||
CCAssert(false , "unrecognized pixel format");
|
||||
CCLOG("bitsPerPixelForFormat: %ld, cannot give useful result", (long)format);
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -114,7 +114,7 @@ public:
|
|||
void releaseData(void *data);
|
||||
void* keepData(void *data, unsigned int length);
|
||||
|
||||
/** Intializes with a texture2d with data */
|
||||
/** Initializes with a texture2d with data */
|
||||
bool initWithData(const void* data, CCTexture2DPixelFormat pixelFormat, unsigned int pixelsWide, unsigned int pixelsHigh, const CCSize& contentSize);
|
||||
|
||||
/**
|
||||
|
@ -251,7 +251,7 @@ private:
|
|||
CC_PROPERTY_READONLY(CCTexture2DPixelFormat, m_ePixelFormat, PixelFormat)
|
||||
/** width in pixels */
|
||||
CC_PROPERTY_READONLY(unsigned int, m_uPixelsWide, PixelsWide)
|
||||
/** hight in pixels */
|
||||
/** height in pixels */
|
||||
CC_PROPERTY_READONLY(unsigned int, m_uPixelsHigh, PixelsHigh)
|
||||
|
||||
/** texture name */
|
||||
|
|
|
@ -384,7 +384,7 @@ void CCTextureAtlas::insertQuadFromIndex(unsigned int oldIndex, unsigned int new
|
|||
{
|
||||
return;
|
||||
}
|
||||
// because it is ambigious in iphone, so we implement abs ourself
|
||||
// because it is ambiguous in iphone, so we implement abs ourselves
|
||||
// unsigned int howMany = abs( oldIndex - newIndex);
|
||||
unsigned int howMany = (oldIndex - newIndex) > 0 ? (oldIndex - newIndex) : (newIndex - oldIndex);
|
||||
unsigned int dst = oldIndex;
|
||||
|
|
|
@ -43,8 +43,8 @@ class CCTexture2D;
|
|||
|
||||
/** @brief A class that implements a Texture Atlas.
|
||||
Supported features:
|
||||
* The atlas file can be a PVRTC, PNG or any other fomrat supported by Texture2D
|
||||
* Quads can be udpated in runtime
|
||||
* The atlas file can be a PVRTC, PNG or any other format supported by Texture2D
|
||||
* Quads can be updated in runtime
|
||||
* Quads can be added in runtime
|
||||
* Quads can be removed in runtime
|
||||
* Quads can be re-ordered in runtime
|
||||
|
|
|
@ -151,7 +151,7 @@ static void* loadImage(void* data)
|
|||
CCImage::EImageFormat imageType = computeImageFormatType(pAsyncStruct->filename);
|
||||
if (imageType == CCImage::kFmtUnKnown)
|
||||
{
|
||||
CCLOG("unsupportted format %s",filename);
|
||||
CCLOG("unsupported format %s",filename);
|
||||
delete pAsyncStruct;
|
||||
|
||||
continue;
|
||||
|
@ -475,7 +475,7 @@ CCTexture2D * CCTextureCache::addImage(const char * path)
|
|||
#ifdef CC_SUPPORT_PVRTC
|
||||
CCTexture2D* CCTextureCache::addPVRTCImage(const char* path, int bpp, bool hasAlpha, int width)
|
||||
{
|
||||
CCAssert(path != NULL, "TextureCache: fileimage MUST not be nill");
|
||||
CCAssert(path != NULL, "TextureCache: fileimage MUST not be nil");
|
||||
CCAssert( bpp==2 || bpp==4, "TextureCache: bpp must be either 2 or 4");
|
||||
|
||||
CCTexture2D * texture;
|
||||
|
@ -513,7 +513,7 @@ CCTexture2D* CCTextureCache::addPVRTCImage(const char* path, int bpp, bool hasAl
|
|||
|
||||
CCTexture2D * CCTextureCache::addPVRImage(const char* path)
|
||||
{
|
||||
CCAssert(path != NULL, "TextureCache: fileimage MUST not be nill");
|
||||
CCAssert(path != NULL, "TextureCache: fileimage MUST not be nil");
|
||||
|
||||
CCTexture2D* texture = NULL;
|
||||
std::string key(path);
|
||||
|
@ -546,7 +546,7 @@ CCTexture2D * CCTextureCache::addPVRImage(const char* path)
|
|||
|
||||
CCTexture2D* CCTextureCache::addUIImage(CCImage *image, const char *key)
|
||||
{
|
||||
CCAssert(image != NULL, "TextureCache: image MUST not be nill");
|
||||
CCAssert(image != NULL, "TextureCache: image MUST not be nil");
|
||||
|
||||
CCTexture2D * texture = NULL;
|
||||
// textureForKey() use full path,so the key should be full path
|
||||
|
|
|
@ -72,7 +72,7 @@ public:
|
|||
|
||||
CCDictionary* snapshotTextures();
|
||||
|
||||
/** Retruns ths shared instance of the cache */
|
||||
/** Returns the shared instance of the cache */
|
||||
static CCTextureCache * sharedTextureCache();
|
||||
|
||||
/** purges the cache. It releases the retained instance.
|
||||
|
@ -83,7 +83,7 @@ public:
|
|||
/** Returns a Texture2D object given an file image
|
||||
* If the file image was not previously loaded, it will create a new CCTexture2D
|
||||
* object and it will return it. It will use the filename as a key.
|
||||
* Otherwise it will return a reference of a previosly loaded image.
|
||||
* Otherwise it will return a reference of a previously loaded image.
|
||||
* Supported image extensions: .png, .bmp, .tiff, .jpeg, .pvr, .gif
|
||||
*/
|
||||
CCTexture2D* addImage(const char* fileimage);
|
||||
|
@ -128,7 +128,7 @@ public:
|
|||
|
||||
/** Removes unused textures
|
||||
* Textures that have a retain count of 1 will be deleted
|
||||
* It is convinient to call this method after when starting a new Scene
|
||||
* It is convenient to call this method after when starting a new Scene
|
||||
* @since v0.8
|
||||
*/
|
||||
void removeUnusedTextures();
|
||||
|
@ -152,7 +152,7 @@ public:
|
|||
#ifdef CC_SUPPORT_PVRTC
|
||||
/** Returns a Texture2D object given an PVRTC RAW filename
|
||||
* If the file image was not previously loaded, it will create a new CCTexture2D
|
||||
* object and it will return it. Otherwise it will return a reference of a previosly loaded image
|
||||
* object and it will return it. Otherwise it will return a reference of a previously loaded image
|
||||
*
|
||||
* It can only load square images: width == height, and it must be a power of 2 (128,256,512...)
|
||||
* bpp can only be 2 or 4. 2 means more compression but lower quality.
|
||||
|
@ -163,7 +163,7 @@ public:
|
|||
|
||||
/** Returns a Texture2D object given an PVR filename
|
||||
* If the file image was not previously loaded, it will create a new CCTexture2D
|
||||
* object and it will return it. Otherwise it will return a reference of a previosly loaded image
|
||||
* object and it will return it. Otherwise it will return a reference of a previously loaded image
|
||||
*/
|
||||
CCTexture2D* addPVRImage(const char* filename);
|
||||
|
||||
|
|
|
@ -47,7 +47,7 @@ enum {
|
|||
kPVRTextureFlagBumpmap = (1<<10), // has normals encoded for a bump map
|
||||
kPVRTextureFlagTiling = (1<<11), // is bordered for tiled pvr
|
||||
kPVRTextureFlagCubemap = (1<<12), // is a cubemap/skybox
|
||||
kPVRTextureFlagFalseMipCol = (1<<13), // are there false coloured MIP levels
|
||||
kPVRTextureFlagFalseMipCol = (1<<13), // are there false colored MIP levels
|
||||
kPVRTextureFlagVolume = (1<<14), // is this a volume texture
|
||||
kPVRTextureFlagAlpha = (1<<15), // v2.1 is there transparency info in the texture
|
||||
kPVRTextureFlagVerticalFlip = (1<<16), // v2.1 is the texture vertically flipped
|
||||
|
@ -195,7 +195,7 @@ bool CCTexturePVR::unpackPVRData(unsigned char* data, unsigned int len)
|
|||
if (! configuration->supportsNPOT() &&
|
||||
(header->width != ccNextPOT(header->width) || header->height != ccNextPOT(header->height)))
|
||||
{
|
||||
CCLOG("cocos2d: ERROR: Loding an NPOT texture (%dx%d) but is not supported on this device", header->width, header->height);
|
||||
CCLOG("cocos2d: ERROR: Loading an NPOT texture (%dx%d) but is not supported on this device", header->width, header->height);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -207,7 +207,7 @@ bool CCTexturePVR::unpackPVRData(unsigned char* data, unsigned int len)
|
|||
//Reset num of mipmaps
|
||||
m_uNumberOfMipmaps = 0;
|
||||
|
||||
//Get size of maimap
|
||||
//Get size of mipmap
|
||||
m_uWidth = width = CC_SWAP_INT32_LITTLE_TO_HOST(header->width);
|
||||
m_uHeight = height = CC_SWAP_INT32_LITTLE_TO_HOST(header->height);
|
||||
|
||||
|
@ -270,14 +270,14 @@ bool CCTexturePVR::unpackPVRData(unsigned char* data, unsigned int len)
|
|||
unsigned int packetLength = (dataLength - dataOffset);
|
||||
packetLength = packetLength > dataSize ? dataSize : packetLength;
|
||||
|
||||
//Make record to the mipmaps array and increment coutner
|
||||
//Make record to the mipmaps array and increment counter
|
||||
m_asMipmaps[m_uNumberOfMipmaps].address = bytes + dataOffset;
|
||||
m_asMipmaps[m_uNumberOfMipmaps].len = packetLength;
|
||||
m_uNumberOfMipmaps++;
|
||||
|
||||
//Check that we didn't overflow
|
||||
CCAssert(m_uNumberOfMipmaps < CC_PVRMIPMAP_MAX,
|
||||
"TexturePVR: Maximum number of mimpaps reached. Increate the CC_PVRMIPMAP_MAX value");
|
||||
"TexturePVR: Maximum number of mipmaps reached. Increase the CC_PVRMIPMAP_MAX value");
|
||||
|
||||
dataOffset += packetLength;
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@ NS_CC_BEGIN
|
|||
*/
|
||||
|
||||
/**
|
||||
@brief Structure which can tell where mimap begins and how long is it
|
||||
@brief Structure which can tell where mipmap begins and how long is it
|
||||
*/
|
||||
struct CCPVRMipmap {
|
||||
unsigned char *address;
|
||||
|
@ -47,7 +47,7 @@ struct CCPVRMipmap {
|
|||
};
|
||||
|
||||
/**
|
||||
@brief Detemine how many mipmaps can we have.
|
||||
@brief Determine how many mipmaps can we have.
|
||||
Its same as define but it respects namespaces
|
||||
*/
|
||||
enum {
|
||||
|
|
|
@ -199,7 +199,7 @@ void CCTMXLayer::setupTiles()
|
|||
}
|
||||
|
||||
CCAssert( m_uMaxGID >= m_pTileSet->m_uFirstGid &&
|
||||
m_uMinGID >= m_pTileSet->m_uFirstGid, "TMX: Only 1 tilset per layer is supported");
|
||||
m_uMinGID >= m_pTileSet->m_uFirstGid, "TMX: Only 1 tileset per layer is supported");
|
||||
}
|
||||
|
||||
// CCTMXLayer - Properties
|
||||
|
@ -306,7 +306,7 @@ CCSprite* CCTMXLayer::reusedTileWithRect(CCRect rect)
|
|||
}
|
||||
else
|
||||
{
|
||||
// XXX: should not be re-init. Potential memeory leak. Not following best practices
|
||||
// XXX: should not be re-init. Potential memory leak. Not following best practices
|
||||
// XXX: it shall call directory [setRect:rect]
|
||||
m_pReusedTile->initWithTexture(m_pobTextureAtlas->getTexture(), rect, false);
|
||||
|
||||
|
|
|
@ -53,12 +53,12 @@ If the layer contains a property named "cc_vertexz" with an integer (in can be p
|
|||
then all the tiles belonging to the layer will use that value as their OpenGL vertex Z for depth.
|
||||
|
||||
On the other hand, if the "cc_vertexz" property has the "automatic" value, then the tiles will use an automatic vertex Z value.
|
||||
Also before drawing the tiles, GL_ALPHA_TEST will be enabled, and disabled after drawin them. The used alpha func will be:
|
||||
Also before drawing the tiles, GL_ALPHA_TEST will be enabled, and disabled after drawing them. The used alpha func will be:
|
||||
|
||||
glAlphaFunc( GL_GREATER, value )
|
||||
|
||||
"value" by default is 0, but you can change it from Tiled by adding the "cc_alpha_func" property to the layer.
|
||||
The value 0 should work for most cases, but if you have tiles that are semi-transparent, then you might want to use a differnt
|
||||
The value 0 should work for most cases, but if you have tiles that are semi-transparent, then you might want to use a different
|
||||
value, like 0.5.
|
||||
|
||||
For further information, please see the programming guide:
|
||||
|
@ -75,11 +75,11 @@ class CC_DLL CCTMXLayer : public CCSpriteBatchNode
|
|||
{
|
||||
/** size of the layer in tiles */
|
||||
CC_SYNTHESIZE_PASS_BY_REF(CCSize, m_tLayerSize, LayerSize);
|
||||
/** size of the map's tile (could be differnt from the tile's size) */
|
||||
/** size of the map's tile (could be different from the tile's size) */
|
||||
CC_SYNTHESIZE_PASS_BY_REF(CCSize, m_tMapTileSize, MapTileSize);
|
||||
/** pointer to the map of tiles */
|
||||
CC_SYNTHESIZE(unsigned int*, m_pTiles, Tiles);
|
||||
/** Tilset information for the layer */
|
||||
/** Tileset information for the layer */
|
||||
CC_PROPERTY(CCTMXTilesetInfo*, m_pTileSet, TileSet);
|
||||
/** Layer orientation, which is the same as the map orientation */
|
||||
CC_SYNTHESIZE(unsigned int, m_uLayerOrientation, LayerOrientation);
|
||||
|
@ -168,7 +168,7 @@ private:
|
|||
|
||||
CCPoint calculateLayerOffset(const CCPoint& offset);
|
||||
|
||||
/* optimization methos */
|
||||
/* optimization methods */
|
||||
CCSprite* appendTileForGID(unsigned int gid, const CCPoint& pos);
|
||||
CCSprite* insertTileForGID(unsigned int gid, const CCPoint& pos);
|
||||
CCSprite* updateTileForGID(unsigned int gid, const CCPoint& pos);
|
||||
|
|
|
@ -42,7 +42,7 @@ class CCTMXMapInfo;
|
|||
* @{
|
||||
*/
|
||||
|
||||
/** Possible oritentations of the TMX map */
|
||||
/** Possible orientations of the TMX map */
|
||||
enum
|
||||
{
|
||||
/** Orthogonal orientation */
|
||||
|
@ -64,7 +64,7 @@ It also supports object groups, objects, and properties.
|
|||
Features:
|
||||
- Each tile will be treated as an CCSprite
|
||||
- The sprites are created on demand. They will be created only when you call "layer->tileAt(position)"
|
||||
- Each tile can be rotated / moved / scaled / tinted / "opacitied", since each tile is a CCSprite
|
||||
- Each tile can be rotated / moved / scaled / tinted / "opaqued", since each tile is a CCSprite
|
||||
- Tiles can be added/removed in runtime
|
||||
- The z-order of the tiles can be modified in runtime
|
||||
- Each tile has an anchorPoint of (0,0)
|
||||
|
@ -80,7 +80,7 @@ Features:
|
|||
|
||||
Limitations:
|
||||
- It only supports one tileset per layer.
|
||||
- Embeded images are not supported
|
||||
- Embedded images are not supported
|
||||
- It only supports the XML format (the JSON format is not supported)
|
||||
|
||||
Technical description:
|
||||
|
@ -147,7 +147,7 @@ public:
|
|||
/** return the TMXLayer for the specific layer */
|
||||
CCTMXLayer* layerNamed(const char *layerName);
|
||||
|
||||
/** return the TMXObjectGroup for the secific group */
|
||||
/** return the TMXObjectGroup for the specific group */
|
||||
CCTMXObjectGroup* objectGroupNamed(const char *groupName);
|
||||
|
||||
/** return the value for the specific property name */
|
||||
|
|
|
@ -43,7 +43,7 @@ using namespace std;
|
|||
#include <libxml/parser.h>
|
||||
#include <libxml/tree.h>
|
||||
#include <libxml/xmlmemory.h>
|
||||
#endf
|
||||
#endif
|
||||
*/
|
||||
|
||||
NS_CC_BEGIN
|
||||
|
@ -652,7 +652,7 @@ void CCTMXMapInfo::endElement(void *ctx, const char *name)
|
|||
int inflatedLen = ZipUtils::ccInflateMemoryWithHint(buffer, len, &deflated, sizeHint);
|
||||
CCAssert(inflatedLen == sizeHint, "");
|
||||
|
||||
inflatedLen = (size_t)&inflatedLen; // XXX: to avoid warings in compiler
|
||||
inflatedLen = (size_t)&inflatedLen; // XXX: to avoid warnings in compiler
|
||||
|
||||
delete [] buffer;
|
||||
buffer = NULL;
|
||||
|
|
|
@ -106,7 +106,7 @@ public:
|
|||
|
||||
/** @brief CCTMXTilesetInfo contains the information about the tilesets like:
|
||||
- Tileset name
|
||||
- Tilset spacing
|
||||
- Tileset spacing
|
||||
- Tileset margin
|
||||
- size of the tiles
|
||||
- Image used for the tiles
|
||||
|
@ -166,7 +166,7 @@ public:
|
|||
CC_SYNTHESIZE(unsigned int, m_uParentGID, ParentGID);
|
||||
/// layer attribs
|
||||
CC_SYNTHESIZE(int, m_nLayerAttribs, LayerAttribs);
|
||||
/// is stroing characters?
|
||||
/// is storing characters?
|
||||
CC_SYNTHESIZE(bool, m_bStoringCharacters, StoringCharacters);
|
||||
/// properties
|
||||
CC_PROPERTY(CCDictionary*, m_pProperties, Properties);
|
||||
|
@ -177,13 +177,13 @@ public:
|
|||
static CCTMXMapInfo * formatWithTMXFile(const char *tmxFile);
|
||||
/** creates a TMX Format with an XML string and a TMX resource path */
|
||||
static CCTMXMapInfo * formatWithXML(const char* tmxString, const char* resourcePath);
|
||||
/** initializes a TMX format witha tmx file */
|
||||
/** initializes a TMX format with a tmx file */
|
||||
bool initWithTMXFile(const char *tmxFile);
|
||||
/** initializes a TMX format with an XML string and a TMX resource path */
|
||||
bool initWithXML(const char* tmxString, const char* resourcePath);
|
||||
/** initalises parsing of an XML file, either a tmx (Map) file or tsx (Tileset) file */
|
||||
/** initializes parsing of an XML file, either a tmx (Map) file or tsx (Tileset) file */
|
||||
bool parseXMLFile(const char *xmlFilename);
|
||||
/* initalises parsing of an XML string, either a tmx (Map) string or tsx (Tileset) string */
|
||||
/* initializes parsing of an XML string, either a tmx (Map) string or tsx (Tileset) string */
|
||||
bool parseXMLString(const char *xmlString);
|
||||
|
||||
CCDictionary* getTileProperties();
|
||||
|
|
|
@ -131,7 +131,7 @@ void CCTileMapAtlas::loadTGAfile(const char *file)
|
|||
#if 1
|
||||
if( m_pTGAInfo->status != TGA_OK )
|
||||
{
|
||||
CCAssert(0, "TileMapAtlasLoadTGA : TileMapAtas cannot load TGA file");
|
||||
CCAssert(0, "TileMapAtlasLoadTGA : TileMapAtlas cannot load TGA file");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
@ -156,7 +156,7 @@ void CCTileMapAtlas::setTile(const ccColor3B& tile, const ccGridSize& position)
|
|||
ptr[position.x + position.y * m_pTGAInfo->width] = tile;
|
||||
|
||||
// XXX: this method consumes a lot of memory
|
||||
// XXX: a tree of something like that shall be impolemented
|
||||
// XXX: a tree of something like that shall be implemented
|
||||
CCInteger *num = (CCInteger*)m_pPosToAtlasIndex->objectForKey(CCString::createWithFormat("%ld,%ld",
|
||||
(long)position.x,
|
||||
(long)position.y)->getCString());
|
||||
|
|
|
@ -93,7 +93,7 @@ private:
|
|||
void updateAtlasValues();
|
||||
|
||||
protected:
|
||||
//! x,y to altas dicctionary
|
||||
//! x,y to atlas dictionary
|
||||
CCDictionary* m_pPosToAtlasIndex;
|
||||
//! numbers of tiles to render
|
||||
int m_nItemsToRender;
|
||||
|
|
|
@ -72,7 +72,7 @@ public:
|
|||
them. You get exactly one UITouch per call.
|
||||
- 2. You can *claim* a UITouch by returning YES in ccTouchBegan. Updates of claimed
|
||||
touches are sent only to the delegate(s) that claimed them. So if you get a move/
|
||||
ended/cancelled 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.
|
||||
|
||||
(The name TargetedTouchDelegate relates to updates "targeting" their specific
|
||||
|
@ -94,7 +94,7 @@ public:
|
|||
};
|
||||
|
||||
/** @brief
|
||||
This type of delegate is the same one used by CocoaTouch. You will receive all the events (Began,Moved,Ended,Cancelled).
|
||||
This type of delegate is the same one used by CocoaTouch. You will receive all the events (Began,Moved,Ended,Canceled).
|
||||
@since v0.8
|
||||
*/
|
||||
class CC_DLL CCStandardTouchDelegate : public CCTouchDelegate
|
||||
|
|
|
@ -136,7 +136,7 @@ void CCTouchDispatcher::addStandardDelegate(CCTouchDelegate *pDelegate, int nPri
|
|||
}
|
||||
else
|
||||
{
|
||||
/* If pHandler is contained in m_pHandlersToRemove, if so remove it from m_pHandlersToRemove and retrun.
|
||||
/* If pHandler is contained in m_pHandlersToRemove, if so remove it from m_pHandlersToRemove and return.
|
||||
* Refer issue #752(cocos2d-x)
|
||||
*/
|
||||
if (ccCArrayContainsValue(m_pHandlersToRemove, pDelegate))
|
||||
|
@ -159,7 +159,7 @@ void CCTouchDispatcher::addTargetedDelegate(CCTouchDelegate *pDelegate, int nPri
|
|||
}
|
||||
else
|
||||
{
|
||||
/* If pHandler is contained in m_pHandlersToRemove, if so remove it from m_pHandlersToRemove and retrun.
|
||||
/* If pHandler is contained in m_pHandlersToRemove, if so remove it from m_pHandlersToRemove and return.
|
||||
* Refer issue #752(cocos2d-x)
|
||||
*/
|
||||
if (ccCArrayContainsValue(m_pHandlersToRemove, pDelegate))
|
||||
|
@ -216,7 +216,7 @@ void CCTouchDispatcher::removeDelegate(CCTouchDelegate *pDelegate)
|
|||
}
|
||||
else
|
||||
{
|
||||
/* If pHandler is contained in m_pHandlersToAdd, if so remove it from m_pHandlersToAdd and retrun.
|
||||
/* If pHandler is contained in m_pHandlersToAdd, if so remove it from m_pHandlersToAdd and return.
|
||||
* Refer issue #752(cocos2d-x)
|
||||
*/
|
||||
CCTouchHandler *pHandler = findHandler(m_pHandlersToAdd, pDelegate);
|
||||
|
@ -365,7 +365,7 @@ void CCTouchDispatcher::touches(CCSet *pTouches, CCEvent *pEvent, unsigned int u
|
|||
} else
|
||||
if (pHandler->getClaimedTouches()->containsObject(pTouch))
|
||||
{
|
||||
// moved ended cancelled
|
||||
// moved ended canceled
|
||||
bClaimed = true;
|
||||
|
||||
switch (sHelper.m_type)
|
||||
|
|
|
@ -73,7 +73,7 @@ protected:
|
|||
};
|
||||
|
||||
/** CCStandardTouchHandler
|
||||
It forwardes each event to the delegate.
|
||||
It forwards each event to the delegate.
|
||||
*/
|
||||
class CC_DLL CCStandardTouchHandler : public CCTouchHandler
|
||||
{
|
||||
|
@ -88,7 +88,7 @@ public:
|
|||
|
||||
/**
|
||||
CCTargetedTouchHandler
|
||||
Object than contains the claimed touches and if it swallos touches.
|
||||
Object than contains the claimed touches and if it swallows touches.
|
||||
Used internally by TouchDispatcher
|
||||
*/
|
||||
class CC_DLL CCTargetedTouchHandler : public CCTouchHandler
|
||||
|
|
|
@ -9,7 +9,7 @@ public:
|
|||
// Here's a difference. Method 'init' in cocos2d-x returns bool, instead of returning 'id' in cocos2d-iphone
|
||||
virtual bool init();
|
||||
|
||||
// there's no 'id' in cpp, so we recommand to return the exactly class pointer
|
||||
// there's no 'id' in cpp, so we recommend returning the class instance pointer
|
||||
static cocos2d::CCScene* scene();
|
||||
|
||||
// a selector callback
|
||||
|
|
|
@ -51,7 +51,7 @@ void AppDelegate::applicationDidEnterBackground()
|
|||
{
|
||||
CCDirector::sharedDirector()->pause();
|
||||
|
||||
// if you use SimpleAudioEngine, it must be pause
|
||||
// if you use SimpleAudioEngine, it must be paused
|
||||
// SimpleAudioEngine::sharedEngine()->pauseBackgroundMusic();
|
||||
}
|
||||
|
||||
|
|
|
@ -76,7 +76,7 @@ static AppDelegate s_sharedApplication;
|
|||
|
||||
- (void)applicationWillEnterForeground:(UIApplication *)application {
|
||||
/*
|
||||
Called as part of transition from the background to the inactive state: here you can undo many of the changes made on entering the background.
|
||||
Called as part of transition from the background to the inactive state: here you can undo many of the changes made on entering the background.
|
||||
*/
|
||||
cocos2d::CCApplication::sharedApplication()->applicationWillEnterForeground();
|
||||
}
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue