Browse Source

Revert change of passing in arguments to constructor

I forgot that `copy` is possibly used elsewhere, and that it also needs to copy those parameters.
Daniel Hritzkiv 10 years ago
parent
commit
ce1a1f14df
2 changed files with 21 additions and 4 deletions
  1. 6 3
      src/textures/CubeTexture.js
  2. 15 1
      src/textures/Texture.js

+ 6 - 3
src/textures/CubeTexture.js

@@ -16,9 +16,12 @@ THREE.CubeTexture = function ( images, mapping, wrapS, wrapT, magFilter, minFilt
 THREE.CubeTexture.prototype = Object.create( THREE.Texture.prototype );
 THREE.CubeTexture.prototype.constructor = THREE.CubeTexture;
 
-THREE.CubeTexture.prototype.clone = function () {
+THREE.CubeTexture.prototype.copy = function ( source ) {
 
-	var texture = new this.constructor( this.images, this.mapping, this.wrapS, this.wrapT, this.magFilter, this.minFilter, this.format, this.type, this.anisotropy );
-	return texture.copy( this );
+	THREE.Texture.prototype.copy.call( this, source );
+	
+	this.images = source.images;
+	
+	return this;
 
 };

+ 15 - 1
src/textures/Texture.js

@@ -57,14 +57,28 @@ THREE.Texture.prototype = {
 
 	clone: function () {
 
-		var texture = new this.constructor( this.image, this.mapping, this.wrapS, this.wrapT, this.magFilter, this.minFilter, this.format, this.type, this.anisotropy );
+		var texture = new this.constructor();
 		return texture.copy( this );
 
 	},
 
 	copy: function ( source ) {
 
+		this.image = source.image;
 		this.mipmaps = source.mipmaps.slice( 0 );
+		
+		this.mapping = source.mapping;		
+		
+		this.wrapS = source.wrapS;		
+		this.wrapT = source.wrapT;		
+		
+		this.magFilter = source.magFilter;		
+		this.minFilter = source.minFilter;		
+		
+		this.anisotropy = source.anisotropy;		
+		
+		this.format = source.format;		
+		this.type = source.type;
 
 		this.offset.copy( source.offset );
 		this.repeat.copy( source.repeat );