Mercurial > hg > Members > koba > t_dandy
annotate spe/Atari.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 | c330ded6d728 |
children |
rev | line source |
---|---|
60
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
1 #include "task_base.h" |
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
2 #include "task_object.h" |
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
3 #include "../ObjectType.h" |
17 | 4 |
60
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
5 SchedDefineTask1(Atari, atari); |
17 | 6 |
7 static int | |
60
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
8 atari(SchedTask *smanager, void *rbuf, void *wbuf) |
17 | 9 { |
10 int w = (int)smanager->get_param(0); | |
11 int h = (int)smanager->get_param(1); | |
60
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
12 long load_id = (long)smanager->get_param(2); |
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
13 |
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
14 CHARACTER *p = (CHARACTER*)smanager->get_input(rbuf, 0); |
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
15 CollisionPropertyPtr property = |
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
16 (CollisionPropertyPtr)smanager->global_get(load_id); |
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
17 |
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
18 int *p_infg_level = &property->infg_level; |
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
19 int infg_level = *p_infg_level; |
17 | 20 |
60
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
21 int tama_lv1_end = property->tama_lv1_end; |
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
22 int tama_lv2_end = property->tama_lv2_end; |
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
23 int laser_lv1_end = property->laser_lv1_end; |
17 | 24 |
60
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
25 int *enemycount = &property->enemycount; |
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
26 |
17 | 27 player *jiki = &property->jiki; |
60
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
28 |
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
29 stge *lg = &property->lg; |
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
30 stge *infg = &property->infg; |
17 | 31 |
32 tama1 *tama_lv1 = property->tama_lv1; | |
33 tama2 *tama_lv2 = property->tama_lv2; | |
60
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
34 tama1 *tlv3 = &property->tlv3; |
17 | 35 laser *laser_lv1 = property->laser_lv1; |
60
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
36 laser *laser_lv2 = &property->laser_lv2; |
17 | 37 laser *laser_lv3 = property->laser_lv3; |
38 | |
39 int i1, ex, ey; | |
40 int n; | |
41 ex = p->x; | |
42 ey = p->y; | |
43 | |
60
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
44 CHARACTER *q = (CHARACTER*)smanager->get_output(wbuf, 0); |
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
45 ObjContainerPtr sprite = (ObjContainerPtr)smanager->get_output(wbuf, 1); |
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
46 sprite->flag = false; |
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
47 sprite->length = 1; |
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
48 |
17 | 49 //自機やられ |
50 #ifndef INVISIBLE_MODE | |
51 if ((ex < jiki->x + 128 / 2) && (ex + w > jiki->x + 128 / 2) | |
52 && (ey < jiki->y + 128 / 2) && (ey + h > jiki->y + 128 / 2) | |
53 && jiki->muteki == 0) { | |
60
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
54 |
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
55 sprite->flag = true; |
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
56 Bom(jiki->x + 16, jiki->y + 16, &sprite->data[0]); |
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
57 |
17 | 58 jiki->bf = FALSE; |
59 jiki->zanki--; | |
60
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
60 jiki->muteki = 120; |
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
61 property->jiki = *jiki; |
17 | 62 |
60
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
63 infg->stg = 0; |
17 | 64 infg_level--; |
65 if (infg_level < 0) | |
66 infg_level = 0; | |
67 | |
60
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
68 *p_infg_level = infg_level; |
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
69 *q = *p; |
17 | 70 return 0; |
71 } | |
72 #endif | |
73 | |
74 if (p->tama == TRUE) | |
75 goto jumping; | |
76 for (i1 = 0; i1 < tama_lv1_end + 1; i1++) { | |
77 | |
78 if ((tama_lv1[i1].x + 64 + 64 > ex) | |
79 && (ex + w > tama_lv1[i1].x + 16) | |
80 && (tama_lv1[i1].y + 128 > ey) && (tama_lv1[i1].y < ey + h) | |
81 && (tama_lv1[i1].r != -1)) { | |
60
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
82 |
17 | 83 tama_lv1[i1].r = -1; |
84 p->vit -= TAMALV1P; | |
60
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
85 infg->stg++; |
17 | 86 if (p->vit <= 0) { |
60
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
87 infg->stg += 4; |
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
88 sprite->flag = true; |
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
89 Bom(p->x, p->y, &sprite->data[0]); |
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
90 *enemycount += (p->score * |
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
91 ((infg->stg / 128) + infg_level + 1)); |
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
92 p->collision_task = true; |
17 | 93 p->f = FALSE; |
94 | |
60
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
95 *q = *p; |
17 | 96 return 0; |
97 } | |
98 } | |
99 if ((tama_lv1[i1].x + 64 > ex) && (ex + w > tama_lv1[i1].x) | |
100 && (tama_lv1[i1].y + 128 > ey) && (tama_lv1[i1].y < ey + h) | |
101 && (tama_lv1[i1].l != -1)) { | |
60
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
102 |
17 | 103 tama_lv1[i1].l = -1; |
104 p->vit -= TAMALV1P; | |
60
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
105 infg->stg++; |
17 | 106 if (p->vit <= 0) { |
60
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
107 infg->stg += 4; |
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
108 sprite->flag = true; |
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
109 Bom(p->x, p->y, &sprite->data[0]); |
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
110 *enemycount += (p->score * |
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
111 ((infg->stg / 128) + infg_level + 1)); |
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
112 p->collision_task = true; |
17 | 113 p->f = FALSE; |
114 | |
60
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
115 *q = *p; |
17 | 116 return 0; |
117 } | |
118 } | |
119 } | |
120 | |
121 for (i1 = 0; i1 < tama_lv2_end + 1; i1++) { | |
122 if ((tama_lv2[i1].x + 128 + 64 > ex) | |
123 && (ex + w > tama_lv2[i1].x + 128) | |
124 && (tama_lv2[i1].y + 192 > ey) && (tama_lv2[i1].y < ey + h) | |
125 && (tama_lv2[i1].rr != -1)) { | |
60
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
126 |
17 | 127 tama_lv2[i1].rr = -1; |
128 p->vit -= TAMALV2P; | |
60
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
129 infg->stg++; |
17 | 130 if (p->vit <= 0) { |
60
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
131 infg->stg += 4; |
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
132 sprite->flag = true; |
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
133 Bom(p->x, p->y, &sprite->data[0]); |
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
134 *enemycount += (p->score * |
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
135 ((infg->stg / 128) + infg_level + 1)); |
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
136 p->collision_task = true; |
17 | 137 p->f = FALSE; |
138 | |
60
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
139 *q = *p; |
17 | 140 return 0; |
141 } | |
142 } | |
143 | |
144 if ((tama_lv2[i1].x + 64 + 64 > ex) | |
145 && (ex + w > tama_lv2[i1].x + 16) | |
146 && (tama_lv2[i1].y - 32 + 192 > ey) | |
147 && (tama_lv2[i1].y - 32 < ey + h) | |
148 && (tama_lv2[i1].sr != -1)) { | |
60
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
149 |
17 | 150 tama_lv2[i1].sr = -1; |
151 p->vit -= TAMALV2P; | |
60
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
152 infg->stg++; |
17 | 153 if (p->vit <= 0) { |
60
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
154 infg->stg += 4; |
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
155 sprite->flag = true; |
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
156 Bom(p->x, p->y, &sprite->data[0]); |
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
157 *enemycount += (p->score * |
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
158 ((infg->stg / 128) + infg_level + 1)); |
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
159 p->collision_task = true; |
17 | 160 p->f = FALSE; |
161 | |
60
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
162 *q = *p; |
17 | 163 return 0; |
164 } | |
165 } | |
166 if ((tama_lv2[i1].x + 64 > ex) && (ex + w > tama_lv2[i1].x) | |
167 && (tama_lv2[i1].y - 32 + 192 > ey) | |
168 && (tama_lv2[i1].y - 32 < ey + h) | |
169 && (tama_lv2[i1].sl != -1)) { | |
60
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
170 |
17 | 171 tama_lv2[i1].sl = -1; |
172 p->vit -= TAMALV2P; | |
60
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
173 infg->stg++; |
17 | 174 if (p->vit <= 0) { |
60
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
175 infg->stg += 4; |
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
176 sprite->flag = true; |
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
177 Bom(p->x, p->y, &sprite->data[0]); |
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
178 *enemycount += (p->score * |
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
179 ((infg->stg / 128) + infg_level + 1)); |
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
180 p->collision_task = true; |
17 | 181 p->f = FALSE; |
182 | |
60
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
183 *q = *p; |
17 | 184 return 0; |
185 } | |
186 } | |
187 if ((tama_lv2[i1].x - 64 + 64 > ex) | |
188 && (ex + w > tama_lv2[i1].x - 64) | |
189 && (tama_lv2[i1].y + 192 > ey) && (tama_lv2[i1].y < ey + h) | |
190 && (tama_lv2[i1].ll != -1)) { | |
60
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
191 |
17 | 192 tama_lv2[i1].ll = -1; |
193 p->vit -= TAMALV2P; | |
60
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
194 infg->stg++; |
17 | 195 if (p->vit <= 0) { |
60
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
196 infg->stg += 4; |
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
197 sprite->flag = true; |
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
198 Bom(p->x, p->y, &sprite->data[0]); |
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
199 *enemycount += (p->score * |
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
200 ((infg->stg / 128) + infg_level + 1)); |
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
201 p->collision_task = true; |
17 | 202 p->f = FALSE; |
203 | |
60
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
204 *q = *p; |
17 | 205 return 0; |
206 } | |
207 } | |
208 } | |
60
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
209 if ((tlv3->r > 0) && (jiki->x < ex + w) && (jiki->x + 128 > ex) |
17 | 210 && (jiki->y > ey + h)) { |
60
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
211 |
17 | 212 p->vit -= TAMALV3P; |
60
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
213 infg->stg++; |
17 | 214 if (p->vit <= 0) { |
60
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
215 infg->stg += 4; |
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
216 sprite->flag = true; |
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
217 Bom(p->x, p->y, &sprite->data[0]); |
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
218 *enemycount += (p->score * |
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
219 ((infg->stg / 128) + infg_level + 1)); |
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
220 p->collision_task = true; |
17 | 221 p->f = FALSE; |
222 | |
60
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
223 *q = *p; |
17 | 224 return 0; |
225 } | |
226 } | |
60
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
227 jumping: |
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
228 if ((tlv3->r > 0) && (jiki->x < ex + w) && (jiki->x + 128 > ex) |
17 | 229 && (jiki->y + 128 > ey) && (jiki->y < ey + h)) { |
60
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
230 |
17 | 231 p->vit -= TAMALV3P; |
60
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
232 infg->stg++; |
17 | 233 if (p->vit <= 0) { |
60
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
234 infg->stg += 4; |
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
235 sprite->flag = true; |
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
236 Bom(p->x, p->y, &sprite->data[0]); |
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
237 *enemycount += (p->score * |
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
238 ((infg->stg / 128) + infg_level + 1)); |
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
239 p->collision_task = true; |
17 | 240 p->f = FALSE; |
241 | |
60
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
242 *q = *p; |
17 | 243 return 0; |
244 } | |
245 } | |
246 /*laser lv1 */ | |
247 for (i1 = 0; i1 < laser_lv1_end + 1; i1++) { | |
248 n = laser_lv1[i1].r * 128 / 4096; | |
249 | |
250 if ((laser_lv1[i1].x + n > ex) && (ex + w > laser_lv1[i1].x) | |
251 && (laser_lv1[i1].y + n > ey) && (laser_lv1[i1].y < ey + h) | |
252 && (laser_lv1[i1].r != -1)) { | |
60
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
253 |
17 | 254 laser_lv1[i1].r = -1; |
255 laser_lv1[i1].y = -1; | |
256 p->vit -= LASERLV1P; | |
60
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
257 infg->stg++; |
17 | 258 if (p->vit <= 0) { |
60
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
259 infg->stg += 4; |
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
260 sprite->flag = true; |
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
261 Bom(p->x, p->y, &sprite->data[0]); |
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
262 *enemycount += (p->score * |
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
263 ((infg->stg / 128) + infg_level + 1)); |
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
264 p->collision_task = true; |
17 | 265 p->f = FALSE; |
266 | |
60
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
267 *q = *p; |
17 | 268 return 0; |
269 } | |
270 } | |
271 } | |
272 /*shield(laser lv2) */ | |
60
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
273 if ((p->tama == TRUE) && (lg->stg > 0) && |
17 | 274 (laser_lv2[0].x + 128 > ex) && (ex + w > laser_lv2[0].x - 128) |
275 && (laser_lv2[0].y + 128 > ey) && (laser_lv2[0].y - 128 < ey + h) | |
276 && (laser_lv2[0].r != 0)) { | |
60
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
277 |
17 | 278 p->vit -= LASERLV2P; |
60
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
279 lg->stg -= 26; |
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
280 |
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
281 infg->stg++; |
17 | 282 if (p->vit <= 0) { |
60
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
283 infg->stg += 4; |
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
284 property->infg = *infg; |
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
285 |
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
286 sprite->flag = true; |
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
287 Bom(p->x, p->y, &sprite->data[0]); |
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
288 *enemycount += (p->score * |
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
289 ((infg->stg / 128) + infg_level + 1)); |
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
290 p->collision_task = true; |
17 | 291 p->f = FALSE; |
60
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
292 |
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
293 *q = *p; |
17 | 294 return 0; |
295 } | |
296 } | |
297 /*bomber(laser lv3) */ | |
298 if (laser_lv3[0].r < 62) { | |
60
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
299 for (i1 = 1; i1 < 64; i1++) { |
17 | 300 if ((laser_lv3[i1].x + 128 > ex) && (ex + w > laser_lv3[i1].x) |
301 && (laser_lv3[i1].y + 128 > ey) | |
302 && (laser_lv3[i1].y < ey + h) | |
303 && (laser_lv3[i1].r > 0)) { | |
60
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
304 |
17 | 305 tama_lv2[i1].rr = -1; |
306 p->vit -= LASERLV3P; | |
60
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
307 infg->stg++; |
17 | 308 if (p->vit <= 0) { |
60
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
309 infg->stg += 4; |
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
310 sprite->flag = true; |
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
311 Bom(p->x, p->y, &sprite->data[0]); |
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
312 *enemycount += (p->score * |
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
313 ((infg->stg / 128) + infg_level + 1)); |
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
314 p->collision_task = true; |
17 | 315 p->f = FALSE; |
316 | |
60
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
317 *q = *p; |
17 | 318 return 0; |
319 } | |
320 } | |
321 } | |
322 } | |
60
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
323 |
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
18
diff
changeset
|
324 *q = *p; |
17 | 325 return 0; |
326 } |