Browse Source

keep texture flags on clone()

ncannasse 7 years ago
parent
commit
4fe1ae9f04
1 changed files with 5 additions and 1 deletions
  1. 5 1
      h3d/mat/Texture.hx

+ 5 - 1
h3d/mat/Texture.hx

@@ -101,7 +101,11 @@ class Texture {
 	public function clone( ?allocPos : h3d.impl.AllocPos ) {
 		var old = lastFrame;
 		preventAutoDispose();
-		var t = new Texture(width, height, null, format, allocPos);
+		var flags = [];
+		for( f in [Target,Cube,MipMapped,IsArray] )
+			if( this.flags.has(f) )
+				flags.push(f);
+		var t = new Texture(width, height, flags, format, allocPos);
 		h3d.pass.Copy.run(this, t);
 		lastFrame = old;
 		return t;