@@ -164,7 +164,8 @@ - (id)initWithDuration:(NSTimeInterval)duration
164
164
_runTime = 0 .0f ;
165
165
_progress = 0 .0f ;
166
166
167
- _transitionPixelFormat = CCTexturePixelFormat_RGB565;
167
+ _transitionPixelFormat = CCTexturePixelFormat_RGBA8888;
168
+ _transitionDepthStencilFormat = GL_DEPTH24_STENCIL8_OES;
168
169
169
170
// disable touch during transition
170
171
self.userInteractionEnabled = NO ;
@@ -197,15 +198,15 @@ - (void)startTransition:(CCScene *)scene
197
198
// create texture for outgoing scene
198
199
_outgoingTexture = [CCRenderTexture renderTextureWithWidth: rect.size.width / _outgoingDownScale
199
200
height: rect.size.height / _outgoingDownScale
200
- pixelFormat: _transitionPixelFormat];
201
+ pixelFormat: _transitionPixelFormat depthStencilFormat: _transitionDepthStencilFormat ];
201
202
_outgoingTexture.position = CGPointMake (rect.size .width * 0 .5f + rect.origin .x , rect.size .height * 0 .5f + rect.origin .y );
202
203
_outgoingTexture.scale = _outgoingDownScale;
203
204
[self addChild: _outgoingTexture z: _outgoingOverIncoming];
204
205
205
206
// create texture for incoming scene
206
207
_incomingTexture = [CCRenderTexture renderTextureWithWidth: rect.size.width / _incomingDownScale
207
208
height: rect.size.height / _incomingDownScale
208
- pixelFormat: _transitionPixelFormat];
209
+ pixelFormat: _transitionPixelFormat depthStencilFormat: _transitionDepthStencilFormat ];
209
210
_incomingTexture.position = CGPointMake (rect.size .width * 0 .5f + rect.origin .x , rect.size .height * 0 .5f + rect.origin .y );
210
211
_incomingTexture.scale = _incomingDownScale;
211
212
[self addChild: _incomingTexture];
@@ -277,7 +278,7 @@ - (void)renderOutgoing:(float)progress
277
278
_outgoingScene.scale = oldScale / _outgoingDownScale;
278
279
279
280
glGetFloatv (GL_COLOR_CLEAR_VALUE, clearColor);
280
- [_outgoingTexture beginWithClear: clearColor[0 ] g: clearColor[1 ] b: clearColor[2 ] a: clearColor[3 ]];
281
+ [_outgoingTexture beginWithClear: clearColor[0 ] g: clearColor[1 ] b: clearColor[2 ] a: clearColor[3 ] depth: 1.0 stencil: 0 ];
281
282
[_outgoingScene visit ];
282
283
[_outgoingTexture end ];
283
284
@@ -294,7 +295,7 @@ - (void)renderIncoming:(float)progress
294
295
_incomingScene.scale = oldScale / _incomingDownScale;
295
296
296
297
glGetFloatv (GL_COLOR_CLEAR_VALUE, clearColor);
297
- [_incomingTexture beginWithClear: clearColor[0 ] g: clearColor[1 ] b: clearColor[2 ] a: clearColor[3 ]];
298
+ [_incomingTexture beginWithClear: clearColor[0 ] g: clearColor[1 ] b: clearColor[2 ] a: clearColor[3 ] depth: 1.0 stencil: 0 ];
298
299
[_incomingScene visit ];
299
300
[_incomingTexture end ];
300
301
0 commit comments