Browse Source

WebGLRenderer: Minor code clean up.

Mr.doob 11 years ago
parent
commit
6e46760d9e
1 changed files with 7 additions and 5 deletions
  1. 7 5
      src/renderers/WebGLRenderer.js

+ 7 - 5
src/renderers/WebGLRenderer.js

@@ -5721,8 +5721,8 @@ THREE.WebGLRenderer = function ( parameters ) {
 
 				_gl.pixelStorei( _gl.UNPACK_FLIP_Y_WEBGL, texture.flipY );
 
-				var isCompressed = texture instanceof THREE.CompressedTexture,
-				isDataTexture = texture.image[0] instanceof THREE.DataTexture;
+				var isCompressed = texture instanceof THREE.CompressedTexture;
+				var isDataTexture = texture.image[ 0 ] instanceof THREE.DataTexture;
 
 				var cubeImage = [];
 
@@ -5751,14 +5751,16 @@ THREE.WebGLRenderer = function ( parameters ) {
 
 					if ( ! isCompressed ) {
 
-						if ( isDataTexture )
+						if ( isDataTexture ) {
 
-							_gl.texImage2D( _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, 0, glFormat, cubeImage[i].width, cubeImage[i].height, 0, glFormat, glType, cubeImage[i].data );
+							_gl.texImage2D( _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, 0, glFormat, cubeImage[ i ].width, cubeImage[ i ].height, 0, glFormat, glType, cubeImage[ i ].data );
 
-						else
+						} else {
 
 							_gl.texImage2D( _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, 0, glFormat, glFormat, glType, cubeImage[ i ] );
 
+						}
+
 					} else {
 
 						var mipmap, mipmaps = cubeImage[ i ].mipmaps;