33
|
1 #include "task_base.h"
|
|
2 #include "task_object.h"
|
|
3
|
|
4 SchedDefineTask1(State11, state11);
|
|
5
|
|
6 static int
|
|
7 state11(SchedTask *smanager, void *rbuf, void *wbuf)
|
|
8 {
|
67
|
9 long rinkf1 = (long)smanager->get_param(0);
|
|
10 long count = (long)smanager->get_param(1);
|
33
|
11 int length;
|
|
12 CHARACTER *p = (CHARACTER*)smanager->get_input(rbuf, 0);
|
|
13
|
|
14 if(rinkf1 == 0)
|
|
15 {
|
|
16 length = 2;
|
|
17 smanager->set_outputSize(2, sizeof(ObjContainer)+sizeof(ObjData)*(length-1));
|
|
18 smanager->setup_outputData();
|
|
19
|
|
20 CHARACTER *q = (CHARACTER*)smanager->get_output(wbuf, 0);
|
|
21 int *w_count = (int*)smanager->get_output(wbuf, 1);
|
|
22 ObjContainerPtr sprite = (ObjContainerPtr)smanager->get_output(wbuf, 2);
|
|
23 sprite->flag = true;
|
|
24 sprite->length = length;
|
|
25
|
|
26 count++;
|
|
27 DefSpriteEx(54, 16, 32, &sprite->data[0]);
|
|
28 PutSpriteEx(54, p->x, p->y, p->s, p->s, 1, &sprite->data[1]);
|
|
29
|
|
30 p->task = STATE11;
|
|
31 *w_count = count;
|
|
32 *q = *p;
|
|
33 return 0;
|
|
34 }
|
|
35 CHARACTER *q = (CHARACTER*)smanager->get_output(wbuf, 0);
|
|
36
|
|
37 p->dt1 = 0;
|
|
38 p->dt2 = 0;
|
|
39
|
|
40 p->task = STATE12;
|
|
41 *q = *p;
|
|
42 return 0;
|
|
43 }
|