changeset 60:b2a95ab818d3

merge
author Mike Pavone <pavone@retrodev.com>
date Thu, 08 Oct 2009 22:54:39 -0400
parents 4f1ae6eb71d8 (current diff) 3d92bc1352c2 (diff)
children fa24ef3b026f
files
diffstat 2 files changed, 44 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/runtime/blueprint.c	Thu Oct 08 22:54:39 2009 -0400
@@ -0,0 +1,30 @@
+#include "blueprint.h"
+#include "builtin.h"
+#include "context.h"
+
+typedef struct
+{
+	blueprint * bp;
+} l_Build;
+
+Func(Build,
+	NumParams 1,
+	CallSpace 1,
+	l_Build)
+	
+	Param(0, TYPE_BLUEPRINT)
+	
+	locals->bp = ((t_Blueprint *)(cdata->params[0]))->bp;
+	release_ref(cdata->params[0]);
+	
+	Ret(0, new_object_bp(locals->bp))
+EndFunc
+
+object * make_Blueprint(int32_t type_id)
+{
+	t_Blueprint * obj;
+	object * ret = new_object(TYPE_BLUEPRINT);
+	obj = (t_Blueprint *)ret;
+	obj->bp = get_blueprint_byid(type_id);
+	return ret;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/runtime/blueprint.h	Thu Oct 08 22:54:39 2009 -0400
@@ -0,0 +1,14 @@
+#ifndef BLUEPRINT_H_
+#define BLUEPRINT_H_
+
+#include "object.h"
+#include "func.h"
+
+OBegin
+	blueprint * bp;
+Object(Blueprint)
+
+object * make_Blueprint(int32_t type_id);
+FuncDef(Build)
+
+#endif //BLUEPRINT_H_