diff --git a/cocos2dx/CCDirector.cpp b/cocos2dx/CCDirector.cpp index 27df5301c8..08d3d9f3de 100644 --- a/cocos2dx/CCDirector.cpp +++ b/cocos2dx/CCDirector.cpp @@ -102,7 +102,7 @@ bool CCDirector::init(void) // FPS m_bDisplayFPS = false; - m_nFrames = 0; + m_uTotalFrames = m_uFrames = 0; m_pszFPS = new char[10]; m_pLastUpdate = new struct cc_timeval(); @@ -227,6 +227,8 @@ void CCDirector::drawScene(void) glPopMatrix(); + m_uTotalFrames++; + // swap buffers if (m_pobOpenGLView) { @@ -669,13 +671,13 @@ void CCDirector::resume(void) // updates the FPS every frame void CCDirector::showFPS(void) { - m_nFrames++; + m_uFrames++; m_fAccumDt += m_fDeltaTime; if (m_fAccumDt > CC_DIRECTOR_FPS_INTERVAL) { - m_fFrameRate = m_nFrames / m_fAccumDt; - m_nFrames = 0; + m_fFrameRate = m_uFrames / m_fAccumDt; + m_uFrames = 0; m_fAccumDt = 0; sprintf(m_pszFPS, "%.1f", m_fFrameRate); diff --git a/cocos2dx/actions/CCActionInterval.cpp b/cocos2dx/actions/CCActionInterval.cpp index cab45bf879..04ee34751d 100644 --- a/cocos2dx/actions/CCActionInterval.cpp +++ b/cocos2dx/actions/CCActionInterval.cpp @@ -2180,8 +2180,7 @@ CCActionInterval* CCAnimate::reverse(void) } } - CCAnimation *pNewAnim = CCAnimation::animationWithName(m_pAnimation->getName(), - m_pAnimation->getDelay(), pNewArray); + CCAnimation *pNewAnim = CCAnimation::animationWithFrames(pNewArray, m_pAnimation->getDelay()); pNewArray->release(); diff --git a/cocos2dx/base_nodes/CCNode.cpp b/cocos2dx/base_nodes/CCNode.cpp index 2f815e744d..ccc9daddbc 100644 --- a/cocos2dx/base_nodes/CCNode.cpp +++ b/cocos2dx/base_nodes/CCNode.cpp @@ -166,7 +166,7 @@ void CCNode::setZOrder(int z) /// ertexZ getter float CCNode::getVertexZ() { - return m_fVertexZ; + return m_fVertexZ / CC_CONTENT_SCALE_FACTOR(); } diff --git a/cocos2dx/cocos2d.cpp b/cocos2dx/cocos2d.cpp index 311f1a8d56..d408f92265 100644 --- a/cocos2dx/cocos2d.cpp +++ b/cocos2dx/cocos2d.cpp @@ -29,7 +29,7 @@ namespace cocos2d { const char* cocos2dVersion() { - return "cocos2d v1.0.0"; + return "cocos2d v1.0.1"; } }//namespace cocos2d diff --git a/cocos2dx/include/CCAnimation.h b/cocos2dx/include/CCAnimation.h index 30befb916f..cdd2e70f1e 100644 --- a/cocos2dx/include/CCAnimation.h +++ b/cocos2dx/include/CCAnimation.h @@ -86,28 +86,6 @@ namespace cocos2d { */ bool initWithFrames(CCMutableArray *pFrames, float delay); - /** Initializes a CCAnimation with a name - @since v0.99.3 - @deprecated Will be removed in 1.0.1. Use "init" instead. - */ - bool initWithName(const char *pszName); - - /** Initializes a CCAnimation with a name and frames - @since v0.99.3 - @deprecated Will be removed in 1.0.1. Use "initWithFrames" instead. - */ - bool initWithName(const char *pszName, CCMutableArray *pFrames); - - /** Initializes a CCAnimation with a name and delay between frames. - @deprecated Will be removed in 1.0.1. Use "initWithFrames:nil delay:delay" instead. - */ - bool initWithName(const char *pszName, float fDelay); - - /** Initializes a CCAnimation with a name, delay and an array of CCSpriteFrames. - @deprecated Will be removed in 1.0.1. Use "initWithFrames:frames delay:delay" instead. - */ - bool initWithName(const char *pszName, float fDelay, CCMutableArray *pFrames); - /** adds a frame to a CCAnimation */ void addFrame(CCSpriteFrame *pFrame); @@ -138,24 +116,6 @@ namespace cocos2d { @since v0.99.5 */ static CCAnimation* animationWithFrames(CCMutableArray *frames, float delay); - - /** Creates a CCAnimation with a name - @since v0.99.3 - @deprecated Will be removed in 1.0.1. Use "animation" instead. - */ - static CCAnimation* animationWithName(const char *pszName); - - /** Creates a CCAnimation with a name and frames - @since v0.99.3 - @deprecated Will be removed in 1.0.1. Use "animationWithFrames" instead. - */ - static CCAnimation* animationWithName(const char *pszName, CCMutableArray *pFrames); - - /** Creates a CCAnimation with a name and delay between frames. */ - static CCAnimation* animationWithName(const char *pszName, float fDelay); - - /** Creates a CCAnimation with a name, delay and an array of CCSpriteFrames. */ - static CCAnimation* animationWithName(const char *pszName, float fDelay, CCMutableArray *pFrames); }; } // end of name sapce cocos2d diff --git a/cocos2dx/include/CCDirector.h b/cocos2dx/include/CCDirector.h index f0f1e44c79..6b942bb05d 100644 --- a/cocos2dx/include/CCDirector.h +++ b/cocos2dx/include/CCDirector.h @@ -404,7 +404,6 @@ protected: bool m_bLandscape; bool m_bDisplayFPS; - int m_nFrames; ccTime m_fAccumDt; ccTime m_fFrameRate; #if CC_DIRECTOR_FAST_FPS @@ -415,6 +414,7 @@ protected: bool m_bPaused; /* How many frames were called since the director started */ + unsigned int m_uTotalFrames; unsigned int m_uFrames; /* The running scene */ diff --git a/cocos2dx/include/CCLabelAtlas.h b/cocos2dx/include/CCLabelAtlas.h index 95963d4dc9..01a87202a3 100644 --- a/cocos2dx/include/CCLabelAtlas.h +++ b/cocos2dx/include/CCLabelAtlas.h @@ -52,12 +52,6 @@ namespace cocos2d{ /** creates the CCLabelAtlas with a string, a char map file(the atlas), the width and height of each element and the starting char of the atlas */ static CCLabelAtlas * labelWithString(const char *label, const char *charMapFile, unsigned int itemWidth, unsigned int itemHeight, unsigned char startCharMap); - - /** creates the CCLabelAtlas with a string, a char map file(the atlas), the width and height of each element in points and the starting char of the atlas. - @deprecated Will be removed in 1.0.1. Use "labelWithString:" instead - */ - static CCLabelAtlas * labelAtlasWithString(const char *label, const char *charMapFile, unsigned int itemWidth, unsigned int itemHeight, unsigned char startCharMap); - /** initializes the CCLabelAtlas with a string, a char map file(the atlas), the width and height of each element and the starting char of the atlas */ bool initWithString(const char *label, const char *charMapFile, unsigned int itemWidth, unsigned int itemHeight, unsigned char startCharMap); // super methods diff --git a/cocos2dx/include/CCLabelBMFont.h b/cocos2dx/include/CCLabelBMFont.h index 320f1e9cca..f6fd02eee1 100644 --- a/cocos2dx/include/CCLabelBMFont.h +++ b/cocos2dx/include/CCLabelBMFont.h @@ -171,12 +171,6 @@ namespace cocos2d{ /** creates a bitmap font altas with an initial string and the FNT file */ static CCLabelBMFont * labelWithString(const char *str, const char *fntFile); - /** creates a BMFont label with an initial string and the FNT file - @deprecated Will be removed in 1.0.1. Use "labelWithString" instead. - @since v0.99.5 - */ - static CCLabelBMFont * bitmapFontAtlasWithString(const char *str, const char *fntFile); - /** init a bitmap font altas with an initial string and the FNT file */ bool initWithString(const char *str, const char *fntFile); /** updates the font chars based on the string to render */ @@ -203,14 +197,6 @@ namespace cocos2d{ /** Purges the FNT config cache */ CC_DLL void FNTConfigRemoveCache( void ); - - /** CCBitmapFontAtlas - @deprecated Use CCLabelBMFont instead. Will be removed 1.0.1 - */ - class CCBitmapFontAtlas : public CCLabelBMFont - { - }; - }// namespace cocos2d #endif //__CCBITMAP_FONT_ATLAS_H__ diff --git a/cocos2dx/include/CCLayer.h b/cocos2dx/include/CCLayer.h index 4e53c726b9..3da9ddf757 100644 --- a/cocos2dx/include/CCLayer.h +++ b/cocos2dx/include/CCLayer.h @@ -196,18 +196,6 @@ protected: virtual void updateColor(); }; -/** CCColorLayer -It is the same as CCLayerColor. - -@deprecated Use CCLayerColor instead. This class will be removed in v1.0.1 -*/ -class CC_DLL CCColorLayer : public CCLayerColor -{ -public: - static CCColorLayer * layerWithColorWidthHeight(ccColor4B color, GLfloat width, GLfloat height); - static CCColorLayer * layerWithColor(ccColor4B color); -}; - // // CCLayerGradient // @@ -302,14 +290,6 @@ public: LAYER_NODE_FUNC(CCLayerMultiplex); }; -/** CCMultiplexLayer -It is the same as CCLayerMultiplex. - -@deprecated Use CCLayerMultiplex instead. This class will be removed in v1.0.1 -*/ -class CCMultiplexLayer : public CCLayerMultiplex -{ -}; }//namespace cocos2d #endif // __CCLAYER_H__ diff --git a/cocos2dx/include/CCSprite.h b/cocos2dx/include/CCSprite.h index 56ed3d985a..a0ce41dfb8 100644 --- a/cocos2dx/include/CCSprite.h +++ b/cocos2dx/include/CCSprite.h @@ -327,25 +327,8 @@ public: /** returns the current displayed frame. */ CCSpriteFrame* displayedFrame(void); - /** adds an Animation to the Sprite. - - @deprecated Use CCAnimationCache instead. Will be removed in 1.0.1 - */ - void addAnimation(CCAnimation *pAnimation); - - /** returns an Animation given it's name. - - @deprecated Use CCAnimationCache instead. Will be removed in 1.0.1 - */ - CCAnimation* animationByName(const char *pszAnimationName); - // Animation - /** changes the display frame based on an animation and an index. - @deprecated Will be removed in 1.0.1. Use setDisplayFrameWithAnimationName:index instead - */ - void setDisplayFrame(const char *pszAnimationName, int nFrameIndex); - /** changes the display frame with animation name and index. The animation name will be get from the CCAnimationCache @since v0.99.5 @@ -355,7 +338,6 @@ public: protected: void updateTextureCoords(CCRect rect); void updateBlendFunc(void); - void initAnimationDictionary(void); void getTransformValues(struct transformValues_ *tv); // optimization protected: @@ -404,9 +386,6 @@ protected: // image is flipped bool m_bFlipX; bool m_bFlipY; - - // Animations that belong to the sprite - CCMutableDictionary *m_pAnimations; }; }//namespace cocos2d diff --git a/cocos2dx/include/CCSpriteBatchNode.h b/cocos2dx/include/CCSpriteBatchNode.h index 128c95b3ba..fbe1c1c6b8 100644 --- a/cocos2dx/include/CCSpriteBatchNode.h +++ b/cocos2dx/include/CCSpriteBatchNode.h @@ -78,27 +78,23 @@ namespace cocos2d The capacity will be increased in 33% in runtime if it run out of space. */ static CCSpriteBatchNode* batchNodeWithTexture(CCTexture2D *tex); - static CCSpriteBatchNode* spriteSheetWithTexture(CCTexture2D *tex); // deprecated /** creates a CCSpriteBatchNode with a texture2d and capacity of children. The capacity will be increased in 33% in runtime if it run out of space. */ static CCSpriteBatchNode* batchNodeWithTexture(CCTexture2D* tex, unsigned int capacity); - static CCSpriteBatchNode* spriteSheetWithTexture(CCTexture2D *tex, unsigned int capacity); // deprecated /** creates a CCSpriteBatchNode with a file image (.png, .jpeg, .pvr, etc) with a default capacity of 29 children. The capacity will be increased in 33% in runtime if it run out of space. The file will be loaded using the TextureMgr. */ static CCSpriteBatchNode* batchNodeWithFile(const char* fileImage); - static CCSpriteBatchNode* spriteSheetWithFile(const char* fileImage); // deprecated /** creates a CCSpriteBatchNode with a file image (.png, .jpeg, .pvr, etc) and capacity of children. The capacity will be increased in 33% in runtime if it run out of space. The file will be loaded using the TextureMgr. */ static CCSpriteBatchNode* batchNodeWithFile(const char* fileImage, unsigned int capacity); - static CCSpriteBatchNode* spriteSheetWithFile(const char* fileImage, unsigned int capacity); // deprecated /** initializes a CCSpriteBatchNode with a texture2d and capacity of children. The capacity will be increased in 33% in runtime if it run out of space. @@ -112,25 +108,6 @@ namespace cocos2d void increaseAtlasCapacity(); - /** creates an sprite with a rect in the CCSpriteBatchNode. - It's the same as: - - create an standard CCSsprite - - set the usingSpriteSheet = YES - - set the textureAtlas to the same texture Atlas as the CCSpriteBatchNode - @deprecated Use [CCSprite spriteWithBatchNode:rect:] instead; - */ - CCSprite* createSpriteWithRect(CCRect rect); - - /** initializes a previously created sprite with a rect. This sprite will have the same texture as the CCSpriteBatchNode. - It's the same as: - - initialize an standard CCSsprite - - set the usingBatchNode = YES - - set the textureAtlas to the same texture Atlas as the CCSpriteBatchNode - @since v0.99.0 - @deprecated Use [CCSprite initWithBatchNode:rect:] instead; - */ - void initSprite(CCSprite *sprite, CCRect rect); - /** removes a child given a certain index. It will also cleanup the running actions depending on the cleanup parameter. @warning Removing a child from a CCSpriteBatchNode is very slow */ diff --git a/cocos2dx/include/CCSpriteFrameCache.h b/cocos2dx/include/CCSpriteFrameCache.h index 80da56e330..9b29cc32d6 100644 --- a/cocos2dx/include/CCSpriteFrameCache.h +++ b/cocos2dx/include/CCSpriteFrameCache.h @@ -117,13 +117,6 @@ public: */ CCSpriteFrame* spriteFrameByName(const char *pszName); - /** Creates an sprite with the name of an sprite frame. - The created sprite will contain the texture, rect and offset of the sprite frame. - It returns an autorelease object. - @deprecated use CCSprite::spriteWithSpriteFrameName(name). This method will be removed on final v0.9 - */ - CCSprite* createSpriteWithFrameName(const char *pszName); - public: /** Returns the shared instance of the Sprite Frame cache */ static CCSpriteFrameCache* sharedSpriteFrameCache(void); diff --git a/cocos2dx/include/CCTMXTiledMap.h b/cocos2dx/include/CCTMXTiledMap.h index 4447a2f3d3..452e7b6cf6 100644 --- a/cocos2dx/include/CCTMXTiledMap.h +++ b/cocos2dx/include/CCTMXTiledMap.h @@ -128,11 +128,6 @@ namespace cocos2d { /** return the TMXObjectGroup for the secific group */ CCTMXObjectGroup* objectGroupNamed(const char *groupName); - /** return the TMXObjectGroup for the secific group - @deprecated Use map#objectGroupNamed instead - */ - CCTMXObjectGroup* groupNamed(const char *groupName); - /** return the value for the specific property name */ CCString *propertyNamed(const char *propertyName); diff --git a/cocos2dx/include/cocos2d.h b/cocos2dx/include/cocos2d.h index 19fbcaee8f..59c5f51ab8 100644 --- a/cocos2dx/include/cocos2d.h +++ b/cocos2dx/include/cocos2d.h @@ -28,6 +28,10 @@ THE SOFTWARE. #ifndef __COCOS2D_H__ #define __COCOS2D_H__ +// 0x00 HI ME LO +// 00 01 00 01 +#define COCOS2D_VERSION 0x00010001 + // // all cocos2d include files // diff --git a/cocos2dx/label_nodes/CCLabelAtlas.cpp b/cocos2dx/label_nodes/CCLabelAtlas.cpp index 9edc543eff..b3a585a158 100644 --- a/cocos2dx/label_nodes/CCLabelAtlas.cpp +++ b/cocos2dx/label_nodes/CCLabelAtlas.cpp @@ -44,11 +44,6 @@ namespace cocos2d{ return NULL; } - CCLabelAtlas * CCLabelAtlas::labelAtlasWithString(const char *label, const char *charMapFile, unsigned int itemWidth, unsigned int itemHeight, unsigned char startCharMap) - { - return labelWithString(label, charMapFile, itemWidth, itemHeight, startCharMap); - } - bool CCLabelAtlas::initWithString(const char *label, const char *charMapFile, unsigned int itemWidth, unsigned int itemHeight, unsigned char startCharMap) { assert(label != NULL); diff --git a/cocos2dx/label_nodes/CCLabelBMFont.cpp b/cocos2dx/label_nodes/CCLabelBMFont.cpp index 34b077253c..2bbe45067a 100644 --- a/cocos2dx/label_nodes/CCLabelBMFont.cpp +++ b/cocos2dx/label_nodes/CCLabelBMFont.cpp @@ -392,11 +392,6 @@ namespace cocos2d{ return NULL; } - CCLabelBMFont * CCLabelBMFont::bitmapFontAtlasWithString(const char *str, const char *fntFile) - { - return labelWithString(str, fntFile); - } - bool CCLabelBMFont::initWithString(const char *theString, const char *fntFile) { assert(theString != NULL); diff --git a/cocos2dx/layers_scenes_transitions_nodes/CCLayer.cpp b/cocos2dx/layers_scenes_transitions_nodes/CCLayer.cpp index 1eb963f45c..6f7bad65d5 100644 --- a/cocos2dx/layers_scenes_transitions_nodes/CCLayer.cpp +++ b/cocos2dx/layers_scenes_transitions_nodes/CCLayer.cpp @@ -469,33 +469,6 @@ void CCLayerColor::draw() glEnable(GL_TEXTURE_2D); } -// -// CCColorLayer -// -CCColorLayer* CCColorLayer::layerWithColorWidthHeight(ccColor4B color, GLfloat width, GLfloat height) -{ - CCColorLayer * pLayer = new CCColorLayer(); - if( pLayer && pLayer->initWithColorWidthHeight(color,width,height)) - { - pLayer->autorelease(); - return pLayer; - } - CC_SAFE_DELETE(pLayer); - return NULL; -} - -CCColorLayer* CCColorLayer::layerWithColor(ccColor4B color) -{ - CCColorLayer * pLayer = new CCColorLayer(); - if(pLayer && pLayer->initWithColor(color)) - { - pLayer->autorelease(); - return pLayer; - } - CC_SAFE_DELETE(pLayer); - return NULL; -} - // // CCLayerGradient // diff --git a/cocos2dx/menu_nodes/CCMenu.cpp b/cocos2dx/menu_nodes/CCMenu.cpp index 373dda9238..fb204719a7 100644 --- a/cocos2dx/menu_nodes/CCMenu.cpp +++ b/cocos2dx/menu_nodes/CCMenu.cpp @@ -77,11 +77,11 @@ namespace cocos2d{ return menuWithItems(item, NULL); } - bool CCMenu::init() - { - va_list args; - return initWithItems(0, args); - } + bool CCMenu::init() + { + va_list args = NULL; + return initWithItems(0, args); + } bool CCMenu::initWithItems(CCMenuItem* item, va_list args) { @@ -174,6 +174,15 @@ namespace cocos2d{ { return false; } + + for (CCNode *c = this->m_pParent; c != NULL; c = c->getParent()) + { + if (c->getIsVisible() == false) + { + return false; + } + } + m_pSelectedItem = this->itemForTouch(touch); if (m_pSelectedItem) { diff --git a/cocos2dx/sprite_nodes/CCAnimation.cpp b/cocos2dx/sprite_nodes/CCAnimation.cpp index 6994a69c24..e44289d2fd 100644 --- a/cocos2dx/sprite_nodes/CCAnimation.cpp +++ b/cocos2dx/sprite_nodes/CCAnimation.cpp @@ -65,42 +65,6 @@ namespace cocos2d return pAnimation; } - CCAnimation* CCAnimation::animationWithName(const char *pszName) - { - CCAnimation *pAnimation = new CCAnimation(); - pAnimation->initWithName(pszName); - pAnimation->autorelease(); - - return pAnimation; - } - - CCAnimation* CCAnimation::animationWithName(const char *pszName, CCMutableArray *pFrames) - { - CCAnimation *pAnimation = new CCAnimation(); - pAnimation->initWithName(pszName, pFrames); - pAnimation->autorelease(); - - return pAnimation; - } - - CCAnimation* CCAnimation::animationWithName(const char *pszName, float fDelay, CCMutableArray *pFrames) - { - CCAnimation *pAnimation = new CCAnimation(); - pAnimation->initWithName(pszName, fDelay, pFrames); - pAnimation->autorelease(); - - return pAnimation; - } - - CCAnimation* CCAnimation::animationWithName(const char *pszName, float fDelay) - { - CCAnimation *pAnimation = new CCAnimation(); - pAnimation->initWithName(pszName, fDelay); - pAnimation->autorelease(); - - return pAnimation; - } - bool CCAnimation::initWithFrames(CCMutableArray *pFrames, float delay) { m_fDelay = delay; @@ -115,31 +79,6 @@ namespace cocos2d return initWithFrames(pFrames, 0); } - bool CCAnimation::initWithName(const char *pszName) - { - return initWithName(pszName, 0, NULL); - } - - bool CCAnimation::initWithName(const char *pszName, float fDelay) - { - return initWithName(pszName, fDelay, NULL); - } - - bool CCAnimation::initWithName(const char *pszName, CCMutableArray *pFrames) - { - return initWithName(pszName, 0, pFrames); - } - - bool CCAnimation::initWithName(const char *pszName, float fDelay, CCMutableArray *pFrames) - { - m_fDelay = fDelay; - m_nameStr = pszName; - m_pobFrames = CCMutableArray::arrayWithArray(pFrames); - m_pobFrames->retain(); - - return true; - } - CCAnimation::~CCAnimation(void) { CCLOGINFO("cocos2d, deallocing %p", this); diff --git a/cocos2dx/sprite_nodes/CCSprite.cpp b/cocos2dx/sprite_nodes/CCSprite.cpp index 5404fc16bc..1cbc637570 100644 --- a/cocos2dx/sprite_nodes/CCSprite.cpp +++ b/cocos2dx/sprite_nodes/CCSprite.cpp @@ -195,9 +195,6 @@ bool CCSprite::init(void) m_bFlipX = m_bFlipY = false; - // lazy alloc - m_pAnimations = NULL; - // default transform anchor: center setAnchorPoint(ccp(0.5f, 0.5f)); @@ -332,7 +329,6 @@ CCSprite::CCSprite() CCSprite::~CCSprite(void) { CC_SAFE_RELEASE(m_pobTexture); - CC_SAFE_RELEASE(m_pAnimations); } void CCSprite::useSelfRender(void) @@ -360,11 +356,6 @@ void CCSprite::useBatchNode(CCSpriteBatchNode *batchNode) m_pobBatchNode = batchNode; } -void CCSprite::initAnimationDictionary(void) -{ - m_pAnimations = new CCMutableDictionary(); -} - void CCSprite::setTextureRect(CCRect rect) { CCRect rectInPixels = CC_RECT_POINTS_TO_PIXELS(rect); @@ -1039,22 +1030,6 @@ void CCSprite::setDisplayFrame(CCSpriteFrame *pNewFrame) setTextureRectInPixels(pNewFrame->getRectInPixels(), pNewFrame->isRotated(), pNewFrame->getOriginalSizeInPixels()); } -// XXX deprecated -void CCSprite::setDisplayFrame(const char *pszAnimationName, int nFrameIndex) -{ - if (! m_pAnimations) - { - initAnimationDictionary(); - } - - CCAnimation *pAnimation = m_pAnimations->objectForKey(std::string(pszAnimationName)); - CCSpriteFrame *pFrame = pAnimation->getFrames()->getObjectAtIndex(nFrameIndex); - - assert(pFrame); - - setDisplayFrame(pFrame); -} - void CCSprite::setDisplayFrameWithAnimationName(const char *animationName, int frameIndex) { assert(animationName); @@ -1087,24 +1062,6 @@ CCSpriteFrame* CCSprite::displayedFrame(void) m_tContentSizeInPixels); } -void CCSprite::addAnimation(CCAnimation *pAnimation) -{ - // lazy alloc - if (! m_pAnimations) - { - initAnimationDictionary(); - } - - m_pAnimations->setObject(pAnimation, pAnimation->getName()); -} - -CCAnimation* CCSprite::animationByName(const char *pszAnimationName) -{ - assert(pszAnimationName != NULL); - - return m_pAnimations->objectForKey(std::string(pszAnimationName)); -} - // Texture protocol void CCSprite::updateBlendFunc(void) diff --git a/cocos2dx/sprite_nodes/CCSpriteBatchNode.cpp b/cocos2dx/sprite_nodes/CCSpriteBatchNode.cpp index 3d017b0ed3..d09620a40d 100644 --- a/cocos2dx/sprite_nodes/CCSpriteBatchNode.cpp +++ b/cocos2dx/sprite_nodes/CCSpriteBatchNode.cpp @@ -48,11 +48,6 @@ namespace cocos2d return batchNode; } - CCSpriteBatchNode* CCSpriteBatchNode::spriteSheetWithTexture(cocos2d::CCTexture2D *tex) - { - return batchNodeWithTexture(tex); - } - CCSpriteBatchNode* CCSpriteBatchNode::batchNodeWithTexture(CCTexture2D* tex, unsigned int capacity) { CCSpriteBatchNode *batchNode = new CCSpriteBatchNode(); @@ -62,11 +57,6 @@ namespace cocos2d return batchNode; } - CCSpriteBatchNode* CCSpriteBatchNode::spriteSheetWithTexture(CCTexture2D *tex, unsigned int capacity) - { - return batchNodeWithTexture(tex, capacity); - } - /* * creation with File Image */ @@ -79,11 +69,6 @@ namespace cocos2d return batchNode; } - CCSpriteBatchNode* CCSpriteBatchNode::spriteSheetWithFile(const char *fileImage, unsigned int capacity) - { - return batchNodeWithFile(fileImage, capacity); - } - CCSpriteBatchNode* CCSpriteBatchNode::batchNodeWithFile(const char *fileImage) { CCSpriteBatchNode *batchNode = new CCSpriteBatchNode(); @@ -93,11 +78,6 @@ namespace cocos2d return batchNode; } - CCSpriteBatchNode* CCSpriteBatchNode::spriteSheetWithFile(const char *fileImage) - { - return batchNodeWithFile(fileImage); - } - /* * init with CCTexture2D */ @@ -170,25 +150,6 @@ namespace cocos2d glPopMatrix(); } - // xxx deprecated - CCSprite* CCSpriteBatchNode::createSpriteWithRect(CCRect rect) - { - CCSprite *pSprite = CCSprite::spriteWithTexture(m_pobTextureAtlas->getTexture(), rect); - pSprite->useBatchNode(this); - - return pSprite; - } - - // XXX deprecated - void CCSpriteBatchNode::initSprite(cocos2d::CCSprite *sprite, cocos2d::CCRect rect) - { - if (sprite) - { - sprite->initWithTexture(m_pobTextureAtlas->getTexture(), rect); - sprite->useBatchNode(this); - } - } - void CCSpriteBatchNode::addChild(CCNode *child, int zOrder, int tag) { assert(child != NULL); diff --git a/cocos2dx/sprite_nodes/CCSpriteFrameCache.cpp b/cocos2dx/sprite_nodes/CCSpriteFrameCache.cpp index 78188410bc..877497b060 100644 --- a/cocos2dx/sprite_nodes/CCSpriteFrameCache.cpp +++ b/cocos2dx/sprite_nodes/CCSpriteFrameCache.cpp @@ -388,11 +388,6 @@ CCSpriteFrame* CCSpriteFrameCache::spriteFrameByName(const char *pszName) return frame; } -CCSprite* CCSpriteFrameCache::createSpriteWithFrameName(const char *pszName) -{ - CCSpriteFrame *frame = m_pSpriteFrames->objectForKey(std::string(pszName)); - return CCSprite::spriteWithSpriteFrame(frame); -} const char * CCSpriteFrameCache::valueForKey(const char *key, CCDictionary *dict) { if (dict) diff --git a/cocos2dx/tileMap_parallax_nodes/CCTMXTiledMap.cpp b/cocos2dx/tileMap_parallax_nodes/CCTMXTiledMap.cpp index 3d0e6e18dc..752c47df3f 100644 --- a/cocos2dx/tileMap_parallax_nodes/CCTMXTiledMap.cpp +++ b/cocos2dx/tileMap_parallax_nodes/CCTMXTiledMap.cpp @@ -227,11 +227,6 @@ namespace cocos2d{ return NULL; } - // XXX deprecated - CCTMXObjectGroup * CCTMXTiledMap::groupNamed(const char *groupName) - { - return objectGroupNamed(groupName); - } CCString * CCTMXTiledMap::propertyNamed(const char *propertyName) { return m_pProperties->objectForKey(std::string(propertyName)); diff --git a/tests/tests/ActionsTest/ActionsTest.cpp b/tests/tests/ActionsTest/ActionsTest.cpp index 73afb42d40..debf254d71 100644 --- a/tests/tests/ActionsTest/ActionsTest.cpp +++ b/tests/tests/ActionsTest/ActionsTest.cpp @@ -609,7 +609,7 @@ void ActionAnimate::onEnter() centerSprites(1); - CCAnimation* animation = CCAnimation::animationWithName("dance", 0.2f); + CCAnimation* animation = CCAnimation::animation(); char frameName[100] = {0}; for( int i=1;i<15;i++) { diff --git a/tests/tests/Box2DTest/Box2dTest.cpp b/tests/tests/Box2DTest/Box2dTest.cpp index 83a49feee7..48e13a5b06 100644 --- a/tests/tests/Box2DTest/Box2dTest.cpp +++ b/tests/tests/Box2DTest/Box2dTest.cpp @@ -120,7 +120,7 @@ void Box2DTestLayer::addNewSpriteWithCoords(CCPoint p) //just randomly picking one of the images int idx = (CCRANDOM_0_1() > .5 ? 0:1); int idy = (CCRANDOM_0_1() > .5 ? 0:1); - CCSprite *sprite = batch->createSpriteWithRect( CCRectMake(32 * idx,32 * idy,32,32)); + CCSprite *sprite = CCSprite::spriteWithTexture(batch->getTexture(), CCRectMake(32 * idx,32 * idy,32,32)); batch->addChild(sprite); sprite->setPosition( CCPointMake( p.x, p.y) );