2
0
ncannasse 7 жил өмнө
parent
commit
8a6423d241

+ 3 - 19
hide/view/Particles2D.hx

@@ -2,26 +2,10 @@ package hide.view;
 import h2d.Graphics in Graphics;
 import h2d.Particles.ParticleGroup in ParticleGroup;
 
-@:access(hide.view.Particles2D)
-private class Particles extends h2d.Particles {
-
-	var parts : Particles2D;
-
-	public function new(parts, parent) {
-		this.parts = parts;
-		super(parent);
-	}
-
-	override function loadTexture( path : String ) {
-		return parts.scene.loadTexture(parts.state.path, path);
-	}
-
-}
-
 class Particles2D extends FileView {
 
 	var scene : hide.comp.Scene;
-	var parts : Particles;
+	var parts : h2d.Particles;
 	var partsProps : { ?backgroundPath : String, ?dx : Int, ?dy : Int };
 
 	var uiProps : { showBounds : Bool };
@@ -30,7 +14,7 @@ class Particles2D extends FileView {
 	var properties : hide.comp.PropsEditor;
 
 	override function getDefaultContent() {
-		var p = new Particles(this,null);
+		var p = new h2d.Particles(null);
 		p.addGroup().name = "Default";
 		return haxe.io.Bytes.ofString(ide.toJSON(p.save()));
 	}
@@ -53,7 +37,7 @@ class Particles2D extends FileView {
 	}
 
 	function init() {
-		parts = new Particles(this, scene.s2d);
+		parts = new h2d.Particles(scene.s2d);
 		parts.smooth = true;
 		parts.load(haxe.Json.parse(sys.io.File.getContent(getPath())));
 		uiProps = { showBounds: false };

+ 2 - 18
hide/view/Particles3D.hx

@@ -1,25 +1,9 @@
 package hide.view;
 
-@:access(hide.view.Particles3D)
-class GpuParticles extends h3d.parts.GpuParticles {
-
-	var parts : Particles3D;
-
-	public function new(parts, parent) {
-		super(parent);
-		this.parts = parts;
-	}
-
-	override function loadTexture( path : String ) {
-		return parts.scene.loadTexture(parts.state.path, path);
-	}
-
-}
-
 class Particles3D extends FileView {
 
 	var scene : hide.comp.Scene;
-	var parts : GpuParticles;
+	var parts : h3d.parts.GpuParticles;
 	var properties : hide.comp.PropsEditor;
 	var bounds : h3d.scene.Box;
 	var model : h3d.scene.Object;
@@ -177,7 +161,7 @@ class Particles3D extends FileView {
 	}
 
 	function init() {
-		parts = new GpuParticles(this,scene.s3d);
+		parts = new h3d.parts.GpuParticles(scene.s3d);
 		parts.load(haxe.Json.parse(sys.io.File.getContent(getPath())));
 		bounds = new h3d.scene.Box(0x808080, parts.bounds, parts);
 		bounds.visible = false;