diff --git a/cocos2dx/sprite_nodes/CCSprite.cpp b/cocos2dx/sprite_nodes/CCSprite.cpp index b8477b338e..caf58d4417 100644 --- a/cocos2dx/sprite_nodes/CCSprite.cpp +++ b/cocos2dx/sprite_nodes/CCSprite.cpp @@ -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; diff --git a/cocos2dx/textures/CCTexture2D.cpp b/cocos2dx/textures/CCTexture2D.cpp index 42c9456f5a..68a5c8f88a 100644 --- a/cocos2dx/textures/CCTexture2D.cpp +++ b/cocos2dx/textures/CCTexture2D.cpp @@ -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()