Mercurial > hg > Members > koba > t_dandy
comparison ppe/chara_state3.cc @ 30:427e1aac0bd7
not run.
author | koba <koba@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Fri, 31 Dec 2010 15:50:44 +0900 |
parents | ee4c488d48a3 |
children | ccb8d9956a1e |
comparison
equal
deleted
inserted
replaced
29:d2e627af7f61 | 30:427e1aac0bd7 |
---|---|
5 | 5 |
6 static int | 6 static int |
7 run(SchedTask *smanager, void *rbuf, void *wbuf) | 7 run(SchedTask *smanager, void *rbuf, void *wbuf) |
8 { | 8 { |
9 CHARACTER *p = (CHARACTER*)smanager->get_input(rbuf, 0); | 9 CHARACTER *p = (CHARACTER*)smanager->get_input(rbuf, 0); |
10 TamaContainerPtr tama = (TamaContainerPtr)smanager->get_input(rbuf, 1); | 10 CHARACTER *q = (CHARACTER*)smanager->get_output(wbuf, 0); |
11 TamaContainerPtr tama = (TamaContainerPtr)smanager->get_output(wbuf, 1); | |
12 | |
13 smanager->set_outputSize(1, sizeof(TamaContainer)*3); | |
14 smanager->setup_outputData(); | |
11 | 15 |
12 p->x += p->vx; | 16 p->x += p->vx; |
13 p->y += p->vy; | 17 p->y += p->vy; |
14 if((p->dt1 == 60) || | 18 if((p->dt1 == 60) || |
15 (p->dt1 == 90) || | 19 (p->dt1 == 90) || |
16 (p->dt1 == 30)) | 20 (p->dt1 == 30)) |
17 { | 21 { |
18 Puttama(0, p->x, p->y, tama); | 22 Puttama(0, p->x, p->y, &tama[0]); |
23 Puttama(0, p->x, p->y, &tama[1]); | |
24 Puttama(0, p->x, p->y, &tama[2]); | |
19 } | 25 } |
20 p->dt1++; | 26 p->dt1++; |
21 | |
22 p->task = STATE3; | 27 p->task = STATE3; |
23 smanager->swap(); | 28 |
29 *q = *p; | |
24 return 0; | 30 return 0; |
25 } | 31 } |