fixed #1165: Close retinaDisplay for HelloWorld by default. Removed ENABLE_ALL_SHADER macro. Fixed some issues in CCSprite.cpp.

This commit is contained in:
James Chen 2012-04-16 12:00:35 +08:00
parent ebc7106164
commit 88951bfeec
3 changed files with 10 additions and 11 deletions

View File

@ -96,7 +96,7 @@ bool AppDelegate::applicationDidFinishLaunching() {
pDirector->setOpenGLView(&CCEGLView::sharedOpenGLView());
// enable High Resource Mode(2x, such as iphone4) and maintains low resource on other devices.
pDirector->enableRetinaDisplay(true);
// pDirector->enableRetinaDisplay(true);
// turn on display FPS
pDirector->setDisplayStats(true);

View File

@ -68,7 +68,7 @@ bool CCShaderCache::init()
loadDefaultShaders();
return true;
}
#define ENABLE_ALL_SHADER 1
void CCShaderCache::loadDefaultShaders()
{
// Position Texture Color shader
@ -86,7 +86,7 @@ void CCShaderCache::loadDefaultShaders()
p->release();
CHECK_GL_ERROR_DEBUG();
#if ENABLE_ALL_SHADER
// Position Texture Color alpha test
p = new CCGLProgram();
p->initWithVertexShaderByteArray(ccPositionTextureColor_vert, ccPositionTextureColorAlphaTest_frag);
@ -135,7 +135,7 @@ void CCShaderCache::loadDefaultShaders()
p->release();
CHECK_GL_ERROR_DEBUG();
#endif
//
// Position, Texture attribs, 1 Color as uniform shader
//
@ -152,7 +152,7 @@ void CCShaderCache::loadDefaultShaders()
p->release();
CHECK_GL_ERROR_DEBUG();
#if ENABLE_ALL_SHADER
//
// Position Texture A8 Color shader
//
@ -186,7 +186,6 @@ void CCShaderCache::loadDefaultShaders()
p->release();
CHECK_GL_ERROR_DEBUG();
#endif
}
CCGLProgram* CCShaderCache::programForKey(const char* key)

View File

@ -523,7 +523,7 @@ void CCSprite::updateTransform(void)
{
arrayMakeObjectsPerformSelector(m_pChildren, updateTransform, CCSprite*);
}
#if 0//CC_SPRITE_DEBUG_DRAW
#if CC_SPRITE_DEBUG_DRAW
// draw bounding box
CCPoint vertices[4] = {
ccp( m_sQuad.bl.vertices.x, m_sQuad.bl.vertices.y ),
@ -594,13 +594,13 @@ void CCSprite::draw(void)
ccDrawPoly(vertices, 4, true);
#elif CC_SPRITE_DEBUG_DRAW == 2
// draw texture box
CGSize s = self.textureRect.size;
CGPoint offsetPix = self.offsetPosition;
CGPoint vertices[4] = {
CCSize s = this->getTextureRect().size;
CCPoint offsetPix = this->getOffsetPosition();
CCPoint vertices[4] = {
ccp(offsetPix.x,offsetPix.y), ccp(offsetPix.x+s.width,offsetPix.y),
ccp(offsetPix.x+s.width,offsetPix.y+s.height), ccp(offsetPix.x,offsetPix.y+s.height)
};
ccDrawPoly(vertices, 4, YES);
ccDrawPoly(vertices, 4, true);
#endif // CC_SPRITE_DEBUG_DRAW
CC_INCREMENT_GL_DRAWS(1);