提交 4f821d39 编写于 作者: M Mr.doob

TextureLoader: Clean up.

上级 613b6e86
......@@ -18,12 +18,12 @@ Object.assign( TextureLoader.prototype, {
load: function ( url, onLoad, onProgress, onError ) {
var texture = new Texture();
var loader = new ImageLoader( this.manager );
loader.setCrossOrigin( this.crossOrigin );
loader.setPath( this.path );
var image = loader.load( url, function ( image ) {
var texture = new Texture();
texture.image = loader.load( url, function () {
// JPEGs can't have an alpha channel, so memory can be saved by storing them as RGB.
var isJPEG = url.search( /\.(jpg|jpeg)$/ ) > 0 || url.search( /^data\:image\/jpeg/ ) === 0;
......@@ -39,7 +39,6 @@ Object.assign( TextureLoader.prototype, {
}, onProgress, onError );
texture.image = image;
return texture;
},
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册