Skip to content

Commit d9b523f

Browse files
committed
Merge branch 'develop' of https://github.com/cocos2d/cocos2d-iphone into develop
2 parents 871c227 + 986091f commit d9b523f

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

cocos2d/CCEffectGlass.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ -(void)buildRenderPasses
233233

234234

235235
// Get the transform from the affected node's local coordinates to the environment node.
236-
GLKMatrix4 effectNodeToRefractEnvNode = CCEffectUtilsTransformFromNodeToNode(pass.node, weakSelf.refractionEnvironment, nil);
236+
GLKMatrix4 effectNodeToRefractEnvNode = weakSelf.refractionEnvironment ? CCEffectUtilsTransformFromNodeToNode(pass.node, weakSelf.refractionEnvironment, nil) : GLKMatrix4Identity;
237237

238238
// Concatenate the node to environment transform with the environment node to environment texture transform.
239239
// The result takes us from the affected node's coordinates to the environment's texture coordinates. We need
@@ -256,7 +256,7 @@ -(void)buildRenderPasses
256256

257257

258258
// Get the transform from the affected node's local coordinates to the environment node.
259-
GLKMatrix4 effectNodeToReflectEnvNode = CCEffectUtilsTransformFromNodeToNode(pass.node, weakSelf.reflectionEnvironment, nil);
259+
GLKMatrix4 effectNodeToReflectEnvNode = weakSelf.reflectionEnvironment ? CCEffectUtilsTransformFromNodeToNode(pass.node, weakSelf.reflectionEnvironment, nil) : GLKMatrix4Identity;
260260

261261
// Concatenate the node to environment transform with the environment node to environment texture transform.
262262
// The result takes us from the affected node's coordinates to the environment's texture coordinates. We need

cocos2d/CCEffectReflection.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ -(void)buildRenderPasses
200200

201201

202202
// Get the transform from the affected node's local coordinates to the environment node.
203-
GLKMatrix4 effectNodeToReflectEnvNode = CCEffectUtilsTransformFromNodeToNode(pass.node, weakSelf.environment, nil);
203+
GLKMatrix4 effectNodeToReflectEnvNode = weakSelf.environment ? CCEffectUtilsTransformFromNodeToNode(pass.node, weakSelf.environment, nil) : GLKMatrix4Identity;
204204

205205
// Concatenate the node to environment transform with the environment node to environment texture transform.
206206
// The result takes us from the affected node's coordinates to the environment's texture coordinates. We need

cocos2d/CCEffectRefraction.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ -(void)buildRenderPasses
162162
pass.shaderUniforms[weakSelf.uniformTranslationTable[@"u_envMap"]] = weakSelf.environment.texture ?: [CCTexture none];
163163

164164
// Get the transform from the affected node's local coordinates to the environment node.
165-
GLKMatrix4 effectNodeToRefractEnvNode = CCEffectUtilsTransformFromNodeToNode(pass.node, weakSelf.environment, nil);
165+
GLKMatrix4 effectNodeToRefractEnvNode = weakSelf.environment ? CCEffectUtilsTransformFromNodeToNode(pass.node, weakSelf.environment, nil) : GLKMatrix4Identity;
166166

167167
// Concatenate the node to environment transform with the environment node to environment texture transform.
168168
// The result takes us from the affected node's coordinates to the environment's texture coordinates. We need

0 commit comments

Comments
 (0)