Mercurial > hg > Members > koba > t_dandy
annotate spe/chara_state25.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" | |
3 #include "Sankaku.h" | |
18 | 4 |
49 | 5 SchedDefineTask1(State25, state25); |
18 | 6 |
7 static int | |
49 | 8 state25(SchedTask *smanager, void *rbuf, void *wbuf) |
18 | 9 { |
49 | 10 int length = 1; |
11 int amari; | |
12 | |
13 int part1_f = (int)smanager->get_param(0); | |
14 int part5_f = (int)smanager->get_param(1); | |
15 int rand = (int)smanager->get_param(2); | |
16 | |
18 | 17 CHARACTER *p = (CHARACTER*)smanager->get_input(rbuf, 0); |
49 | 18 int count = *(int*)smanager->get_input(rbuf, 1); |
18 | 19 |
49 | 20 smanager->set_outputSize(4, sizeof(ObjContainer)+sizeof(ObjData)*(length-1)); |
21 smanager->setup_outputData(); | |
22 | |
23 CHARACTER *q = (CHARACTER*)smanager->get_output(wbuf, 0); | |
24 int *w_count = (int*)smanager->get_output(wbuf, 1); | |
25 int *rinkx = (int*)smanager->get_output(wbuf, 2); | |
26 int *rinkf1 = (int*)smanager->get_output(wbuf, 3); | |
27 ObjContainerPtr sprite = (ObjContainerPtr)smanager->get_output(wbuf, 4); | |
28 sprite->flag = true; | |
29 sprite->length = length; | |
18 | 30 |
31 if(p->dt1 <= 360) | |
32 { | |
33 p->x = Mycos(p->dt1) * 30 / SANKAKU + 82 + 32; | |
34 p->y = Mysin(p->dt1) * 30 / SANKAKU + 30; | |
35 } | |
36 if(p->dt1 > 360) | |
37 { | |
38 p->x = Mycos(p->dt1) * 30 * -1 /SANKAKU + 142 + 32; | |
39 p->y = Mysin(p->dt1) * 30 / SANKAKU + 30; | |
40 } | |
41 count++; | |
49 | 42 *w_count = count; |
43 PutSprite(count, p->x - 42, p->y, 64, &sprite->data[0]); | |
44 amari = rand % 160; | |
45 if((amari == 1) && (part5_f == TRUE)) | |
18 | 46 { |
60
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
49
diff
changeset
|
47 p->state_task = STATE26; |
49 | 48 *rinkf1 = 1; |
18 | 49 } |
49 | 50 if((amari == 2) && (part1_f == TRUE)) |
18 | 51 { |
60
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
49
diff
changeset
|
52 p->state_task = STATE27; |
49 | 53 *rinkf1 = 5; |
54 *rinkx = 0; | |
55 | |
56 *q = *p; | |
18 | 57 return 0; |
58 } | |
49 | 59 if((part5_f == TRUE) && (part1_f != TRUE)) |
18 | 60 { |
60
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
49
diff
changeset
|
61 p->state_task = STATE28; |
18 | 62 } |
63 p->dt1 += 3; | |
64 if(p->dt1 == 720) | |
65 { | |
66 p->dt1 = 0; | |
67 } | |
49 | 68 |
69 *q = *p; | |
18 | 70 return 0; |
71 } |