changeset 29:da11cc30423f

Added miniD wrap
author zzzzrrr <mason.green@gmail.com>
date Mon, 30 Mar 2009 15:35:54 -0400
parents 1cc6b8c0acd2
children 1cd0d4c7258e
files ships/ship.d test/wrap.d
diffstat 2 files changed, 36 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/ships/ship.d	Mon Mar 30 12:48:45 2009 -0400
+++ b/ships/ship.d	Mon Mar 30 15:35:54 2009 -0400
@@ -47,6 +47,7 @@
 alias LinkedList!(bzShape) ShapeList;
 
 import openmelee.ai.utilities : randomRange;
+import openmelee.test.wrap;
 
 struct State 
 {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/wrap.d	Mon Mar 30 15:35:54 2009 -0400
@@ -0,0 +1,35 @@
+module openmelee.test.wrap;
+
+import blaze.common.bzMath;
+
+private {
+	import xf.xpose2.Expose;
+	import xf.xpose2.MiniD;
+}
+
+char[] mdxpose(char[] name, char[] expStr) {
+	return "
+	struct MDWrapper__"~name~" {
+		mixin(xpose2(`"~name~"`, `"~expStr~"`));
+		mixin xposeMiniDNoSubclass!(`"~name~"`);
+	}";
+}
+
+mixin(mdxpose(`bzVec2`, `
+	x|y|
+	_ctor overload bzVec function(float, float)
+`));
+
+void initMD(MDThread* t) {
+	pushGlobal(t, "modules");
+	field(t, -1, "customLoaders");
+
+	newFunction(t, function uword(MDThread* t, uword numParams)
+	{
+		xposeMiniD_initAll(t);
+		return 0;
+	}, "boxen");
+
+	fielda(t, -2, "boxen");
+	pop(t, 2);
+}