Mercurial > hg > Game > Cerium
annotate Renderer/Engine/task/DataUpdate.cc @ 677:24054155368c draft
add Load light info for some spe
author | yutaka@henri.cr.ie.u-ryukyu.ac.jp |
---|---|
date | Sun, 06 Dec 2009 07:40:26 +0900 |
parents | |
children | 3a97fdd53a8e |
rev | line source |
---|---|
677
24054155368c
add Load light info for some spe
yutaka@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff
changeset
|
1 #include <stdio.h> |
24054155368c
add Load light info for some spe
yutaka@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff
changeset
|
2 #include "DataUpdate.h" |
24054155368c
add Load light info for some spe
yutaka@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff
changeset
|
3 #include "Func.h" |
24054155368c
add Load light info for some spe
yutaka@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff
changeset
|
4 |
24054155368c
add Load light info for some spe
yutaka@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff
changeset
|
5 /* これは必須 */ |
24054155368c
add Load light info for some spe
yutaka@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff
changeset
|
6 SchedDefineTask(DataUpdate); |
24054155368c
add Load light info for some spe
yutaka@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff
changeset
|
7 |
24054155368c
add Load light info for some spe
yutaka@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff
changeset
|
8 static int |
24054155368c
add Load light info for some spe
yutaka@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff
changeset
|
9 run(SchedTask *s, void *rbuf, void *wbuf) |
24054155368c
add Load light info for some spe
yutaka@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff
changeset
|
10 { |
24054155368c
add Load light info for some spe
yutaka@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff
changeset
|
11 |
24054155368c
add Load light info for some spe
yutaka@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff
changeset
|
12 float *idata = (float*)s->get_input(rbuf, 0); |
24054155368c
add Load light info for some spe
yutaka@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff
changeset
|
13 int load_id = (int)s->get_param(0); |
24054155368c
add Load light info for some spe
yutaka@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff
changeset
|
14 float *global_data = (float*)s->global_get(load_id); |
24054155368c
add Load light info for some spe
yutaka@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff
changeset
|
15 |
24054155368c
add Load light info for some spe
yutaka@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff
changeset
|
16 global_data[0] = idata[0]; |
24054155368c
add Load light info for some spe
yutaka@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff
changeset
|
17 global_data[1] = idata[1]; |
24054155368c
add Load light info for some spe
yutaka@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff
changeset
|
18 global_data[2] = idata[2]; |
24054155368c
add Load light info for some spe
yutaka@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff
changeset
|
19 global_data[3] = idata[3]; |
24054155368c
add Load light info for some spe
yutaka@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff
changeset
|
20 |
24054155368c
add Load light info for some spe
yutaka@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff
changeset
|
21 #if 0 |
24054155368c
add Load light info for some spe
yutaka@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff
changeset
|
22 s->printf("spe %f ",idata[0]); |
24054155368c
add Load light info for some spe
yutaka@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff
changeset
|
23 s->printf("spe %f ",idata[1]); |
24054155368c
add Load light info for some spe
yutaka@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff
changeset
|
24 s->printf("spe %f\n",idata[2]); |
24054155368c
add Load light info for some spe
yutaka@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff
changeset
|
25 #endif |
24054155368c
add Load light info for some spe
yutaka@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff
changeset
|
26 |
24054155368c
add Load light info for some spe
yutaka@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff
changeset
|
27 return 0; |
24054155368c
add Load light info for some spe
yutaka@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff
changeset
|
28 } |