comparison spe/chara_state8.cc @ 49:f4140672ef9f

fix.
author koba <koba@cr.ie.u-ryukyu.ac.jp>
date Fri, 21 Jan 2011 22:18:28 +0900
parents 39e643fc4f90
children cfd42ee2ad28
comparison
equal deleted inserted replaced
45:e01948ce859a 49:f4140672ef9f
1 #include "task_base.h" 1 #include "task_base.h"
2 #include "task_object.h" 2 #include "task_object.h"
3 3
4 SchedDefineTask1(STATE8, state8); 4 SchedDefineTask1(State8, state8);
5 5
6 static int 6 static int
7 state8(SchedTask *smanager, void *rbuf, void *wbuf) 7 state8(SchedTask *smanager, void *rbuf, void *wbuf)
8 { 8 {
9 CHARACTER *p = (CHARACTER*)smanager->get_input(rbuf, 0); 9 CHARACTER *p = (CHARACTER*)smanager->get_input(rbuf, 0);
10 int length = 2; 10 int count = *(int*)smanager->get_input(rbuf, 1);
11 int length;
11 12
12 smanager->set_outputSize(1, sizeof(ObjContainer)+sizeof(ObjData)*(length-1));
13 smanager->setup_outputData();
14
15 CHARACTER *q = (CHARACTER*)smanager->get_output(wbuf, 0);
16 ObjContainerPtr sprite = (ObjContainerPtr)smanager->get_output(wbuf, 1);
17 sprite->flag = false;
18
19 #if 0
20 if(p->y < 520) 13 if(p->y < 520)
21 { 14 {
22 tekino0 = p; 15 length = 2;
23 kyeenemyno = p; 16 smanager->set_outputSize(2, sizeof(ObjContainer)+sizeof(ObjData)*(length-1));
17 smanager->setup_outputData();
18
19 CHARACTER *q = (CHARACTER*)smanager->get_output(wbuf, 0);
20 int *w_count = (int*)smanager->get_output(wbuf, 1);
21 ObjContainerPtr sprite = (ObjContainerPtr)smanager->get_output(wbuf, 2);
22 sprite->flag = true;
23 sprite->length = length;
24
24 p->y += p->vy; 25 p->y += p->vy;
25 count++; 26 count++;
26 DefSpriteEx(p->charano, 16*4, 32*4); 27
27 PutSpriteEx(p->charano, (p->x * 4), (p->y * 4), 0.2, 0.2, 1); 28 DefSpriteEx(p->charano, 16*4, 32*4, &sprite->data[0]);
29 PutSpriteEx(p->charano, (p->x * 4), (p->y * 4), 0.2, 0.2, 1, &sprite->data[1]);
30
28 p->dt1 = 512; 31 p->dt1 = 512;
29 p->s = 0.125; 32 p->s = 0.125;
30 p->task = STATE8; 33 p->task = STATE8;
34
35 *w_count = count;
36 *q = *p;
31 return 0; 37 return 0;
32 } 38 }
33 #endif
34 39
40 CHARACTER *q = (CHARACTER*)smanager->get_output(wbuf, 0);
35 p->task = STATE9; 41 p->task = STATE9;
42
43 *q = *p;
36 return 0; 44 return 0;
37 } 45 }