Mercurial > hg > Members > koba > t_dandy
annotate spe/chara_state22.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(State22, state22); |
18 | 5 |
6 static int | |
49 | 7 state22(SchedTask *smanager, void *rbuf, void *wbuf) |
18 | 8 { |
60
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
49
diff
changeset
|
9 int rand1 = (int)smanager->get_param(0); |
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
49
diff
changeset
|
10 int rand2 = (int)smanager->get_param(1); |
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
49
diff
changeset
|
11 int rand3 = (int)smanager->get_param(2); |
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
49
diff
changeset
|
12 int rand4 = (int)smanager->get_param(3); |
49 | 13 |
18 | 14 CHARACTER *p = (CHARACTER*)smanager->get_input(rbuf, 0); |
15 | |
60
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
49
diff
changeset
|
16 int sf = rand1 % 4; |
18 | 17 if((sf == 0) || (sf == 1)) |
18 { | |
19 p->x = -35; | |
60
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
49
diff
changeset
|
20 p->y = rand2 % (120 - 35); |
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
49
diff
changeset
|
21 p->vx = (rand3 % 4 + 1); |
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
49
diff
changeset
|
22 p->vy = rand4 % 3 + 1; |
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
49
diff
changeset
|
23 p->state_task = STATE23; |
18 | 24 } |
25 if((sf == 2)) | |
26 { | |
60
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
49
diff
changeset
|
27 p->x = rand2 % 290; |
18 | 28 p->y = -30; |
60
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
49
diff
changeset
|
29 p->vx = rand3 % 3 - 1; |
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
49
diff
changeset
|
30 p->vy = (rand4 % 4 + 1); |
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
49
diff
changeset
|
31 p->state_task = STATE23; |
18 | 32 } |
33 if(sf == 3) | |
34 { | |
35 p->x = 320; | |
60
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
49
diff
changeset
|
36 p->y = rand2 % (120 - 35); |
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
49
diff
changeset
|
37 p->vx = (rand3 % 4 + 1) * -1; |
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
49
diff
changeset
|
38 p->vy = rand4 % 3 -1; |
cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
yutaka@localhost.localdomain
parents:
49
diff
changeset
|
39 p->state_task = STATE23; |
18 | 40 } |
49 | 41 |
42 smanager->swap(); | |
18 | 43 return 0; |
44 } |