annotate ppe/chara_state33.cc @ 64:07bc996c8e49

fix t_dandy on ps3.
author koba <koba@cr.ie.u-ryukyu.ac.jp>
date Fri, 11 Feb 2011 18:20:30 +0900
parents 978097c6427a
children b97628fca317
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(State33, state33);
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 state33(SchedTask *smanager, void *rbuf, void *wbuf)
c122e3d2302e add all state task.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
8 {
c122e3d2302e add all state task.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
9 int enemystate_11 = (int)smanager->get_param(4);
c122e3d2302e add all state task.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
10 int enemystate_19 = (int)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;
57
978097c6427a bug fix.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents: 37
diff changeset
30 p->collision_task = true;
35
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->x = kyeenemyno->x + 32 - 4;
c122e3d2302e add all state task.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
40 p->y = kyeenemyno->y;
c122e3d2302e add all state task.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
41 p->charano = enemystate_19;
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 if (rinkf1 == 6)
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 p->charano = enemystate_11;
c122e3d2302e add all state task.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
46 }
c122e3d2302e add all state task.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
47 *q = *p;
c122e3d2302e add all state task.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
48 return 0;
c122e3d2302e add all state task.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
49 }