From dffdef1118f2e59296ac2eb877e9f6d3e121317e Mon Sep 17 00:00:00 2001 From: andyque Date: Tue, 2 Sep 2014 11:21:11 +0800 Subject: [PATCH] fix transition scene stencil buffer --- cocos/2d/CCTransition.cpp | 4 ++-- cocos/2d/CCTransitionProgress.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cocos/2d/CCTransition.cpp b/cocos/2d/CCTransition.cpp index ce8fccc533..97f734d6ae 100644 --- a/cocos/2d/CCTransition.cpp +++ b/cocos/2d/CCTransition.cpp @@ -1278,7 +1278,7 @@ void TransitionCrossFade::onEnter() LayerColor* layer = LayerColor::create(color); // create the first render texture for inScene - RenderTexture* inTexture = RenderTexture::create((int)size.width, (int)size.height); + RenderTexture* inTexture = RenderTexture::create((int)size.width, (int)size.height,Texture2D::PixelFormat::RGBA8888,GL_DEPTH24_STENCIL8); if (nullptr == inTexture) { @@ -1295,7 +1295,7 @@ void TransitionCrossFade::onEnter() inTexture->end(); // create the second render texture for outScene - RenderTexture* outTexture = RenderTexture::create((int)size.width, (int)size.height); + RenderTexture* outTexture = RenderTexture::create((int)size.width, (int)size.height,Texture2D::PixelFormat::RGBA8888,GL_DEPTH24_STENCIL8); outTexture->getSprite()->setAnchorPoint( Vec2(0.5f,0.5f) ); outTexture->setPosition(size.width/2, size.height/2); outTexture->setAnchorPoint( Vec2(0.5f,0.5f) ); diff --git a/cocos/2d/CCTransitionProgress.cpp b/cocos/2d/CCTransitionProgress.cpp index de0e7f8ce3..ddd0710af6 100644 --- a/cocos/2d/CCTransitionProgress.cpp +++ b/cocos/2d/CCTransitionProgress.cpp @@ -71,7 +71,7 @@ void TransitionProgress::onEnter() Size size = Director::getInstance()->getWinSize(); // create the second render texture for outScene - RenderTexture *texture = RenderTexture::create((int)size.width, (int)size.height); + RenderTexture *texture = RenderTexture::create((int)size.width, (int)size.height,Texture2D::PixelFormat::RGBA8888,GL_DEPTH24_STENCIL8); texture->getSprite()->setAnchorPoint(Vec2(0.5f,0.5f)); texture->setPosition(size.width/2, size.height/2); texture->setAnchorPoint(Vec2(0.5f,0.5f));