Browse Source

Fixed SceneLoader not loading Textures properly. Fixes #4908.

Mr.doob 11 years ago
parent
commit
e50e3ed263
1 changed files with 11 additions and 5 deletions
  1. 11 5
      examples/js/loaders/SceneLoader.js

+ 11 - 5
examples/js/loaders/SceneLoader.js

@@ -985,14 +985,20 @@ THREE.SceneLoader.prototype = {
 
 					texture = new THREE.Texture();
 					loader = new THREE.ImageLoader();
-					loader.load( fullUrl, function ( image ) {
+					
+					( function ( texture ) {
 
-						texture.image = image;
-						texture.needsUpdate = true;
+						loader.load( fullUrl, function ( image ) {
 
-						textureCallback();
+							texture.image = image;
+							texture.needsUpdate = true;
 
-					} );
+							textureCallback();
+
+						} );
+					
+					} )( texture )
+					
 
 				}