fixed #1439:synchronize to cocos2d-iphone v2.0.0

This commit is contained in:
minggo 2012-08-22 15:51:25 +08:00
parent 2a9d29ba21
commit 3b442dfc0f
5 changed files with 22 additions and 20 deletions

View File

@ -733,7 +733,7 @@ void CCDirector::showStats(void)
sprintf(m_pszFPS, "%.1f", m_fFrameRate);
m_pFPSLabel->setString(m_pszFPS);
sprintf(m_pszFPS, "%4d", g_uNumberOfDraws);
sprintf(m_pszFPS, "%4lu", (unsigned long)g_uNumberOfDraws);
m_pDrawsLabel->setString(m_pszFPS);
}

View File

@ -214,7 +214,7 @@ bool CCRenderTexture::initWithWidthAndHeight(int w, int h, CCTexture2DPixelForma
//create and attach depth buffer
glGenRenderbuffers(1, &m_uDepthRenderBufffer);
glBindRenderbuffer(GL_RENDERBUFFER, m_uDepthRenderBufffer);
glRenderbufferStorage(GL_RENDERBUFFER, uDepthStencilFormat, powW, powH);
glRenderbufferStorage(GL_RENDERBUFFER, uDepthStencilFormat, (GLsizei)powW, (GLsizei)powH);
glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, m_uDepthRenderBufffer);
// if depth format is the one with stencil part, bind same render buffer as stencil attachment

View File

@ -227,32 +227,32 @@ static bool _initWithString(const char * pText, cocos2d::CCImage::ETextAlign eAl
font = [UIFont fontWithName:fntName size:nSize];
if (font)
{
dim = _calculateStringSizeWithFontOrZFont(str, font, &constrainSize, false);
dim = _calculateStringSizeWithFontOrZFont(str, font, &constrainSize, false);
}
if (! font)
{
font = [[FontManager sharedManager] zFontWithName:fntName pointSize:nSize];
if (font)
{
dim =_calculateStringSizeWithFontOrZFont(str, font, &constrainSize, true);
}
font = [[FontManager sharedManager] zFontWithName:fntName pointSize:nSize];
if (font)
{
dim =_calculateStringSizeWithFontOrZFont(str, font, &constrainSize, true);
}
}
if (! font)
{
fntName = _isValidFontName(pFontName) ? fntName : @"MarkerFelt-Wide";
font = [UIFont fontWithName:fntName size:nSize];
fntName = _isValidFontName(pFontName) ? fntName : @"MarkerFelt-Wide";
font = [UIFont fontWithName:fntName size:nSize];
if (! font)
{
font = [UIFont systemFontOfSize:nSize];
}
if (! font)
{
font = [UIFont systemFontOfSize:nSize];
}
if (font)
{
dim = _calculateStringSizeWithFontOrZFont(str, font, &constrainSize, false);
}
if (font)
{
dim = _calculateStringSizeWithFontOrZFont(str, font, &constrainSize, false);
}
}
CC_BREAK_IF(! font);

View File

@ -267,7 +267,7 @@ bool CCTexturePVR::unpackPVRData(unsigned char* data, unsigned int len)
}
dataSize = widthBlocks * heightBlocks * ((blockSize * bpp) / 8);
float packetLength = (dataLength - dataOffset);
unsigned int packetLength = (dataLength - dataOffset);
packetLength = packetLength > dataSize ? dataSize : packetLength;
//Make record to the mipmaps array and increment coutner

View File

@ -157,7 +157,9 @@ void CCTileMapAtlas::setTile(const ccColor3B& tile, const ccGridSize& position)
// XXX: this method consumes a lot of memory
// XXX: a tree of something like that shall be impolemented
CCInteger *num = (CCInteger*)m_pPosToAtlasIndex->objectForKey(CCString::createWithFormat("%d,%d", position.x, position.y)->getCString());
CCInteger *num = (CCInteger*)m_pPosToAtlasIndex->objectForKey(CCString::createWithFormat("%ld,%ld",
(long)position.x,
(long)position.y)->getCString());
this->updateAtlasValueAt(position, tile, num->getValue());
}
}