Mercurial > hg > Members > kono > Cerium
annotate Renderer/Engine/spe/ChainInit.cc @ 639:70c5c2d2eb24
fix
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Thu, 19 Nov 2009 18:45:24 +0900 |
parents | ab866bc8a624 |
children | 716d8bd95503 |
rev | line source |
---|---|
507 | 1 #include <stdio.h> |
2 #include <string.h> | |
3 #include "ChainInit.h" | |
4 #include "Func.h" | |
5 | |
6 /* これは必須 */ | |
7 SchedDefineTask(ChainInit); | |
8 | |
9 /* | |
10 spe の global 領域に MemList を生成する | |
11 */ | |
12 | |
13 typedef struct { | |
14 double x, y, next_x, next_y; | |
15 double vx, vy, next_vx, next_vy; | |
16 int can_move; | |
17 uint32 parent; | |
18 } CHAIN_VARS; | |
19 | |
20 | |
21 static int | |
22 run(SchedTask *s,void *rbuf, void *wbuf) | |
23 { | |
24 CHAIN_VARS* idata = (CHAIN_VARS*)s->get_input(rbuf, 0); | |
626
ab866bc8a624
64bit mode compatibility on Cell
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
507
diff
changeset
|
25 uint32 chain_len = (unsigned long)s->get_param(0); |
507 | 26 |
27 // property は spe 上で allocate している(global) | |
28 CHAIN_VARS *property = (CHAIN_VARS*)s->global_alloc(DATA_ID, sizeof(CHAIN_VARS)*chain_len); | |
29 memcpy(property, idata, sizeof(CHAIN_VARS)*chain_len); | |
30 | |
31 return 0; | |
32 } |