|
@@ -3,23 +3,20 @@
|
|
*/
|
|
*/
|
|
|
|
|
|
import { Cache } from './Cache.js';
|
|
import { Cache } from './Cache.js';
|
|
-import { DefaultLoadingManager } from './LoadingManager.js';
|
|
|
|
-
|
|
|
|
|
|
+import { Loader } from './Loader.js';
|
|
|
|
|
|
function ImageLoader( manager ) {
|
|
function ImageLoader( manager ) {
|
|
|
|
|
|
- this.manager = ( manager !== undefined ) ? manager : DefaultLoadingManager;
|
|
|
|
|
|
+ Loader.call( this, manager );
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
-Object.assign( ImageLoader.prototype, {
|
|
|
|
|
|
+ImageLoader.prototype = Object.assign( Object.create( Loader.prototype ), {
|
|
|
|
|
|
- crossOrigin: 'anonymous',
|
|
|
|
|
|
+ constructor: ImageLoader,
|
|
|
|
|
|
load: function ( url, onLoad, onProgress, onError ) {
|
|
load: function ( url, onLoad, onProgress, onError ) {
|
|
|
|
|
|
- if ( url === undefined ) url = '';
|
|
|
|
-
|
|
|
|
if ( this.path !== undefined ) url = this.path + url;
|
|
if ( this.path !== undefined ) url = this.path + url;
|
|
|
|
|
|
url = this.manager.resolveURL( url );
|
|
url = this.manager.resolveURL( url );
|
|
@@ -86,20 +83,6 @@ Object.assign( ImageLoader.prototype, {
|
|
|
|
|
|
return image;
|
|
return image;
|
|
|
|
|
|
- },
|
|
|
|
-
|
|
|
|
- setCrossOrigin: function ( value ) {
|
|
|
|
-
|
|
|
|
- this.crossOrigin = value;
|
|
|
|
- return this;
|
|
|
|
-
|
|
|
|
- },
|
|
|
|
-
|
|
|
|
- setPath: function ( value ) {
|
|
|
|
-
|
|
|
|
- this.path = value;
|
|
|
|
- return this;
|
|
|
|
-
|
|
|
|
}
|
|
}
|
|
|
|
|
|
} );
|
|
} );
|