Browse Source

prevent texture disposal while in clone()

ncannasse 7 năm trước cách đây
mục cha
commit
a021155495
1 tập tin đã thay đổi với 3 bổ sung0 xóa
  1. 3 0
      h3d/mat/Texture.hx

+ 3 - 0
h3d/mat/Texture.hx

@@ -96,8 +96,11 @@ class Texture {
 	}
 	}
 
 
 	public function clone( ?allocPos : h3d.impl.AllocPos ) {
 	public function clone( ?allocPos : h3d.impl.AllocPos ) {
+		var old = lastFrame;
+		preventAutoDispose();
 		var t = new Texture(width, height, null, format, allocPos);
 		var t = new Texture(width, height, null, format, allocPos);
 		h3d.pass.Copy.run(this, t);
 		h3d.pass.Copy.run(this, t);
+		lastFrame = old;
 		return t;
 		return t;
 	}
 	}