mirror of https://github.com/axmolengine/axmol.git
Merge branch 'upto-0.99.5' of https://github.com/cocos2d/cocos2d-x into merger
This commit is contained in:
commit
e312bb4d18
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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<CCNode*>::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<CCNode*>::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) )
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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 )
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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(".");
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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) );
|
||||
|
||||
|
|
|
@ -31,6 +31,8 @@
|
|||
about Chipmunk which may change with little to no warning.
|
||||
*/
|
||||
|
||||
#include "cocos2d.h"
|
||||
#include "cocos2dChipmunkDemo.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
|
@ -38,9 +40,6 @@
|
|||
#include <math.h>
|
||||
#include <limits.h>
|
||||
|
||||
#include "cocos2d.h"
|
||||
#include "cocos2dChipmunkDemo.h"
|
||||
|
||||
#define SLEEP_TICKS 16
|
||||
|
||||
//extern chipmunkDemo Test;
|
||||
|
|
|
@ -19,16 +19,16 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "chipmunk.h"
|
||||
#include "drawSpace.h"
|
||||
#include "cocos2d.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <math.h>
|
||||
#include <limits.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "chipmunk.h"
|
||||
#include "drawSpace.h"
|
||||
#include "cocos2d.h"
|
||||
|
||||
/*
|
||||
IMPORTANT - READ ME!
|
||||
|
||||
|
|
|
@ -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));
|
||||
|
||||
|
||||
//
|
||||
|
|
Loading…
Reference in New Issue