fixed content size issue for retina

This commit is contained in:
Phenix Yu 2012-04-11 19:27:34 +08:00
parent ab8af9e04c
commit 247bf08d98
2 changed files with 14 additions and 10 deletions

View File

@ -524,7 +524,7 @@ void CCSprite::updateTransform(void)
{
arrayMakeObjectsPerformSelector(m_pChildren, updateTransform, CCSprite*);
}
#if CC_SPRITE_DEBUG_DRAW
#if 0//CC_SPRITE_DEBUG_DRAW
// draw bounding box
CCPoint vertices[4] = {
ccp( m_sQuad.bl.vertices.x, m_sQuad.bl.vertices.y ),
@ -586,13 +586,13 @@ void CCSprite::draw(void)
#if CC_SPRITE_DEBUG_DRAW == 1
// draw bounding box
CGPoint vertices[4]={
ccp(quad_.tl.vertices.x,quad_.tl.vertices.y),
ccp(quad_.bl.vertices.x,quad_.bl.vertices.y),
ccp(quad_.br.vertices.x,quad_.br.vertices.y),
ccp(quad_.tr.vertices.x,quad_.tr.vertices.y),
CCPoint vertices[4]={
ccp(m_sQuad.tl.vertices.x,m_sQuad.tl.vertices.y),
ccp(m_sQuad.bl.vertices.x,m_sQuad.bl.vertices.y),
ccp(m_sQuad.br.vertices.x,m_sQuad.br.vertices.y),
ccp(m_sQuad.tr.vertices.x,m_sQuad.tr.vertices.y),
};
ccDrawPoly(vertices, 4, YES);
ccDrawPoly(vertices, 4, true);
#elif CC_SPRITE_DEBUG_DRAW == 2
// draw texture box
CGSize s = self.textureRect.size;

View File

@ -112,14 +112,18 @@ GLuint CCTexture2D::getName()
return m_uName;
}
const CCSize& CCTexture2D::getContentSize()
const CCSize& CCTexture2D::getContentSizeInPixels()
{
return m_tContentSize;
}
const CCSize& CCTexture2D::getContentSizeInPixels()
const CCSize& CCTexture2D::getContentSize()
{
return m_tContentSize;
CCSize ret;
ret.width = m_tContentSize.width / CC_CONTENT_SCALE_FACTOR();
ret.height = m_tContentSize.height / CC_CONTENT_SCALE_FACTOR();
return ret;
}
GLfloat CCTexture2D::getMaxS()