annotate ppe/chara_state1.cc @ 20:6487f54ba3d1

add new file.
author koba <koba@cr.ie.u-ryukyu.ac.jp>
date Sun, 26 Dec 2010 19:00:01 +0900
parents
children 5f1abbe03b9a
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
20
6487f54ba3d1 add new file.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1 #include "chara_state1.h"
6487f54ba3d1 add new file.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
2 #include "task_object.h"
6487f54ba3d1 add new file.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
3
6487f54ba3d1 add new file.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
4 SchedDefineTask(STATE1);
6487f54ba3d1 add new file.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
5
6487f54ba3d1 add new file.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
6 static int
6487f54ba3d1 add new file.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
7 run(SchedTask *smanager, void *rbuf, void *wbuf)
6487f54ba3d1 add new file.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
8 {
6487f54ba3d1 add new file.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
9 CHARACTER *p = (CHARACTER*)smanager->get_input(rbuf, 0);
6487f54ba3d1 add new file.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
10
6487f54ba3d1 add new file.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
11 p->x -= p->vx;
6487f54ba3d1 add new file.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
12 p->y -= p->vy;
6487f54ba3d1 add new file.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
13
6487f54ba3d1 add new file.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
14 p->task = STATE1;
6487f54ba3d1 add new file.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
15 smanager->swap();
6487f54ba3d1 add new file.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
16 return 0;
6487f54ba3d1 add new file.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
17 }