|
@@ -11,7 +11,7 @@ function TextureLoader( manager, imageLoader ) {
|
|
|
|
|
|
Loader.call( this, manager );
|
|
|
|
|
|
- this.imageLoader = imageLoader || new ImageLoader( manager );
|
|
|
+ this.imageLoader = null;
|
|
|
|
|
|
}
|
|
|
|
|
@@ -23,6 +23,12 @@ TextureLoader.prototype = Object.assign( Object.create( Loader.prototype ), {
|
|
|
|
|
|
const texture = new Texture();
|
|
|
|
|
|
+ if ( !this.imageLoader ) {
|
|
|
+
|
|
|
+ this.imageLoader = new ImageLoader( this.manager );
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
const loader = this.imageLoader;
|
|
|
loader.setCrossOrigin( this.crossOrigin );
|
|
|
loader.setPath( this.path );
|
|
@@ -47,6 +53,13 @@ TextureLoader.prototype = Object.assign( Object.create( Loader.prototype ), {
|
|
|
|
|
|
return texture;
|
|
|
|
|
|
+ },
|
|
|
+
|
|
|
+ setImageLoader: function ( imageLoader ) {
|
|
|
+
|
|
|
+ this.imageLoader = imageLoader;
|
|
|
+ return this;
|
|
|
+
|
|
|
}
|
|
|
|
|
|
} );
|