Skip to content

Commit 15da3dd

Browse files
committed
ImageUtils: Deprecated loadTexture() and loadTextureCube().
1 parent a1fa8ac commit 15da3dd

File tree

1 file changed

+6
-12
lines changed

1 file changed

+6
-12
lines changed

src/extras/ImageUtils.js

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,12 @@ THREE.ImageUtils = {
1010

1111
loadTexture: function ( url, mapping, onLoad, onError ) {
1212

13+
console.warn( 'THREE.ImageUtils.loadTexture is being deprecated. Use THREE.TextureLoader() instead.' );
14+
1315
var loader = new THREE.TextureLoader();
1416
loader.setCrossOrigin( this.crossOrigin );
1517

16-
var texture = loader.load( url, function ( texture ) {
17-
18-
if ( onLoad ) onLoad( texture );
19-
20-
}, undefined, onError );
21-
18+
var texture = loader.load( url, onLoad, undefined, onError );
2219
texture.mapping = mapping;
2320

2421
return texture;
@@ -27,15 +24,12 @@ THREE.ImageUtils = {
2724

2825
loadTextureCube: function ( urls, mapping, onLoad, onError ) {
2926

27+
console.warn( 'THREE.ImageUtils.loadTextureCube is being deprecated. Use THREE.CubeTextureLoader() instead.' );
28+
3029
var loader = new THREE.CubeTextureLoader();
3130
loader.setCrossOrigin( this.crossOrigin );
3231

33-
var texture = loader.load( urls, function ( texture ) {
34-
35-
if ( onLoad ) onLoad( texture );
36-
37-
}, undefined, onError );
38-
32+
var texture = loader.load( urls, onLoad, undefined, onError );
3933
texture.mapping = mapping;
4034

4135
return texture;

0 commit comments

Comments
 (0)