annotate ppe/chara_state34.cc @ 67:21ac9f57a6d4

Mac OS X 64bit
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Sat, 21 May 2011 16:27:41 +0900
parents 6989f8cb0259
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
35
c122e3d2302e add all state task.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1 #include "task_base.h"
c122e3d2302e add all state task.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
2 #include "task_object.h"
c122e3d2302e add all state task.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
3
c122e3d2302e add all state task.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
4 SchedDefineTask1(State34, state34);
c122e3d2302e add all state task.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
5
c122e3d2302e add all state task.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
6 static int
c122e3d2302e add all state task.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
7 state34(SchedTask *smanager, void *rbuf, void *wbuf)
c122e3d2302e add all state task.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
8 {
67
21ac9f57a6d4 Mac OS X 64bit
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 37
diff changeset
9 long enemystate_12 = (long)smanager->get_param(4);
21ac9f57a6d4 Mac OS X 64bit
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 37
diff changeset
10 long enemystate_21 = (long)smanager->get_param(5);
37
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents: 35
diff changeset
11
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents: 35
diff changeset
12 int length;
35
c122e3d2302e add all state task.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
13 CHARACTER *p = (CHARACTER*)smanager->get_input(rbuf, 0);
c122e3d2302e add all state task.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
14 CHARACTER *kyeenemyno = (CHARACTER*)smanager->get_input(rbuf, 1);
c122e3d2302e add all state task.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
15 int rinkf1 = *(int*)smanager->get_input(rbuf, 3);
c122e3d2302e add all state task.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
16 CHARACTER *q = (CHARACTER*)smanager->get_output(wbuf, 0);
c122e3d2302e add all state task.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
17
c122e3d2302e add all state task.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
18 if (kyeenemyno->f == FALSE)
c122e3d2302e add all state task.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
19 {
37
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents: 35
diff changeset
20 length = 1;
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents: 35
diff changeset
21 smanager->set_outputSize(2, sizeof(ObjContainer)+sizeof(ObjData)*(length-1));
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents: 35
diff changeset
22 smanager->setup_outputData();
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents: 35
diff changeset
23 CHARACTER *q = (CHARACTER*)smanager->get_output(wbuf, 0);
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents: 35
diff changeset
24 ObjContainerPtr sprite = (ObjContainerPtr)smanager->get_output(wbuf, 2);
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents: 35
diff changeset
25 sprite->flag = true;
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents: 35
diff changeset
26 sprite->length = length;
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents: 35
diff changeset
27
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents: 35
diff changeset
28 Bom(p->x, p->y, &sprite->data[0]);
35
c122e3d2302e add all state task.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
29 p->f = FALSE;
c122e3d2302e add all state task.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
30 p->task = DELETE_CHARA;
c122e3d2302e add all state task.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
31
c122e3d2302e add all state task.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
32 *q = *p;
c122e3d2302e add all state task.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
33 return 0;
c122e3d2302e add all state task.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
34 }
c122e3d2302e add all state task.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
35 p->x = kyeenemyno->x - 32;
c122e3d2302e add all state task.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
36 p->y = kyeenemyno->y;
c122e3d2302e add all state task.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
37 if (rinkf1 == 5)
c122e3d2302e add all state task.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
38 {
c122e3d2302e add all state task.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
39 p->charano = enemystate_21;
c122e3d2302e add all state task.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
40 }
c122e3d2302e add all state task.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
41 if (rinkf1 == 6)
c122e3d2302e add all state task.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
42 {
c122e3d2302e add all state task.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
43 p->charano = enemystate_12;
c122e3d2302e add all state task.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
44 }
c122e3d2302e add all state task.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
45 *q = *p;
c122e3d2302e add all state task.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
46 return 0;
c122e3d2302e add all state task.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
47 }