diff --git a/cocos2dx/include/FileUtils.h b/cocos2dx/include/FileUtils.h index e96f3bceb2..3d6d935144 100644 --- a/cocos2dx/include/FileUtils.h +++ b/cocos2dx/include/FileUtils.h @@ -48,6 +48,12 @@ public: @warning If you get the file data succeed,you must delete it after used. */ static unsigned char* getFileDataFromZip(const char* pszZipFilePath, const char* pszFileName, unsigned long * pSize); + + /** removes the HD suffix from a path + @returns const char * without the HD suffix + @since v0.99.5 + */ + static const char* ccRemoveHDSuffixFromFile(const char* path); }; } // namespace cocos2d diff --git a/cocos2dx/menu_nodes/CCMenuItem.cpp b/cocos2dx/menu_nodes/CCMenuItem.cpp index c9ed91e8ce..93e15f33fb 100644 --- a/cocos2dx/menu_nodes/CCMenuItem.cpp +++ b/cocos2dx/menu_nodes/CCMenuItem.cpp @@ -145,7 +145,6 @@ namespace cocos2d{ } CCMenuItemLabel::~CCMenuItemLabel() { - CCX_SAFE_RELEASE(m_pLabel); } void CCMenuItemLabel::setString(const char * label) { @@ -378,9 +377,10 @@ namespace cocos2d{ { assert(normalSprite != NULL); CCMenuItem::initWithTarget(target, selector); - this->m_pNormalImage = normalSprite; CCX_SAFE_RETAIN(normalSprite); - this->m_pSelectedImage = selectedSprite; CCX_SAFE_RETAIN(selectedSprite); - this->m_pDisabledImage = disabledSprite; CCX_SAFE_RETAIN(disabledSprite); + setNormalImage(normalSprite); + setSelectedImage(selectedSprite); + setDisabledImage(disabledSprite); + this->setContentSize(m_pNormalImage->getContentSize()); return true; } diff --git a/cocos2dx/particle_nodes/CCParticleSystemQuad.cpp b/cocos2dx/particle_nodes/CCParticleSystemQuad.cpp index 69132a4361..953db682db 100644 --- a/cocos2dx/particle_nodes/CCParticleSystemQuad.cpp +++ b/cocos2dx/particle_nodes/CCParticleSystemQuad.cpp @@ -53,7 +53,15 @@ bool CCParticleSystemQuad::initWithTotalParticles(int numberOfParticles) } // initialize only once the texCoords and the indices - this->initTexCoordsWithRect(CGRectMake((float)0, (float)0, (float)m_pTexture->getPixelsWide(), (float)m_pTexture->getPixelsHigh())); + if (m_pTexture) + { + this->initTexCoordsWithRect(CGRectMake((float)0, (float)0, (float)m_pTexture->getPixelsWide(), (float)m_pTexture->getPixelsHigh())); + } + else + { + this->initTexCoordsWithRect(CGRectMake((float)0, (float)0, (float)1, (float)1)); + } + this->initIndices(); #if CC_USES_VBO @@ -89,8 +97,14 @@ void CCParticleSystemQuad::initTexCoordsWithRect(CGRect pointRect) pointRect.size.width * CC_CONTENT_SCALE_FACTOR(), pointRect.size.height * CC_CONTENT_SCALE_FACTOR()); - GLfloat wide = (GLfloat)m_pTexture->getPixelsWide(); - GLfloat high = (GLfloat)m_pTexture->getPixelsHigh(); + GLfloat wide = (GLfloat) pointRect.size.width; + GLfloat high = (GLfloat) pointRect.size.height; + + if (m_pTexture) + { + wide = (GLfloat)m_pTexture->getPixelsWide(); + high = (GLfloat)m_pTexture->getPixelsHigh(); + } #if CC_FIX_ARTIFACTS_BY_STRECHING_TEXEL GLfloat left = (rect.origin.x*2+1) / (wide*2); diff --git a/cocos2dx/platform/CCDirector_mobile.cpp b/cocos2dx/platform/CCDirector_mobile.cpp index c4aa2efcd5..3a346c2fb9 100644 --- a/cocos2dx/platform/CCDirector_mobile.cpp +++ b/cocos2dx/platform/CCDirector_mobile.cpp @@ -284,11 +284,10 @@ void CCDirector::setOpenGLView(CC_GLVIEW *pobOpenGLView) delete m_pobOpenGLView; // [openGLView_ release] m_pobOpenGLView = pobOpenGLView; - setGLDefaultValues(); - // set size m_obWinSizeInPoints = CCNSSizeToCGSize(m_pobOpenGLView->getSize()); m_obWinSizeInPixels = CGSizeMake(m_obWinSizeInPoints.width * m_fContentScaleFactor, m_obWinSizeInPoints.height * m_fContentScaleFactor); + setGLDefaultValues(); if (m_fContentScaleFactor != 1) { @@ -297,7 +296,7 @@ void CCDirector::setOpenGLView(CC_GLVIEW *pobOpenGLView) CCTouchDispatcher *pTouchDispatcher = CCTouchDispatcher::sharedDispatcher(); m_pobOpenGLView->setTouchDelegate(pTouchDispatcher); - pTouchDispatcher->setDispatchEvents(true); + pTouchDispatcher->setDispatchEvents(true); } } diff --git a/cocos2dx/platform/CCMenu_mobile.cpp b/cocos2dx/platform/CCMenu_mobile.cpp index e246905fb7..59721117e7 100644 --- a/cocos2dx/platform/CCMenu_mobile.cpp +++ b/cocos2dx/platform/CCMenu_mobile.cpp @@ -84,7 +84,7 @@ namespace cocos2d{ { s.height -= r.size.height; } - this->m_tPosition = ccp(s.width/2, s.height/2); + setPosition(ccp(s.width/2, s.height/2)); int z=0; diff --git a/cocos2dx/platform/CCNode_mobile.cpp b/cocos2dx/platform/CCNode_mobile.cpp index d79b640a04..6e88e18470 100644 --- a/cocos2dx/platform/CCNode_mobile.cpp +++ b/cocos2dx/platform/CCNode_mobile.cpp @@ -223,11 +223,11 @@ void CCNode::setPosition(CGPoint newPosition) m_tPosition = newPosition; if (CC_CONTENT_SCALE_FACTOR() == 1) { - m_tAnchorPointInPixels = m_tPosition; + m_tPositionInPixels = m_tPosition; } else { - m_tAnchorPointInPixels = ccpMult(newPosition, CC_CONTENT_SCALE_FACTOR()); + m_tPositionInPixels = ccpMult(newPosition, CC_CONTENT_SCALE_FACTOR()); } m_bIsTransformDirty = m_bIsInverseDirty = true; @@ -343,7 +343,17 @@ void CCNode::setContentSize(CGSize size) if( ! CGSize::CGSizeEqualToSize(size, m_tContentSize) ) { m_tContentSize = size; - m_tAnchorPointInPixels = ccp( m_tContentSize.width * m_tAnchorPoint.x, m_tContentSize.height * m_tAnchorPoint.y ); + + if( CC_CONTENT_SCALE_FACTOR() == 1 ) + { + m_tContentSizeInPixels = m_tContentSize; + } + else + { + m_tContentSizeInPixels = CGSizeMake( size.width * CC_CONTENT_SCALE_FACTOR(), size.height * CC_CONTENT_SCALE_FACTOR() ); + } + + m_tAnchorPointInPixels = ccp( m_tContentSizeInPixels.width * m_tAnchorPoint.x, m_tContentSizeInPixels.height * m_tAnchorPoint.y ); m_bIsTransformDirty = m_bIsInverseDirty = true; #ifdef CC_NODE_TRANSFORM_USING_AFFINE_MATRIX m_bIsTransformGLDirty = true; @@ -641,35 +651,30 @@ void CCNode::detachChild(CCNode *child, bool doCleanup) // helper used by reorderChild & add void CCNode::insertChild(CCNode* child, int z) { - unsigned int index=0; + unsigned int index = 0; + CCNode* a = m_pChildren->getLastObject(); + if (!a || a->getZOrder() <= z) + { + m_pChildren->addObject(child); + } + else + { + CCNode* pNode; + NSMutableArray::NSMutableArrayIterator it; + for( it = m_pChildren->begin(); it != m_pChildren->end(); it++) + { + pNode = (*it); - if(m_pChildren && m_pChildren->count() > 0) - { - CCNode* pNode = m_pChildren->getLastObject(); + if ( pNode && pNode->m_nZOrder > z ) + { + m_pChildren->insertObjectAtIndex(child, index); + break; + } + index++; + } + } - // // quick comparison to improve performance - if (! pNode || pNode->getZOrder() <= z) - { - m_pChildren->addObject(child); - } - else - { - NSMutableArray::NSMutableArrayIterator it; - for( it = m_pChildren->begin(); it != m_pChildren->end(); it++) - { - pNode = (*it); - - if ( pNode && pNode->m_nZOrder > z ) - { - m_pChildren->insertObjectAtIndex(child, index); - break; - } - index++; - } - } - } - - child->setZOrder(z); + child->setZOrder(z); } void CCNode::reorderChild(CCNode *child, int zOrder) @@ -809,9 +814,9 @@ void CCNode::transform() glTranslatef( RENDER_IN_SUBPIXEL(-m_tAnchorPointInPixels.x), RENDER_IN_SUBPIXEL(-m_tAnchorPointInPixels.y), 0); if (m_tAnchorPointInPixels.x != 0 || m_tAnchorPointInPixels.y != 0) - glTranslatef( RENDER_IN_SUBPIXEL(m_tPositionInPixels.x + m_tAnchorPointInPixels.x), RENDER_IN_SUBPIXEL(m_tPosition.y + m_tAnchorPointInPixels.y), m_fVertexZ); + glTranslatef( RENDER_IN_SUBPIXEL(m_tPositionInPixels.x + m_tAnchorPointInPixels.x), RENDER_IN_SUBPIXEL(m_tPositionInPixels.y + m_tAnchorPointInPixels.y), m_fVertexZ); else if ( m_tPositionInPixels.x !=0 || m_tPositionInPixels.y !=0 || m_fVertexZ != 0) - glTranslatef( RENDER_IN_SUBPIXEL(m_tPosition.x), RENDER_IN_SUBPIXEL(m_tPosition.y), m_fVertexZ ); + glTranslatef( RENDER_IN_SUBPIXEL(m_tPositionInPixels.x), RENDER_IN_SUBPIXEL(m_tPositionInPixels.y), m_fVertexZ ); // rotate if (m_fRotation != 0.0f ) @@ -967,7 +972,7 @@ CGAffineTransform CCNode::nodeToParentTransform(void) m_tTransform = CGAffineTransformTranslate(m_tTransform, m_tAnchorPointInPixels.x, m_tAnchorPointInPixels.y); if( ! CGPoint::CGPointEqualToPoint(m_tPositionInPixels, CGPointZero) ) - m_tTransform = CGAffineTransformTranslate(m_tTransform, m_tPositionInPixels.x, m_tPosition.y); + m_tTransform = CGAffineTransformTranslate(m_tTransform, m_tPositionInPixels.x, m_tPositionInPixels.y); if( m_fRotation != 0 ) m_tTransform = CGAffineTransformRotate(m_tTransform, -CC_DEGREES_TO_RADIANS(m_fRotation)); if( ! (m_fScaleX == 1 && m_fScaleY == 1) ) diff --git a/cocos2dx/platform/mac/CCMenu_mac.cpp b/cocos2dx/platform/mac/CCMenu_mac.cpp index a87d408e1f..3c253e2d71 100644 --- a/cocos2dx/platform/mac/CCMenu_mac.cpp +++ b/cocos2dx/platform/mac/CCMenu_mac.cpp @@ -74,7 +74,7 @@ namespace cocos2d{ // XXX: in v0.7, winSize should return the visible size // XXX: so the bar calculation should be done there - this->m_tPosition = ccp(s.width/2, s.height/2); + setPosition(ccp(s.width/2, s.height/2)); int z=0; diff --git a/cocos2dx/platform/mac/CCNode_mac.cpp b/cocos2dx/platform/mac/CCNode_mac.cpp index 80ad97c38a..65fce706bc 100644 --- a/cocos2dx/platform/mac/CCNode_mac.cpp +++ b/cocos2dx/platform/mac/CCNode_mac.cpp @@ -224,11 +224,11 @@ void CCNode::setPosition(CGPoint newPosition) m_tPosition = newPosition; if (CC_CONTENT_SCALE_FACTOR() == 1) { - m_tAnchorPointInPixels = m_tPosition + m_tPositionInPixels = m_tPosition } else { - m_tAnchorPointInPixels = ccpMult(newPosition, CC_CONTENT_SCALE_FACTOR()); + m_tPositionInPixels = ccpMult(newPosition, CC_CONTENT_SCALE_FACTOR()); } m_bIsTransformDirty = m_bIsInverseDirty = true; @@ -239,11 +239,11 @@ void CCNode::setPosition(CGPoint newPosition) void CCNode::setPositionInPixels(CGPoint newPosition) { - m_tAnchorPointInPixels = newPosition; + m_tPositionInPixels = newPosition; if ( CC_CONTENT_SCALE_FACTOR() == 1) { - m_tPosition = m_tAnchorPointInPixels; + m_tPosition = m_tPositionInPixels; } else { @@ -801,9 +801,9 @@ void CCNode::transform() glTranslatef( RENDER_IN_SUBPIXEL(-m_tAnchorPointInPixels.x), RENDER_IN_SUBPIXEL(-m_tAnchorPointInPixels.y), 0); if (m_tAnchorPointInPixels.x != 0 || m_tAnchorPointInPixels.y != 0) - glTranslatef( RENDER_IN_SUBPIXEL(m_tPositionInPixels.x + m_tAnchorPointInPixels.x), RENDER_IN_SUBPIXEL(m_tPosition.y + m_tAnchorPointInPixels.y), m_fVertexZ); + glTranslatef( RENDER_IN_SUBPIXEL(m_tPositionInPixels.x + m_tAnchorPointInPixels.x), RENDER_IN_SUBPIXEL(m_tPositionInPixels.y + m_tAnchorPointInPixels.y), m_fVertexZ); else if ( m_tPositionInPixels.x !=0 || m_tPositionInPixels.y !=0 || m_fVertexZ != 0) - glTranslatef( RENDER_IN_SUBPIXEL(m_tPosition.x), RENDER_IN_SUBPIXEL(m_tPosition.y), m_fVertexZ ); + glTranslatef( RENDER_IN_SUBPIXEL(m_tPositionInPixels.x), RENDER_IN_SUBPIXEL(m_tPositionInPixels.y), m_fVertexZ ); // rotate if (m_fRotation != 0.0f ) diff --git a/cocos2dx/platform/uphone/CCXFileUtils_uphone.cpp b/cocos2dx/platform/uphone/CCXFileUtils_uphone.cpp index 4a35f24c76..53c05ec089 100644 --- a/cocos2dx/platform/uphone/CCXFileUtils_uphone.cpp +++ b/cocos2dx/platform/uphone/CCXFileUtils_uphone.cpp @@ -470,8 +470,33 @@ int CCFileUtils::ccLoadFileIntoMemory(const char *filename, unsigned char **out) const char* CCFileUtils::ccRemoveHDSuffixFromFile( const char *path ) { - ///@todo - return NULL; +#if CC_IS_RETINA_DISPLAY_SUPPORTED + + if( CC_CONTENT_SCALE_FACTOR() == 2 ) + { + std::string curPath = path; + int pos = curPath.rfind("/"); + std::string fileName = curPath.substr(pos + 1); + + std::string filePath = ""; + if (-1 != pos) + { + filePath = curPath.substr(0, pos); + } + + int suffixPos = fileName.rfind(CC_RETINA_DISPLAY_FILENAME_SUFFIX); + if (-1 != suffixPos) + { + fileName.replace(pos, strlen(CC_RETINA_DISPLAY_FILENAME_SUFFIX), ""); + } + + std::string result = filePath + fileName; + return result.c_str(); + } + +#endif // CC_IS_RETINA_DISPLAY_SUPPORTED + + return path; } ////////////////////////////////////////////////// diff --git a/cocos2dx/sprite_nodes/CCSprite.cpp b/cocos2dx/sprite_nodes/CCSprite.cpp index 409eb5b7eb..ff415958cb 100644 --- a/cocos2dx/sprite_nodes/CCSprite.cpp +++ b/cocos2dx/sprite_nodes/CCSprite.cpp @@ -342,7 +342,8 @@ void CCSprite::useSelfRender(void) void CCSprite::useBatchNode(CCSpriteBatchNode *batchNode) { m_bUsesBatchNode = true; - m_pobTextureAtlas = m_pobBatchNode->getTextureAtlas(); // weak ref + m_pobTextureAtlas = batchNode->getTextureAtlas(); // weak ref + m_pobBatchNode = batchNode; } void CCSprite::useSpriteSheetRender(CCSpriteSheetInternalOnly *pSpriteSheet) diff --git a/cocos2dx/sprite_nodes/CCSpriteFrameCache.cpp b/cocos2dx/sprite_nodes/CCSpriteFrameCache.cpp index 5a7e6fe42d..4e6171fd36 100644 --- a/cocos2dx/sprite_nodes/CCSpriteFrameCache.cpp +++ b/cocos2dx/sprite_nodes/CCSpriteFrameCache.cpp @@ -227,7 +227,7 @@ void CCSpriteFrameCache::addSpriteFramesWithFile(const char *pszPlist) // build texture path relative to plist file // stringByDeletingLastPathComponent - string textureBase(pszPlist); + string textureBase(pszPath); int indexOfLastSeperator = textureBase.find_last_of('/'); if (indexOfLastSeperator == textureBase.length() - 1) { @@ -245,6 +245,7 @@ void CCSpriteFrameCache::addSpriteFramesWithFile(const char *pszPlist) else { // build texture path by replacing file extension + texturePath = pszPath; // remove .xxx size_t startPos = texturePath.find_last_of("."); diff --git a/cocos2dx/support/file_support/FileUtils.cpp b/cocos2dx/support/file_support/FileUtils.cpp index 9d556afea9..8824bb66d9 100644 --- a/cocos2dx/support/file_support/FileUtils.cpp +++ b/cocos2dx/support/file_support/FileUtils.cpp @@ -95,4 +95,35 @@ unsigned char* FileUtils::getFileDataFromZip(const char* pszZipFilePath, const c return pBuffer; } +const char* FileUtils::ccRemoveHDSuffixFromFile(const char* path) +{ +#if CC_IS_RETINA_DISPLAY_SUPPORTED + + if( CC_CONTENT_SCALE_FACTOR() == 2 ) + { + std::string curPath = path; + int pos = curPath.rfind("/"); + std::string fileName = curPath.substr(pos + 1); + + std::string filePath = ""; + if (-1 != pos) + { + filePath = curPath.substr(0, pos); + } + + int suffixPos = fileName.rfind(CC_RETINA_DISPLAY_FILENAME_SUFFIX); + if (-1 != suffixPos) + { + fileName.replace(pos, strlen(CC_RETINA_DISPLAY_FILENAME_SUFFIX), ""); + } + + std::string result = filePath + fileName; + return result.c_str(); + } + +#endif // CC_IS_RETINA_DISPLAY_SUPPORTED + + return path; +} + } //namespace cocos2d diff --git a/cocos2dx/tileMap_parallax_nodes/CCTMXLayer.cpp b/cocos2dx/tileMap_parallax_nodes/CCTMXLayer.cpp index f413ea7981..cb092c06b7 100644 --- a/cocos2dx/tileMap_parallax_nodes/CCTMXLayer.cpp +++ b/cocos2dx/tileMap_parallax_nodes/CCTMXLayer.cpp @@ -335,7 +335,7 @@ namespace cocos2d { // get atlas index unsigned int indexForZ = atlasIndexForExistantZ(z); m_pReusedTile->setAtlasIndex(indexForZ); - m_pReusedTile->setDirty(YES); + m_pReusedTile->setDirty(true); m_pReusedTile->updateTransform(); m_pTiles[z] = gid; diff --git a/tests/tests/Box2DTest/Box2dTest.cpp b/tests/tests/Box2DTest/Box2dTest.cpp index ffbe3d270d..33b1061b21 100644 --- a/tests/tests/Box2DTest/Box2dTest.cpp +++ b/tests/tests/Box2DTest/Box2dTest.cpp @@ -121,7 +121,7 @@ void Box2DTestLayer::addNewSpriteWithCoords(CGPoint p) int idx = (CCRANDOM_0_1() > .5 ? 0:1); int idy = (CCRANDOM_0_1() > .5 ? 0:1); CCSprite *sprite = sheet->createSpriteWithRect( CGRectMake(32 * idx,32 * idy,32,32)); - (CCNode*)(sheet)->addChild(sprite); + sheet->addChild(sprite); sprite->setPosition( CGPointMake( p.x, p.y) ); diff --git a/tests/tests/ChipmunkTest/cocos2dChipmunkDemo.cpp b/tests/tests/ChipmunkTest/cocos2dChipmunkDemo.cpp index 35a27d5f1f..841765e3e8 100644 --- a/tests/tests/ChipmunkTest/cocos2dChipmunkDemo.cpp +++ b/tests/tests/ChipmunkTest/cocos2dChipmunkDemo.cpp @@ -31,6 +31,8 @@ about Chipmunk which may change with little to no warning. */ +#include "cocos2d.h" +#include "cocos2dChipmunkDemo.h" #include #include @@ -38,9 +40,6 @@ #include #include -#include "cocos2d.h" -#include "cocos2dChipmunkDemo.h" - #define SLEEP_TICKS 16 //extern chipmunkDemo Test; diff --git a/tests/tests/ChipmunkTest/drawSpace.cpp b/tests/tests/ChipmunkTest/drawSpace.cpp index be562fe60d..13089612fd 100644 --- a/tests/tests/ChipmunkTest/drawSpace.cpp +++ b/tests/tests/ChipmunkTest/drawSpace.cpp @@ -19,16 +19,16 @@ * SOFTWARE. */ +#include "chipmunk.h" +#include "drawSpace.h" +#include "cocos2d.h" + #include #include #include #include #include -#include "chipmunk.h" -#include "drawSpace.h" -#include "cocos2d.h" - /* IMPORTANT - READ ME! diff --git a/tests/tests/SpriteTest/SpriteTest.cpp b/tests/tests/SpriteTest/SpriteTest.cpp index 011dbfab26..8286c9a6c4 100644 --- a/tests/tests/SpriteTest/SpriteTest.cpp +++ b/tests/tests/SpriteTest/SpriteTest.cpp @@ -291,7 +291,7 @@ void SpriteSheet1::addNewSpriteWithCoords(CGPoint p) CCSprite* sprite = CCSprite::spriteWithTexture(sheet->getTexture(), CGRectMake(x,y,85,121)); - (CCNode*)(sheet)->addChild(sprite); + sheet->addChild(sprite); sprite->setPosition( ccp( p.x, p.y) ); @@ -646,7 +646,7 @@ SpriteSheetReorder::SpriteSheetReorder() for(int i=0; i<10; i++) { - CCSprite* s1 = CCSprite::spriteWithSpriteSheet(asmtest, CGRectMake(0, 0, 50, 50)); + CCSprite* s1 = CCSprite::spriteWithSpriteSheet((CCSpriteSheetInternalOnly* )asmtest, CGRectMake(0, 0, 50, 50)); a->addObject(s1); asmtest->addChild(s1, 10); } @@ -718,7 +718,7 @@ SpriteSheetReorderIssue744::SpriteSheetReorderIssue744() CCSpriteBatchNode* sheet = CCSpriteBatchNode::spriteSheetWithFile("Images/grossini_dance_atlas.png", 15); addChild(sheet, 0, kTagSpriteSheet); - CCSprite* sprite = CCSprite::spriteWithSpriteSheet(sheet,CGRectMake(0, 0, 85, 121)); + CCSprite* sprite = CCSprite::spriteWithSpriteSheet((CCSpriteSheetInternalOnly* )sheet,CGRectMake(0, 0, 85, 121)); sprite->setPosition( ccp(s.width/2, s.height/2) ); sheet->addChild(sprite, 3); sheet->reorderChild(sprite, 1); @@ -1871,12 +1871,12 @@ SpriteAnimationSplit::SpriteAnimationSplit() CCTexture2D *texture = CCTextureCache::sharedTextureCache()->addImage("animations/dragon_animation.png"); // manually add frames to the frame cache - CCSpriteFrame *frame0 = CCSpriteFrame::frameWithTexture(texture, CGRectMake(132*0, 132*0, 132, 132), CGPointZero); - CCSpriteFrame *frame1 = CCSpriteFrame::frameWithTexture(texture, CGRectMake(132*1, 132*0, 132, 132), CGPointZero); - CCSpriteFrame *frame2 = CCSpriteFrame::frameWithTexture(texture, CGRectMake(132*2, 132*0, 132, 132), CGPointZero); - CCSpriteFrame *frame3 = CCSpriteFrame::frameWithTexture(texture, CGRectMake(132*3, 132*0, 132, 132), CGPointZero); - CCSpriteFrame *frame4 = CCSpriteFrame::frameWithTexture(texture, CGRectMake(132*0, 132*1, 132, 132), CGPointZero); - CCSpriteFrame *frame5 = CCSpriteFrame::frameWithTexture(texture, CGRectMake(132*1, 132*1, 132, 132), CGPointZero); + CCSpriteFrame *frame0 = CCSpriteFrame::frameWithTexture(texture, CGRectMake(132*0, 132*0, 132, 132)); + CCSpriteFrame *frame1 = CCSpriteFrame::frameWithTexture(texture, CGRectMake(132*1, 132*0, 132, 132)); + CCSpriteFrame *frame2 = CCSpriteFrame::frameWithTexture(texture, CGRectMake(132*2, 132*0, 132, 132)); + CCSpriteFrame *frame3 = CCSpriteFrame::frameWithTexture(texture, CGRectMake(132*3, 132*0, 132, 132)); + CCSpriteFrame *frame4 = CCSpriteFrame::frameWithTexture(texture, CGRectMake(132*0, 132*1, 132, 132)); + CCSpriteFrame *frame5 = CCSpriteFrame::frameWithTexture(texture, CGRectMake(132*1, 132*1, 132, 132)); //