Mercurial > hg > Game > Cerium
annotate 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 |
rev | line source |
---|---|
755
8aaa29d3e874
add Test/create_task {spe, task}/Property
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff
changeset
|
1 #include <stdio.h> |
8aaa29d3e874
add Test/create_task {spe, task}/Property
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff
changeset
|
2 #include <string.h> |
8aaa29d3e874
add Test/create_task {spe, task}/Property
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff
changeset
|
3 #include <math.h> |
8aaa29d3e874
add Test/create_task {spe, task}/Property
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff
changeset
|
4 #include "Property.h" |
8aaa29d3e874
add Test/create_task {spe, task}/Property
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff
changeset
|
5 #include "Func.h" |
8aaa29d3e874
add Test/create_task {spe, task}/Property
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff
changeset
|
6 #include "types.h" |
8aaa29d3e874
add Test/create_task {spe, task}/Property
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff
changeset
|
7 |
8aaa29d3e874
add Test/create_task {spe, task}/Property
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff
changeset
|
8 /* これは必須 */ |
8aaa29d3e874
add Test/create_task {spe, task}/Property
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff
changeset
|
9 SchedDefineTask(PropertyTask); |
8aaa29d3e874
add Test/create_task {spe, task}/Property
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff
changeset
|
10 |
8aaa29d3e874
add Test/create_task {spe, task}/Property
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff
changeset
|
11 typedef struct { |
8aaa29d3e874
add Test/create_task {spe, task}/Property
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff
changeset
|
12 float x, y, z; |
8aaa29d3e874
add Test/create_task {spe, task}/Property
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff
changeset
|
13 } Property, *PropertyPtr; |
8aaa29d3e874
add Test/create_task {spe, task}/Property
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff
changeset
|
14 |
8aaa29d3e874
add Test/create_task {spe, task}/Property
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff
changeset
|
15 static int |
8aaa29d3e874
add Test/create_task {spe, task}/Property
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff
changeset
|
16 run(SchedTask *s,void *rbuf, void *wbuf) |
8aaa29d3e874
add Test/create_task {spe, task}/Property
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff
changeset
|
17 { |
8aaa29d3e874
add Test/create_task {spe, task}/Property
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff
changeset
|
18 PropertyPtr property = (PropertyPtr)s->get_input(rbuf, 0); |
8aaa29d3e874
add Test/create_task {spe, task}/Property
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff
changeset
|
19 PropertyPtr update_property = (PropertyPtr)s->get_output(wbuf, 0); |
8aaa29d3e874
add Test/create_task {spe, task}/Property
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff
changeset
|
20 |
8aaa29d3e874
add Test/create_task {spe, task}/Property
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff
changeset
|
21 property->x += 1.0f; |
8aaa29d3e874
add Test/create_task {spe, task}/Property
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff
changeset
|
22 property->y += 1.0f; |
8aaa29d3e874
add Test/create_task {spe, task}/Property
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff
changeset
|
23 property->z += 1.0f; |
8aaa29d3e874
add Test/create_task {spe, task}/Property
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff
changeset
|
24 |
8aaa29d3e874
add Test/create_task {spe, task}/Property
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff
changeset
|
25 memcpy((void*)update_property, (void*)property, sizeof(Property)); |
8aaa29d3e874
add Test/create_task {spe, task}/Property
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff
changeset
|
26 return 0; |
8aaa29d3e874
add Test/create_task {spe, task}/Property
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff
changeset
|
27 } |