Merge pull request #941 from minggo/gles20

fix some bugs
This commit is contained in:
minggo 2012-05-30 00:44:22 -07:00
commit 80389d0611
3 changed files with 8 additions and 12 deletions

View File

@ -1,15 +1,11 @@
#ifndef __CCPLATFORMDEFINE_H__
#define __CCPLATFORMDEFINE_H__
#include <assert.h>
#define CC_DLL
#define CC_ASSERT(cond) \
if (! (cond)) \
{ \
char content[100]; \
sprintf(content, "%s function:%s line:%d", __FILE__, __FUNCTION__, __LINE__ - 3); \
CCMessageBox(content, "Assert error"); \
}
#define CC_ASSERT(cond) assert(cond)
#define CC_UNUSED_PARAM(unusedparam) (void)unusedparam

View File

@ -576,16 +576,16 @@ void CCTexture2D::PVRImagesHavePremultipliedAlpha(bool haveAlphaPremultiplied)
void CCTexture2D::generateMipmap()
{
CCAssert( m_uPixelsWide == ccNextPOT(m_uPixelsWide) && m_uPixelsHigh == ccNextPOT(m_uPixelsHigh), "Mimpap texture only works in POT textures");
//CCAssert( m_uPixelsWide == ccNextPOT(m_uPixelsWide) && m_uPixelsHigh == ccNextPOT(m_uPixelsHigh), "Mimpap texture only works in POT textures");
ccGLBindTexture2D( m_uName );
glGenerateMipmap(GL_TEXTURE_2D);
}
void CCTexture2D::setTexParameters(ccTexParams *texParams)
{
CCAssert( (m_uPixelsWide == ccNextPOT(m_uPixelsWide) && m_uPixelsHigh == ccNextPOT(m_uPixelsHigh)) ||
(texParams->wrapS == GL_CLAMP_TO_EDGE && texParams->wrapT == GL_CLAMP_TO_EDGE),
"GL_CLAMP_TO_EDGE should be used in NPOT textures");
//CCAssert( (m_uPixelsWide == ccNextPOT(m_uPixelsWide) && m_uPixelsHigh == ccNextPOT(m_uPixelsHigh)) ||
//(texParams->wrapS == GL_CLAMP_TO_EDGE && texParams->wrapT == GL_CLAMP_TO_EDGE),
//"GL_CLAMP_TO_EDGE should be used in NPOT textures");
ccGLBindTexture2D( m_uName );
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, texParams->minFilter );
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, texParams->magFilter );

View File

@ -95,7 +95,7 @@ void ParticleMainScene::initWithSubTest(int asubtest, int particles)
addChild(infoLabel, 1, kTagInfoLayer);
// particles on stage
CCLabelAtlas *labelAtlas = CCLabelAtlas::labelWithString("0000", "Images/fps_images.png", 16, 24, '.');
CCLabelAtlas *labelAtlas = CCLabelAtlas::labelWithString("0000", "fonts/fps_images.png", 16, 24, '.');
addChild(labelAtlas, 0, kTagLabelAtlas);
labelAtlas->setPosition(ccp(s.width-66,50));