21
|
1 #include "task_base.h"
|
20
|
2 #include "task_object.h"
|
|
3
|
25
|
4 SchedDefineTask(State3);
|
20
|
5
|
|
6 static int
|
|
7 run(SchedTask *smanager, void *rbuf, void *wbuf)
|
|
8 {
|
|
9 CHARACTER *p = (CHARACTER*)smanager->get_input(rbuf, 0);
|
30
|
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();
|
20
|
15
|
|
16 p->x += p->vx;
|
|
17 p->y += p->vy;
|
|
18 if((p->dt1 == 60) ||
|
|
19 (p->dt1 == 90) ||
|
|
20 (p->dt1 == 30))
|
|
21 {
|
30
|
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]);
|
20
|
25 }
|
|
26 p->dt1++;
|
|
27 p->task = STATE3;
|
30
|
28
|
|
29 *q = *p;
|
20
|
30 return 0;
|
|
31 }
|