Browse Source

CompressedTextureLoader: Fixed ES5 error.

Mr.doob 9 years ago
parent
commit
7ab7dc04cf
1 changed files with 21 additions and 21 deletions
  1. 21 21
      src/loaders/CompressedTextureLoader.js

+ 21 - 21
src/loaders/CompressedTextureLoader.js

@@ -32,40 +32,40 @@ THREE.CompressedTextureLoader.prototype = {
 		loader.setPath( this.path );
 		loader.setPath( this.path );
 		loader.setResponseType( 'arraybuffer' );
 		loader.setResponseType( 'arraybuffer' );
 
 
-		if ( Array.isArray( url ) ) {
+		function loadTexture( i ) {
 
 
-			var loaded = 0;
+			loader.load( url[ i ], function ( buffer ) {
 
 
-			function loadTexture( i ) {
+				var texDatas = scope._parser( buffer, true );
 
 
-				loader.load( url[ i ], function ( buffer ) {
+				images[ i ] = {
+					width: texDatas.width,
+					height: texDatas.height,
+					format: texDatas.format,
+					mipmaps: texDatas.mipmaps
+				};
 
 
-					var texDatas = scope._parser( buffer, true );
+				loaded += 1;
 
 
-					images[ i ] = {
-						width: texDatas.width,
-						height: texDatas.height,
-						format: texDatas.format,
-						mipmaps: texDatas.mipmaps
-					};
+				if ( loaded === 6 ) {
 
 
-					loaded += 1;
+					if ( texDatas.mipmapCount === 1 )
+						texture.minFilter = THREE.LinearFilter;
 
 
-					if ( loaded === 6 ) {
+					texture.format = texDatas.format;
+					texture.needsUpdate = true;
 
 
-						if ( texDatas.mipmapCount === 1 )
- 							texture.minFilter = THREE.LinearFilter;
+					if ( onLoad ) onLoad( texture );
 
 
-						texture.format = texDatas.format;
-						texture.needsUpdate = true;
+				}
 
 
-						if ( onLoad ) onLoad( texture );
+			}, onProgress, onError );
 
 
-					}
+		}
 
 
-				}, onProgress, onError );
+		if ( Array.isArray( url ) ) {
 
 
-			};
+			var loaded = 0;
 
 
 			for ( var i = 0, il = url.length; i < il; ++ i ) {
 			for ( var i = 0, il = url.length; i < il; ++ i ) {