comparison ppe/chara_state501.cc @ 35:c122e3d2302e

add all state task.
author koba <koba@cr.ie.u-ryukyu.ac.jp>
date Sun, 09 Jan 2011 14:28:44 +0900
parents
children
comparison
equal deleted inserted replaced
34:7aaaaf5dde40 35:c122e3d2302e
1 #include "task_base.h"
2 #include "task_object.h"
3
4 SchedDefineTask1(State501, state501);
5
6 static int
7 state501(SchedTask *smanager, void *rbuf, void *wbuf)
8 {
9 int length;
10 CHARACTER *p = (CHARACTER*)smanager->get_input(rbuf, 0);
11
12 p->x += p->vx;
13 p->y += p->vy;
14 if(p->dt1 % 32 == 1)
15 {
16 length = 1;
17 smanager->set_outputSize(1, sizeof(ObjContainer)+sizeof(ObjData)*(length-1));
18 smanager->setup_outputData();
19 ObjContainerPtr sprite = (ObjContainerPtr)smanager->get_output(wbuf, 1);
20 sprite->flag = true;
21 sprite->length = length;
22
23 Puttama(11, p->x, p->y, &sprite->data[0]);
24 }
25 CHARACTER *q = (CHARACTER*)smanager->get_output(wbuf, 0);
26
27 p->dt1++;
28 *q = *p;
29 return 0;
30 }