Mercurial > hg > Game > Cerium
diff Renderer/Engine/task/Property.cc @ 755:8aaa29d3e874 draft
add Test/create_task {spe, task}/Property
author | hiroki@henri.cr.ie.u-ryukyu.ac.jp |
---|---|
date | Fri, 29 Jan 2010 11:34:43 +0900 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Renderer/Engine/task/Property.cc Fri Jan 29 11:34:43 2010 +0900 @@ -0,0 +1,27 @@ +#include <stdio.h> +#include <string.h> +#include <math.h> +#include "Property.h" +#include "Func.h" +#include "types.h" + +/* これは必須 */ +SchedDefineTask(PropertyTask); + +typedef struct { + float x, y, z; +} Property, *PropertyPtr; + +static int +run(SchedTask *s,void *rbuf, void *wbuf) +{ + PropertyPtr property = (PropertyPtr)s->get_input(rbuf, 0); + PropertyPtr update_property = (PropertyPtr)s->get_output(wbuf, 0); + + property->x += 1.0f; + property->y += 1.0f; + property->z += 1.0f; + + memcpy((void*)update_property, (void*)property, sizeof(Property)); + return 0; +}