Selaa lähdekoodia

Code clean up.

Mr.doob 11 vuotta sitten
vanhempi
commit
5eb496d950
1 muutettua tiedostoa jossa 18 lisäystä ja 0 poistoa
  1. 18 0
      src/renderers/WebGLRenderer.js

+ 18 - 0
src/renderers/WebGLRenderer.js

@@ -5604,14 +5604,23 @@ THREE.WebGLRenderer = function ( parameters ) {
 			for ( var i = 0, il = mipmaps.length; i < il; i ++ ) {
 
 				mipmap = mipmaps[ i ];
+
 				if ( texture.format !== THREE.RGBAFormat && texture.format !== THREE.RGBFormat ) {
+
 					if ( _compressedTextureFormats.indexOf( glFormat ) > -1 ) {
+
 						_gl.compressedTexImage2D( _gl.TEXTURE_2D, i, glFormat, mipmap.width, mipmap.height, 0, mipmap.data );
+
 					} else {
+
 						console.warn( "Attempt to load unsupported compressed texture format" );
+
 					}
+
 				} else {
+
 					_gl.texImage2D( _gl.TEXTURE_2D, i, glFormat, mipmap.width, mipmap.height, 0, glFormat, glType, mipmap.data );
+
 				}
 
 			}
@@ -5750,20 +5759,29 @@ THREE.WebGLRenderer = function ( parameters ) {
 						for ( var j = 0, jl = mipmaps.length; j < jl; j ++ ) {
 
 							mipmap = mipmaps[ j ];
+
 							if ( texture.format !== THREE.RGBAFormat && texture.format !== THREE.RGBFormat ) {
 
 								if ( _compressedTextureFormats.indexOf( glFormat ) > -1 ) {
+
 									_gl.compressedTexImage2D( _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, j, glFormat, mipmap.width, mipmap.height, 0, mipmap.data );
+
 								} else {
+
 									console.warn( "Attempt to load unsupported compressed texture format" );
+
 								}
 
 							} else {
+
 								_gl.texImage2D( _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, j, glFormat, mipmap.width, mipmap.height, 0, glFormat, glType, mipmap.data );
+
 							}
 
 						}
+
 					}
+
 				}
 
 				if ( texture.generateMipmaps && isImagePowerOfTwo ) {