Преглед на файлове

refactor samples, use templates to generate build directory

Nicolas Cannasse преди 9 години
родител
ревизия
7c509113d1
променени са 99 файла, в които са добавени 317 реда и са изтрити 1886 реда
  1. 1 0
      .gitignore
  2. 0 7
      samples/2d/2d_ogl.hxml
  3. 0 53
      samples/2d/2d_ogl.hxproj
  4. 0 9
      samples/2d/2d_swf.hxml
  5. 0 57
      samples/2d/2d_swf.hxproj
  6. 0 7
      samples/2d/2d_wgl.hxml
  7. 0 53
      samples/2d/2d_wgl.hxproj
  8. 0 31
      samples/All.hx
  9. 2 2
      samples/Base2D.hx
  10. 2 2
      samples/Basic3D.hx
  11. 0 0
      samples/Bounds.hx
  12. 4 4
      samples/CollideCheck.hx
  13. 2 2
      samples/Filters.hx
  14. 88 0
      samples/Generator.hx
  15. 2 2
      samples/GraphicsDraw.hx
  16. 12 5
      samples/Interactive.hx
  17. 2 2
      samples/Lights.hx
  18. 2 2
      samples/Mask.hx
  19. 11 11
      samples/Network.hx
  20. 2 2
      samples/Quaternion.hx
  21. 2 3
      samples/Sao.hx
  22. 2 3
      samples/Shadows.hx
  23. 2 2
      samples/Skin.hx
  24. 6 13
      samples/Sound.hx
  25. 25 0
      samples/VisualComponents.hx
  26. 2 2
      samples/World.hx
  27. 4 1
      samples/all.hxml
  28. 0 15
      samples/basic/basic_lime.xml
  29. 0 7
      samples/basic/basic_ogl.hxml
  30. 0 56
      samples/basic/basic_ogl.hxproj
  31. 0 9
      samples/basic/basic_swf.hxml
  32. 0 7
      samples/basic/basic_wgl.hxml
  33. 0 55
      samples/basic/basic_wgl.hxproj
  34. 0 9
      samples/basic/index.html
  35. 0 10
      samples/bounds/bounds.hxml
  36. 0 59
      samples/bounds/bounds.hxproj
  37. 0 9
      samples/bounds/index.html
  38. 0 8
      samples/col/col.hxml
  39. 0 53
      samples/col/col.hxproj
  40. 0 16
      samples/col/index.html
  41. 0 31
      samples/comps/Comps.hx
  42. 0 98
      samples/comps/components.html
  43. 0 15
      samples/comps/comps.hxml
  44. 0 53
      samples/comps/comps.hxproj
  45. 0 6
      samples/comps/index.html
  46. 0 11
      samples/draw/draw.hxml
  47. 0 55
      samples/draw/draw.hxproj
  48. 0 9
      samples/draw/index.html
  49. 0 7
      samples/filters/filters_swf.hxml
  50. 0 57
      samples/filters/filters_swf.hxproj
  51. 0 5
      samples/filters/filters_wgl.hxml
  52. 0 53
      samples/filters/filters_wgl.hxproj
  53. 0 10
      samples/filters/index.html
  54. 3 0
      samples/gen.hxml
  55. 0 7
      samples/interact/interact.hxml
  56. 0 57
      samples/interact/interact.hxproj
  57. 0 9
      samples/lights/index.html
  58. 0 17
      samples/lights/lights.hxml
  59. 0 56
      samples/lights/lights.hxproj
  60. 0 7
      samples/maskcache/mask.hxml
  61. 0 57
      samples/maskcache/mask.hxproj
  62. 0 14
      samples/network/network.app
  63. 0 7
      samples/network/network.hxml
  64. 0 57
      samples/network/network.hxproj
  65. 0 9
      samples/quat/index.html
  66. 0 4
      samples/quat/quat.hxml
  67. 0 9
      samples/sao/index.html
  68. 0 11
      samples/sao/sao.hxml
  69. 0 56
      samples/sao/sao.hxproj
  70. 0 9
      samples/shadows/index.html
  71. 0 17
      samples/shadows/shadows.hxml
  72. 0 56
      samples/shadows/shadows.hxproj
  73. 0 9
      samples/skin/index.html
  74. 0 16
      samples/skin/skin.hxml
  75. 0 56
      samples/skin/skin.hxproj
  76. 0 0
      samples/skin_res/Model.FBX
  77. 0 0
      samples/skin_res/Skeleton01.png
  78. 0 0
      samples/skin_res/Sword01.png
  79. 0 16
      samples/sound/index.html
  80. 0 10
      samples/sound/sound.hxml
  81. 0 53
      samples/sound/sound.hxproj
  82. 0 0
      samples/sound_res/music_loop.mp3
  83. 0 0
      samples/sound_res/sound_fx.wav
  84. 0 18
      samples/spine/Main.hx
  85. 0 6
      samples/spine/spine.hxml
  86. 0 60
      samples/spine/spine.hxproj
  87. 1 1
      samples/templates/LimeApp.hx
  88. 5 0
      samples/templates/__name_js.hxml
  89. 50 51
      samples/templates/__name_js.hxproj
  90. 15 0
      samples/templates/__name_lime.xml
  91. 7 0
      samples/templates/__name_swf.hxml
  92. 55 59
      samples/templates/__name_swf.hxproj
  93. 8 8
      samples/templates/index.html
  94. 0 6
      samples/world/world.hxml
  95. 0 60
      samples/world/world.hxproj
  96. 0 0
      samples/world_res/rock.hmd
  97. 0 0
      samples/world_res/rockTexture.jpg
  98. 0 0
      samples/world_res/tree.hmd
  99. 0 0
      samples/world_res/treeTexture.png

+ 1 - 0
.gitignore

@@ -6,3 +6,4 @@ bin
 .tmp
 /hxd/net/inspect.min.css
 /hxd/inspect/inspect.min.css
+/samples/build

+ 0 - 7
samples/2d/2d_ogl.hxml

@@ -1,7 +0,0 @@
--cpp bin
--main Main
--lib heaps
--dce full
--D resourcesPath=../res
---macro include('h2d',['h2d.CdbLevel'])
--lib hxsdl

+ 0 - 53
samples/2d/2d_ogl.hxproj

@@ -1,53 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<project version="2">
-  <!-- Output SWF options -->
-  <output>
-    <movie outputType="Application" />
-    <movie input="" />
-    <movie path="bin" />
-    <movie fps="60" />
-    <movie width="800" />
-    <movie height="600" />
-    <movie version="0" />
-    <movie minorVersion="0" />
-    <movie platform="C++" />
-    <movie background="#FFFFFF" />
-  </output>
-  <!-- Other classes to be compiled into your SWF -->
-  <classpaths>
-    <!-- example: <class path="..." /> -->
-  </classpaths>
-  <!-- Build options -->
-  <build>
-    <option directives="" />
-    <option flashStrict="False" />
-    <option noInlineOnDebug="False" />
-    <option mainClass="Main" />
-    <option enabledebug="False" />
-    <option additional="-lib heaps&#xA;-dce full&#xA;-D resourcesPath=../res&#xA;--macro include('h2d',['h2d.CdbLevel'])&#xA;-lib hxsdl" />
-  </build>
-  <!-- haxelib libraries -->
-  <haxelib>
-    <!-- example: <library name="..." /> -->
-  </haxelib>
-  <!-- Class files to compile (other referenced classes will automatically be included) -->
-  <compileTargets>
-    <!-- example: <compile path="..." /> -->
-  </compileTargets>
-  <!-- Paths to exclude from the Project Explorer tree -->
-  <hiddenPaths>
-    <hidden path="obj" />
-  </hiddenPaths>
-  <!-- Executed before build -->
-  <preBuildCommand />
-  <!-- Executed after build -->
-  <postBuildCommand alwaysRun="False" />
-  <!-- Other project options -->
-  <options>
-    <option showHiddenPaths="False" />
-    <option testMovie="OpenDocument" />
-    <option testMovieCommand="bin\Main-debug.exe" />
-  </options>
-  <!-- Plugin storage -->
-  <storage />
-</project>

+ 0 - 9
samples/2d/2d_swf.hxml

@@ -1,9 +0,0 @@
--swf main.swf
--swf-header 800:600:60:FFFFFF
--swf-version 11.8
--main Main
--lib heaps
--dce full
--D resourcesPath=../res
--D source-map-content
---macro include('h2d',['h2d.CdbLevel'])

+ 0 - 57
samples/2d/2d_swf.hxproj

@@ -1,57 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<project version="2">
-  <!-- Output SWF options -->
-  <output>
-    <movie outputType="Application" />
-    <movie input="" />
-    <movie path="main.swf" />
-    <movie fps="60" />
-    <movie width="800" />
-    <movie height="600" />
-    <movie version="11" />
-    <movie minorVersion="8" />
-    <movie platform="Flash Player" />
-    <movie background="#FFFFFF" />
-  </output>
-  <!-- Other classes to be compiled into your SWF -->
-  <classpaths>
-    <!-- example: <class path="..." /> -->
-  </classpaths>
-  <!-- Build options -->
-  <build>
-    <option directives="" />
-    <option flashStrict="False" />
-    <option noInlineOnDebug="False" />
-    <option mainClass="Main" />
-    <option enabledebug="False" />
-    <option additional="-lib heaps&#xA;-dce full&#xA;-D resourcesPath=../res&#xA;-D source-map-content&#xA;--macro include('h2d',['h2d.CdbLevel'])" />
-  </build>
-  <!-- haxelib libraries -->
-  <haxelib>
-    <!-- example: <library name="..." /> -->
-  </haxelib>
-  <!-- Class files to compile (other referenced classes will automatically be included) -->
-  <compileTargets>
-    <!-- example: <compile path="..." /> -->
-  </compileTargets>
-  <!-- Assets to embed into the output SWF -->
-  <library>
-    <!-- example: <asset path="..." id="..." update="..." glyphs="..." mode="..." place="..." sharepoint="..." /> -->
-  </library>
-  <!-- Paths to exclude from the Project Explorer tree -->
-  <hiddenPaths>
-    <hidden path="obj" />
-  </hiddenPaths>
-  <!-- Executed before build -->
-  <preBuildCommand />
-  <!-- Executed after build -->
-  <postBuildCommand alwaysRun="False" />
-  <!-- Other project options -->
-  <options>
-    <option showHiddenPaths="False" />
-    <option testMovie="OpenDocument" />
-    <option testMovieCommand="main.swf" />
-  </options>
-  <!-- Plugin storage -->
-  <storage />
-</project>

+ 0 - 7
samples/2d/2d_wgl.hxml

@@ -1,7 +0,0 @@
--js main.js
--main Main
--lib heaps
--dce full
--D resourcesPath=../res
--D source-map-content
---macro include('h2d',['h2d.CdbLevel'])

+ 0 - 53
samples/2d/2d_wgl.hxproj

@@ -1,53 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<project version="2">
-  <!-- Output SWF options -->
-  <output>
-    <movie outputType="Application" />
-    <movie input="" />
-    <movie path="main.js" />
-    <movie fps="60" />
-    <movie width="800" />
-    <movie height="600" />
-    <movie version="0" />
-    <movie minorVersion="0" />
-    <movie platform="JavaScript" />
-    <movie background="#FFFFFF" />
-  </output>
-  <!-- Other classes to be compiled into your SWF -->
-  <classpaths>
-    <!-- example: <class path="..." /> -->
-  </classpaths>
-  <!-- Build options -->
-  <build>
-    <option directives="" />
-    <option flashStrict="False" />
-    <option noInlineOnDebug="False" />
-    <option mainClass="Main" />
-    <option enabledebug="False" />
-    <option additional="-lib heaps&#xA;-dce full&#xA;-D resourcesPath=../res&#xA;-D source-map-content&#xA;--macro include('h2d',['h2d.CdbLevel'])" />
-  </build>
-  <!-- haxelib libraries -->
-  <haxelib>
-    <!-- example: <library name="..." /> -->
-  </haxelib>
-  <!-- Class files to compile (other referenced classes will automatically be included) -->
-  <compileTargets>
-    <!-- example: <compile path="..." /> -->
-  </compileTargets>
-  <!-- Paths to exclude from the Project Explorer tree -->
-  <hiddenPaths>
-    <hidden path="obj" />
-  </hiddenPaths>
-  <!-- Executed before build -->
-  <preBuildCommand />
-  <!-- Executed after build -->
-  <postBuildCommand alwaysRun="False" />
-  <!-- Other project options -->
-  <options>
-    <option showHiddenPaths="False" />
-    <option testMovie="OpenDocument" />
-    <option testMovieCommand="index.html" />
-  </options>
-  <!-- Plugin storage -->
-  <storage />
-</project>

+ 0 - 31
samples/All.hx

@@ -1,31 +0,0 @@
-class All {
-	static function main() {
-		var cwd = Sys.getCwd();
-		var errored = [];
-		for( f in sys.FileSystem.readDirectory(".") ) {
-			if( !sys.FileSystem.isDirectory(f) )
-				continue;
-			var dir = cwd+"/"+f;
-			Sys.setCwd(dir);
-			for( d in sys.FileSystem.readDirectory(dir) ) {
-				if( !StringTools.endsWith(d,".hxml") ) continue;
-				var name = d.substr(0,-5);
-				if( f != name ) name = f+"/"+name;
-				var pass = false;
-				Sys.println(name);
-				try {
-					if( Sys.command("haxe "+d) == 0 ) pass = true;
-				} catch( e : Dynamic ) {
-					Sys.println(e);
-				}
-				if( !pass ) errored.push(name);
-			}
-			Sys.setCwd(cwd);
-		}
-		if( errored.length > 0 ) {
-			Sys.println(errored.length+" ERRORED : "+errored);
-			Sys.exit(1);
-		}
-		Sys.println("DONE");
-	}
-}

+ 2 - 2
samples/2d/Main.hx → samples/Base2D.hx

@@ -1,4 +1,4 @@
-class Main extends hxd.App {
+class Base2D extends hxd.App {
 
 	var spr : h2d.Sprite;
 	var tf : h2d.Text;
@@ -85,7 +85,7 @@ class Main extends hxd.App {
 
 	static function main() {
 		hxd.Res.initEmbed();
-		new Main();
+		new Base2D();
 	}
 
 }

+ 2 - 2
samples/basic/Main.hx → samples/Basic3D.hx

@@ -1,6 +1,6 @@
 import h3d.scene.*;
 
-class Main extends hxd.App {
+class Basic3D extends hxd.App {
 
 	var time : Float = 0.;
 	var obj1 : Mesh;
@@ -75,7 +75,7 @@ class Main extends hxd.App {
 		hxd.Res.initEmbed();
 
 		// start the application
-		new Main();
+		new Basic3D();
 	}
 
 }

+ 0 - 0
samples/bounds/Bounds.hx → samples/Bounds.hx


+ 4 - 4
samples/col/TestCol.hx → samples/CollideCheck.hx

@@ -1,4 +1,4 @@
-class TestCol extends hxd.App {
+class CollideCheck extends hxd.App {
 
 	static var RW = 100;
 	static var RH = 30;
@@ -14,11 +14,11 @@ class TestCol extends hxd.App {
 		rrect.beginFill(0xFFFFFFFF);
 		for( i in 0...k+1 ) {
 			var a = Math.PI * i / k - Math.PI / 2;
-			rrect.addPoint(size + RH * Math.cos(a), RH * Math.sin(a));
+			rrect.lineTo(size + RH * Math.cos(a), RH * Math.sin(a));
 		}
 		for( i in 0...k+1 ) {
 			var a = Math.PI * i / k + Math.PI / 2;
-			rrect.addPoint(-size + RH * Math.cos(a), RH * Math.sin(a));
+			rrect.lineTo(-size + RH * Math.cos(a), RH * Math.sin(a));
 		}
 		rrect.endFill();
 
@@ -82,7 +82,7 @@ class TestCol extends hxd.App {
 	}
 
 	static function main() {
-		new TestCol();
+		new CollideCheck();
 	}
 
 }

+ 2 - 2
samples/filters/Main.hx → samples/Filters.hx

@@ -1,6 +1,6 @@
 import hxd.Key in K;
 
-class Main extends hxd.App {
+class Filters extends hxd.App {
 
 	var spr : h2d.Sprite;
 	var bmp : h2d.Bitmap;
@@ -71,7 +71,7 @@ class Main extends hxd.App {
 
 	static function main() {
 		hxd.Res.initEmbed();
-		new Main();
+		new Filters();
 	}
 
 }

+ 88 - 0
samples/Generator.hx

@@ -0,0 +1,88 @@
+class Generator {
+	
+	static function compile() {
+		var errored = [];
+		Sys.setCwd("build");
+		var cwd = Sys.getCwd();
+		for( f in sys.FileSystem.readDirectory(".") ) {
+			if( !sys.FileSystem.isDirectory(f) )
+				continue;
+			var dir = cwd+"/"+f;
+			Sys.setCwd(dir);
+			for( d in sys.FileSystem.readDirectory(dir) ) {
+				if( !StringTools.endsWith(d,".hxml") ) continue;
+				var name = d.substr(0,-5);
+				if( f != name ) name = f+"/"+name;
+				var pass = false;
+				Sys.println(name);
+				try {
+					if( Sys.command("haxe "+d) == 0 ) pass = true;
+				} catch( e : Dynamic ) {
+					Sys.println(e);
+				}
+				if( !pass ) errored.push(name);
+			}
+			Sys.setCwd(cwd);
+		}
+		if( errored.length > 0 ) {
+			Sys.println(errored.length+" ERRORED : "+errored);
+			Sys.exit(1);
+		}
+		Sys.println("DONE");
+	}
+	
+	#if hscript
+	static function generateProjects() {
+		
+		var templates = [];
+		for( f in sys.FileSystem.readDirectory("templates") )
+			templates.push({ file : f, data : sys.io.File.getContent("templates/" + f) });
+		
+		try sys.FileSystem.createDirectory("build") catch( e : Dynamic ) {};
+		sys.io.File.saveContent("build/README.txt","This directory is automatically generated by samples/Script.hx using samples/templates");
+		
+		for( f in sys.FileSystem.readDirectory(".") ) {
+		
+			if( sys.FileSystem.isDirectory(f) || !StringTools.endsWith(f,".hx") )
+				continue;
+			
+			var title = f.split(".").shift();
+			
+			if( title == "Generator" ) continue;
+			
+			var name = title.charAt(0).toLowerCase() + title.substr(1);
+			var params = [];
+			if( sys.FileSystem.exists(name+"_res") )
+				params.push("-D resourcesPath=../../"+name+"_res");
+			
+			var content = sys.io.File.getContent(f);
+			~/\/\/PARAM=(.*)/g.map(content,function(r) { params.push(StringTools.trim(r.matched(1))); return ""; });
+			
+			var context = {
+				main : title,
+				name : name,
+				params : params.join("\n"),
+				StringTools : StringTools,
+			};
+			
+			try sys.FileSystem.createDirectory("build/"+name) catch( e : Dynamic ) {};
+			#if !silent
+			Sys.println(name);
+			#end
+
+			var interp = new hscript.Interp();
+			for( f in Reflect.fields(context) )
+				interp.variables.set(f, Reflect.field(context, f));
+			for( t in templates ) {
+				var data = ~/::([^:]+)::/g.map(t.data, function(r) {
+					var script = r.matched(1);
+					var expr = new hscript.Parser().parseString(script);
+					return "" + interp.execute(expr);
+				});
+				var file = t.file.split("__name").join(name);
+				sys.io.File.saveContent("build/" + name + "/" + file, data);
+			}
+		}
+	}	
+	#end
+}

+ 2 - 2
samples/draw/Draw.hx → samples/GraphicsDraw.hx

@@ -1,4 +1,4 @@
-class Draw extends hxd.App {
+class GraphicsDraw extends hxd.App {
 
 	var bclone : h2d.Bitmap;
 	var texture : h3d.mat.Texture;
@@ -100,7 +100,7 @@ class Draw extends hxd.App {
 	}
 
 	static function main() {
-		new Draw();
+		new GraphicsDraw();
 	}
 
 }

+ 12 - 5
samples/interact/Main.hx → samples/Interactive.hx

@@ -1,9 +1,11 @@
+//PARAM=-D resourcesPath=../../skin_res
 
-class Main extends hxd.App {
+class Interactive extends hxd.App {
 
 	var rnd : hxd.Rand;
 	var light : h3d.scene.DirLight;
 	var obj : h3d.scene.Object;
+	var b : h2d.Interactive;
 
 	function initInteract( i : h3d.scene.Interactive, m : h3d.scene.Mesh ) {
 		var beacon = null;
@@ -77,10 +79,8 @@ class Main extends hxd.App {
 			initInteract(i, m);
 		}
 
-		var b = new h2d.Interactive(150, 100, s2d);
+		b = new h2d.Interactive(150, 100, s2d);
 		b.backgroundColor = 0x80204060;
-		b.x = 300;
-		b.y = 150;
 		b.rotation = Math.PI / 3;
 		//b.scaleX = 1.5; // TODO
 
@@ -102,6 +102,13 @@ class Main extends hxd.App {
 			pix.remove();
 			pix = null;
 		};
+		
+		onResize();
+	}
+	
+	override function onResize() {
+		b.x = (s2d.width >> 1) - 200;
+		b.y = 150;
 	}
 
 	override function update(dt:Float) {
@@ -111,6 +118,6 @@ class Main extends hxd.App {
 
 	static function main() {
 		hxd.Res.initEmbed();
-		new Main();
+		new Interactive();
 	}
 }

+ 2 - 2
samples/lights/Main.hx → samples/Lights.hx

@@ -1,6 +1,6 @@
 import hxd.Math;
 
-class Main extends hxd.App {
+class Lights extends hxd.App {
 
 	var time : Float = 0.;
 	var lights : Array<h3d.scene.PointLight>;
@@ -69,7 +69,7 @@ class Main extends hxd.App {
 	}
 
 	static function main() {
-		new Main();
+		new Lights();
 	}
 
 }

+ 2 - 2
samples/maskcache/Main.hx → samples/Mask.hx

@@ -1,4 +1,4 @@
-class Main extends hxd.App {
+class Mask extends hxd.App {
 
 	var spr : h2d.Sprite;
 	var spr2 : h2d.Sprite;
@@ -46,7 +46,7 @@ class Main extends hxd.App {
 
 	static function main() {
 		hxd.Res.initEmbed();
-		new Main();
+		new Mask();
 	}
 
 }

+ 11 - 11
samples/network/Main.hx → samples/Network.hx

@@ -6,7 +6,7 @@ class Cursor implements hxd.net.NetworkSerializable {
 	@:s public var x(default, set) : Float;
 	@:s public var y(default, set) : Float;
 
-	var main : Main;
+	var net : Network;
 	var bmp : h2d.Graphics;
 
 	public function new( color, uid=0 ) {
@@ -37,9 +37,9 @@ class Cursor implements hxd.net.NetworkSerializable {
 	}
 
 	function init() {
-		main = Main.inst;
-		main.log("Init "+this);
-		bmp = new h2d.Graphics(main.s2d);
+		net = Network.inst;
+		net.log("Init "+this);
+		bmp = new h2d.Graphics(net.s2d);
 		bmp.beginFill(color, 0.5);
 		bmp.drawCircle(0, 0, 10);
 		bmp.beginFill(color);
@@ -55,7 +55,7 @@ class Cursor implements hxd.net.NetworkSerializable {
 
 	@:rpc function blink( s : Float ) {
 		bmp.scale(s);
-		main.event.waitUntil(function(dt) {
+		net.event.waitUntil(function(dt) {
 			bmp.scaleX *= Math.pow(0.9, dt);
 			bmp.scaleY *= Math.pow(0.9, dt);
 			if( bmp.scaleX < 1 ) {
@@ -71,15 +71,15 @@ class Cursor implements hxd.net.NetworkSerializable {
 		// refresh bmp
 		this.x = x;
 		this.y = y;
-		if( uid == Main.inst.uid ) {
-			Main.inst.cursor = this;
-			Main.inst.host.self.ownerObject = this;
+		if( uid == net.uid ) {
+			net.cursor = this;
+			net.host.self.ownerObject = this;
 		}
 	}
 
 }
 
-class Main extends hxd.App {
+class Network extends hxd.App {
 
 	static var HOST = "127.0.0.1";
 	static var PORT = 6676;
@@ -145,12 +145,12 @@ class Main extends hxd.App {
 		host.flush();
 	}
 
-	public static var inst : Main;
+	public static var inst : Network;
 	static function main() {
 		#if air3
 		@:privateAccess hxd.Stage.getInstance().multipleWindowsSupport = true;
 		#end
-		inst = new Main();
+		inst = new Network();
 	}
 
 }

+ 2 - 2
samples/quat/QuatDemo.hx → samples/Quaternion.hx

@@ -1,4 +1,4 @@
-class QuatDemo extends hxd.App {
+class Quaternion extends hxd.App {
 
 	var cube : h3d.scene.Mesh;
 
@@ -73,7 +73,7 @@ class QuatDemo extends hxd.App {
 	}
 
 	static function main() {
-		new QuatDemo();
+		new Quaternion();
 	}
 
 }

+ 2 - 3
samples/sao/Main.hx → samples/Sao.hx

@@ -39,7 +39,7 @@ class CustomRenderer extends h3d.scene.Renderer {
 
 }
 
-class Main extends hxd.App {
+class Sao extends hxd.App {
 
 	var time : Float = 0.;
 	var wscale = 1.;
@@ -141,9 +141,8 @@ class Main extends hxd.App {
 		s3d.camera.pos.set(camdist * Math.cos(time), camdist * Math.sin(time), camdist * 0.5);
 	}
 
-	public static var inst : Main;
 	static function main() {
-		inst = new Main();
+		new Sao();
 	}
 
 }

+ 2 - 3
samples/shadows/Main.hx → samples/Shadows.hx

@@ -1,6 +1,6 @@
 import hxd.Math;
 
-class Main extends hxd.App {
+class Shadows extends hxd.App {
 
 	var time : Float = 0.;
 	var spheres : Array<h3d.scene.Object>;
@@ -46,9 +46,8 @@ class Main extends hxd.App {
 		dir.direction.set(Math.cos(time), Math.sin(time) * 2, -1);
 	}
 
-	public static var inst : Main;
 	static function main() {
-		inst = new Main();
+		new Shadows();
 	}
 
 }

+ 2 - 2
samples/skin/Main.hx → samples/Skin.hx

@@ -1,6 +1,6 @@
 import h3d.scene.*;
 
-class Main extends hxd.App {
+class Skin extends hxd.App {
 
 	var cache : h3d.prim.ModelCache;
 
@@ -69,7 +69,7 @@ class Main extends hxd.App {
 
 	static function main() {
 		hxd.Res.initEmbed();
-		new Main();
+		new Skin();
 	}
 
 }

+ 6 - 13
samples/sound/Sound.hx → samples/Sound.hx

@@ -20,17 +20,10 @@ class Sound extends hxd.App {
 	static var music : hxd.snd.Worker;
 
 	override function init() {
-		//var c = new NoiseChannel();
-		//haxe.Timer.delay(c.stop, 1000);
-/*
-		#if (cpp || stb_ogg_sound || true)
-		var c = hxd.Res.music_loop_ogg.play(true);
-		#else
+		var c = new NoiseChannel();
+		haxe.Timer.delay(c.stop, 1000);
 		var c = hxd.Res.music_loop.play(true);
-		#end
-		c.onEnd = function() trace("LOOP");*/
-
-		hxd.Res.haunted_intro_ogg.play().queueNext(hxd.Res.haunted_loop_ogg);
+		c.onEnd = function() trace("LOOP");
 	}
 
 	override function update(dt:Float) {
@@ -45,9 +38,9 @@ class Sound extends hxd.App {
 
 	static function main() {
 		hxd.Res.initEmbed({compressSounds:true});
-//		if( hxd.res.Sound.startWorker() )
-//			return;
+		if( hxd.res.Sound.startWorker() )
+			return;
 		new Sound();
 	}
 
-}
+}

+ 25 - 0
samples/VisualComponents.hx

@@ -0,0 +1,25 @@
+/*
+	Package h2d.comp contains some visual components to create IDE in Heaps.
+	** This is no longer much maintained.
+*/
+class VisualComponents extends hxd.App {
+
+	var document : h2d.comp.Component;
+	
+	override function init() {
+		document = h2d.comp.Parser.fromHtml(hxd.res.Embed.getFileContent("components.html"),{ fmt : hxd.Math.fmt });
+		s2d.addChild(document);
+	}
+	
+	override function onResize() {
+		document.setStyle(null);
+	}
+
+	static function main() {
+		// make sure that arial.ttf is inside the current class path (remove "true" to get errors)
+		// embedding the font will greatly improve visibility on flash (might be required on some targets)
+		hxd.res.Embed.embedFont("Arial.ttf", true);
+		new VisualComponents();
+	}
+
+}

+ 2 - 2
samples/world/Main.hx → samples/World.hx

@@ -1,6 +1,6 @@
 import hxd.Key in K;
 
-class Main extends hxd.App {
+class World extends hxd.App {
 
 	var world : h3d.scene.World;
 	var shadow :h3d.pass.ShadowMap;
@@ -83,7 +83,7 @@ class Main extends hxd.App {
 
 	static function main() {
 		hxd.Res.initEmbed();
-		new Main();
+		new World();
 	}
 
 }

+ 4 - 1
samples/all.hxml

@@ -1 +1,4 @@
---macro All.main()
+-D silent
+gen.hxml
+--next
+--macro Generator.compile()

+ 0 - 15
samples/basic/basic_lime.xml

@@ -1,15 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<project>
-	<meta title="Basic" package="heaps.samples.Basic" version="1.0.0" company="" />
-	
-	<app main="LimeApp" file="Basic" path="bin" />
-	<app min-swf-version="12.0" />
-	
-	<window background="#000000" fps="30" />
-	<window width="800" height="600" unless="mobile" />
-	<window orientation="landscape" vsync="false" antialiasing="0" if="cpp" colors32b="true" allow-high-dpi="true"/>
-
-	<haxedef name="resourcesPath" value="../res"/>
-	<haxelib name="lime" />
-	<haxelib name="heaps" />
-</project>

+ 0 - 7
samples/basic/basic_ogl.hxml

@@ -1,7 +0,0 @@
--cpp bin
--main Main
--lib heaps
--D resourcesPath=../res
--dce full
--lib hxsdl
---macro include('h3d')

+ 0 - 56
samples/basic/basic_ogl.hxproj

@@ -1,56 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<project version="2">
-  <!-- Output SWF options -->
-  <output>
-    <movie outputType="Application" />
-    <movie input="" />
-    <movie path="bin" />
-    <movie fps="60" />
-    <movie width="800" />
-    <movie height="600" />
-    <movie version="1" />
-    <movie minorVersion="0" />
-    <movie platform="C++" />
-    <movie background="#FFFFFF" />
-  </output>
-  <!-- Other classes to be compiled into your SWF -->
-  <classpaths>
-    <!-- example: <class path="..." /> -->
-  </classpaths>
-  <!-- Build options -->
-  <build>
-    <option directives="" />
-    <option flashStrict="False" />
-    <option noInlineOnDebug="False" />
-    <option mainClass="Main" />
-    <option enabledebug="False" />
-    <option additional="-lib heaps&#xA;-D resourcesPath=../res&#xA;-dce full&#xA;-lib hxsdl&#xA;--macro include('h3d')" />
-  </build>
-  <!-- haxelib libraries -->
-  <haxelib>
-    <!-- example: <library name="..." /> -->
-  </haxelib>
-  <!-- Class files to compile (other referenced classes will automatically be included) -->
-  <compileTargets>
-    <!-- example: <compile path="..." /> -->
-  </compileTargets>
-  <!-- Paths to exclude from the Project Explorer tree -->
-  <hiddenPaths>
-    <hidden path="engine.hxml" />
-    <hidden path="obj" />
-    <hidden path="main.js" />
-    <hidden path="main.js.map" />
-  </hiddenPaths>
-  <!-- Executed before build -->
-  <preBuildCommand />
-  <!-- Executed after build -->
-  <postBuildCommand alwaysRun="False" />
-  <!-- Other project options -->
-  <options>
-    <option showHiddenPaths="False" />
-    <option testMovie="OpenDocument" />
-    <option testMovieCommand="bin\Main-Debug.exe" />
-  </options>
-  <!-- Plugin storage -->
-  <storage />
-</project>

+ 0 - 9
samples/basic/basic_swf.hxml

@@ -1,9 +0,0 @@
--swf main.swf
--swf-header 1280:800:60:FFFFFF
---flash-strict
--swf-version 14
--main Main
--lib heaps
--D resourcesPath=../res
--dce full
---macro include('h3d')

+ 0 - 7
samples/basic/basic_wgl.hxml

@@ -1,7 +0,0 @@
--js main.js
--main Main
--lib heaps
--D resourcesPath=../res
--D source-map-content
--dce full
---macro include('h3d')

+ 0 - 55
samples/basic/basic_wgl.hxproj

@@ -1,55 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<project version="2">
-  <!-- Output SWF options -->
-  <output>
-    <movie outputType="Application" />
-    <movie input="" />
-    <movie path="main.js" />
-    <movie fps="60" />
-    <movie width="800" />
-    <movie height="600" />
-    <movie version="1" />
-    <movie minorVersion="0" />
-    <movie platform="JavaScript" />
-    <movie background="#FFFFFF" />
-  </output>
-  <!-- Other classes to be compiled into your SWF -->
-  <classpaths>
-    <!-- example: <class path="..." /> -->
-  </classpaths>
-  <!-- Build options -->
-  <build>
-    <option directives="" />
-    <option flashStrict="False" />
-    <option mainClass="Main" />
-    <option enabledebug="False" />
-    <option additional="-lib heaps&#xA;-D resourcesPath=../res&#xA;-D source-map-content&#xA;-dce full&#xA;--macro include('h3d')" />
-  </build>
-  <!-- haxelib libraries -->
-  <haxelib>
-    <!-- example: <library name="..." /> -->
-  </haxelib>
-  <!-- Class files to compile (other referenced classes will automatically be included) -->
-  <compileTargets>
-    <!-- example: <compile path="..." /> -->
-  </compileTargets>
-  <!-- Paths to exclude from the Project Explorer tree -->
-  <hiddenPaths>
-    <hidden path="engine.hxml" />
-    <hidden path="obj" />
-    <hidden path="main.js" />
-    <hidden path="main.js.map" />
-  </hiddenPaths>
-  <!-- Executed before build -->
-  <preBuildCommand />
-  <!-- Executed after build -->
-  <postBuildCommand alwaysRun="False" />
-  <!-- Other project options -->
-  <options>
-    <option showHiddenPaths="False" />
-    <option testMovie="OpenDocument" />
-    <option testMovieCommand="index.html" />
-  </options>
-  <!-- Plugin storage -->
-  <storage />
-</project>

+ 0 - 9
samples/basic/index.html

@@ -1,9 +0,0 @@
-<html>
-<head><meta charset="utf-8"/></head>
-<body style="margin:0;padding:0;background-color:black">
-	
-	<canvas id="webgl" style="width:100%;height:100%"></canvas>
-	<script type="text/javascript" src="main.js"></script>
-	
-</body>
-</html>

+ 0 - 10
samples/bounds/bounds.hxml

@@ -1,10 +0,0 @@
--swf bounds.swf
--swf-header 800:600:60:FFFFFF
---flash-strict
--swf-version 11.6
--main Bounds
--lib heaps
---next
--js main.js
--main Bounds
--lib heaps

+ 0 - 59
samples/bounds/bounds.hxproj

@@ -1,59 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<project version="2">
-  <!-- Output SWF options -->
-  <output>
-    <movie outputType="Application" />
-    <movie input="" />
-    <movie path="bounds.swf" />
-    <movie fps="60" />
-    <movie width="800" />
-    <movie height="600" />
-    <movie version="11" />
-    <movie minorVersion="6" />
-    <movie platform="Flash Player" />
-    <movie background="#FFFFFF" />
-  </output>
-  <!-- Other classes to be compiled into your SWF -->
-  <classpaths>
-    <!-- example: <class path="..." /> -->
-  </classpaths>
-  <!-- Build options -->
-  <build>
-    <option directives="" />
-    <option flashStrict="True" />
-    <option noInlineOnDebug="False" />
-    <option mainClass="Bounds" />
-    <option enabledebug="False" />
-    <option additional="-lib heaps&#xA;--next&#xA;-js main.js&#xA;-main Bounds&#xA;-lib heaps" />
-  </build>
-  <!-- haxelib libraries -->
-  <haxelib>
-    <!-- example: <library name="..." /> -->
-  </haxelib>
-  <!-- Class files to compile (other referenced classes will automatically be included) -->
-  <compileTargets>
-    <!-- example: <compile path="..." /> -->
-  </compileTargets>
-  <!-- Assets to embed into the output SWF -->
-  <library>
-    <!-- example: <asset path="..." id="..." update="..." glyphs="..." mode="..." place="..." sharepoint="..." /> -->
-  </library>
-  <!-- Paths to exclude from the Project Explorer tree -->
-  <hiddenPaths>
-    <hidden path="draw.swf" />
-    <hidden path="draw.hxml" />
-    <hidden path="obj" />
-  </hiddenPaths>
-  <!-- Executed before build -->
-  <preBuildCommand />
-  <!-- Executed after build -->
-  <postBuildCommand alwaysRun="False" />
-  <!-- Other project options -->
-  <options>
-    <option showHiddenPaths="False" />
-    <option testMovie="Default" />
-    <option testMovieCommand="" />
-  </options>
-  <!-- Plugin storage -->
-  <storage />
-</project>

+ 0 - 9
samples/bounds/index.html

@@ -1,9 +0,0 @@
-<html>
-<head><meta charset="utf-8"/></head>
-<body style="margin:0;padding:0;background-color:black">
-	
-	<canvas id="webgl" style="width:100%;height:100%"></canvas>
-	<script type="text/javascript" src="main.js"></script>
-	
-</body>
-</html>

+ 0 - 8
samples/col/col.hxml

@@ -1,8 +0,0 @@
--js main.js
--main TestCol
--lib heaps
---next
--swf main.swf
--swf-version 11.8
--main TestCol
--lib heaps

+ 0 - 53
samples/col/col.hxproj

@@ -1,53 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<project version="2">
-  <!-- Output SWF options -->
-  <output>
-    <movie outputType="Application" />
-    <movie input="" />
-    <movie path="main.js" />
-    <movie fps="60" />
-    <movie width="800" />
-    <movie height="600" />
-    <movie version="1" />
-    <movie minorVersion="0" />
-    <movie platform="JavaScript" />
-    <movie background="#FFFFFF" />
-  </output>
-  <!-- Other classes to be compiled into your SWF -->
-  <classpaths>
-    <!-- example: <class path="..." /> -->
-  </classpaths>
-  <!-- Build options -->
-  <build>
-    <option directives="" />
-    <option flashStrict="False" />
-    <option noInlineOnDebug="False" />
-    <option mainClass="TestCol" />
-    <option enabledebug="False" />
-    <option additional="-lib heaps&#xA;--next&#xA;-swf main.swf&#xA;-swf-version 11.8&#xA;-main TestCol&#xA;-lib heaps" />
-  </build>
-  <!-- haxelib libraries -->
-  <haxelib>
-    <!-- example: <library name="..." /> -->
-  </haxelib>
-  <!-- Class files to compile (other referenced classes will automatically be included) -->
-  <compileTargets>
-    <!-- example: <compile path="..." /> -->
-  </compileTargets>
-  <!-- Paths to exclude from the Project Explorer tree -->
-  <hiddenPaths>
-    <hidden path="obj" />
-  </hiddenPaths>
-  <!-- Executed before build -->
-  <preBuildCommand />
-  <!-- Executed after build -->
-  <postBuildCommand alwaysRun="False" />
-  <!-- Other project options -->
-  <options>
-    <option showHiddenPaths="False" />
-    <option testMovie="OpenDocument" />
-    <option testMovieCommand="index.html" />
-  </options>
-  <!-- Plugin storage -->
-  <storage />
-</project>

+ 0 - 16
samples/col/index.html

@@ -1,16 +0,0 @@
-<html>
-<body style="margin:0;padding:0;background-color:red">
-	<script src="http://code.jquery.com/jquery-1.10.2.min.js"></script>
-	
-	<br/>
-	
-	
-	<div id="log"></div>
-	
-	<center>
-		<canvas id="webgl" style="width:80%;height:60%"></canvas>
-	</center>
-	<script type="text/javascript" src="main.js"></script>
-	
-</body>
-</html>

+ 0 - 31
samples/comps/Comps.hx

@@ -1,31 +0,0 @@
-class Comps {
-
-	var engine : h3d.Engine;
-	var scene : h2d.Scene;
-
-	function new() {
-		engine = new h3d.Engine();
-		engine.onReady = init;
-		engine.init();
-		// make sure that arial.ttf is inside the current class path (remove "true" to get errors)
-		// embedding the font will greatly improve visibility on flash (might be required on some targets)
-		hxd.res.Embed.embedFont("Arial.ttf", true);
-	}
-
-	function init() {
-		hxd.System.setLoop(update);
-		scene = new h2d.Scene();
-		var document = h2d.comp.Parser.fromHtml(hxd.res.Embed.getFileContent("components.html"),{ fmt : hxd.Math.fmt });
-		scene.addChild(document);
-		engine.onResized = function() document.setStyle(null);
-	}
-
-	function update() {
-		engine.render(scene);
-	}
-
-	static function main() {
-		new Comps();
-	}
-
-}

+ 0 - 98
samples/comps/components.html

@@ -1,98 +0,0 @@
-<body>
-	<style>
-		.window {
-			layout : absolute;
-			padding : 15;
-		}
-		button.big {
-			width : 500px;
-		}
-		
-		.main {
-			layout : inline;
-		}
-		
-		.main:vertical {
-			layout : vertical;
-		}
-
-		.main:absolute {
-			layout : absolute;
-		}
-		
-		.border {
-			border : 1px solid #888;
-		}
-		
-		.dock {
-			layout:dock;
-		}
-		
-		.showBorders box {
-			border : 1px solid red;
-		}
-		.showBorders label, .showBorders box.dock {
-			border : 1px solid #0FF;
-		}
-		.rounded1 {
-			border-radius: 10px;
-			border-width: 4px;
-			border-color: #7a7a78;
-			background-color: rgba(224, 220, 123, 0.9);
-			width: 200px;
-			height: 100px;
-			offset: 400 570;
-		}
-		
-	</style>
-	<div class="panel window">
-		<div class="main" id="box">
-			<button value="V Box" onclick="$('#box').style('layout : vertical')"/>
-			<button value="H Box" onclick="$('#box').style('layout : horizontal')"/>
-			<button value="I Box" onclick="$('#box').style('layout : inline')"/>
-			<button class="big" value="A slightly long one (styled with CSS)" onclick="$(this).text('Clicked!')"/>
-			<div>
-				<button value="Show Borders" onclick="$('.window').toggleClass('showBorders')"/>
-			</div>
-			<slider onchange="$('#lb1').text(api.fmt($(this).val()))"/>
-			<label id="lb1"></label>
-			<slider onchange="$('#lb2').text(api.fmt($(this).val()))" style="increment:0.1"/>
-			<label id="lb2"></label>
-			<div>
-				<checkbox onchange="$('#lbc').text($(this).val()?'ON':'OFF')"/>
-				<label id="lbc">OFF</label>
-			</div>
-			
-			<itemlist selected="1">
-				<div class="line">
-					<span>Item 1</span>
-				</div>
-				<div class="line">
-					<span>Item 2</span>
-				</div>
-				<div class="line">
-					<checkbox/>
-					<span>Item 3</span>
-				</div>
-			</itemlist>
-			
-			<input value="bla"/>
-			<input/>
-			
-			<colorpicker/>
-			<gradienteditor/>
-			
-			<div class="dock">
-				<div class="panel border" style="dock:top; height:60px"/>
-				<div class="panel border" style="dock:left; width:30px"/>
-				<div class="panel border" style="dock:right; width:40px"/>
-				<div class="panel border" style="dock:bottom; height:40px"/>
-				<div class="panel border" style="dock:left; width:20px"/>
-				<div class="panel border" style="dock:full"/>
-				<div class="panel border" style="dock:full; width : 20px; height : 20px"/>
-			</div>
-		</div>
-	</div>
-	<button value="Standalone" x="700" y="570"/>
-	<div class="rounded1"  ></div>
-</body>

+ 0 - 15
samples/comps/comps.hxml

@@ -1,15 +0,0 @@
--js main.js
--main Comps
--lib heaps
--lib hscript
--dce full
--D resourcesPath=../res
---next
--lib heaps
--lib hscript
--swf comps.swf
--swf-version 11.8
--swf-header 1024:768:60
--main Comps
--dce full
--D resourcesPath=../res

+ 0 - 53
samples/comps/comps.hxproj

@@ -1,53 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<project version="2">
-  <!-- Output SWF options -->
-  <output>
-    <movie outputType="Application" />
-    <movie input="" />
-    <movie path="main.js" />
-    <movie fps="60" />
-    <movie width="800" />
-    <movie height="600" />
-    <movie version="1" />
-    <movie minorVersion="0" />
-    <movie platform="JavaScript" />
-    <movie background="#FFFFFF" />
-  </output>
-  <!-- Other classes to be compiled into your SWF -->
-  <classpaths>
-    <!-- example: <class path="..." /> -->
-  </classpaths>
-  <!-- Build options -->
-  <build>
-    <option directives="resourcesPath=&quot;../res&quot;" />
-    <option flashStrict="False" />
-    <option noInlineOnDebug="False" />
-    <option mainClass="Comps" />
-    <option enabledebug="False" />
-    <option additional="-lib heaps&#xA;-lib hscript&#xA;-dce full&#xA;&#xA;--next&#xA;-lib heaps&#xA;-lib hscript&#xA;-swf comps.swf&#xA;-swf-version 11.8&#xA;-swf-header 1024:768:60&#xA;-main Comps&#xA;-dce full" />
-  </build>
-  <!-- haxelib libraries -->
-  <haxelib>
-    <!-- example: <library name="..." /> -->
-  </haxelib>
-  <!-- Class files to compile (other referenced classes will automatically be included) -->
-  <compileTargets>
-    <!-- example: <compile path="..." /> -->
-  </compileTargets>
-  <!-- Paths to exclude from the Project Explorer tree -->
-  <hiddenPaths>
-    <hidden path="obj" />
-  </hiddenPaths>
-  <!-- Executed before build -->
-  <preBuildCommand />
-  <!-- Executed after build -->
-  <postBuildCommand alwaysRun="False" />
-  <!-- Other project options -->
-  <options>
-    <option showHiddenPaths="False" />
-    <option testMovie="OpenDocument" />
-    <option testMovieCommand="comps.swf" />
-  </options>
-  <!-- Plugin storage -->
-  <storage />
-</project>

+ 0 - 6
samples/comps/index.html

@@ -1,6 +0,0 @@
-<html>
-<body style="margin:0;padding:0;background-color:red">
-	<canvas id="webgl" style="width:100%;height:100%"></canvas>
-	<script type="text/javascript" src="main.js"></script>
-</body>
-</html>

+ 0 - 11
samples/draw/draw.hxml

@@ -1,11 +0,0 @@
--js main.js
--main Draw
--lib heaps
--dce full
---next
--swf draw.swf
--swf-version 11.8
--swf-header 2000:2000:60
--lib heaps
--main Draw
--dce full

+ 0 - 55
samples/draw/draw.hxproj

@@ -1,55 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<project version="2">
-  <!-- Output SWF options -->
-  <output>
-    <movie outputType="Application" />
-    <movie input="" />
-    <movie path="main.js" />
-    <movie fps="60" />
-    <movie width="800" />
-    <movie height="600" />
-    <movie version="1" />
-    <movie minorVersion="0" />
-    <movie platform="JavaScript" />
-    <movie background="#FFFFFF" />
-  </output>
-  <!-- Other classes to be compiled into your SWF -->
-  <classpaths>
-    <!-- example: <class path="..." /> -->
-  </classpaths>
-  <!-- Build options -->
-  <build>
-    <option directives="" />
-    <option flashStrict="False" />
-    <option noInlineOnDebug="False" />
-    <option mainClass="Draw" />
-    <option enabledebug="False" />
-    <option additional="-lib heaps&#xA;-dce full&#xA;&#xA;--next&#xA;-swf draw.swf&#xA;-swf-version 11.8&#xA;-swf-header 2000:2000:60&#xA;-lib heaps&#xA;-main Draw&#xA;-dce full" />
-  </build>
-  <!-- haxelib libraries -->
-  <haxelib>
-    <!-- example: <library name="..." /> -->
-  </haxelib>
-  <!-- Class files to compile (other referenced classes will automatically be included) -->
-  <compileTargets>
-    <!-- example: <compile path="..." /> -->
-  </compileTargets>
-  <!-- Paths to exclude from the Project Explorer tree -->
-  <hiddenPaths>
-    <hidden path="draw.swf" />
-    <hidden path="draw.hxml" />
-    <hidden path="obj" />
-  </hiddenPaths>
-  <!-- Executed before build -->
-  <preBuildCommand />
-  <!-- Executed after build -->
-  <postBuildCommand alwaysRun="False" />
-  <!-- Other project options -->
-  <options>
-    <option showHiddenPaths="True" />
-    <option testMovie="OpenDocument" />
-    <option testMovieCommand="index.html" />
-  </options>
-  <!-- Plugin storage -->
-  <storage />
-</project>

+ 0 - 9
samples/draw/index.html

@@ -1,9 +0,0 @@
-<html>
-<head><meta charset="utf-8"/></head>
-<body style="margin:0;padding:0;background-color:black">
-	
-	<canvas id="webgl" style="width:100%;height:100%"></canvas>
-	<script type="text/javascript" src="main.js"></script>
-	
-</body>
-</html>

+ 0 - 7
samples/filters/filters_swf.hxml

@@ -1,7 +0,0 @@
--swf filters.swf
--swf-header 800:400:60:FFFFFF
--swf-version 11.8
--main Main
--lib heaps
--dce full
--D resourcesPath=../res

+ 0 - 57
samples/filters/filters_swf.hxproj

@@ -1,57 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<project version="2">
-  <!-- Output SWF options -->
-  <output>
-    <movie outputType="Application" />
-    <movie input="" />
-    <movie path="filters.swf" />
-    <movie fps="60" />
-    <movie width="800" />
-    <movie height="400" />
-    <movie version="11" />
-    <movie minorVersion="8" />
-    <movie platform="Flash Player" />
-    <movie background="#FFFFFF" />
-  </output>
-  <!-- Other classes to be compiled into your SWF -->
-  <classpaths>
-    <!-- example: <class path="..." /> -->
-  </classpaths>
-  <!-- Build options -->
-  <build>
-    <option directives="" />
-    <option flashStrict="False" />
-    <option noInlineOnDebug="False" />
-    <option mainClass="Main" />
-    <option enabledebug="False" />
-    <option additional="-lib heaps&#xA;-dce full&#xA;-D resourcesPath=../res" />
-  </build>
-  <!-- haxelib libraries -->
-  <haxelib>
-    <!-- example: <library name="..." /> -->
-  </haxelib>
-  <!-- Class files to compile (other referenced classes will automatically be included) -->
-  <compileTargets>
-    <!-- example: <compile path="..." /> -->
-  </compileTargets>
-  <!-- Assets to embed into the output SWF -->
-  <library>
-    <!-- example: <asset path="..." id="..." update="..." glyphs="..." mode="..." place="..." sharepoint="..." /> -->
-  </library>
-  <!-- Paths to exclude from the Project Explorer tree -->
-  <hiddenPaths>
-    <hidden path="obj" />
-  </hiddenPaths>
-  <!-- Executed before build -->
-  <preBuildCommand />
-  <!-- Executed after build -->
-  <postBuildCommand alwaysRun="False" />
-  <!-- Other project options -->
-  <options>
-    <option showHiddenPaths="False" />
-    <option testMovie="OpenDocument" />
-    <option testMovieCommand="filters.swf" />
-  </options>
-  <!-- Plugin storage -->
-  <storage />
-</project>

+ 0 - 5
samples/filters/filters_wgl.hxml

@@ -1,5 +0,0 @@
--js main.js
--main Main
--lib heaps
--dce full
--D resourcesPath=../res

+ 0 - 53
samples/filters/filters_wgl.hxproj

@@ -1,53 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<project version="2">
-  <!-- Output SWF options -->
-  <output>
-    <movie outputType="Application" />
-    <movie input="" />
-    <movie path="main.js" />
-    <movie fps="60" />
-    <movie width="800" />
-    <movie height="400" />
-    <movie version="1" />
-    <movie minorVersion="0" />
-    <movie platform="JavaScript" />
-    <movie background="#FFFFFF" />
-  </output>
-  <!-- Other classes to be compiled into your SWF -->
-  <classpaths>
-    <!-- example: <class path="..." /> -->
-  </classpaths>
-  <!-- Build options -->
-  <build>
-    <option directives="" />
-    <option flashStrict="False" />
-    <option noInlineOnDebug="False" />
-    <option mainClass="Main" />
-    <option enabledebug="False" />
-    <option additional="-lib heaps&#xA;-dce full&#xA;-D resourcesPath=../res" />
-  </build>
-  <!-- haxelib libraries -->
-  <haxelib>
-    <!-- example: <library name="..." /> -->
-  </haxelib>
-  <!-- Class files to compile (other referenced classes will automatically be included) -->
-  <compileTargets>
-    <!-- example: <compile path="..." /> -->
-  </compileTargets>
-  <!-- Paths to exclude from the Project Explorer tree -->
-  <hiddenPaths>
-    <hidden path="obj" />
-  </hiddenPaths>
-  <!-- Executed before build -->
-  <preBuildCommand />
-  <!-- Executed after build -->
-  <postBuildCommand alwaysRun="False" />
-  <!-- Other project options -->
-  <options>
-    <option showHiddenPaths="False" />
-    <option testMovie="OpenDocument" />
-    <option testMovieCommand="index.html" />
-  </options>
-  <!-- Plugin storage -->
-  <storage />
-</project>

+ 0 - 10
samples/filters/index.html

@@ -1,10 +0,0 @@
-<html>
-<head><meta charset="utf-8"/></head>
-<body style="margin:0;padding:0;background-color:black">
-
-	<a href="https://github.com/ncannasse/heaps/blob/master/samples/filters/Main.hx" style="color:white;position:absolute;right:10px;">Source Code</a>
-	<canvas id="webgl" style="width:100%;height:100%"></canvas>
-	<script type="text/javascript" src="main.js"></script>
-
-</body>
-</html>

+ 3 - 0
samples/gen.hxml

@@ -0,0 +1,3 @@
+-lib hscript
+-dce no
+--macro Generator.generateProjects()

+ 0 - 7
samples/interact/interact.hxml

@@ -1,7 +0,0 @@
--swf interact.swf
--swf-header 800:600:60:FFFFFF
--swf-version 11.8
--main Main
--lib heaps
--dce full
--D resourcesPath=../skin/res

+ 0 - 57
samples/interact/interact.hxproj

@@ -1,57 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<project version="2">
-  <!-- Output SWF options -->
-  <output>
-    <movie outputType="Application" />
-    <movie input="" />
-    <movie path="interact.swf" />
-    <movie fps="60" />
-    <movie width="800" />
-    <movie height="600" />
-    <movie version="11" />
-    <movie minorVersion="8" />
-    <movie platform="Flash Player" />
-    <movie background="#FFFFFF" />
-  </output>
-  <!-- Other classes to be compiled into your SWF -->
-  <classpaths>
-    <!-- example: <class path="..." /> -->
-  </classpaths>
-  <!-- Build options -->
-  <build>
-    <option directives="" />
-    <option flashStrict="False" />
-    <option noInlineOnDebug="False" />
-    <option mainClass="Main" />
-    <option enabledebug="False" />
-    <option additional="-lib heaps&#xA;-dce full&#xA;-D resourcesPath=../skin/res" />
-  </build>
-  <!-- haxelib libraries -->
-  <haxelib>
-    <!-- example: <library name="..." /> -->
-  </haxelib>
-  <!-- Class files to compile (other referenced classes will automatically be included) -->
-  <compileTargets>
-    <!-- example: <compile path="..." /> -->
-  </compileTargets>
-  <!-- Assets to embed into the output SWF -->
-  <library>
-    <!-- example: <asset path="..." id="..." update="..." glyphs="..." mode="..." place="..." sharepoint="..." /> -->
-  </library>
-  <!-- Paths to exclude from the Project Explorer tree -->
-  <hiddenPaths>
-    <hidden path="obj" />
-  </hiddenPaths>
-  <!-- Executed before build -->
-  <preBuildCommand />
-  <!-- Executed after build -->
-  <postBuildCommand alwaysRun="False" />
-  <!-- Other project options -->
-  <options>
-    <option showHiddenPaths="False" />
-    <option testMovie="OpenDocument" />
-    <option testMovieCommand="interact.swf" />
-  </options>
-  <!-- Plugin storage -->
-  <storage />
-</project>

+ 0 - 9
samples/lights/index.html

@@ -1,9 +0,0 @@
-<html>
-<head><meta charset="utf-8"/></head>
-<body style="margin:0;padding:0;background-color:black">
-	
-	<canvas id="webgl" style="width:100%;height:100%"></canvas>
-	<script type="text/javascript" src="main.js"></script>
-	
-</body>
-</html>

+ 0 - 17
samples/lights/lights.hxml

@@ -1,17 +0,0 @@
--js main.js
--main Main
--lib heaps
--dce full
---next
--swf lights.swf
--swf-version 11.8
--swf-header 1280:1024:60
--dce full
--main Main
--lib heaps
---next
--cpp bin
--dce full
--main Main
--lib heaps
--lib hxsdl

+ 0 - 56
samples/lights/lights.hxproj

@@ -1,56 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<project version="2">
-  <!-- Output SWF options -->
-  <output>
-    <movie outputType="Application" />
-    <movie input="" />
-    <movie path="main.js" />
-    <movie fps="60" />
-    <movie width="800" />
-    <movie height="600" />
-    <movie version="1" />
-    <movie minorVersion="0" />
-    <movie platform="JavaScript" />
-    <movie background="#FFFFFF" />
-  </output>
-  <!-- Other classes to be compiled into your SWF -->
-  <classpaths>
-    <!-- example: <class path="..." /> -->
-  </classpaths>
-  <!-- Build options -->
-  <build>
-    <option directives="" />
-    <option flashStrict="False" />
-    <option noInlineOnDebug="False" />
-    <option mainClass="Main" />
-    <option enabledebug="False" />
-    <option additional="-lib heaps&#xA;-dce full&#xA;&#xA;--next&#xA;-swf lights.swf&#xA;-swf-version 11.8&#xA;-swf-header 1280:1024:60&#xA;-dce full&#xA;-main Main&#xA;-lib heaps&#xA;&#xA;--next&#xA;-cpp bin&#xA;-dce full&#xA;-main Main&#xA;-lib heaps&#xA;-lib hxsdl" />
-  </build>
-  <!-- haxelib libraries -->
-  <haxelib>
-    <!-- example: <library name="..." /> -->
-  </haxelib>
-  <!-- Class files to compile (other referenced classes will automatically be included) -->
-  <compileTargets>
-    <!-- example: <compile path="..." /> -->
-  </compileTargets>
-  <!-- Paths to exclude from the Project Explorer tree -->
-  <hiddenPaths>
-    <hidden path="engine.hxml" />
-    <hidden path="obj" />
-    <hidden path="main.js" />
-    <hidden path="main.js.map" />
-  </hiddenPaths>
-  <!-- Executed before build -->
-  <preBuildCommand />
-  <!-- Executed after build -->
-  <postBuildCommand alwaysRun="False" />
-  <!-- Other project options -->
-  <options>
-    <option showHiddenPaths="True" />
-    <option testMovie="OpenDocument" />
-    <option testMovieCommand="lights.swf" />
-  </options>
-  <!-- Plugin storage -->
-  <storage />
-</project>

+ 0 - 7
samples/maskcache/mask.hxml

@@ -1,7 +0,0 @@
--swf mask.swf
--swf-header 800:400:60:FFFFFF
--swf-version 11.8
--main Main
--lib heaps
--dce full
--D resourcesPath=../res

+ 0 - 57
samples/maskcache/mask.hxproj

@@ -1,57 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<project version="2">
-  <!-- Output SWF options -->
-  <output>
-    <movie outputType="Application" />
-    <movie input="" />
-    <movie path="mask.swf" />
-    <movie fps="60" />
-    <movie width="800" />
-    <movie height="400" />
-    <movie version="11" />
-    <movie minorVersion="8" />
-    <movie platform="Flash Player" />
-    <movie background="#FFFFFF" />
-  </output>
-  <!-- Other classes to be compiled into your SWF -->
-  <classpaths>
-    <!-- example: <class path="..." /> -->
-  </classpaths>
-  <!-- Build options -->
-  <build>
-    <option directives="" />
-    <option flashStrict="False" />
-    <option noInlineOnDebug="False" />
-    <option mainClass="Main" />
-    <option enabledebug="False" />
-    <option additional="-lib heaps&#xA;-dce full&#xA;-D resourcesPath=../res" />
-  </build>
-  <!-- haxelib libraries -->
-  <haxelib>
-    <!-- example: <library name="..." /> -->
-  </haxelib>
-  <!-- Class files to compile (other referenced classes will automatically be included) -->
-  <compileTargets>
-    <!-- example: <compile path="..." /> -->
-  </compileTargets>
-  <!-- Assets to embed into the output SWF -->
-  <library>
-    <!-- example: <asset path="..." id="..." update="..." glyphs="..." mode="..." place="..." sharepoint="..." /> -->
-  </library>
-  <!-- Paths to exclude from the Project Explorer tree -->
-  <hiddenPaths>
-    <hidden path="obj" />
-  </hiddenPaths>
-  <!-- Executed before build -->
-  <preBuildCommand />
-  <!-- Executed after build -->
-  <postBuildCommand alwaysRun="False" />
-  <!-- Other project options -->
-  <options>
-    <option showHiddenPaths="False" />
-    <option testMovie="OpenDocument" />
-    <option testMovieCommand="mask.swf" />
-  </options>
-  <!-- Plugin storage -->
-  <storage />
-</project>

+ 0 - 14
samples/network/network.app

@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<application xmlns="http://ns.adobe.com/air/application/15.0">
-    <id>NetworkExample</id>
-    <name>Network Example</name>
-    <filename>Network Example</filename>
-    <versionNumber>1.0</versionNumber>
-	<supportedProfiles>extendedDesktop</supportedProfiles>
-    <initialWindow>
-        <content>network.swf</content>
-        <visible>true</visible>
-        <renderMode>direct</renderMode>
-        <depthAndStencil>true</depthAndStencil>
-    </initialWindow>
-</application>

+ 0 - 7
samples/network/network.hxml

@@ -1,7 +0,0 @@
--swf network.swf
--swf-header 600:400:60:FFFFFF
--swf-version 15.0
--main Main
--lib heaps
--lib air3
--D native-trace

+ 0 - 57
samples/network/network.hxproj

@@ -1,57 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<project version="2">
-  <!-- Output SWF options -->
-  <output>
-    <movie outputType="Application" />
-    <movie input="" />
-    <movie path="network.swf" />
-    <movie fps="60" />
-    <movie width="600" />
-    <movie height="400" />
-    <movie version="15" />
-    <movie minorVersion="0" />
-    <movie platform="Flash Player" />
-    <movie background="#FFFFFF" />
-  </output>
-  <!-- Other classes to be compiled into your SWF -->
-  <classpaths>
-    <!-- example: <class path="..." /> -->
-  </classpaths>
-  <!-- Build options -->
-  <build>
-    <option directives="" />
-    <option flashStrict="False" />
-    <option noInlineOnDebug="False" />
-    <option mainClass="Main" />
-    <option enabledebug="False" />
-    <option additional="-lib heaps&#xA;-lib air3&#xA;-D native-trace" />
-  </build>
-  <!-- haxelib libraries -->
-  <haxelib>
-    <!-- example: <library name="..." /> -->
-  </haxelib>
-  <!-- Class files to compile (other referenced classes will automatically be included) -->
-  <compileTargets>
-    <!-- example: <compile path="..." /> -->
-  </compileTargets>
-  <!-- Assets to embed into the output SWF -->
-  <library>
-    <!-- example: <asset path="..." id="..." update="..." glyphs="..." mode="..." place="..." sharepoint="..." /> -->
-  </library>
-  <!-- Paths to exclude from the Project Explorer tree -->
-  <hiddenPaths>
-    <hidden path="obj" />
-  </hiddenPaths>
-  <!-- Executed before build -->
-  <preBuildCommand />
-  <!-- Executed after build -->
-  <postBuildCommand alwaysRun="False" />
-  <!-- Other project options -->
-  <options>
-    <option showHiddenPaths="False" />
-    <option testMovie="Custom" />
-    <option testMovieCommand="adl network.app" />
-  </options>
-  <!-- Plugin storage -->
-  <storage />
-</project>

+ 0 - 9
samples/quat/index.html

@@ -1,9 +0,0 @@
-<html>
-<head><meta charset="utf-8"/></head>
-<body style="margin:0;padding:0;background-color:black">
-	
-	<canvas id="webgl" style="width:100%;height:100%"></canvas>
-	<script type="text/javascript" src="main.js"></script>
-	
-</body>
-</html>

+ 0 - 4
samples/quat/quat.hxml

@@ -1,4 +0,0 @@
--js main.js
--main QuatDemo
--lib heaps
--dce full

+ 0 - 9
samples/sao/index.html

@@ -1,9 +0,0 @@
-<html>
-<head><meta charset="utf-8"/></head>
-<body style="margin:0;padding:0;background-color:black">
-	
-	<canvas id="webgl" style="width:100%;height:100%"></canvas>
-	<script type="text/javascript" src="main.js"></script>
-	
-</body>
-</html>

+ 0 - 11
samples/sao/sao.hxml

@@ -1,11 +0,0 @@
--js main.js
--main Main
--lib heaps
--dce full
---next
--swf sao.swf
--lib heaps
--dce full
--swf-version 15
--swf-header 1024:768:60
--main Main

+ 0 - 56
samples/sao/sao.hxproj

@@ -1,56 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<project version="2">
-  <!-- Output SWF options -->
-  <output>
-    <movie outputType="Application" />
-    <movie input="" />
-    <movie path="main.js" />
-    <movie fps="60" />
-    <movie width="800" />
-    <movie height="600" />
-    <movie version="1" />
-    <movie minorVersion="0" />
-    <movie platform="JavaScript" />
-    <movie background="#FFFFFF" />
-  </output>
-  <!-- Other classes to be compiled into your SWF -->
-  <classpaths>
-    <!-- example: <class path="..." /> -->
-  </classpaths>
-  <!-- Build options -->
-  <build>
-    <option directives="" />
-    <option flashStrict="False" />
-    <option noInlineOnDebug="False" />
-    <option mainClass="Main" />
-    <option enabledebug="False" />
-    <option additional="-lib heaps&#xA;-dce full&#xA;&#xA;--next&#xA;-swf sao.swf&#xA;-lib heaps&#xA;-dce full&#xA;-swf-version 15&#xA;-swf-header 1024:768:60&#xA;-main Main" />
-  </build>
-  <!-- haxelib libraries -->
-  <haxelib>
-    <!-- example: <library name="..." /> -->
-  </haxelib>
-  <!-- Class files to compile (other referenced classes will automatically be included) -->
-  <compileTargets>
-    <!-- example: <compile path="..." /> -->
-  </compileTargets>
-  <!-- Paths to exclude from the Project Explorer tree -->
-  <hiddenPaths>
-    <hidden path="engine.hxml" />
-    <hidden path="obj" />
-    <hidden path="main.js" />
-    <hidden path="main.js.map" />
-  </hiddenPaths>
-  <!-- Executed before build -->
-  <preBuildCommand />
-  <!-- Executed after build -->
-  <postBuildCommand alwaysRun="False" />
-  <!-- Other project options -->
-  <options>
-    <option showHiddenPaths="False" />
-    <option testMovie="OpenDocument" />
-    <option testMovieCommand="sao.swf" />
-  </options>
-  <!-- Plugin storage -->
-  <storage />
-</project>

+ 0 - 9
samples/shadows/index.html

@@ -1,9 +0,0 @@
-<html>
-<head><meta charset="utf-8"/></head>
-<body style="margin:0;padding:0;background-color:black">
-	
-	<canvas id="webgl" style="width:100%;height:100%"></canvas>
-	<script type="text/javascript" src="main.js"></script>
-	
-</body>
-</html>

+ 0 - 17
samples/shadows/shadows.hxml

@@ -1,17 +0,0 @@
--js main.js
--main Main
--lib heaps
--dce full
---next
--swf shadows.swf
--lib heaps
--dce full
--swf-version 11.8
--swf-header 1024:768:60
--main Main
---next
--cpp bin
--dce full
--main Main
--lib heaps
--lib hxsdl

+ 0 - 56
samples/shadows/shadows.hxproj

@@ -1,56 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<project version="2">
-  <!-- Output SWF options -->
-  <output>
-    <movie outputType="Application" />
-    <movie input="" />
-    <movie path="main.js" />
-    <movie fps="60" />
-    <movie width="800" />
-    <movie height="600" />
-    <movie version="1" />
-    <movie minorVersion="0" />
-    <movie platform="JavaScript" />
-    <movie background="#FFFFFF" />
-  </output>
-  <!-- Other classes to be compiled into your SWF -->
-  <classpaths>
-    <!-- example: <class path="..." /> -->
-  </classpaths>
-  <!-- Build options -->
-  <build>
-    <option directives="" />
-    <option flashStrict="False" />
-    <option noInlineOnDebug="False" />
-    <option mainClass="Main" />
-    <option enabledebug="False" />
-    <option additional="-lib heaps&#xA;-dce full&#xA;&#xA;--next&#xA;-swf shadows.swf&#xA;-lib heaps&#xA;-dce full&#xA;-swf-version 11.8&#xA;-swf-header 1024:768:60&#xA;-main Main&#xA;&#xA;--next&#xA;-cpp bin&#xA;-dce full&#xA;-main Main&#xA;-lib heaps&#xA;-lib hxsdl" />
-  </build>
-  <!-- haxelib libraries -->
-  <haxelib>
-    <!-- example: <library name="..." /> -->
-  </haxelib>
-  <!-- Class files to compile (other referenced classes will automatically be included) -->
-  <compileTargets>
-    <!-- example: <compile path="..." /> -->
-  </compileTargets>
-  <!-- Paths to exclude from the Project Explorer tree -->
-  <hiddenPaths>
-    <hidden path="engine.hxml" />
-    <hidden path="obj" />
-    <hidden path="main.js" />
-    <hidden path="main.js.map" />
-  </hiddenPaths>
-  <!-- Executed before build -->
-  <preBuildCommand />
-  <!-- Executed after build -->
-  <postBuildCommand alwaysRun="False" />
-  <!-- Other project options -->
-  <options>
-    <option showHiddenPaths="False" />
-    <option testMovie="OpenDocument" />
-    <option testMovieCommand="shadows.swf" />
-  </options>
-  <!-- Plugin storage -->
-  <storage />
-</project>

+ 0 - 9
samples/skin/index.html

@@ -1,9 +0,0 @@
-<html>
-<head><meta charset="utf-8"/></head>
-<body style="margin:0;padding:0;background-color:black">
-	
-	<canvas id="webgl" style="width:100%;height:100%"></canvas>
-	<script type="text/javascript" src="main.js"></script>
-	
-</body>
-</html>

+ 0 - 16
samples/skin/skin.hxml

@@ -1,16 +0,0 @@
--js main.js
--main Main
--lib heaps
--dce full
---next
--swf skin.swf
--swf-version 11.8
--swf-header 1280:900:60
--main Main
--lib heaps
--dce full
---next
--cpp bin
--main Main
--lib heaps
--lib hxsdl

+ 0 - 56
samples/skin/skin.hxproj

@@ -1,56 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<project version="2">
-  <!-- Output SWF options -->
-  <output>
-    <movie outputType="Application" />
-    <movie input="" />
-    <movie path="main.js" />
-    <movie fps="60" />
-    <movie width="800" />
-    <movie height="600" />
-    <movie version="1" />
-    <movie minorVersion="0" />
-    <movie platform="JavaScript" />
-    <movie background="#FFFFFF" />
-  </output>
-  <!-- Other classes to be compiled into your SWF -->
-  <classpaths>
-    <!-- example: <class path="..." /> -->
-  </classpaths>
-  <!-- Build options -->
-  <build>
-    <option directives="" />
-    <option flashStrict="False" />
-    <option noInlineOnDebug="False" />
-    <option mainClass="Main" />
-    <option enabledebug="False" />
-    <option additional="-lib heaps&#xA;-dce full&#xA;&#xA;--next&#xA;-swf skin.swf&#xA;-swf-version 11.8&#xA;-swf-header 1280:900:60&#xA;-main Main&#xA;-lib heaps&#xA;-dce full&#xA;&#xA;--next&#xA;-cpp bin&#xA;-main Main&#xA;-lib heaps&#xA;-lib hxsdl" />
-  </build>
-  <!-- haxelib libraries -->
-  <haxelib>
-    <!-- example: <library name="..." /> -->
-  </haxelib>
-  <!-- Class files to compile (other referenced classes will automatically be included) -->
-  <compileTargets>
-    <!-- example: <compile path="..." /> -->
-  </compileTargets>
-  <!-- Paths to exclude from the Project Explorer tree -->
-  <hiddenPaths>
-    <hidden path="engine.hxml" />
-    <hidden path="obj" />
-    <hidden path="main.js" />
-    <hidden path="main.js.map" />
-  </hiddenPaths>
-  <!-- Executed before build -->
-  <preBuildCommand />
-  <!-- Executed after build -->
-  <postBuildCommand alwaysRun="False" />
-  <!-- Other project options -->
-  <options>
-    <option showHiddenPaths="False" />
-    <option testMovie="OpenDocument" />
-    <option testMovieCommand="skin.swf" />
-  </options>
-  <!-- Plugin storage -->
-  <storage />
-</project>

+ 0 - 0
samples/skin/res/Model.FBX → samples/skin_res/Model.FBX


+ 0 - 0
samples/skin/res/Skeleton01.png → samples/skin_res/Skeleton01.png


+ 0 - 0
samples/skin/res/Sword01.png → samples/skin_res/Sword01.png


+ 0 - 16
samples/sound/index.html

@@ -1,16 +0,0 @@
-<html>
-<body style="margin:0;padding:0;background-color:red">
-	<script src="http://code.jquery.com/jquery-1.10.2.min.js"></script>
-	
-	<br/>
-	
-	
-	<div id="log"></div>
-	
-	<center>
-		<canvas id="webgl" style="width:80%;height:60%"></canvas>
-	</center>
-	<script type="text/javascript" src="main.js"></script>
-	
-</body>
-</html>

+ 0 - 10
samples/sound/sound.hxml

@@ -1,10 +0,0 @@
--js main.js
--main Sound
--lib heaps
--lib stb_ogg_sound
---next
--swf main.swf
--swf-version 11.8
--main Sound
--lib heaps
--lib stb_ogg_sound

+ 0 - 53
samples/sound/sound.hxproj

@@ -1,53 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<project version="2">
-  <!-- Output SWF options -->
-  <output>
-    <movie outputType="Application" />
-    <movie input="" />
-    <movie path="main.js" />
-    <movie fps="60" />
-    <movie width="800" />
-    <movie height="600" />
-    <movie version="1" />
-    <movie minorVersion="0" />
-    <movie platform="JavaScript" />
-    <movie background="#FFFFFF" />
-  </output>
-  <!-- Other classes to be compiled into your SWF -->
-  <classpaths>
-    <!-- example: <class path="..." /> -->
-  </classpaths>
-  <!-- Build options -->
-  <build>
-    <option directives="" />
-    <option flashStrict="False" />
-    <option noInlineOnDebug="False" />
-    <option mainClass="Sound" />
-    <option enabledebug="False" />
-    <option additional="-lib heaps&#xA;-lib stb_ogg_sound&#xA;&#xA;--next&#xA;-swf main.swf&#xA;-swf-version 11.8&#xA;-main Sound&#xA;-lib heaps&#xA;-lib stb_ogg_sound&#xA;&#xA;#--next&#xA;#-cpp bin&#xA;#-main Sound&#xA;#-lib heaps&#xA;#-lib hxsdl" />
-  </build>
-  <!-- haxelib libraries -->
-  <haxelib>
-    <!-- example: <library name="..." /> -->
-  </haxelib>
-  <!-- Class files to compile (other referenced classes will automatically be included) -->
-  <compileTargets>
-    <!-- example: <compile path="..." /> -->
-  </compileTargets>
-  <!-- Paths to exclude from the Project Explorer tree -->
-  <hiddenPaths>
-    <hidden path="obj" />
-  </hiddenPaths>
-  <!-- Executed before build -->
-  <preBuildCommand />
-  <!-- Executed after build -->
-  <postBuildCommand alwaysRun="False" />
-  <!-- Other project options -->
-  <options>
-    <option showHiddenPaths="False" />
-    <option testMovie="OpenDocument" />
-    <option testMovieCommand="main.swf" />
-  </options>
-  <!-- Plugin storage -->
-  <storage />
-</project>

+ 0 - 0
samples/sound/res/music_loop.mp3 → samples/sound_res/music_loop.mp3


+ 0 - 0
samples/sound/res/sound_fx.wav → samples/sound_res/sound_fx.wav


+ 0 - 18
samples/spine/Main.hx

@@ -1,18 +0,0 @@
-
-class Main extends hxd.App {
-
-	override function init() {
-		var group = new h2d.Sprite(s2d);
-		group.scale(0.5);
-		var atlas = hxd.Res.Gorilla.toAtlas();
-		var r = new hxd.fmt.spine.Library();
-		r.loadText(hxd.Res.GorillaAnim.entry.getText());
-	}
-
-	static function main() {
-		hxd.Res.initEmbed();
-		new Main();
-	}
-
-
-}

+ 0 - 6
samples/spine/spine.hxml

@@ -1,6 +0,0 @@
--swf spine.swf
--swf-header 800:600:60:FFFFFF
--swf-version 15.0
--main Main
--lib heaps
--dce full

+ 0 - 60
samples/spine/spine.hxproj

@@ -1,60 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<project version="2">
-  <!-- Output SWF options -->
-  <output>
-    <movie outputType="Application" />
-    <movie input="" />
-    <movie path="spine.swf" />
-    <movie fps="60" />
-    <movie width="800" />
-    <movie height="600" />
-    <movie version="15" />
-    <movie minorVersion="0" />
-    <movie platform="Flash Player" />
-    <movie background="#FFFFFF" />
-  </output>
-  <!-- Other classes to be compiled into your SWF -->
-  <classpaths>
-    <!-- example: <class path="..." /> -->
-  </classpaths>
-  <!-- Build options -->
-  <build>
-    <option directives="" />
-    <option flashStrict="False" />
-    <option noInlineOnDebug="False" />
-    <option mainClass="Main" />
-    <option enabledebug="False" />
-    <option additional="-lib heaps&#xA;-dce full" />
-  </build>
-  <!-- haxelib libraries -->
-  <haxelib>
-    <!-- example: <library name="..." /> -->
-  </haxelib>
-  <!-- Class files to compile (other referenced classes will automatically be included) -->
-  <compileTargets>
-    <!-- example: <compile path="..." /> -->
-  </compileTargets>
-  <!-- Assets to embed into the output SWF -->
-  <library>
-    <!-- example: <asset path="..." id="..." update="..." glyphs="..." mode="..." place="..." sharepoint="..." /> -->
-  </library>
-  <!-- Paths to exclude from the Project Explorer tree -->
-  <hiddenPaths>
-    <hidden path="engine.hxml" />
-    <hidden path="obj" />
-    <hidden path="main.js" />
-    <hidden path="main.js.map" />
-  </hiddenPaths>
-  <!-- Executed before build -->
-  <preBuildCommand />
-  <!-- Executed after build -->
-  <postBuildCommand alwaysRun="False" />
-  <!-- Other project options -->
-  <options>
-    <option showHiddenPaths="False" />
-    <option testMovie="OpenDocument" />
-    <option testMovieCommand="spine.swf" />
-  </options>
-  <!-- Plugin storage -->
-  <storage />
-</project>

+ 1 - 1
samples/basic/LimeApp.hx → samples/templates/LimeApp.hx

@@ -1,6 +1,6 @@
 class LimeApp extends lime.app.Application {
 	override public function create(c) {
 		super.create(c);
-		@:privateAccess Main.main();
+		@:privateAccess ::main::.main();
 	}
 }

+ 5 - 0
samples/templates/__name_js.hxml

@@ -0,0 +1,5 @@
+-lib heaps
+-cp ../..
+-js ::name::.js
+-main ::main::
+::params::

+ 50 - 51
samples/quat/quat.hxproj → samples/templates/__name_js.hxproj

@@ -1,52 +1,51 @@
-<?xml version="1.0" encoding="utf-8"?>
-<project version="2">
-  <!-- Output SWF options -->
-  <output>
-    <movie outputType="Application" />
-    <movie input="" />
-    <movie path="main.js" />
-    <movie fps="60" />
-    <movie width="800" />
-    <movie height="600" />
-    <movie version="1" />
-    <movie minorVersion="0" />
-    <movie platform="JavaScript" />
-    <movie background="#FFFFFF" />
-  </output>
-  <!-- Other classes to be compiled into your SWF -->
-  <classpaths>
-    <!-- example: <class path="..." /> -->
-  </classpaths>
-  <!-- Build options -->
-  <build>
-    <option directives="" />
-    <option flashStrict="False" />
-    <option mainClass="QuatDemo" />
-    <option enabledebug="False" />
-    <option additional="-lib heaps&#xA;-dce full" />
-  </build>
-  <!-- haxelib libraries -->
-  <haxelib>
-    <!-- example: <library name="..." /> -->
-  </haxelib>
-  <!-- Class files to compile (other referenced classes will automatically be included) -->
-  <compileTargets>
-    <!-- example: <compile path="..." /> -->
-  </compileTargets>
-  <!-- Paths to exclude from the Project Explorer tree -->
-  <hiddenPaths>
-    <hidden path="obj" />
-  </hiddenPaths>
-  <!-- Executed before build -->
-  <preBuildCommand />
-  <!-- Executed after build -->
-  <postBuildCommand alwaysRun="False" />
-  <!-- Other project options -->
-  <options>
-    <option showHiddenPaths="False" />
-    <option testMovie="OpenDocument" />
-    <option testMovieCommand="index.html" />
-  </options>
-  <!-- Plugin storage -->
-  <storage />
+<?xml version="1.0" encoding="utf-8"?>
+<project version="2">
+  <!-- Output SWF options -->
+  <output>
+    <movie outputType="Application" />
+    <movie input="" />
+    <movie path="::name::.js" />
+    <movie fps="60" />
+    <movie width="800" />
+    <movie height="600" />
+    <movie version="1" />
+    <movie minorVersion="0" />
+    <movie platform="JavaScript" />
+    <movie background="#FFFFFF" />
+  </output>
+  <!-- Other classes to be compiled into your SWF -->
+  <classpaths>
+    <class path="..\.." />
+  </classpaths>
+  <!-- Build options -->
+  <build>
+    <option directives="" />
+    <option flashStrict="False" />
+    <option mainClass="::main::" />
+    <option enabledebug="False" />
+    <option additional="::params.split("\n").join("&#xA;")::" />
+  </build>
+  <!-- haxelib libraries -->
+  <haxelib>
+    <library name="heaps" />
+  </haxelib>
+  <!-- Class files to compile (other referenced classes will automatically be included) -->
+  <compileTargets>
+    <!-- example: <compile path="..." /> -->
+  </compileTargets>
+  <!-- Paths to exclude from the Project Explorer tree -->
+  <hiddenPaths>
+  </hiddenPaths>
+  <!-- Executed before build -->
+  <preBuildCommand />
+  <!-- Executed after build -->
+  <postBuildCommand alwaysRun="False" />
+  <!-- Other project options -->
+  <options>
+    <option showHiddenPaths="False" />
+    <option testMovie="OpenDocument" />
+    <option testMovieCommand="index.html" />
+  </options>
+  <!-- Plugin storage -->
+  <storage />
 </project>

+ 15 - 0
samples/templates/__name_lime.xml

@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>
+<project>
+	<meta title="::name::" package="heaps.samples.::name::" version="1.0.0" company="" />
+	
+	<app main="LimeApp" file="::name::" path="bin" />
+	<app min-swf-version="12.0" />
+	
+	<window background="#000000" fps="60" />
+	<window width="1280" height="800" unless="mobile" />
+	<window orientation="landscape" vsync="false" antialiasing="0" if="cpp" colors32b="true" allow-high-dpi="true"/>
+
+	<haxedef name="resourcesPath" value="::{ var k = params.split("-D resourcesPath="); if( k[1] == null ) "res" else StringTools.trim(k[1].split("\n")[0]); }::"/>
+	<haxelib name="lime" />
+	<haxelib name="heaps" />
+</project>

+ 7 - 0
samples/templates/__name_swf.hxml

@@ -0,0 +1,7 @@
+-lib heaps
+-cp ../..
+-swf ::name::.swf
+-swf-header 1280:800:60:FFFFFF
+-swf-version 14.0
+-main ::main::
+::params::

+ 55 - 59
samples/basic/basic_swf.hxproj → samples/templates/__name_swf.hxproj

@@ -1,60 +1,56 @@
-<?xml version="1.0" encoding="utf-8"?>
-<project version="2">
-  <!-- Output SWF options -->
-  <output>
-    <movie outputType="Application" />
-    <movie input="" />
-    <movie path="main.swf" />
-    <movie fps="60" />
-    <movie width="1280" />
-    <movie height="800" />
-    <movie version="14" />
-    <movie minorVersion="0" />
-    <movie platform="Flash Player" />
-    <movie background="#FFFFFF" />
-  </output>
-  <!-- Other classes to be compiled into your SWF -->
-  <classpaths>
-    <!-- example: <class path="..." /> -->
-  </classpaths>
-  <!-- Build options -->
-  <build>
-    <option directives="" />
-    <option flashStrict="True" />
-    <option noInlineOnDebug="False" />
-    <option mainClass="Main" />
-    <option enabledebug="False" />
-    <option additional="-lib heaps&#xA;-D resourcesPath=../res&#xA;-dce full&#xA;--macro include('h3d')" />
-  </build>
-  <!-- haxelib libraries -->
-  <haxelib>
-    <!-- example: <library name="..." /> -->
-  </haxelib>
-  <!-- Class files to compile (other referenced classes will automatically be included) -->
-  <compileTargets>
-    <!-- example: <compile path="..." /> -->
-  </compileTargets>
-  <!-- Assets to embed into the output SWF -->
-  <library>
-    <!-- example: <asset path="..." id="..." update="..." glyphs="..." mode="..." place="..." sharepoint="..." /> -->
-  </library>
-  <!-- Paths to exclude from the Project Explorer tree -->
-  <hiddenPaths>
-    <hidden path="engine.hxml" />
-    <hidden path="obj" />
-    <hidden path="main.js" />
-    <hidden path="main.js.map" />
-  </hiddenPaths>
-  <!-- Executed before build -->
-  <preBuildCommand />
-  <!-- Executed after build -->
-  <postBuildCommand alwaysRun="False" />
-  <!-- Other project options -->
-  <options>
-    <option showHiddenPaths="False" />
-    <option testMovie="Default" />
-    <option testMovieCommand="index.html" />
-  </options>
-  <!-- Plugin storage -->
-  <storage />
+<?xml version="1.0" encoding="utf-8"?>
+<project version="2">
+  <!-- Output SWF options -->
+  <output>
+    <movie outputType="Application" />
+    <movie input="" />
+    <movie path="::name::.swf" />
+    <movie fps="60" />
+    <movie width="1280" />
+    <movie height="800" />
+    <movie version="14" />
+    <movie minorVersion="0" />
+    <movie platform="Flash Player" />
+    <movie background="#FFFFFF" />
+  </output>
+  <!-- Other classes to be compiled into your SWF -->
+  <classpaths>
+    <class path="..\.." />
+  </classpaths>
+  <!-- Build options -->
+  <build>
+    <option directives="" />
+    <option flashStrict="True" />
+    <option noInlineOnDebug="False" />
+    <option mainClass="::main::" />
+    <option enabledebug="False" />
+    <option additional="::params.split("\n").join("&#xA;")::" />
+  </build>
+  <!-- haxelib libraries -->
+  <haxelib>
+    <library name="heaps" />
+  </haxelib>
+  <!-- Class files to compile (other referenced classes will automatically be included) -->
+  <compileTargets>
+    <!-- example: <compile path="..." /> -->
+  </compileTargets>
+  <!-- Assets to embed into the output SWF -->
+  <library>
+    <!-- example: <asset path="..." id="..." update="..." glyphs="..." mode="..." place="..." sharepoint="..." /> -->
+  </library>
+  <!-- Paths to exclude from the Project Explorer tree -->
+  <hiddenPaths>
+  </hiddenPaths>
+  <!-- Executed before build -->
+  <preBuildCommand />
+  <!-- Executed after build -->
+  <postBuildCommand alwaysRun="False" />
+  <!-- Other project options -->
+  <options>
+    <option showHiddenPaths="False" />
+    <option testMovie="Default" />
+    <option testMovieCommand="::name::.swf" />
+  </options>
+  <!-- Plugin storage -->
+  <storage />
 </project>

+ 8 - 8
samples/2d/index.html → samples/templates/index.html

@@ -1,9 +1,9 @@
-<html>
-<head><meta charset="utf-8"/></head>
-<body style="margin:0;padding:0;background-color:black">
-	
-	<canvas id="webgl" style="width:100%;height:100%"></canvas>
-	<script type="text/javascript" src="main.js"></script>
-	
-</body>
+<html>
+<head><meta charset="utf-8"/><title>::name::</title></head>
+<body style="margin:0;padding:0;background-color:black">
+	
+	<canvas id="webgl" style="width:100%;height:100%"></canvas>
+	<script type="text/javascript" src="::name::.js"></script>
+	
+</body>
 </html>

+ 0 - 6
samples/world/world.hxml

@@ -1,6 +0,0 @@
--swf world.swf
--swf-header 800:600:60:000000
--swf-version 15.0
--main Main
--lib heaps
--dce full

+ 0 - 60
samples/world/world.hxproj

@@ -1,60 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<project version="2">
-  <!-- Output SWF options -->
-  <output>
-    <movie outputType="Application" />
-    <movie input="" />
-    <movie path="world.swf" />
-    <movie fps="60" />
-    <movie width="800" />
-    <movie height="600" />
-    <movie version="15" />
-    <movie minorVersion="0" />
-    <movie platform="Flash Player" />
-    <movie background="#000000" />
-  </output>
-  <!-- Other classes to be compiled into your SWF -->
-  <classpaths>
-    <!-- example: <class path="..." /> -->
-  </classpaths>
-  <!-- Build options -->
-  <build>
-    <option directives="" />
-    <option flashStrict="False" />
-    <option noInlineOnDebug="False" />
-    <option mainClass="Main" />
-    <option enabledebug="False" />
-    <option additional="-lib heaps&#xA;-dce full" />
-  </build>
-  <!-- haxelib libraries -->
-  <haxelib>
-    <!-- example: <library name="..." /> -->
-  </haxelib>
-  <!-- Class files to compile (other referenced classes will automatically be included) -->
-  <compileTargets>
-    <!-- example: <compile path="..." /> -->
-  </compileTargets>
-  <!-- Assets to embed into the output SWF -->
-  <library>
-    <!-- example: <asset path="..." id="..." update="..." glyphs="..." mode="..." place="..." sharepoint="..." /> -->
-  </library>
-  <!-- Paths to exclude from the Project Explorer tree -->
-  <hiddenPaths>
-    <hidden path="engine.hxml" />
-    <hidden path="obj" />
-    <hidden path="main.js" />
-    <hidden path="main.js.map" />
-  </hiddenPaths>
-  <!-- Executed before build -->
-  <preBuildCommand />
-  <!-- Executed after build -->
-  <postBuildCommand alwaysRun="False" />
-  <!-- Other project options -->
-  <options>
-    <option showHiddenPaths="False" />
-    <option testMovie="OpenDocument" />
-    <option testMovieCommand="world.swf" />
-  </options>
-  <!-- Plugin storage -->
-  <storage />
-</project>

+ 0 - 0
samples/world/res/rock.hmd → samples/world_res/rock.hmd


+ 0 - 0
samples/world/res/rockTexture.jpg → samples/world_res/rockTexture.jpg


+ 0 - 0
samples/world/res/tree.hmd → samples/world_res/tree.hmd


+ 0 - 0
samples/world/res/treeTexture.png → samples/world_res/treeTexture.png