From 685b70e6fbb03a71dbb79a1928b720eb0bd38eeb Mon Sep 17 00:00:00 2001 From: Walzer Date: Mon, 23 Jul 2012 22:49:11 +0800 Subject: [PATCH] =?UTF-8?q?fixed=20#1402,=20r=C3=A9solve=20conflicting=20"?= =?UTF-8?q?create"=20functions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. Following https://docs.google.com/document/d/1eqvYjVah0R9nkjzJ_ga1-_cyjHnizVQ5dyESYNpYM0s/edit?pli=1 2. use CCSequence/CCSpawn::initWithTwoActions, createWithTwoActions instead of initOneTwo, create(one, two). 3. haven't re-generate lua-binding to resolve the conflicts yet. --- cocos2dx/CCScheduler.cpp | 4 +- cocos2dx/actions/CCActionGrid.cpp | 4 +- cocos2dx/actions/CCActionInterval.cpp | 38 +++++++++---------- cocos2dx/actions/CCActionInterval.h | 8 ++-- cocos2dx/base_nodes/CCNode.cpp | 2 +- cocos2dx/cocoa/CCArray.cpp | 12 +++--- cocos2dx/cocoa/CCArray.h | 10 ++--- cocos2dx/cocoa/CCDictionary.cpp | 10 ++--- cocos2dx/cocoa/CCDictionary.h | 4 +- cocos2dx/cocoa/CCString.cpp | 6 +-- cocos2dx/cocoa/CCString.h | 2 +- cocos2dx/effects/CCGrid.cpp | 21 +++++++++- cocos2dx/effects/CCGrid.h | 25 +++++++++--- cocos2dx/label_nodes/CCLabelAtlas.cpp | 18 ++++----- cocos2dx/label_nodes/CCLabelAtlas.h | 10 ++--- .../CCLayer.cpp | 2 +- cocos2dx/menu_nodes/CCMenu.cpp | 4 +- cocos2dx/menu_nodes/CCMenu.h | 2 +- cocos2dx/menu_nodes/CCMenuItem.cpp | 8 ++-- cocos2dx/menu_nodes/CCMenuItem.h | 2 +- cocos2dx/misc_nodes/CCRenderTexture.cpp | 2 +- .../particle_nodes/CCParticleBatchNode.cpp | 4 +- cocos2dx/particle_nodes/CCParticleBatchNode.h | 2 +- cocos2dx/platform/CCPlatformMacros.h | 12 +++--- cocos2dx/sprite_nodes/CCAnimation.cpp | 10 ++--- cocos2dx/sprite_nodes/CCAnimation.h | 2 +- cocos2dx/sprite_nodes/CCAnimationCache.cpp | 6 +-- cocos2dx/sprite_nodes/CCSprite.cpp | 16 ++++---- cocos2dx/sprite_nodes/CCSprite.h | 6 +-- cocos2dx/sprite_nodes/CCSpriteBatchNode.cpp | 4 +- cocos2dx/sprite_nodes/CCSpriteBatchNode.h | 2 +- cocos2dx/sprite_nodes/CCSpriteFrame.cpp | 8 ++-- cocos2dx/sprite_nodes/CCSpriteFrame.h | 22 +++++------ cocos2dx/support/CCNotificationCenter.cpp | 2 +- cocos2dx/textures/CCTextureAtlas.cpp | 4 +- cocos2dx/textures/CCTextureAtlas.h | 2 +- cocos2dx/textures/CCTexturePVR.cpp | 5 +++ cocos2dx/textures/CCTexturePVR.h | 5 ++- .../tilemap_parallax_nodes/CCTMXLayer.cpp | 2 +- .../tilemap_parallax_nodes/CCTMXTiledMap.cpp | 4 +- .../tilemap_parallax_nodes/CCTMXTiledMap.h | 2 +- .../tilemap_parallax_nodes/CCTMXXMLParser.cpp | 2 +- .../touch_dispatcher/CCTouchDispatcher.cpp | 6 +-- extensions/CCBReader/CCBReader.cpp | 2 +- extensions/CCBReader/CCNodeLoader.cpp | 2 +- .../UI/CCControlExtension/CCControl.cpp | 2 +- .../UI/CCControlExtension/CCScale9Sprite.cpp | 22 +++++------ .../HelloLua.xcodeproj/project.pbxproj | 17 ++++----- .../Classes/ActionsTest/ActionsTest.cpp | 4 +- .../NotificationCenterTest.cpp | 4 +- .../TestCpp/Classes/LabelTest/LabelTest.cpp | 2 +- .../TestCpp/Classes/LayerTest/LayerTest.cpp | 2 +- samples/TestCpp/Classes/MenuTest/MenuTest.cpp | 8 ++-- .../MotionStreakTest/MotionStreakTest.cpp | 2 +- .../Classes/ParticleTest/ParticleTest.cpp | 10 ++--- .../PerformanceNodeChildrenTest.cpp | 16 ++++---- .../PerformanceTest/PerformanceSpriteTest.cpp | 8 ++-- .../RenderTextureTest/RenderTextureTest.cpp | 4 +- .../SpriteTest/SpriteTest.cpp.REMOVED.git-id | 2 +- .../Classes/Texture2dTest/Texture2dTest.cpp | 6 +-- .../Classes/TileMapTest/TileMapTest.cpp | 2 +- .../Classes/TouchesTest/TouchesTest.cpp | 2 +- .../Classes/ZwoptexTest/ZwoptexTest.cpp | 4 +- .../project.pbxproj.REMOVED.git-id | 2 +- .../LuaCocos2d.cpp.REMOVED.git-id | 2 +- 65 files changed, 242 insertions(+), 205 deletions(-) diff --git a/cocos2dx/CCScheduler.cpp b/cocos2dx/CCScheduler.cpp index c018783bd4..b3af500a14 100644 --- a/cocos2dx/CCScheduler.cpp +++ b/cocos2dx/CCScheduler.cpp @@ -485,7 +485,7 @@ void CCScheduler::removeUpdateFromHash(struct _listEntry *entry) HASH_DEL(m_pHashForUpdates, element); free(element); - // target#release should be the last one to prevent + // target#release should be the last one to prevent // a possible double-free. eg: If the [target dealloc] might want to remove it itself from there pTarget->release(); } @@ -608,7 +608,7 @@ unsigned int CCScheduler::scheduleScriptFunc(unsigned int nHandler, float fInter CCSchedulerScriptHandlerEntry* pEntry = CCSchedulerScriptHandlerEntry::entryWithHandler(nHandler, fInterval, bPaused); if (!m_pScriptHandlerEntries) { - m_pScriptHandlerEntries = CCArray::create(20); + m_pScriptHandlerEntries = CCArray::createWithCapacity(20); m_pScriptHandlerEntries->retain(); } m_pScriptHandlerEntries->addObject(pEntry); diff --git a/cocos2dx/actions/CCActionGrid.cpp b/cocos2dx/actions/CCActionGrid.cpp index cb0f32fe3a..b7466062e9 100644 --- a/cocos2dx/actions/CCActionGrid.cpp +++ b/cocos2dx/actions/CCActionGrid.cpp @@ -138,7 +138,7 @@ CCObject* CCGridAction::copyWithZone(CCZone *pZone) CCGridBase* CCGrid3DAction::getGrid(void) { - return CCGrid3D::gridWithSize(m_sGridSize); + return CCGrid3D::create(m_sGridSize); } ccVertex3F CCGrid3DAction::vertex(const ccGridSize& pos) @@ -163,7 +163,7 @@ void CCGrid3DAction::setVertex(const ccGridSize& pos, const ccVertex3F& vertex) CCGridBase* CCTiledGrid3DAction::getGrid(void) { - return CCTiledGrid3D::gridWithSize(m_sGridSize); + return CCTiledGrid3D::create(m_sGridSize); } ccQuad3 CCTiledGrid3DAction::tile(const ccGridSize& pos) diff --git a/cocos2dx/actions/CCActionInterval.cpp b/cocos2dx/actions/CCActionInterval.cpp index 745f914737..57d12e7ffa 100644 --- a/cocos2dx/actions/CCActionInterval.cpp +++ b/cocos2dx/actions/CCActionInterval.cpp @@ -153,13 +153,13 @@ CCActionInterval* CCActionInterval::reverse(void) // CCSequence* CCSequence::actionOneTwo(CCFiniteTimeAction *pActionOne, CCFiniteTimeAction *pActionTwo) { - return CCSequence::create(pActionOne, pActionTwo); + return CCSequence::createWithTwoActions(pActionOne, pActionTwo); } -CCSequence* CCSequence::create(CCFiniteTimeAction *pActionOne, CCFiniteTimeAction *pActionTwo) +CCSequence* CCSequence::createWithTwoActions(CCFiniteTimeAction *pActionOne, CCFiniteTimeAction *pActionTwo) { CCSequence *pSequence = new CCSequence(); - pSequence->initOneTwo(pActionOne, pActionTwo); + pSequence->initWithTwoActions(pActionOne, pActionTwo); pSequence->autorelease(); return pSequence; @@ -178,7 +178,7 @@ CCFiniteTimeAction* CCSequence::actions(CCFiniteTimeAction *pAction1, ...) pNow = va_arg(params, CCFiniteTimeAction*); if (pNow) { - pPrev = CCSequence::create(pPrev, pNow); + pPrev = CCSequence::createWithTwoActions(pPrev, pNow); } else { @@ -203,7 +203,7 @@ CCFiniteTimeAction* CCSequence::create(CCFiniteTimeAction *pAction1, ...) pNow = va_arg(params, CCFiniteTimeAction*); if (pNow) { - pPrev = create(pPrev, pNow); + pPrev = createWithTwoActions(pPrev, pNow); } else { @@ -226,13 +226,13 @@ CCFiniteTimeAction* CCSequence::create(CCArray* arrayOfActions) for (unsigned int i = 1; i < arrayOfActions->count(); ++i) { - prev = create(prev, (CCFiniteTimeAction*)arrayOfActions->objectAtIndex(i)); + prev = createWithTwoActions(prev, (CCFiniteTimeAction*)arrayOfActions->objectAtIndex(i)); } return prev; } -bool CCSequence::initOneTwo(CCFiniteTimeAction *pActionOne, CCFiniteTimeAction *pActionTwo) +bool CCSequence::initWithTwoActions(CCFiniteTimeAction *pActionOne, CCFiniteTimeAction *pActionTwo) { CCAssert(pActionOne != NULL, ""); CCAssert(pActionTwo != NULL, ""); @@ -266,7 +266,7 @@ CCObject* CCSequence::copyWithZone(CCZone *pZone) CCActionInterval::copyWithZone(pZone); - pCopy->initOneTwo((CCFiniteTimeAction*)(m_pActions[0]->copy()->autorelease()), + pCopy->initWithTwoActions((CCFiniteTimeAction*)(m_pActions[0]->copy()->autorelease()), (CCFiniteTimeAction*)(m_pActions[1]->copy()->autorelease())); CC_SAFE_DELETE(pNewZone); @@ -347,7 +347,7 @@ void CCSequence::update(float t) CCActionInterval* CCSequence::reverse(void) { - return CCSequence::create(m_pActions[1]->reverse(), m_pActions[0]->reverse()); + return CCSequence::createWithTwoActions(m_pActions[1]->reverse(), m_pActions[0]->reverse()); } // @@ -585,7 +585,7 @@ CCFiniteTimeAction* CCSpawn::actions(CCFiniteTimeAction *pAction1, ...) pNow = va_arg(params, CCFiniteTimeAction*); if (pNow) { - pPrev = CCSpawn::create(pPrev, pNow); + pPrev = CCSpawn::createWithTwoActions(pPrev, pNow); } else { @@ -610,7 +610,7 @@ CCFiniteTimeAction* CCSpawn::create(CCFiniteTimeAction *pAction1, ...) pNow = va_arg(params, CCFiniteTimeAction*); if (pNow) { - pPrev = create(pPrev, pNow); + pPrev = createWithTwoActions(pPrev, pNow); } else { @@ -633,7 +633,7 @@ CCFiniteTimeAction* CCSpawn::create(CCArray *arrayOfActions) for (unsigned int i = 1; i < arrayOfActions->count(); ++i) { - prev = create(prev, (CCFiniteTimeAction*)arrayOfActions->objectAtIndex(i)); + prev = createWithTwoActions(prev, (CCFiniteTimeAction*)arrayOfActions->objectAtIndex(i)); } return prev; @@ -641,19 +641,19 @@ CCFiniteTimeAction* CCSpawn::create(CCArray *arrayOfActions) CCSpawn* CCSpawn::actionOneTwo(CCFiniteTimeAction *pAction1, CCFiniteTimeAction *pAction2) { - return CCSpawn::create(pAction1, pAction2); + return CCSpawn::createWithTwoActions(pAction1, pAction2); } -CCSpawn* CCSpawn::create(CCFiniteTimeAction *pAction1, CCFiniteTimeAction *pAction2) +CCSpawn* CCSpawn::createWithTwoActions(CCFiniteTimeAction *pAction1, CCFiniteTimeAction *pAction2) { CCSpawn *pSpawn = new CCSpawn(); - pSpawn->initOneTwo(pAction1, pAction2); + pSpawn->initWithTwoActions(pAction1, pAction2); pSpawn->autorelease(); return pSpawn; } -bool CCSpawn:: initOneTwo(CCFiniteTimeAction *pAction1, CCFiniteTimeAction *pAction2) +bool CCSpawn:: initWithTwoActions(CCFiniteTimeAction *pAction1, CCFiniteTimeAction *pAction2) { CCAssert(pAction1 != NULL, ""); CCAssert(pAction2 != NULL, ""); @@ -705,7 +705,7 @@ CCObject* CCSpawn::copyWithZone(CCZone *pZone) CCActionInterval::copyWithZone(pZone); - pCopy->initOneTwo((CCFiniteTimeAction*)(m_pOne->copy()->autorelease()), + pCopy->initWithTwoActions((CCFiniteTimeAction*)(m_pOne->copy()->autorelease()), (CCFiniteTimeAction*)(m_pTwo->copy()->autorelease())); CC_SAFE_DELETE(pNewZone); @@ -746,7 +746,7 @@ void CCSpawn::update(float time) CCActionInterval* CCSpawn::reverse(void) { - return CCSpawn::create(m_pOne->reverse(), m_pTwo->reverse()); + return CCSpawn::createWithTwoActions(m_pOne->reverse(), m_pTwo->reverse()); } // @@ -2380,7 +2380,7 @@ void CCAnimate::update(float t) CCActionInterval* CCAnimate::reverse(void) { CCArray* pOldArray = m_pAnimation->getFrames(); - CCArray* pNewArray = CCArray::create(pOldArray->count()); + CCArray* pNewArray = CCArray::createWithCapacity(pOldArray->count()); CCARRAY_VERIFY_TYPE(pOldArray, CCAnimationFrame*); diff --git a/cocos2dx/actions/CCActionInterval.h b/cocos2dx/actions/CCActionInterval.h index 708b4b7820..95345b4c5a 100644 --- a/cocos2dx/actions/CCActionInterval.h +++ b/cocos2dx/actions/CCActionInterval.h @@ -103,7 +103,7 @@ public: ~CCSequence(void); /** initializes the action */ - bool initOneTwo(CCFiniteTimeAction *pActionOne, CCFiniteTimeAction *pActionTwo); + bool initWithTwoActions(CCFiniteTimeAction *pActionOne, CCFiniteTimeAction *pActionTwo); virtual CCObject* copyWithZone(CCZone* pZone); virtual void startWithTarget(CCNode *pTarget); @@ -130,7 +130,7 @@ public: /** helper contructor to create an array of sequenceable actions given an array */ static CCFiniteTimeAction* create(CCArray *arrayOfActions); /** creates the action */ - static CCSequence* create(CCFiniteTimeAction *pActionOne, CCFiniteTimeAction *pActionTwo); + static CCSequence* createWithTwoActions(CCFiniteTimeAction *pActionOne, CCFiniteTimeAction *pActionTwo); protected: CCFiniteTimeAction *m_pActions[2]; @@ -243,7 +243,7 @@ public: ~CCSpawn(void); /** initializes the Spawn action with the 2 actions to spawn */ - bool initOneTwo(CCFiniteTimeAction *pAction1, CCFiniteTimeAction *pAction2); + bool initWithTwoActions(CCFiniteTimeAction *pAction1, CCFiniteTimeAction *pAction2); virtual CCObject* copyWithZone(CCZone* pZone); virtual void startWithTarget(CCNode *pTarget); @@ -274,7 +274,7 @@ public: static CCFiniteTimeAction* create(CCArray *arrayOfActions); /** creates the Spawn action */ - static CCSpawn* create(CCFiniteTimeAction *pAction1, CCFiniteTimeAction *pAction2); + static CCSpawn* createWithTwoActions(CCFiniteTimeAction *pAction1, CCFiniteTimeAction *pAction2); protected: CCFiniteTimeAction *m_pOne; diff --git a/cocos2dx/base_nodes/CCNode.cpp b/cocos2dx/base_nodes/CCNode.cpp index 4e45ed7d34..d6b077181d 100644 --- a/cocos2dx/base_nodes/CCNode.cpp +++ b/cocos2dx/base_nodes/CCNode.cpp @@ -467,7 +467,7 @@ const char* CCNode::description() // lazy allocs void CCNode::childrenAlloc(void) { - m_pChildren = CCArray::create(4); + m_pChildren = CCArray::createWithCapacity(4); m_pChildren->retain(); } diff --git a/cocos2dx/cocoa/CCArray.cpp b/cocos2dx/cocoa/CCArray.cpp index 63c6d8ad8f..1178685dec 100644 --- a/cocos2dx/cocoa/CCArray.cpp +++ b/cocos2dx/cocoa/CCArray.cpp @@ -136,10 +136,10 @@ CCArray* CCArray::create(CCObject* pObject, ...) CCArray* CCArray::arrayWithCapacity(unsigned int capacity) { - return CCArray::create(capacity); + return CCArray::createWithCapacity(capacity); } -CCArray* CCArray::create(unsigned int capacity) +CCArray* CCArray::createWithCapacity(unsigned int capacity) { CCArray* pArray = new CCArray(); @@ -157,10 +157,10 @@ CCArray* CCArray::create(unsigned int capacity) CCArray* CCArray::arrayWithArray(CCArray* otherArray) { - return CCArray::create(otherArray); + return CCArray::createWithArray(otherArray); } -CCArray* CCArray::create(CCArray* otherArray) +CCArray* CCArray::createWithArray(CCArray* otherArray) { CCArray* pRet = (CCArray*)otherArray->copy(); pRet->autorelease(); @@ -169,10 +169,10 @@ CCArray* CCArray::create(CCArray* otherArray) CCArray* CCArray::arrayWithContentsOfFile(const char* pFileName) { - return CCArray::create(pFileName); + return CCArray::createWithContentsOfFile(pFileName); } -CCArray* CCArray::create(const char* pFileName) +CCArray* CCArray::createWithContentsOfFile(const char* pFileName) { CCArray* pRet = CCArray::createWithContentsOfFileThreadSafe(pFileName); if (pRet != NULL) diff --git a/cocos2dx/cocoa/CCArray.h b/cocos2dx/cocoa/CCArray.h index 5f69be05f3..b0eecdd118 100644 --- a/cocos2dx/cocoa/CCArray.h +++ b/cocos2dx/cocoa/CCArray.h @@ -152,20 +152,20 @@ public: /** Create an array */ static CCArray* create(); - /** Create an array with one object */ - static CCArray* createWithObject(CCObject* pObject); /** Create an array with some objects */ static CCArray* create(CCObject* pObject, ...); + /** Create an array with one object */ + static CCArray* createWithObject(CCObject* pObject); /** Create an array with capacity */ - static CCArray* create(unsigned int capacity); + static CCArray* createWithCapacity(unsigned int capacity); /** Create an array with an existing array */ - static CCArray* create(CCArray* otherArray); + static CCArray* createWithArray(CCArray* otherArray); /** @brief Generate a CCArray pointer by file @param pFileName The file name of *.plist file @return The CCArray pointer generated from the file */ - static CCArray* create(const char* pFileName); + static CCArray* createWithContentsOfFile(const char* pFileName); /* @brief The same meaning as arrayWithContentsOfFile(), but it doesn't call autorelease, so the diff --git a/cocos2dx/cocoa/CCDictionary.cpp b/cocos2dx/cocoa/CCDictionary.cpp index a413f539ec..990fbac698 100644 --- a/cocos2dx/cocoa/CCDictionary.cpp +++ b/cocos2dx/cocoa/CCDictionary.cpp @@ -29,7 +29,7 @@ CCArray* CCDictionary::allKeys() int iKeyCount = this->count(); if (iKeyCount <= 0) return NULL; - CCArray* pArray = CCArray::create(iKeyCount); + CCArray* pArray = CCArray::createWithCapacity(iKeyCount); CCDictElement *pElement, *tmp; if (m_eDictType == kCCDictStr) @@ -309,10 +309,10 @@ CCDictionary* CCDictionary::create() CCDictionary* CCDictionary::dictionaryWithDictionary(CCDictionary* srcDict) { - return CCDictionary::create(srcDict); + return CCDictionary::createWithDictionary(srcDict); } -CCDictionary* CCDictionary::create(CCDictionary* srcDict) +CCDictionary* CCDictionary::createWithDictionary(CCDictionary* srcDict) { CCDictionary* pNewDict = (CCDictionary*)srcDict->copy(); pNewDict->autorelease(); @@ -333,10 +333,10 @@ CCDictionary* CCDictionary::createWithContentsOfFileThreadSafe(const char *pFile CCDictionary* CCDictionary::dictionaryWithContentsOfFile(const char *pFileName) { - return CCDictionary::create(pFileName); + return CCDictionary::createWithContentsOfFile(pFileName); } -CCDictionary* CCDictionary::create(const char *pFileName) +CCDictionary* CCDictionary::createWithContentsOfFile(const char *pFileName) { CCDictionary* pRet = createWithContentsOfFileThreadSafe(pFileName); pRet->autorelease(); diff --git a/cocos2dx/cocoa/CCDictionary.h b/cocos2dx/cocoa/CCDictionary.h index ec54485d30..c6f8e3392f 100644 --- a/cocos2dx/cocoa/CCDictionary.h +++ b/cocos2dx/cocoa/CCDictionary.h @@ -163,13 +163,13 @@ public: static CCDictionary* create(); - static CCDictionary* create(CCDictionary* srcDict); + static CCDictionary* createWithDictionary(CCDictionary* srcDict); /** @brief Generate a CCDictionary pointer by file @param pFileName The file name of *.plist file @return The CCDictionary pointer generated from the file */ - static CCDictionary* create(const char *pFileName); + static CCDictionary* createWithContentsOfFile(const char *pFileName); /* @brief The same meaning as dictionaryWithContentsOfFile(), but it doesn't call autorelease, so the diff --git a/cocos2dx/cocoa/CCString.cpp b/cocos2dx/cocoa/CCString.cpp index 7e7407b692..f522d11eec 100644 --- a/cocos2dx/cocoa/CCString.cpp +++ b/cocos2dx/cocoa/CCString.cpp @@ -171,10 +171,10 @@ CCString* CCString::stringWithString(const std::string& pStr) CCString* CCString::stringWithData(const unsigned char* pData, unsigned long nLen) { - return CCString::create(pData, nLen); + return CCString::createWithData(pData, nLen); } -CCString* CCString::create(const unsigned char* pData, unsigned long nLen) +CCString* CCString::createWithData(const unsigned char* pData, unsigned long nLen) { CCString* pRet = NULL; if (pData != NULL) @@ -228,7 +228,7 @@ CCString* CCString::createWithContentsOfFile(const char* pszFileName) unsigned char* pData = 0; CCString* pRet = NULL; pData = CCFileUtils::sharedFileUtils()->getFileData(pszFileName, "rb", &size); - pRet = CCString::create(pData, size); + pRet = CCString::createWithData(pData, size); CC_SAFE_DELETE_ARRAY(pData); return pRet; } diff --git a/cocos2dx/cocoa/CCString.h b/cocos2dx/cocoa/CCString.h index 3084de461c..94912399a0 100644 --- a/cocos2dx/cocoa/CCString.h +++ b/cocos2dx/cocoa/CCString.h @@ -132,7 +132,7 @@ public: * @return A CCString pointer which is an autorelease object pointer, * it means that you needn't do a release operation unless you retain it. */ - static CCString* create(const unsigned char* pData, unsigned long nLen); + static CCString* createWithData(const unsigned char* pData, unsigned long nLen); /** create a string with a file, * @return A CCString pointer which is an autorelease object pointer, diff --git a/cocos2dx/effects/CCGrid.cpp b/cocos2dx/effects/CCGrid.cpp index d061564f95..4086810404 100644 --- a/cocos2dx/effects/CCGrid.cpp +++ b/cocos2dx/effects/CCGrid.cpp @@ -264,8 +264,12 @@ void CCGridBase::calculateVertexPoints(void) } // implementation of CCGrid3D - CCGrid3D* CCGrid3D::gridWithSize(const ccGridSize& gridSize, CCTexture2D *pTexture, bool bFlipped) +{ + return CCGrid3D::create(gridSize, pTexture, bFlipped); +} + +CCGrid3D* CCGrid3D::create(const ccGridSize& gridSize, CCTexture2D *pTexture, bool bFlipped) { CCGrid3D *pRet= new CCGrid3D(); @@ -286,6 +290,11 @@ CCGrid3D* CCGrid3D::gridWithSize(const ccGridSize& gridSize, CCTexture2D *pTextu } CCGrid3D* CCGrid3D::gridWithSize(const ccGridSize& gridSize) +{ + return CCGrid3D::create(gridSize); +} + +CCGrid3D* CCGrid3D::create(const ccGridSize& gridSize) { CCGrid3D *pRet= new CCGrid3D(); @@ -479,6 +488,11 @@ CCTiledGrid3D::~CCTiledGrid3D(void) } CCTiledGrid3D* CCTiledGrid3D::gridWithSize(const ccGridSize& gridSize, CCTexture2D *pTexture, bool bFlipped) +{ + return CCTiledGrid3D::create(gridSize, pTexture, bFlipped); +} + +CCTiledGrid3D* CCTiledGrid3D::create(const ccGridSize& gridSize, CCTexture2D *pTexture, bool bFlipped) { CCTiledGrid3D *pRet= new CCTiledGrid3D(); @@ -499,6 +513,11 @@ CCTiledGrid3D* CCTiledGrid3D::gridWithSize(const ccGridSize& gridSize, CCTexture } CCTiledGrid3D* CCTiledGrid3D::gridWithSize(const ccGridSize& gridSize) +{ + return CCTiledGrid3D::create(gridSize); +} + +CCTiledGrid3D* CCTiledGrid3D::create(const ccGridSize& gridSize) { CCTiledGrid3D *pRet= new CCTiledGrid3D(); diff --git a/cocos2dx/effects/CCGrid.h b/cocos2dx/effects/CCGrid.h index 23b116af55..df008373e3 100644 --- a/cocos2dx/effects/CCGrid.h +++ b/cocos2dx/effects/CCGrid.h @@ -130,9 +130,18 @@ public: virtual void calculateVertexPoints(void); public: - static CCGrid3D* gridWithSize(const ccGridSize& gridSize, CCTexture2D *pTexture, bool bFlipped); - static CCGrid3D* gridWithSize(const ccGridSize& gridSize); - + /** @deprecated: This interface will be deprecated sooner or later. + */ + CC_DEPRECATED_ATTRIBUTE static CCGrid3D* gridWithSize(const ccGridSize& gridSize, CCTexture2D *pTexture, bool bFlipped); + /** @deprecated: This interface will be deprecated sooner or later. + */ + CC_DEPRECATED_ATTRIBUTE static CCGrid3D* gridWithSize(const ccGridSize& gridSize); + + /** create one Grid */ + static CCGrid3D* create(const ccGridSize& gridSize, CCTexture2D *pTexture, bool bFlipped); + /** create one Grid */ + static CCGrid3D* create(const ccGridSize& gridSize); + protected: GLvoid *m_pTexCoordinates; GLvoid *m_pVertices; @@ -162,9 +171,13 @@ public: virtual void calculateVertexPoints(void); public: - static CCTiledGrid3D* gridWithSize(const ccGridSize& gridSize, CCTexture2D *pTexture, bool bFlipped); - static CCTiledGrid3D* gridWithSize(const ccGridSize& gridSize); - + CC_DEPRECATED_ATTRIBUTE static CCTiledGrid3D* gridWithSize(const ccGridSize& gridSize, CCTexture2D *pTexture, bool bFlipped); + CC_DEPRECATED_ATTRIBUTE static CCTiledGrid3D* gridWithSize(const ccGridSize& gridSize); + /** create one Grid */ + static CCTiledGrid3D* create(const ccGridSize& gridSize, CCTexture2D *pTexture, bool bFlipped); + /** create one Grid */ + static CCTiledGrid3D* create(const ccGridSize& gridSize); + protected: GLvoid *m_pTexCoordinates; GLvoid *m_pVertices; diff --git a/cocos2dx/label_nodes/CCLabelAtlas.cpp b/cocos2dx/label_nodes/CCLabelAtlas.cpp index a17d652cd0..5bf84f02f5 100644 --- a/cocos2dx/label_nodes/CCLabelAtlas.cpp +++ b/cocos2dx/label_nodes/CCLabelAtlas.cpp @@ -41,15 +41,15 @@ THE SOFTWARE. NS_CC_BEGIN //CCLabelAtlas - Creation & Init -CCLabelAtlas* CCLabelAtlas::labelWithString(const char *label, const char *charMapFile, unsigned int itemWidth, int unsigned itemHeight, unsigned int startCharMap) +CCLabelAtlas* CCLabelAtlas::labelWithString(const char *string, const char *charMapFile, unsigned int itemWidth, int unsigned itemHeight, unsigned int startCharMap) { - return CCLabelAtlas::create(label, charMapFile, itemWidth, itemHeight, startCharMap); + return CCLabelAtlas::create(string, charMapFile, itemWidth, itemHeight, startCharMap); } -CCLabelAtlas* CCLabelAtlas::create(const char *label, const char *charMapFile, unsigned int itemWidth, int unsigned itemHeight, unsigned int startCharMap) +CCLabelAtlas* CCLabelAtlas::create(const char *string, const char *charMapFile, unsigned int itemWidth, int unsigned itemHeight, unsigned int startCharMap) { CCLabelAtlas *pRet = new CCLabelAtlas(); - if(pRet && pRet->initWithString(label, charMapFile, itemWidth, itemHeight, startCharMap)) + if(pRet && pRet->initWithString(string, charMapFile, itemWidth, itemHeight, startCharMap)) { pRet->autorelease(); return pRet; @@ -58,13 +58,13 @@ CCLabelAtlas* CCLabelAtlas::create(const char *label, const char *charMapFile, u return NULL; } -bool CCLabelAtlas::initWithString(const char *label, const char *charMapFile, unsigned int itemWidth, unsigned int itemHeight, unsigned int startCharMap) +bool CCLabelAtlas::initWithString(const char *string, const char *charMapFile, unsigned int itemWidth, unsigned int itemHeight, unsigned int startCharMap) { - CCAssert(label != NULL, ""); - if (CCAtlasNode::initWithTileFile(charMapFile, itemWidth, itemHeight, strlen(label))) + CCAssert(string != NULL, ""); + if (CCAtlasNode::initWithTileFile(charMapFile, itemWidth, itemHeight, strlen(string))) { m_uMapStartChar = startCharMap; - this->setString(label); + this->setString(string); return true; } return false; @@ -95,7 +95,7 @@ CCLabelAtlas* CCLabelAtlas::create(const char *string, const char *fntFile) bool CCLabelAtlas::initWithString(const char *theString, const char *fntFile) { - CCDictionary *dict = CCDictionary::create(CCFileUtils::sharedFileUtils()->fullPathFromRelativePath(fntFile)); + CCDictionary *dict = CCDictionary::createWithContentsOfFile(CCFileUtils::sharedFileUtils()->fullPathFromRelativePath(fntFile)); CCAssert(((CCString*)dict->objectForKey("version"))->intValue() == 1, "Unsupported version. Upgrade cocos2d version"); diff --git a/cocos2dx/label_nodes/CCLabelAtlas.h b/cocos2dx/label_nodes/CCLabelAtlas.h index 997cecfc07..01cc8b8ec6 100644 --- a/cocos2dx/label_nodes/CCLabelAtlas.h +++ b/cocos2dx/label_nodes/CCLabelAtlas.h @@ -61,24 +61,24 @@ public: /** 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 @deprecated: This interface will be deprecated sooner or later. */ - CC_DEPRECATED_ATTRIBUTE static CCLabelAtlas * labelWithString(const char *label, const char *charMapFile, unsigned int itemWidth, unsigned int itemHeight, unsigned int startCharMap); + CC_DEPRECATED_ATTRIBUTE static CCLabelAtlas * labelWithString(const char *string, const char *charMapFile, unsigned int itemWidth, unsigned int itemHeight, unsigned int startCharMap); /** creates the CCLabelAtlas with a string and a configuration file @deprecated: This interface will be deprecated sooner or later. @since v2.0 */ - CC_DEPRECATED_ATTRIBUTE static CCLabelAtlas* labelWithString(const char *sring, const char *fntFile); + CC_DEPRECATED_ATTRIBUTE static CCLabelAtlas* labelWithString(const char *string, const char *fntFile); /** 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 * create(const char *label, const char *charMapFile, unsigned int itemWidth, unsigned int itemHeight, unsigned int startCharMap); + static CCLabelAtlas * create(const char *string, const char *charMapFile, unsigned int itemWidth, unsigned int itemHeight, unsigned int startCharMap); /** creates the CCLabelAtlas with a string and a configuration file @since v2.0 */ - static CCLabelAtlas* create(const char *sring, const char *fntFile); + static CCLabelAtlas* create(const char *string, const char *fntFile); /** 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 int startCharMap); + bool initWithString(const char *string, const char *charMapFile, unsigned int itemWidth, unsigned int itemHeight, unsigned int startCharMap); /** initializes the CCLabelAtlas with a string and a configuration file @since v2.0 diff --git a/cocos2dx/layers_scenes_transitions_nodes/CCLayer.cpp b/cocos2dx/layers_scenes_transitions_nodes/CCLayer.cpp index cf0e38aa49..958a6c68cc 100644 --- a/cocos2dx/layers_scenes_transitions_nodes/CCLayer.cpp +++ b/cocos2dx/layers_scenes_transitions_nodes/CCLayer.cpp @@ -797,7 +797,7 @@ void CCLayerMultiplex::addLayer(CCLayer* layer) bool CCLayerMultiplex::initWithLayers(CCLayer *layer, va_list params) { - m_pLayers = CCArray::create(5); + m_pLayers = CCArray::createWithCapacity(5); m_pLayers->retain(); m_pLayers->addObject(layer); diff --git a/cocos2dx/menu_nodes/CCMenu.cpp b/cocos2dx/menu_nodes/CCMenu.cpp index 1dfe17fc76..c3f3ddfa54 100644 --- a/cocos2dx/menu_nodes/CCMenu.cpp +++ b/cocos2dx/menu_nodes/CCMenu.cpp @@ -90,10 +90,10 @@ CCMenu * CCMenu::create(CCMenuItem* item, ...) CCMenu* CCMenu::menuWithArray(CCArray* pArrayOfItems) { - return CCMenu::create(pArrayOfItems); + return CCMenu::createWithArray(pArrayOfItems); } -CCMenu* CCMenu::create(CCArray* pArrayOfItems) +CCMenu* CCMenu::createWithArray(CCArray* pArrayOfItems) { CCMenu *pRet = new CCMenu(); if (pRet && pRet->initWithArray(pArrayOfItems)) diff --git a/cocos2dx/menu_nodes/CCMenu.h b/cocos2dx/menu_nodes/CCMenu.h index 669cf318a1..d636592c83 100644 --- a/cocos2dx/menu_nodes/CCMenu.h +++ b/cocos2dx/menu_nodes/CCMenu.h @@ -98,7 +98,7 @@ public: static CCMenu* create(CCMenuItem* item, ...); /** creates a CCMenu with a CCArray of CCMenuItem objects */ - static CCMenu* create(CCArray* pArrayOfItems); + static CCMenu* createWithArray(CCArray* pArrayOfItems); /** creates a CCMenu with it's item, then use addChild() to add * other items. It is used for script, it can't init with undetermined diff --git a/cocos2dx/menu_nodes/CCMenuItem.cpp b/cocos2dx/menu_nodes/CCMenuItem.cpp index 93df0ca76c..3c4875b50f 100644 --- a/cocos2dx/menu_nodes/CCMenuItem.cpp +++ b/cocos2dx/menu_nodes/CCMenuItem.cpp @@ -796,17 +796,17 @@ bool CCMenuItemImage::initWithNormalImage(const char *normalImage, const char *s // void CCMenuItemImage::setNormalSpriteFrame(CCSpriteFrame * frame) { - setNormalImage(CCSprite::create(frame)); + setNormalImage(CCSprite::createWithSpriteFrame(frame)); } void CCMenuItemImage::setSelectedSpriteFrame(CCSpriteFrame * frame) { - setSelectedImage(CCSprite::create(frame)); + setSelectedImage(CCSprite::createWithSpriteFrame(frame)); } void CCMenuItemImage::setDisabledSpriteFrame(CCSpriteFrame * frame) { - setDisabledImage(CCSprite::create(frame)); + setDisabledImage(CCSprite::createWithSpriteFrame(frame)); } // // MenuItemToggle @@ -834,7 +834,7 @@ CCMenuItemToggle * CCMenuItemToggle::itemWithTarget(CCObject* target, SEL_MenuHa return pRet; } -CCMenuItemToggle * CCMenuItemToggle::create(CCObject* target, SEL_MenuHandler selector, CCMenuItem* item, ...) +CCMenuItemToggle * CCMenuItemToggle::createWithTarget(CCObject* target, SEL_MenuHandler selector, CCMenuItem* item, ...) { va_list args; va_start(args, item); diff --git a/cocos2dx/menu_nodes/CCMenuItem.h b/cocos2dx/menu_nodes/CCMenuItem.h index af2b245f6e..0ec7bc4333 100644 --- a/cocos2dx/menu_nodes/CCMenuItem.h +++ b/cocos2dx/menu_nodes/CCMenuItem.h @@ -391,7 +391,7 @@ public: CC_DEPRECATED_ATTRIBUTE static CCMenuItemToggle* itemWithTarget(CCObject* target, SEL_MenuHandler selector, CCMenuItem* item, ...); /** creates a menu item from a list of items with a target/selector */ - static CCMenuItemToggle* create(CCObject* target, SEL_MenuHandler selector, CCMenuItem* item, ...); + static CCMenuItemToggle* createWithTarget(CCObject* target, SEL_MenuHandler selector, CCMenuItem* item, ...); /** initializes a menu item from a list of items with a target selector */ bool initWithTarget(CCObject* target, SEL_MenuHandler selector, CCMenuItem* item, va_list args); diff --git a/cocos2dx/misc_nodes/CCRenderTexture.cpp b/cocos2dx/misc_nodes/CCRenderTexture.cpp index f39b516296..1227e855be 100644 --- a/cocos2dx/misc_nodes/CCRenderTexture.cpp +++ b/cocos2dx/misc_nodes/CCRenderTexture.cpp @@ -228,7 +228,7 @@ bool CCRenderTexture::initWithWidthAndHeight(int w, int h, CCTexture2DPixelForma m_pTexture->setAliasTexParameters(); - m_pSprite = CCSprite::create(m_pTexture); + m_pSprite = CCSprite::createWithTexture(m_pTexture); m_pTexture->release(); m_pSprite->setScaleY(-1); diff --git a/cocos2dx/particle_nodes/CCParticleBatchNode.cpp b/cocos2dx/particle_nodes/CCParticleBatchNode.cpp index 94a105840f..86da441a9b 100644 --- a/cocos2dx/particle_nodes/CCParticleBatchNode.cpp +++ b/cocos2dx/particle_nodes/CCParticleBatchNode.cpp @@ -60,10 +60,10 @@ CCParticleBatchNode::~CCParticleBatchNode() */ CCParticleBatchNode* CCParticleBatchNode::batchNodeWithTexture(CCTexture2D *tex, unsigned int capacity/* = kCCParticleDefaultCapacity*/) { - return CCParticleBatchNode::create(tex, capacity); + return CCParticleBatchNode::createWithTexture(tex, capacity); } -CCParticleBatchNode* CCParticleBatchNode::create(CCTexture2D *tex, unsigned int capacity/* = kCCParticleDefaultCapacity*/) +CCParticleBatchNode* CCParticleBatchNode::createWithTexture(CCTexture2D *tex, unsigned int capacity/* = kCCParticleDefaultCapacity*/) { CCParticleBatchNode * p = new CCParticleBatchNode(); if( p && p->initWithTexture(tex, capacity)) diff --git a/cocos2dx/particle_nodes/CCParticleBatchNode.h b/cocos2dx/particle_nodes/CCParticleBatchNode.h index 59b9c6bbca..b02594273d 100644 --- a/cocos2dx/particle_nodes/CCParticleBatchNode.h +++ b/cocos2dx/particle_nodes/CCParticleBatchNode.h @@ -81,7 +81,7 @@ public: CC_DEPRECATED_ATTRIBUTE static CCParticleBatchNode* batchNodeWithFile(const char* fileImage, unsigned int capacity = kCCParticleDefaultCapacity); /** initializes the particle system with CCTexture2D, a capacity of particles, which particle system to use */ - static CCParticleBatchNode* create(CCTexture2D *tex, unsigned int capacity = kCCParticleDefaultCapacity); + static CCParticleBatchNode* createWithTexture(CCTexture2D *tex, unsigned int capacity = kCCParticleDefaultCapacity); /** initializes the particle system with the name of a file on disk (for a list of supported formats look at the CCTexture2D class), a capacity of particles */ static CCParticleBatchNode* create(const char* fileImage, unsigned int capacity = kCCParticleDefaultCapacity); diff --git a/cocos2dx/platform/CCPlatformMacros.h b/cocos2dx/platform/CCPlatformMacros.h index 0027ec3f84..7abab28297 100644 --- a/cocos2dx/platform/CCPlatformMacros.h +++ b/cocos2dx/platform/CCPlatformMacros.h @@ -194,12 +194,12 @@ public: virtual void set##funName(varType var) \ /* * only certain compilers support __attribute__((deprecated)) */ -#if defined(__GNUC__) && ((__GNUC__ >= 4) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1))) - #define CC_DEPRECATED_ATTRIBUTE __attribute__((deprecated)) -#elif _MSC_VER >= 1400 //vs 2005 or higher -#define CC_DEPRECATED_ATTRIBUTE __declspec(deprecated) -#else +// #if defined(__GNUC__) && ((__GNUC__ >= 4) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1))) +// #define CC_DEPRECATED_ATTRIBUTE __attribute__((deprecated)) +// #elif _MSC_VER >= 1400 //vs 2005 or higher +// #define CC_DEPRECATED_ATTRIBUTE __declspec(deprecated) +// #else #define CC_DEPRECATED_ATTRIBUTE -#endif +// #endif #endif // __CC_PLATFORM_MACROS_H__ diff --git a/cocos2dx/sprite_nodes/CCAnimation.cpp b/cocos2dx/sprite_nodes/CCAnimation.cpp index 068bc10e91..a914170a21 100644 --- a/cocos2dx/sprite_nodes/CCAnimation.cpp +++ b/cocos2dx/sprite_nodes/CCAnimation.cpp @@ -97,10 +97,10 @@ CCAnimation* CCAnimation::create(void) CCAnimation* CCAnimation::animationWithSpriteFrames(CCArray *frames, float delay/* = 0.0f*/) { - return CCAnimation::create(frames, delay); + return CCAnimation::createWithSpriteFrames(frames, delay); } -CCAnimation* CCAnimation::create(CCArray *frames, float delay/* = 0.0f*/) +CCAnimation* CCAnimation::createWithSpriteFrames(CCArray *frames, float delay/* = 0.0f*/) { CCAnimation *pAnimation = new CCAnimation(); pAnimation->initWithSpriteFrames(frames, delay); @@ -161,7 +161,7 @@ bool CCAnimation::initWithAnimationFrames(CCArray* arrayOfAnimationFrames, float m_fDelayPerUnit = delayPerUnit; m_uLoops = loops; - setFrames(CCArray::create(arrayOfAnimationFrames)); + setFrames(CCArray::createWithArray(arrayOfAnimationFrames)); CCObject* pObj = NULL; CCARRAY_FOREACH(m_pFrames, pObj) @@ -205,13 +205,13 @@ void CCAnimation::addSpriteFrameWithFileName(const char *pszFileName) CCTexture2D *pTexture = CCTextureCache::sharedTextureCache()->addImage(pszFileName); CCRect rect = CCRectZero; rect.size = pTexture->getContentSize(); - CCSpriteFrame *pFrame = CCSpriteFrame::create(pTexture, rect); + CCSpriteFrame *pFrame = CCSpriteFrame::createWithTexture(pTexture, rect); addSpriteFrame(pFrame); } void CCAnimation::addSpriteFrameWithTexture(CCTexture2D *pobTexture, const CCRect& rect) { - CCSpriteFrame *pFrame = CCSpriteFrame::create(pobTexture, rect); + CCSpriteFrame *pFrame = CCSpriteFrame::createWithTexture(pobTexture, rect); addSpriteFrame(pFrame); } diff --git a/cocos2dx/sprite_nodes/CCAnimation.h b/cocos2dx/sprite_nodes/CCAnimation.h index 3898fb6dc0..590fec5240 100644 --- a/cocos2dx/sprite_nodes/CCAnimation.h +++ b/cocos2dx/sprite_nodes/CCAnimation.h @@ -116,7 +116,7 @@ public: The frames will be added with one "delay unit". @since v0.99.5 */ - static CCAnimation* create(CCArray* arrayOfSpriteFrameNames, float delay = 0.0f); + static CCAnimation* createWithSpriteFrames(CCArray* arrayOfSpriteFrameNames, float delay = 0.0f); /* Creates an animation with an array of CCAnimationFrame, the delay per units in seconds and and how many times it should be executed. @since v2.0 diff --git a/cocos2dx/sprite_nodes/CCAnimationCache.cpp b/cocos2dx/sprite_nodes/CCAnimationCache.cpp index 973dc85740..0a6fdea4ac 100644 --- a/cocos2dx/sprite_nodes/CCAnimationCache.cpp +++ b/cocos2dx/sprite_nodes/CCAnimationCache.cpp @@ -108,7 +108,7 @@ void CCAnimationCache::parseVersion1(CCDictionary* animations) continue; } - CCArray* frames = CCArray::create(frameNames->count()); + CCArray* frames = CCArray::createWithCapacity(frameNames->count()); frames->retain(); CCObject* pObj = NULL; @@ -164,7 +164,7 @@ void CCAnimationCache::parseVersion2(CCDictionary* animations) } // Array of AnimationFrames - CCArray* array = CCArray::create(frameArray->count()); + CCArray* array = CCArray::createWithCapacity(frameArray->count()); array->retain(); CCObject* pObj = NULL; @@ -245,7 +245,7 @@ void CCAnimationCache::addAnimationsWithFile(const char* plist) CCAssert( plist, "Invalid texture file name"); const char* path = CCFileUtils::sharedFileUtils()->fullPathFromRelativePath(plist); - CCDictionary* dict = CCDictionary::create(path); + CCDictionary* dict = CCDictionary::createWithContentsOfFile(path); CCAssert( dict, "CCAnimationCache: File could not be found"); diff --git a/cocos2dx/sprite_nodes/CCSprite.cpp b/cocos2dx/sprite_nodes/CCSprite.cpp index 66c104bf19..d5ea15a0d4 100644 --- a/cocos2dx/sprite_nodes/CCSprite.cpp +++ b/cocos2dx/sprite_nodes/CCSprite.cpp @@ -60,10 +60,10 @@ NS_CC_BEGIN CCSprite* CCSprite::spriteWithTexture(CCTexture2D *pTexture) { - return CCSprite::create(pTexture); + return CCSprite::createWithTexture(pTexture); } -CCSprite* CCSprite::create(CCTexture2D *pTexture) +CCSprite* CCSprite::createWithTexture(CCTexture2D *pTexture) { CCSprite *pobSprite = new CCSprite(); if (pobSprite && pobSprite->initWithTexture(pTexture)) @@ -77,10 +77,10 @@ CCSprite* CCSprite::create(CCTexture2D *pTexture) CCSprite* CCSprite::spriteWithTexture(CCTexture2D *pTexture, const CCRect& rect) { - return CCSprite::create(pTexture, rect); + return CCSprite::createWithTexture(pTexture, rect); } -CCSprite* CCSprite::create(CCTexture2D *pTexture, const CCRect& rect) +CCSprite* CCSprite::createWithTexture(CCTexture2D *pTexture, const CCRect& rect) { CCSprite *pobSprite = new CCSprite(); if (pobSprite && pobSprite->initWithTexture(pTexture, rect)) @@ -128,10 +128,10 @@ CCSprite* CCSprite::create(const char *pszFileName, const CCRect& rect) CCSprite* CCSprite::spriteWithSpriteFrame(CCSpriteFrame *pSpriteFrame) { - return CCSprite::create(pSpriteFrame); + return CCSprite::createWithSpriteFrame(pSpriteFrame); } -CCSprite* CCSprite::create(CCSpriteFrame *pSpriteFrame) +CCSprite* CCSprite::createWithSpriteFrame(CCSpriteFrame *pSpriteFrame) { CCSprite *pobSprite = new CCSprite(); if (pobSprite && pobSprite->initWithSpriteFrame(pSpriteFrame)) @@ -155,7 +155,7 @@ CCSprite* CCSprite::createWithSpriteFrameName(const char *pszSpriteFrameName) char msg[256] = {0}; sprintf(msg, "Invalid spriteFrameName: %s", pszSpriteFrameName); CCAssert(pFrame != NULL, msg); - return create(pFrame); + return createWithSpriteFrame(pFrame); } CCSprite* CCSprite::node() @@ -1023,7 +1023,7 @@ bool CCSprite::isFrameDisplayed(CCSpriteFrame *pFrame) CCSpriteFrame* CCSprite::displayFrame(void) { - return CCSpriteFrame::create(m_pobTexture, + return CCSpriteFrame::createWithTexture(m_pobTexture, CC_RECT_POINTS_TO_PIXELS(m_obRect), m_bRectRotated, m_obUnflippedOffsetPositionFromCenter, diff --git a/cocos2dx/sprite_nodes/CCSprite.h b/cocos2dx/sprite_nodes/CCSprite.h index 0c44ca27bd..b4f96e482c 100644 --- a/cocos2dx/sprite_nodes/CCSprite.h +++ b/cocos2dx/sprite_nodes/CCSprite.h @@ -142,12 +142,12 @@ public: The rect used will be the size of the texture. The offset will be (0,0). */ - static CCSprite* create(CCTexture2D *pTexture); + static CCSprite* createWithTexture(CCTexture2D *pTexture); /** Creates an sprite with a texture and a rect. The offset will be (0,0). */ - static CCSprite* create(CCTexture2D *pTexture, const CCRect& rect); + static CCSprite* createWithTexture(CCTexture2D *pTexture, const CCRect& rect); /** Creates an sprite with an sprite frame. @deprecated: This interface will be deprecated sooner or later. @@ -163,7 +163,7 @@ public: CC_DEPRECATED_ATTRIBUTE static CCSprite* spriteWithSpriteFrameName(const char *pszSpriteFrameName); /** Creates an sprite with an sprite frame. */ - static CCSprite* create(CCSpriteFrame *pSpriteFrame); + static CCSprite* createWithSpriteFrame(CCSpriteFrame *pSpriteFrame); /** Creates an sprite with an sprite frame name. An CCSpriteFrame will be fetched from the CCSpriteFrameCache by name. diff --git a/cocos2dx/sprite_nodes/CCSpriteBatchNode.cpp b/cocos2dx/sprite_nodes/CCSpriteBatchNode.cpp index 4f31949437..ac82b54d03 100644 --- a/cocos2dx/sprite_nodes/CCSpriteBatchNode.cpp +++ b/cocos2dx/sprite_nodes/CCSpriteBatchNode.cpp @@ -48,10 +48,10 @@ NS_CC_BEGIN CCSpriteBatchNode* CCSpriteBatchNode::batchNodeWithTexture(CCTexture2D* tex, unsigned int capacity/* = kDefaultSpriteBatchCapacity*/) { - return CCSpriteBatchNode::create(tex, capacity); + return CCSpriteBatchNode::createWithTexture(tex, capacity); } -CCSpriteBatchNode* CCSpriteBatchNode::create(CCTexture2D* tex, unsigned int capacity/* = kDefaultSpriteBatchCapacity*/) +CCSpriteBatchNode* CCSpriteBatchNode::createWithTexture(CCTexture2D* tex, unsigned int capacity/* = kDefaultSpriteBatchCapacity*/) { CCSpriteBatchNode *batchNode = new CCSpriteBatchNode(); batchNode->initWithTexture(tex, capacity); diff --git a/cocos2dx/sprite_nodes/CCSpriteBatchNode.h b/cocos2dx/sprite_nodes/CCSpriteBatchNode.h index 3499a2f336..2a30f37487 100644 --- a/cocos2dx/sprite_nodes/CCSpriteBatchNode.h +++ b/cocos2dx/sprite_nodes/CCSpriteBatchNode.h @@ -97,7 +97,7 @@ public: /** 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* create(CCTexture2D* tex, unsigned int capacity = kDefaultSpriteBatchCapacity); + static CCSpriteBatchNode* createWithTexture(CCTexture2D* tex, unsigned int capacity = kDefaultSpriteBatchCapacity); /** 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. diff --git a/cocos2dx/sprite_nodes/CCSpriteFrame.cpp b/cocos2dx/sprite_nodes/CCSpriteFrame.cpp index 461606b6f2..616a22c62f 100644 --- a/cocos2dx/sprite_nodes/CCSpriteFrame.cpp +++ b/cocos2dx/sprite_nodes/CCSpriteFrame.cpp @@ -33,10 +33,10 @@ NS_CC_BEGIN CCSpriteFrame* CCSpriteFrame::frameWithTexture(CCTexture2D *pobTexture, const CCRect& rect) { - return CCSpriteFrame::create(pobTexture, rect); + return CCSpriteFrame::createWithTexture(pobTexture, rect); } -CCSpriteFrame* CCSpriteFrame::create(CCTexture2D *pobTexture, const CCRect& rect) +CCSpriteFrame* CCSpriteFrame::createWithTexture(CCTexture2D *pobTexture, const CCRect& rect) { CCSpriteFrame *pSpriteFrame = new CCSpriteFrame();; pSpriteFrame->initWithTexture(pobTexture, rect); @@ -61,10 +61,10 @@ CCSpriteFrame* CCSpriteFrame::create(const char* filename, const CCRect& rect) CCSpriteFrame* CCSpriteFrame::frameWithTexture(CCTexture2D* pobTexture, const CCRect& rect, bool rotated, const CCPoint& offset, const CCSize& originalSize) { - return CCSpriteFrame::create(pobTexture, rect, rotated, offset, originalSize); + return CCSpriteFrame::createWithTexture(pobTexture, rect, rotated, offset, originalSize); } -CCSpriteFrame* CCSpriteFrame::create(CCTexture2D* pobTexture, const CCRect& rect, bool rotated, const CCPoint& offset, const CCSize& originalSize) +CCSpriteFrame* CCSpriteFrame::createWithTexture(CCTexture2D* pobTexture, const CCRect& rect, bool rotated, const CCPoint& offset, const CCSize& originalSize) { CCSpriteFrame *pSpriteFrame = new CCSpriteFrame();; pSpriteFrame->initWithTexture(pobTexture, rect, rotated, offset, originalSize); diff --git a/cocos2dx/sprite_nodes/CCSpriteFrame.h b/cocos2dx/sprite_nodes/CCSpriteFrame.h index 23247d3e6c..6f2f2a03dc 100644 --- a/cocos2dx/sprite_nodes/CCSpriteFrame.h +++ b/cocos2dx/sprite_nodes/CCSpriteFrame.h @@ -119,25 +119,25 @@ public: */ CC_DEPRECATED_ATTRIBUTE static CCSpriteFrame* frameWithTextureFilename(const char* filename, const CCRect& rect, bool rotated, const CCPoint& offset, const CCSize& originalSize); - /** Create a CCSpriteFrame with a texture, rect in points. - It is assumed that the frame was not trimmed. - */ - static CCSpriteFrame* create(CCTexture2D* pobTexture, const CCRect& rect); - /** Create a CCSpriteFrame with a texture filename, rect in points. It is assumed that the frame was not trimmed. */ static CCSpriteFrame* create(const char* filename, const CCRect& rect); - - /** Create a CCSpriteFrame with a texture, rect, rotated, offset and originalSize in pixels. - The originalSize is the size in points of the frame before being trimmed. - */ - static CCSpriteFrame* create(CCTexture2D* pobTexture, const CCRect& rect, bool rotated, const CCPoint& offset, const CCSize& originalSize); - + /** Create a CCSpriteFrame with a texture filename, rect, rotated, offset and originalSize in pixels. The originalSize is the size in pixels of the frame before being trimmed. */ static CCSpriteFrame* create(const char* filename, const CCRect& rect, bool rotated, const CCPoint& offset, const CCSize& originalSize); + + /** Create a CCSpriteFrame with a texture, rect in points. + It is assumed that the frame was not trimmed. + */ + static CCSpriteFrame* createWithTexture(CCTexture2D* pobTexture, const CCRect& rect); + + /** Create a CCSpriteFrame with a texture, rect, rotated, offset and originalSize in pixels. + The originalSize is the size in points of the frame before being trimmed. + */ + static CCSpriteFrame* createWithTexture(CCTexture2D* pobTexture, const CCRect& rect, bool rotated, const CCPoint& offset, const CCSize& originalSize); public: /** Initializes a CCSpriteFrame with a texture, rect in points. diff --git a/cocos2dx/support/CCNotificationCenter.cpp b/cocos2dx/support/CCNotificationCenter.cpp index 2202341166..a480e01ebb 100644 --- a/cocos2dx/support/CCNotificationCenter.cpp +++ b/cocos2dx/support/CCNotificationCenter.cpp @@ -34,7 +34,7 @@ static CCNotificationCenter *s_sharedNotifCenter = NULL; CCNotificationCenter::CCNotificationCenter() { - m_observers = CCArray::create(3); + m_observers = CCArray::createWithCapacity(3); m_observers->retain(); } diff --git a/cocos2dx/textures/CCTextureAtlas.cpp b/cocos2dx/textures/CCTextureAtlas.cpp index 4d38b1e539..c738b8dc15 100644 --- a/cocos2dx/textures/CCTextureAtlas.cpp +++ b/cocos2dx/textures/CCTextureAtlas.cpp @@ -121,10 +121,10 @@ CCTextureAtlas * CCTextureAtlas::create(const char* file, unsigned int capacity) CCTextureAtlas * CCTextureAtlas::textureAtlasWithTexture(CCTexture2D *texture, unsigned int capacity) { - return CCTextureAtlas::create(texture, capacity); + return CCTextureAtlas::createWithTexture(texture, capacity); } -CCTextureAtlas * CCTextureAtlas::create(CCTexture2D *texture, unsigned int capacity) +CCTextureAtlas * CCTextureAtlas::createWithTexture(CCTexture2D *texture, unsigned int capacity) { CCTextureAtlas * pTextureAtlas = new CCTextureAtlas(); if (pTextureAtlas && pTextureAtlas->initWithTexture(texture, capacity)) diff --git a/cocos2dx/textures/CCTextureAtlas.h b/cocos2dx/textures/CCTextureAtlas.h index ee9be6e8c9..fd8be63e78 100644 --- a/cocos2dx/textures/CCTextureAtlas.h +++ b/cocos2dx/textures/CCTextureAtlas.h @@ -109,7 +109,7 @@ public: * with an initial capacity for n Quads. * The TextureAtlas capacity can be increased in runtime. */ - static CCTextureAtlas* create(CCTexture2D *texture, unsigned int capacity); + static CCTextureAtlas* createWithTexture(CCTexture2D *texture, unsigned int capacity); /** initializes a TextureAtlas with a previously initialized Texture2D object, and diff --git a/cocos2dx/textures/CCTexturePVR.cpp b/cocos2dx/textures/CCTexturePVR.cpp index 749b96f05c..4b53744562 100755 --- a/cocos2dx/textures/CCTexturePVR.cpp +++ b/cocos2dx/textures/CCTexturePVR.cpp @@ -432,6 +432,11 @@ bool CCTexturePVR::initWithContentsOfFile(const char* path) } CCTexturePVR * CCTexturePVR::pvrTextureWithContentsOfFile(const char* path) +{ + return CCTexturePVR::create(path); +} + +CCTexturePVR * CCTexturePVR::create(const char* path) { CCTexturePVR * pTexture = new CCTexturePVR(); if (pTexture) diff --git a/cocos2dx/textures/CCTexturePVR.h b/cocos2dx/textures/CCTexturePVR.h index eaa8c26c7f..2893cf3c93 100644 --- a/cocos2dx/textures/CCTexturePVR.h +++ b/cocos2dx/textures/CCTexturePVR.h @@ -86,8 +86,11 @@ public: /** initializes a CCTexturePVR with a path */ bool initWithContentsOfFile(const char* path); + /** creates and initializes a CCTexturePVR with a path + @deprecated This interface will be deprecated when js-binding is stable. */ + CC_DEPRECATED_ATTRIBUTE static CCTexturePVR* pvrTextureWithContentsOfFile(const char* path); /** creates and initializes a CCTexturePVR with a path */ - static CCTexturePVR* pvrTextureWithContentsOfFile(const char* path); + static CCTexturePVR* create(const char* path); // properties diff --git a/cocos2dx/tilemap_parallax_nodes/CCTMXLayer.cpp b/cocos2dx/tilemap_parallax_nodes/CCTMXLayer.cpp index ced17788d2..fc52c93355 100644 --- a/cocos2dx/tilemap_parallax_nodes/CCTMXLayer.cpp +++ b/cocos2dx/tilemap_parallax_nodes/CCTMXLayer.cpp @@ -75,7 +75,7 @@ bool CCTMXLayer::initWithTilesetInfo(CCTMXTilesetInfo *tilesetInfo, CCTMXLayerIn m_uMinGID = layerInfo->m_uMinGID; m_uMaxGID = layerInfo->m_uMaxGID; m_cOpacity = layerInfo->m_cOpacity; - setProperties(CCDictionary::create(layerInfo->getProperties())); + setProperties(CCDictionary::createWithDictionary(layerInfo->getProperties())); m_fContentScaleFactor = CCDirector::sharedDirector()->getContentScaleFactor(); // tilesetInfo diff --git a/cocos2dx/tilemap_parallax_nodes/CCTMXTiledMap.cpp b/cocos2dx/tilemap_parallax_nodes/CCTMXTiledMap.cpp index 17d2b25ed3..72a997e11c 100644 --- a/cocos2dx/tilemap_parallax_nodes/CCTMXTiledMap.cpp +++ b/cocos2dx/tilemap_parallax_nodes/CCTMXTiledMap.cpp @@ -51,10 +51,10 @@ CCTMXTiledMap * CCTMXTiledMap::create(const char *tmxFile) CCTMXTiledMap* CCTMXTiledMap::tiledMapWithXML(const char* tmxString, const char* resourcePath) { - return CCTMXTiledMap::create(tmxString, resourcePath); + return CCTMXTiledMap::createWithXML(tmxString, resourcePath); } -CCTMXTiledMap* CCTMXTiledMap::create(const char* tmxString, const char* resourcePath) +CCTMXTiledMap* CCTMXTiledMap::createWithXML(const char* tmxString, const char* resourcePath) { CCTMXTiledMap *pRet = new CCTMXTiledMap(); if (pRet->initWithXML(tmxString, resourcePath)) diff --git a/cocos2dx/tilemap_parallax_nodes/CCTMXTiledMap.h b/cocos2dx/tilemap_parallax_nodes/CCTMXTiledMap.h index 789ce178dc..a1013dfd8b 100644 --- a/cocos2dx/tilemap_parallax_nodes/CCTMXTiledMap.h +++ b/cocos2dx/tilemap_parallax_nodes/CCTMXTiledMap.h @@ -136,7 +136,7 @@ public: static CCTMXTiledMap* create(const char *tmxFile); /** initializes a TMX Tiled Map with a TMX formatted XML string and a path to TMX resources */ - static CCTMXTiledMap* create(const char* tmxString, const char* resourcePath); + static CCTMXTiledMap* createWithXML(const char* tmxString, const char* resourcePath); /** initializes a TMX Tiled Map with a TMX file */ bool initWithTMXFile(const char *tmxFile); diff --git a/cocos2dx/tilemap_parallax_nodes/CCTMXXMLParser.cpp b/cocos2dx/tilemap_parallax_nodes/CCTMXXMLParser.cpp index 7c6b3db0ca..15fda27d90 100644 --- a/cocos2dx/tilemap_parallax_nodes/CCTMXXMLParser.cpp +++ b/cocos2dx/tilemap_parallax_nodes/CCTMXXMLParser.cpp @@ -165,7 +165,7 @@ void CCTMXMapInfo::internalInit(const char* tmxFileName, const char* resourcePat m_sResources = resourcePath; } - m_pObjectGroups = CCArray::create(4); + m_pObjectGroups = CCArray::createWithCapacity(4); m_pObjectGroups->retain(); m_pProperties = new CCDictionary(); diff --git a/cocos2dx/touch_dispatcher/CCTouchDispatcher.cpp b/cocos2dx/touch_dispatcher/CCTouchDispatcher.cpp index ba46d4d3e7..e37f3d053d 100644 --- a/cocos2dx/touch_dispatcher/CCTouchDispatcher.cpp +++ b/cocos2dx/touch_dispatcher/CCTouchDispatcher.cpp @@ -67,11 +67,11 @@ void CCTouchDispatcher::setDispatchEvents(bool bDispatchEvents) bool CCTouchDispatcher::init(void) { m_bDispatchEvents = true; - m_pTargetedHandlers = CCArray::create(8); + m_pTargetedHandlers = CCArray::createWithCapacity(8); m_pTargetedHandlers->retain(); - m_pStandardHandlers = CCArray::create(4); + m_pStandardHandlers = CCArray::createWithCapacity(4); m_pStandardHandlers->retain(); - m_pHandlersToAdd = CCArray::create(8); + m_pHandlersToAdd = CCArray::createWithCapacity(8); m_pHandlersToAdd->retain(); m_pHandlersToRemove = ccCArrayNew(8); diff --git a/extensions/CCBReader/CCBReader.cpp b/extensions/CCBReader/CCBReader.cpp index 00235d4334..129faad147 100644 --- a/extensions/CCBReader/CCBReader.cpp +++ b/extensions/CCBReader/CCBReader.cpp @@ -167,7 +167,7 @@ void CCBReader::readStringCacheEntry() { int numBytes = b0 << 8 | b1; const unsigned char * src = (const unsigned char *) (this->mBytes + this->mCurrentByte); - CCString * string = CCString::create(src, (unsigned long)numBytes); + CCString * string = CCString::createWithData(src, (unsigned long)numBytes); string->retain(); this->mCurrentByte += numBytes; diff --git a/extensions/CCBReader/CCNodeLoader.cpp b/extensions/CCBReader/CCNodeLoader.cpp index fa492c9d3b..9a32f421e8 100644 --- a/extensions/CCBReader/CCNodeLoader.cpp +++ b/extensions/CCBReader/CCNodeLoader.cpp @@ -416,7 +416,7 @@ CCSpriteFrame * CCNodeLoader::parsePropTypeSpriteFrame(CCNode * pNode, CCNode * CCTexture2D * texture = CCTextureCache::sharedTextureCache()->addImage(spriteFilePath->getCString()); CCRect bounds = CCRectMake(0, 0, texture->getContentSize().width, texture->getContentSize().height); - spriteFrame = CCSpriteFrame::create(texture, bounds); + spriteFrame = CCSpriteFrame::createWithTexture(texture, bounds); } else { CCSpriteFrameCache * frameCache = CCSpriteFrameCache::sharedSpriteFrameCache(); diff --git a/extensions/UI/CCControlExtension/CCControl.cpp b/extensions/UI/CCControlExtension/CCControl.cpp index 543a9ae3a5..05d649a79f 100644 --- a/extensions/UI/CCControlExtension/CCControl.cpp +++ b/extensions/UI/CCControlExtension/CCControl.cpp @@ -293,7 +293,7 @@ CCArray* CCControl::dispatchListforControlEvent(CCControlEvent controlEvent) // If the invocation list does not exist for the dispatch table, we create it if (invocationList == NULL) { - invocationList = CCArray::create(1); + invocationList = CCArray::createWithCapacity(1); dispatchTable->setObject(invocationList, controlEvent); } return invocationList; diff --git a/extensions/UI/CCControlExtension/CCScale9Sprite.cpp b/extensions/UI/CCControlExtension/CCScale9Sprite.cpp index 2cc7a173dd..9913af1eb5 100644 --- a/extensions/UI/CCControlExtension/CCScale9Sprite.cpp +++ b/extensions/UI/CCControlExtension/CCScale9Sprite.cpp @@ -120,25 +120,25 @@ bool CCScale9Sprite::updateWithBatchNode(CCSpriteBatchNode* batchnode, CCRect re // // Centre - centre = CCSprite::create(scale9Image->getTexture(), m_capInsetsInternal); + centre = CCSprite::createWithTexture(scale9Image->getTexture(), m_capInsetsInternal); scale9Image->addChild(centre, 0, pCentre); // Top - top = CCSprite::create(scale9Image->getTexture(), CCRectMake(m_capInsetsInternal.origin.x, + top = CCSprite::createWithTexture(scale9Image->getTexture(), CCRectMake(m_capInsetsInternal.origin.x, t, m_capInsetsInternal.size.width, m_capInsetsInternal.origin.y - t)); scale9Image->addChild(top, 1, pTop); // Bottom - bottom = CCSprite::create(scale9Image->getTexture(), CCRectMake( m_capInsetsInternal.origin.x, + bottom = CCSprite::createWithTexture(scale9Image->getTexture(), CCRectMake( m_capInsetsInternal.origin.x, m_capInsetsInternal.origin.y + m_capInsetsInternal.size.height, m_capInsetsInternal.size.width, h - (m_capInsetsInternal.origin.y - t + m_capInsetsInternal.size.height) )); scale9Image->addChild(bottom, 1, pBottom); // Left - left = CCSprite::create(scale9Image->getTexture(), CCRectMake( + left = CCSprite::createWithTexture(scale9Image->getTexture(), CCRectMake( l, m_capInsetsInternal.origin.y, m_capInsetsInternal.origin.x - l, @@ -146,7 +146,7 @@ bool CCScale9Sprite::updateWithBatchNode(CCSpriteBatchNode* batchnode, CCRect re scale9Image->addChild(left, 1, pLeft); // Right - right = CCSprite::create(scale9Image->getTexture(), CCRectMake( + right = CCSprite::createWithTexture(scale9Image->getTexture(), CCRectMake( m_capInsetsInternal.origin.x + m_capInsetsInternal.size.width, m_capInsetsInternal.origin.y, w - (m_capInsetsInternal.origin.x - l + m_capInsetsInternal.size.width), @@ -154,7 +154,7 @@ bool CCScale9Sprite::updateWithBatchNode(CCSpriteBatchNode* batchnode, CCRect re scale9Image->addChild(right, 1, pRight); // Top left - topLeft = CCSprite::create(scale9Image->getTexture(), CCRectMake( + topLeft = CCSprite::createWithTexture(scale9Image->getTexture(), CCRectMake( l, t, m_capInsetsInternal.origin.x - l, @@ -163,7 +163,7 @@ bool CCScale9Sprite::updateWithBatchNode(CCSpriteBatchNode* batchnode, CCRect re scale9Image->addChild(topLeft, 2, pTopLeft); // Top right - topRight = CCSprite::create(scale9Image->getTexture(), CCRectMake( + topRight = CCSprite::createWithTexture(scale9Image->getTexture(), CCRectMake( m_capInsetsInternal.origin.x + m_capInsetsInternal.size.width, t, w - (m_capInsetsInternal.origin.x - l + m_capInsetsInternal.size.width), @@ -172,7 +172,7 @@ bool CCScale9Sprite::updateWithBatchNode(CCSpriteBatchNode* batchnode, CCRect re scale9Image->addChild(topRight, 2, pTopRight); // Bottom left - bottomLeft = CCSprite::create(scale9Image->getTexture(), CCRectMake( + bottomLeft = CCSprite::createWithTexture(scale9Image->getTexture(), CCRectMake( l, m_capInsetsInternal.origin.y + m_capInsetsInternal.size.height, m_capInsetsInternal.origin.x - l, @@ -180,7 +180,7 @@ bool CCScale9Sprite::updateWithBatchNode(CCSpriteBatchNode* batchnode, CCRect re scale9Image->addChild(bottomLeft, 2, pBottomLeft); // Bottom right - bottomRight = CCSprite::create(scale9Image->getTexture(), CCRectMake( + bottomRight = CCSprite::createWithTexture(scale9Image->getTexture(), CCRectMake( m_capInsetsInternal.origin.x + m_capInsetsInternal.size.width, m_capInsetsInternal.origin.y + m_capInsetsInternal.size.height, w - (m_capInsetsInternal.origin.x - l + m_capInsetsInternal.size.width), @@ -347,7 +347,7 @@ bool CCScale9Sprite::initWithSpriteFrame(CCSpriteFrame* spriteFrame, CCRect capI { CCAssert(spriteFrame != NULL, "Sprite frame must be not nil"); - CCSpriteBatchNode *batchnode = CCSpriteBatchNode::create(spriteFrame->getTexture(), 9); + CCSpriteBatchNode *batchnode = CCSpriteBatchNode::createWithTexture(spriteFrame->getTexture(), 9); bool pReturn = this->initWithBatchNode(batchnode, spriteFrame->getRect(), capInsets); return pReturn; } @@ -602,7 +602,7 @@ bool CCScale9Sprite::isOpacityModifyRGB() void CCScale9Sprite::setSpriteFrame(CCSpriteFrame * spriteFrame) { - CCSpriteBatchNode * batchnode = CCSpriteBatchNode::create(spriteFrame->getTexture(), 9); + CCSpriteBatchNode * batchnode = CCSpriteBatchNode::createWithTexture(spriteFrame->getTexture(), 9); this->updateWithBatchNode(batchnode, spriteFrame->getRect(), CCRectZero); // Reset insets diff --git a/samples/HelloLua/proj.ios/HelloLua.xcodeproj/project.pbxproj b/samples/HelloLua/proj.ios/HelloLua.xcodeproj/project.pbxproj index 59f350cb42..4e1758263d 100644 --- a/samples/HelloLua/proj.ios/HelloLua.xcodeproj/project.pbxproj +++ b/samples/HelloLua/proj.ios/HelloLua.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 45; + objectVersion = 46; objects = { /* Begin PBXBuildFile section */ @@ -537,8 +537,11 @@ /* Begin PBXProject section */ 29B97313FDCFA39411CA2CEA /* Project object */ = { isa = PBXProject; + attributes = { + LastUpgradeCheck = 0430; + }; buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "HelloLua" */; - compatibilityVersion = "Xcode 3.1"; + compatibilityVersion = "Xcode 3.2"; developmentRegion = English; hasScannedForEncodings = 1; knownRegions = ( @@ -677,7 +680,6 @@ COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; GCC_DYNAMIC_NO_PIC = NO; - GCC_ENABLE_FIX_AND_CONTINUE = NO; GCC_FAST_OBJC_DISPATCH = YES; GCC_INLINES_ARE_PRIVATE_EXTERN = NO; GCC_OBJC_CALL_CXX_CDTORS = YES; @@ -706,14 +708,13 @@ IPHONEOS_DEPLOYMENT_TARGET = 5.0; LIBRARY_SEARCH_PATHS = ( "$(inherited)", - "\"$(SRCROOT)/../../cocos2dx/platform/third_party/ios/libraries\"", + "\"$(SRCROOT)/../../../cocos2dx/platform/third_party/ios/libraries\"", ); ONLY_ACTIVE_ARCH = YES; OTHER_LDFLAGS = ( "-ObjC", "-all_load", ); - PREBINDING = NO; PRODUCT_NAME = HelloLua; SDKROOT = iphoneos; SKIP_INSTALL = YES; @@ -729,7 +730,6 @@ ALWAYS_SEARCH_USER_PATHS = NO; COPY_PHASE_STRIP = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - GCC_ENABLE_FIX_AND_CONTINUE = NO; GCC_FAST_OBJC_DISPATCH = YES; GCC_INLINES_ARE_PRIVATE_EXTERN = NO; GCC_OBJC_CALL_CXX_CDTORS = YES; @@ -757,14 +757,13 @@ IPHONEOS_DEPLOYMENT_TARGET = 5.0; LIBRARY_SEARCH_PATHS = ( "$(inherited)", - "\"$(SRCROOT)/../../cocos2dx/platform/third_party/ios/libraries\"", + "\"$(SRCROOT)/../../../cocos2dx/platform/third_party/ios/libraries\"", ); ONLY_ACTIVE_ARCH = NO; OTHER_LDFLAGS = ( "-ObjC", "-all_load", ); - PREBINDING = NO; PRODUCT_NAME = HelloLua; SDKROOT = iphoneos; SKIP_INSTALL = YES; @@ -793,7 +792,6 @@ GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 4.0; ONLY_ACTIVE_ARCH = YES; - PREBINDING = NO; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; VALID_ARCHS = "armv6 armv7 i386"; @@ -814,7 +812,6 @@ GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 4.0; - PREBINDING = NO; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; VALID_ARCHS = "armv6 armv7 i386"; diff --git a/samples/TestCpp/Classes/ActionsTest/ActionsTest.cpp b/samples/TestCpp/Classes/ActionsTest/ActionsTest.cpp index 1ad65b9133..a6cac8819f 100644 --- a/samples/TestCpp/Classes/ActionsTest/ActionsTest.cpp +++ b/samples/TestCpp/Classes/ActionsTest/ActionsTest.cpp @@ -635,6 +635,7 @@ void ActionAnimate::onEnter() centerSprites(3); + // // Manual animation // @@ -651,8 +652,7 @@ void ActionAnimate::onEnter() CCAnimate* action = CCAnimate::create(animation); m_grossini->runAction(CCSequence::create(action, action->reverse(), NULL)); - - + // // File animation // diff --git a/samples/TestCpp/Classes/ExtensionsTest/NotificationCenterTest/NotificationCenterTest.cpp b/samples/TestCpp/Classes/ExtensionsTest/NotificationCenterTest/NotificationCenterTest.cpp index eba5ec2fdf..844b667ef6 100644 --- a/samples/TestCpp/Classes/ExtensionsTest/NotificationCenterTest/NotificationCenterTest.cpp +++ b/samples/TestCpp/Classes/ExtensionsTest/NotificationCenterTest/NotificationCenterTest.cpp @@ -94,7 +94,7 @@ NotificationCenterTest::NotificationCenterTest() CCLabelTTF *label2 = CCLabelTTF::create("switch on", "Marker Felt", 26); CCMenuItemLabel *item1 = CCMenuItemLabel::create(label1); CCMenuItemLabel *item2 = CCMenuItemLabel::create(label2); - CCMenuItemToggle *item = CCMenuItemToggle::create(this, menu_selector(NotificationCenterTest::toggleSwitch), item1, item2, NULL); + CCMenuItemToggle *item = CCMenuItemToggle::createWithTarget(this, menu_selector(NotificationCenterTest::toggleSwitch), item1, item2, NULL); // turn on item->setSelectedIndex(1); CCMenu *menu = CCMenu::create(item, NULL); @@ -116,7 +116,7 @@ NotificationCenterTest::NotificationCenterTest() CCLabelTTF *label2 = CCLabelTTF::create("connected", "Marker Felt", 26); CCMenuItemLabel *item1 = CCMenuItemLabel::create(label1); CCMenuItemLabel *item2 = CCMenuItemLabel::create(label2); - CCMenuItemToggle *item = CCMenuItemToggle::create(this, menu_selector(NotificationCenterTest::connectToSwitch), item1, item2, NULL); + CCMenuItemToggle *item = CCMenuItemToggle::createWithTarget(this, menu_selector(NotificationCenterTest::connectToSwitch), item1, item2, NULL); item->setTag(kTagConnect+i); item->setPosition(ccp(light->getPosition().x, light->getPosition().y+50)); menuConnect->addChild(item, 0); diff --git a/samples/TestCpp/Classes/LabelTest/LabelTest.cpp b/samples/TestCpp/Classes/LabelTest/LabelTest.cpp index c5da591143..0da3fd6bcf 100644 --- a/samples/TestCpp/Classes/LabelTest/LabelTest.cpp +++ b/samples/TestCpp/Classes/LabelTest/LabelTest.cpp @@ -1390,7 +1390,7 @@ std::string BMFontOneAtlas::subtitle() /// BMFontUnicode BMFontUnicode::BMFontUnicode() { - CCDictionary *strings = CCDictionary::create("fonts/strings.xml"); + CCDictionary *strings = CCDictionary::createWithContentsOfFile("fonts/strings.xml"); const char *chinese = ((CCString*)strings->objectForKey("chinese1"))->m_sString.c_str(); const char *japanese = ((CCString*)strings->objectForKey("japanese"))->m_sString.c_str(); const char *spanish = ((CCString*)strings->objectForKey("spanish"))->m_sString.c_str(); diff --git a/samples/TestCpp/Classes/LayerTest/LayerTest.cpp b/samples/TestCpp/Classes/LayerTest/LayerTest.cpp index 72de4d3596..06c86c56b0 100644 --- a/samples/TestCpp/Classes/LayerTest/LayerTest.cpp +++ b/samples/TestCpp/Classes/LayerTest/LayerTest.cpp @@ -314,7 +314,7 @@ LayerGradient::LayerGradient() CCLabelTTF *label2 = CCLabelTTF::create("Compressed Interpolation: Disabled", "Marker Felt", 26); CCMenuItemLabel *item1 = CCMenuItemLabel::create(label1); CCMenuItemLabel *item2 = CCMenuItemLabel::create(label2); - CCMenuItemToggle *item = CCMenuItemToggle::create(this, menu_selector(LayerGradient::toggleItem), item1, item2, NULL); + CCMenuItemToggle *item = CCMenuItemToggle::createWithTarget(this, menu_selector(LayerGradient::toggleItem), item1, item2, NULL); CCMenu *menu = CCMenu::create(item, NULL); addChild(menu); diff --git a/samples/TestCpp/Classes/MenuTest/MenuTest.cpp b/samples/TestCpp/Classes/MenuTest/MenuTest.cpp index 761ae744b5..3b39b9b5a8 100644 --- a/samples/TestCpp/Classes/MenuTest/MenuTest.cpp +++ b/samples/TestCpp/Classes/MenuTest/MenuTest.cpp @@ -383,7 +383,7 @@ MenuLayer4::MenuLayer4() title1->setEnabled(false); CCMenuItemFont::setFontName( "Marker Felt" ); CCMenuItemFont::setFontSize(34); - CCMenuItemToggle* item1 = CCMenuItemToggle::create( this, + CCMenuItemToggle* item1 = CCMenuItemToggle::createWithTarget(this, menu_selector(MenuLayer4::menuCallback), CCMenuItemFont::create( "On" ), CCMenuItemFont::create( "Off"), @@ -395,7 +395,7 @@ MenuLayer4::MenuLayer4() title2->setEnabled(false); CCMenuItemFont::setFontName( "Marker Felt" ); CCMenuItemFont::setFontSize(34); - CCMenuItemToggle *item2 = CCMenuItemToggle::create( this, + CCMenuItemToggle *item2 = CCMenuItemToggle::createWithTarget(this, menu_selector(MenuLayer4::menuCallback), CCMenuItemFont::create( "On" ), CCMenuItemFont::create( "Off"), @@ -407,7 +407,7 @@ MenuLayer4::MenuLayer4() title3->setEnabled( false ); CCMenuItemFont::setFontName( "Marker Felt" ); CCMenuItemFont::setFontSize(34); - CCMenuItemToggle *item3 = CCMenuItemToggle::create( this, + CCMenuItemToggle *item3 = CCMenuItemToggle::createWithTarget(this, menu_selector(MenuLayer4::menuCallback), CCMenuItemFont::create( "High" ), CCMenuItemFont::create( "Low" ), @@ -419,7 +419,7 @@ MenuLayer4::MenuLayer4() title4->setEnabled(false); CCMenuItemFont::setFontName( "Marker Felt" ); CCMenuItemFont::setFontSize(34); - CCMenuItemToggle *item4 = CCMenuItemToggle::create( this, + CCMenuItemToggle *item4 = CCMenuItemToggle::createWithTarget(this, menu_selector(MenuLayer4::menuCallback), CCMenuItemFont::create( "Off" ), NULL ); diff --git a/samples/TestCpp/Classes/MotionStreakTest/MotionStreakTest.cpp b/samples/TestCpp/Classes/MotionStreakTest/MotionStreakTest.cpp index 6e393be72b..ffc4d40494 100644 --- a/samples/TestCpp/Classes/MotionStreakTest/MotionStreakTest.cpp +++ b/samples/TestCpp/Classes/MotionStreakTest/MotionStreakTest.cpp @@ -258,7 +258,7 @@ void MotionStreakTest::onEnter() addChild(menu, 1); - CCMenuItemToggle *itemMode = CCMenuItemToggle::create(this, menu_selector(MotionStreakTest::modeCallback), + CCMenuItemToggle *itemMode = CCMenuItemToggle::createWithTarget(this, menu_selector(MotionStreakTest::modeCallback), CCMenuItemFont::create("Use High Quality Mode"), CCMenuItemFont::create("Use Fast Mode"), NULL); diff --git a/samples/TestCpp/Classes/ParticleTest/ParticleTest.cpp b/samples/TestCpp/Classes/ParticleTest/ParticleTest.cpp index 75f434a9f0..f865bec6d1 100644 --- a/samples/TestCpp/Classes/ParticleTest/ParticleTest.cpp +++ b/samples/TestCpp/Classes/ParticleTest/ParticleTest.cpp @@ -1088,7 +1088,7 @@ void ParticleDemo::onEnter(void) CCMenuItemImage* item2 = CCMenuItemImage::create(s_pPathR1, s_pPathR2, this, menu_selector(ParticleDemo::restartCallback) ); CCMenuItemImage* item3 = CCMenuItemImage::create(s_pPathF1, s_pPathF2, this, menu_selector(ParticleDemo::nextCallback) ); - CCMenuItemToggle* item4 = CCMenuItemToggle::create( this, + CCMenuItemToggle* item4 = CCMenuItemToggle::createWithTarget(this, menu_selector(ParticleDemo::toggleCallback), CCMenuItemFont::create( "Free Movement" ), CCMenuItemFont::create( "Relative Movement" ), @@ -1239,7 +1239,7 @@ void ParticleBatchHybrid::onEnter() m_emitter = CCParticleSystemQuad::create("Particles/LavaFlow.plist"); m_emitter->retain(); - CCParticleBatchNode *batch = CCParticleBatchNode::create(m_emitter->getTexture()); + CCParticleBatchNode *batch = CCParticleBatchNode::createWithTexture(m_emitter->getTexture()); batch->addChild(m_emitter); @@ -1298,7 +1298,7 @@ void ParticleBatchMultipleEmitters::onEnter() emitter2->setPosition(ccp( s.width/2, s.height/2)); emitter3->setPosition(ccp( s.width/4, s.height/4)); - CCParticleBatchNode *batch = CCParticleBatchNode::create(emitter1->getTexture()); + CCParticleBatchNode *batch = CCParticleBatchNode::createWithTexture(emitter1->getTexture()); batch->addChild(emitter1, 0); batch->addChild(emitter2, 0); @@ -1330,7 +1330,7 @@ void ParticleReorder::onEnter() CCParticleSystem* ignore = CCParticleSystemQuad::create("Particles/SmallSun.plist"); CCNode *parent1 = CCNode::create(); - CCNode *parent2 = CCParticleBatchNode::create(ignore->getTexture()); + CCNode *parent2 = CCParticleBatchNode::createWithTexture(ignore->getTexture()); ignore->unscheduleUpdate(); for( unsigned int i=0; i<2;i++) @@ -1646,7 +1646,7 @@ void AddAndDeleteParticleSystems::onEnter() m_background = NULL; //adds the texture inside the plist to the texture cache - m_pBatchNode = CCParticleBatchNode::create((CCTexture2D*)NULL, 16000); + m_pBatchNode = CCParticleBatchNode::createWithTexture((CCTexture2D*)NULL, 16000); addChild(m_pBatchNode, 1, 2); diff --git a/samples/TestCpp/Classes/PerformanceTest/PerformanceNodeChildrenTest.cpp b/samples/TestCpp/Classes/PerformanceTest/PerformanceNodeChildrenTest.cpp index 3dfbd8b1f5..b8a61b6322 100644 --- a/samples/TestCpp/Classes/PerformanceTest/PerformanceNodeChildrenTest.cpp +++ b/samples/TestCpp/Classes/PerformanceTest/PerformanceNodeChildrenTest.cpp @@ -180,7 +180,7 @@ void IterateSpriteSheet::updateQuantityOfNodes() { for(int i = 0; i < (quantityOfNodes-currentQuantityOfNodes); i++) { - CCSprite *sprite = CCSprite::create(batchNode->getTexture(), CCRectMake(0, 0, 32, 32)); + CCSprite *sprite = CCSprite::createWithTexture(batchNode->getTexture(), CCRectMake(0, 0, 32, 32)); batchNode->addChild(sprite); sprite->setPosition(ccp( CCRANDOM_0_1()*s.width, CCRANDOM_0_1()*s.height)); } @@ -337,7 +337,7 @@ void AddRemoveSpriteSheet::updateQuantityOfNodes() { for (int i=0; i < (quantityOfNodes-currentQuantityOfNodes); i++) { - CCSprite *sprite = CCSprite::create(batchNode->getTexture(), CCRectMake(0, 0, 32, 32)); + CCSprite *sprite = CCSprite::createWithTexture(batchNode->getTexture(), CCRectMake(0, 0, 32, 32)); batchNode->addChild(sprite); sprite->setPosition(ccp( CCRANDOM_0_1()*s.width, CCRANDOM_0_1()*s.height)); sprite->setVisible(false); @@ -376,13 +376,13 @@ void AddSpriteSheet::update(float dt) if( totalToAdd > 0 ) { - CCArray* sprites = CCArray::create(totalToAdd); + CCArray* sprites = CCArray::createWithCapacity(totalToAdd); int *zs = new int[totalToAdd]; // Don't include the sprite creation time and random as part of the profiling for(int i=0; igetTexture(), CCRectMake(0,0,32,32)); + CCSprite* pSprite = CCSprite::createWithTexture(batchNode->getTexture(), CCRectMake(0,0,32,32)); sprites->addObject(pSprite); zs[i] = CCRANDOM_MINUS1_1() * 50; } @@ -440,12 +440,12 @@ void RemoveSpriteSheet::update(float dt) if( totalToAdd > 0 ) { - CCArray* sprites = CCArray::create(totalToAdd); + CCArray* sprites = CCArray::createWithCapacity(totalToAdd); // Don't include the sprite creation time as part of the profiling for(int i=0;igetTexture(), CCRectMake(0,0,32,32)); + CCSprite* pSprite = CCSprite::createWithTexture(batchNode->getTexture(), CCRectMake(0,0,32,32)); sprites->addObject(pSprite); } @@ -500,12 +500,12 @@ void ReorderSpriteSheet::update(float dt) if( totalToAdd > 0 ) { - CCArray* sprites = CCArray::create(totalToAdd); + CCArray* sprites = CCArray::createWithCapacity(totalToAdd); // Don't include the sprite creation time as part of the profiling for(int i=0;igetTexture(), CCRectMake(0,0,32,32)); + CCSprite* pSprite = CCSprite::createWithTexture(batchNode->getTexture(), CCRectMake(0,0,32,32)); sprites->addObject(pSprite); } diff --git a/samples/TestCpp/Classes/PerformanceTest/PerformanceSpriteTest.cpp b/samples/TestCpp/Classes/PerformanceTest/PerformanceSpriteTest.cpp index af15df7b44..1452f71e5e 100644 --- a/samples/TestCpp/Classes/PerformanceTest/PerformanceSpriteTest.cpp +++ b/samples/TestCpp/Classes/PerformanceTest/PerformanceSpriteTest.cpp @@ -130,7 +130,7 @@ CCSprite* SubTest::createSpriteWithTag(int tag) case 2: case 3: { - sprite = CCSprite::create(batchNode->getTexture(), CCRectMake(0, 0, 52, 139)); + sprite = CCSprite::createWithTexture(batchNode->getTexture(), CCRectMake(0, 0, 52, 139)); batchNode->addChild(sprite, 0, tag+100); break; } @@ -154,7 +154,7 @@ CCSprite* SubTest::createSpriteWithTag(int tag) x *= 85; y *= 121; - sprite = CCSprite::create(batchNode->getTexture(), CCRectMake(x,y,85,121)); + sprite = CCSprite::createWithTexture(batchNode->getTexture(), CCRectMake(x,y,85,121)); batchNode->addChild(sprite, 0, tag+100); break; } @@ -185,7 +185,7 @@ CCSprite* SubTest::createSpriteWithTag(int tag) x *= 32; y *= 32; - sprite = CCSprite::create(batchNode->getTexture(), CCRectMake(x,y,32,32)); + sprite = CCSprite::createWithTexture(batchNode->getTexture(), CCRectMake(x,y,32,32)); batchNode->addChild(sprite, 0, tag+100); break; } @@ -441,7 +441,7 @@ void performanceActions20(CCSprite* pSprite) float growDuration = 0.5f + (rand() % 1000) / 500.0f; CCActionInterval *grow = CCScaleBy::create(growDuration, 0.5f, 0.5f); - CCAction *permanentScaleLoop = CCRepeatForever::create(CCSequence::create(grow, grow->reverse())); + CCAction *permanentScaleLoop = CCRepeatForever::create(CCSequence::createWithTwoActions(grow, grow->reverse())); pSprite->runAction(permanentScaleLoop); } diff --git a/samples/TestCpp/Classes/RenderTextureTest/RenderTextureTest.cpp b/samples/TestCpp/Classes/RenderTextureTest/RenderTextureTest.cpp index 97d55c4f6e..b156546d3f 100644 --- a/samples/TestCpp/Classes/RenderTextureTest/RenderTextureTest.cpp +++ b/samples/TestCpp/Classes/RenderTextureTest/RenderTextureTest.cpp @@ -188,7 +188,7 @@ void RenderTextureSave::saveImage(cocos2d::CCObject *pSender) CC_SAFE_DELETE(pImage); - CCSprite *sprite = CCSprite::create(tex); + CCSprite *sprite = CCSprite::createWithTexture(tex); sprite->setScale(0.3f); addChild(sprite); @@ -457,7 +457,7 @@ void RenderTextureZbuffer::renderScreenShot() texture->end(); - CCSprite *sprite = CCSprite::create(texture->getSprite()->getTexture()); + CCSprite *sprite = CCSprite::createWithTexture(texture->getSprite()->getTexture()); sprite->setPosition(ccp(256, 256)); sprite->setOpacity(182); diff --git a/samples/TestCpp/Classes/SpriteTest/SpriteTest.cpp.REMOVED.git-id b/samples/TestCpp/Classes/SpriteTest/SpriteTest.cpp.REMOVED.git-id index 5404304a26..f13d582669 100644 --- a/samples/TestCpp/Classes/SpriteTest/SpriteTest.cpp.REMOVED.git-id +++ b/samples/TestCpp/Classes/SpriteTest/SpriteTest.cpp.REMOVED.git-id @@ -1 +1 @@ -ce063dda23d6a1bcfed54ba357a7aded426ea89e \ No newline at end of file +5fc56349b3bc725b72183e738c2673d084631809 \ No newline at end of file diff --git a/samples/TestCpp/Classes/Texture2dTest/Texture2dTest.cpp b/samples/TestCpp/Classes/Texture2dTest/Texture2dTest.cpp index e50762c8bd..f504fe4239 100644 --- a/samples/TestCpp/Classes/Texture2dTest/Texture2dTest.cpp +++ b/samples/TestCpp/Classes/Texture2dTest/Texture2dTest.cpp @@ -283,12 +283,12 @@ void TextureMipMap::onEnter() CCTexture2D *texture1 = CCTextureCache::sharedTextureCache()->addImage("Images/grossini_dance_atlas_nomipmap.png"); - CCSprite *img0 = CCSprite::create(texture0); + CCSprite *img0 = CCSprite::createWithTexture(texture0); img0->setTextureRect(CCRectMake(85, 121, 85, 121)); img0->setPosition(ccp( s.width/3.0f, s.height/2.0f)); addChild(img0); - CCSprite *img1 = CCSprite::create(texture1); + CCSprite *img1 = CCSprite::createWithTexture(texture1); img1->setTextureRect(CCRectMake(85, 121, 85, 121)); img1->setPosition(ccp( 2*s.width/3.0f, s.height/2.0f)); addChild(img1); @@ -1162,7 +1162,7 @@ void TextureAsync::imageLoaded(CCObject* pObj) // This test just creates a sprite based on the Texture - CCSprite *sprite = CCSprite::create(tex); + CCSprite *sprite = CCSprite::createWithTexture(tex); sprite->setAnchorPoint(ccp(0,0)); addChild(sprite, -1); diff --git a/samples/TestCpp/Classes/TileMapTest/TileMapTest.cpp b/samples/TestCpp/Classes/TileMapTest/TileMapTest.cpp index 334ccddbc6..bc2b29f223 100644 --- a/samples/TestCpp/Classes/TileMapTest/TileMapTest.cpp +++ b/samples/TestCpp/Classes/TileMapTest/TileMapTest.cpp @@ -1257,7 +1257,7 @@ TMXOrthoFromXMLTest::TMXOrthoFromXMLTest() CCString* str = CCString::createWithContentsOfFile(CCFileUtils::sharedFileUtils()->fullPathFromRelativePath(file.c_str())); CCAssert(str != NULL, "Unable to open file"); - CCTMXTiledMap *map = CCTMXTiledMap::create(str->getCString() ,resources.c_str()); + CCTMXTiledMap *map = CCTMXTiledMap::createWithXML(str->getCString() ,resources.c_str()); addChild(map, 0, kTagTileMap); CCSize s = map->getContentSize(); diff --git a/samples/TestCpp/Classes/TouchesTest/TouchesTest.cpp b/samples/TestCpp/Classes/TouchesTest/TouchesTest.cpp index 4bfcadda60..cf7a472952 100644 --- a/samples/TestCpp/Classes/TouchesTest/TouchesTest.cpp +++ b/samples/TestCpp/Classes/TouchesTest/TouchesTest.cpp @@ -54,7 +54,7 @@ PongLayer::PongLayer() CCTexture2D* paddleTexture = CCTextureCache::sharedTextureCache()->addImage(s_Paddle); - CCArray *paddlesM = CCArray::create(4); + CCArray *paddlesM = CCArray::createWithCapacity(4); Paddle* paddle = Paddle::paddleWithTexture(paddleTexture); paddle->setPosition( CCPointMake(m_tWinSize.width/2, 15) ); diff --git a/samples/TestCpp/Classes/ZwoptexTest/ZwoptexTest.cpp b/samples/TestCpp/Classes/ZwoptexTest/ZwoptexTest.cpp index 375967147c..bb143af603 100644 --- a/samples/TestCpp/Classes/ZwoptexTest/ZwoptexTest.cpp +++ b/samples/TestCpp/Classes/ZwoptexTest/ZwoptexTest.cpp @@ -136,7 +136,7 @@ void ZwoptexGenericTest::onEnter() layer1->setPosition(ccp(s.width/2-80 - (85.0f * 0.5f), s.height/2 - (121.0f * 0.5f))); addChild(layer1); - sprite1 = CCSprite::create(CCSpriteFrameCache::sharedSpriteFrameCache()->spriteFrameByName("grossini_dance_01.png")); + sprite1 = CCSprite::createWithSpriteFrame(CCSpriteFrameCache::sharedSpriteFrameCache()->spriteFrameByName("grossini_dance_01.png")); sprite1->setPosition(ccp( s.width/2-80, s.height/2)); addChild(sprite1); @@ -147,7 +147,7 @@ void ZwoptexGenericTest::onEnter() layer2->setPosition(ccp(s.width/2+80 - (85.0f * 0.5f), s.height/2 - (121.0f * 0.5f))); addChild(layer2); - sprite2 = CCSprite::create(CCSpriteFrameCache::sharedSpriteFrameCache()->spriteFrameByName("grossini_dance_generic_01.png")); + sprite2 = CCSprite::createWithSpriteFrame(CCSpriteFrameCache::sharedSpriteFrameCache()->spriteFrameByName("grossini_dance_generic_01.png")); sprite2->setPosition(ccp( s.width/2 + 80, s.height/2)); addChild(sprite2); diff --git a/samples/TestCpp/proj.ios/TestCpp.xcodeproj/project.pbxproj.REMOVED.git-id b/samples/TestCpp/proj.ios/TestCpp.xcodeproj/project.pbxproj.REMOVED.git-id index d772e4054a..a7122f3cb8 100644 --- a/samples/TestCpp/proj.ios/TestCpp.xcodeproj/project.pbxproj.REMOVED.git-id +++ b/samples/TestCpp/proj.ios/TestCpp.xcodeproj/project.pbxproj.REMOVED.git-id @@ -1 +1 @@ -d9ee53ff007acf07cd57b33d0fb5648fd87b7a51 \ No newline at end of file +da857ec78bd3072e568563ae4ee25a23c63295f9 \ No newline at end of file diff --git a/scripting/lua/cocos2dx_support/LuaCocos2d.cpp.REMOVED.git-id b/scripting/lua/cocos2dx_support/LuaCocos2d.cpp.REMOVED.git-id index 1cbf820276..6dd7bd14d7 100644 --- a/scripting/lua/cocos2dx_support/LuaCocos2d.cpp.REMOVED.git-id +++ b/scripting/lua/cocos2dx_support/LuaCocos2d.cpp.REMOVED.git-id @@ -1 +1 @@ -5a7e5635d52e83fd5083588da3ed657152d523cb \ No newline at end of file +7cb982a0fdfc6ad650535099fa5fadf5d05073e4 \ No newline at end of file