fixed #1297: fixed a bug in CCRenderTexture::begin. The parameters of glViewPort should not multiply CC_CONTENT_SCALE_FACTOR().

This commit is contained in:
James Chen 2012-06-06 15:56:55 +08:00
parent 734ea54aba
commit 4b7f9f582f
1 changed files with 2 additions and 2 deletions

View File

@ -172,10 +172,10 @@ void CCRenderTexture::begin()
float heightRatio = size.height / texSize.height;
// Adjust the orthographic projection and viewport
glViewport(0, 0, (GLsizei)(texSize.width * CC_CONTENT_SCALE_FACTOR()), (GLsizei)(texSize.height * CC_CONTENT_SCALE_FACTOR()));
glViewport(0, 0, (GLsizei)texSize.width, (GLsizei)texSize.height);
// special viewport for 3d projection + retina display
if ( director->getProjection() == kCCDirectorProjection3D && CC_CONTENT_SCALE_FACTOR() != 1 )
if ( director->getProjection() == kCCDirectorProjection3D && CC_CONTENT_SCALE_FACTOR() != 1.0f )
{
glViewport((GLsizei)(-texSize.width/2), (GLsizei)(-texSize.height/2), (GLsizei)(texSize.width * CC_CONTENT_SCALE_FACTOR()), (GLsizei)(texSize.height * CC_CONTENT_SCALE_FACTOR()));
}