view runtime/blueprint.c @ 48:a24eb366195c

Fixed some bugs introduced in previous commit and moved definition of integer methods out of runtime and into the compiler
author Mike Pavone <pavone@retrodev.com>
date Tue, 02 Mar 2010 00:18:49 -0500
parents 3d92bc1352c2
children 3e20ed8959c4
line wrap: on
line source

#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;
}