Mercurial > hg > Members > koba > t_dandy
annotate spe/chara_state35.cc @ 60:cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
author | yutaka@localhost.localdomain |
---|---|
date | Sun, 06 Feb 2011 17:16:43 +0900 |
parents | f4140672ef9f |
children |
rev | line source |
---|---|
49 | 1 #include "task_base.h" |
2 #include "task_object.h" | |
18 | 3 |
49 | 4 SchedDefineTask1(State35, state35); |
18 | 5 |
6 static int | |
49 | 7 state35(SchedTask *smanager, void *rbuf, void *wbuf) |
18 | 8 { |
49 | 9 int enemystate_15 = (int)smanager->get_param(4); |
10 int enemystate_16 = (int)smanager->get_param(5); | |
11 | |
12 int length; | |
18 | 13 CHARACTER *p = (CHARACTER*)smanager->get_input(rbuf, 0); |
49 | 14 CHARACTER *kyeenemyno = (CHARACTER*)smanager->get_input(rbuf, 1); |
15 int count = *(int*)smanager->get_input(rbuf, 2); | |
16 int rinkf1 = *(int*)smanager->get_input(rbuf, 3); | |
18 | 17 |
18 if (kyeenemyno->f == FALSE) | |
19 { | |
49 | 20 length = 1; |
21 smanager->set_outputSize(2, sizeof(ObjContainer)+sizeof(ObjData)*(length-1)); | |
22 smanager->setup_outputData(); | |
23 CHARACTER *q = (CHARACTER*)smanager->get_output(wbuf, 0); | |
24 ObjContainerPtr sprite = (ObjContainerPtr)smanager->get_output(wbuf, 2); | |
25 sprite->flag = true; | |
26 sprite->length = length; | |
27 | |
28 Bom(p->x, p->y, &sprite->data[0]); | |
18 | 29 p->f = FALSE; |
60
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
49
diff
changeset
|
30 p->collision_task = true; |
49 | 31 |
32 *q = *p; | |
18 | 33 return 0; |
34 } | |
35 p->x = kyeenemyno->x; | |
36 p->y = kyeenemyno->y + 32; | |
37 if (rinkf1 == 1) | |
38 { | |
49 | 39 p->charano = enemystate_16; |
18 | 40 } |
41 if (rinkf1 == 2) | |
42 { | |
49 | 43 length = 2; |
44 smanager->set_outputSize(2, sizeof(ObjContainer)+sizeof(ObjData)*(length-1)); | |
45 smanager->setup_outputData(); | |
46 ObjContainerPtr sprite = (ObjContainerPtr)smanager->get_output(wbuf, 2); | |
47 sprite->flag = true; | |
48 sprite->length = length; | |
49 | |
18 | 50 count++; |
51 PutSprite(count, p->x - 10, | |
52 p->y + 16, | |
49 | 53 58 + p->dt2 % 4, &sprite->data[0]); |
18 | 54 count++; |
55 PutSprite(count, p->x + 10, | |
56 p->y + 16, | |
49 | 57 58 + p->dt2 % 4, &sprite->data[1]); |
18 | 58 p->dt2++; |
59 } | |
60 if (rinkf1 == 3) | |
61 { | |
49 | 62 length = 4; |
63 smanager->set_outputSize(2, sizeof(ObjContainer)+sizeof(ObjData)*(length-1)); | |
64 smanager->setup_outputData(); | |
65 ObjContainerPtr sprite = (ObjContainerPtr)smanager->get_output(wbuf, 2); | |
66 sprite->flag = true; | |
67 | |
18 | 68 count++; |
69 PutSprite(count, p->x - 10, | |
70 p->y + 16, | |
49 | 71 58 + p->dt2 % 4, &sprite->data[0]); |
18 | 72 count++; |
73 PutSprite(count, p->x + 10, | |
74 p->y + 16, | |
49 | 75 58 + p->dt2 % 4, &sprite->data[1]); |
18 | 76 if (p->dt2 % 20 == 1) |
77 { | |
49 | 78 Puttama(7, p->x, p->y + 16, &sprite->data[2]); |
18 | 79 Puttama(7, p->x + 20, |
49 | 80 p->y + 16, &sprite->data[3]); |
81 } else { | |
82 length = 2; | |
18 | 83 } |
49 | 84 sprite->length = length; |
18 | 85 p->dt2++; |
86 } | |
87 if (rinkf1 == 4) { | |
49 | 88 p->charano = enemystate_15; |
18 | 89 p->dt2 = 0; |
90 } | |
49 | 91 CHARACTER *q = (CHARACTER*)smanager->get_output(wbuf, 0); |
92 int *w_count = (int*)smanager->get_output(wbuf, 1); | |
93 | |
94 *w_count = count; | |
95 *q = *p; | |
18 | 96 return 0; |
97 } |