comparison 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
comparison
equal deleted inserted replaced
59:cd05eee90279 60:cfd42ee2ad28
4 SchedDefineTask1(State22, state22); 4 SchedDefineTask1(State22, state22);
5 5
6 static int 6 static int
7 state22(SchedTask *smanager, void *rbuf, void *wbuf) 7 state22(SchedTask *smanager, void *rbuf, void *wbuf)
8 { 8 {
9 int rand = (int)smanager->get_param(0); 9 int rand1 = (int)smanager->get_param(0);
10 int rand2 = (int)smanager->get_param(1);
11 int rand3 = (int)smanager->get_param(2);
12 int rand4 = (int)smanager->get_param(3);
10 13
11 CHARACTER *p = (CHARACTER*)smanager->get_input(rbuf, 0); 14 CHARACTER *p = (CHARACTER*)smanager->get_input(rbuf, 0);
12 15
13 int sf = rand % 4; 16 int sf = rand1 % 4;
14 if((sf == 0) || (sf == 1)) 17 if((sf == 0) || (sf == 1))
15 { 18 {
16 p->x = -35; 19 p->x = -35;
17 p->y = rand % (120 - 35); 20 p->y = rand2 % (120 - 35);
18 p->vx = (rand % 4 + 1); 21 p->vx = (rand3 % 4 + 1);
19 p->vy = rand % 3 + 1; 22 p->vy = rand4 % 3 + 1;
20 p->task = STATE23; 23 p->state_task = STATE23;
21 } 24 }
22 if((sf == 2)) 25 if((sf == 2))
23 { 26 {
24 p->x = rand % 290; 27 p->x = rand2 % 290;
25 p->y = -30; 28 p->y = -30;
26 p->vx = rand % 3 - 1; 29 p->vx = rand3 % 3 - 1;
27 p->vy = (rand % 4 + 1); 30 p->vy = (rand4 % 4 + 1);
28 p->task = STATE23; 31 p->state_task = STATE23;
29 } 32 }
30 if(sf == 3) 33 if(sf == 3)
31 { 34 {
32 p->x = 320; 35 p->x = 320;
33 p->y = rand % (120 - 35); 36 p->y = rand2 % (120 - 35);
34 p->vx = (rand % 4 + 1) * -1; 37 p->vx = (rand3 % 4 + 1) * -1;
35 p->vy = rand % 3 -1; 38 p->vy = rand4 % 3 -1;
36 p->task = STATE23; 39 p->state_task = STATE23;
37 } 40 }
38 41
39 smanager->swap(); 42 smanager->swap();
40 return 0; 43 return 0;
41 } 44 }