|
@@ -6,10 +6,10 @@
|
|
|
|
|
|
THREE.Texture = function ( image, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy ) {
|
|
|
|
|
|
- this.id = THREE.TextureLibrary.length;
|
|
|
-
|
|
|
THREE.TextureLibrary.push( this );
|
|
|
|
|
|
+ this.id = THREE.TextureIdCount ++;
|
|
|
+
|
|
|
this.image = image;
|
|
|
|
|
|
this.mapping = mapping !== undefined ? mapping : new THREE.UVMapping();
|
|
@@ -73,10 +73,12 @@ THREE.Texture.prototype = {
|
|
|
|
|
|
deallocate: function () {
|
|
|
|
|
|
- THREE.TextureLibrary[ this.id ] = null;
|
|
|
+ var index = THREE.TextureLibrary.indexOf( this );
|
|
|
+ if ( index !== -1 ) THREE.TextureLibrary.splice( index, 1 );
|
|
|
|
|
|
}
|
|
|
|
|
|
};
|
|
|
|
|
|
+THREE.TextureIdCount = 0;
|
|
|
THREE.TextureLibrary = [];
|