From 4b7f9f582f91aa4c855b88ab8f9c30cfa86bac9c Mon Sep 17 00:00:00 2001 From: James Chen Date: Wed, 6 Jun 2012 15:56:55 +0800 Subject: [PATCH] fixed #1297: fixed a bug in CCRenderTexture::begin. The parameters of glViewPort should not multiply CC_CONTENT_SCALE_FACTOR(). --- cocos2dx/misc_nodes/CCRenderTexture.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cocos2dx/misc_nodes/CCRenderTexture.cpp b/cocos2dx/misc_nodes/CCRenderTexture.cpp index 7c144aee43..978406a9eb 100644 --- a/cocos2dx/misc_nodes/CCRenderTexture.cpp +++ b/cocos2dx/misc_nodes/CCRenderTexture.cpp @@ -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())); }