Mercurial > hg > Members > koba > t_dandy
view spe/chara_state13.cc @ 49:f4140672ef9f
fix.
author | koba <koba@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Fri, 21 Jan 2011 22:18:28 +0900 |
parents | c330ded6d728 |
children | cfd42ee2ad28 |
line wrap: on
line source
#include "task_base.h" #include "task_object.h" SchedDefineTask1(State13, state13); static int state13(SchedTask *smanager, void *rbuf, void *wbuf) { int rinkx = (int)smanager->get_param(0); int rinky = (int)smanager->get_param(1); int filpcount = (int)smanager->get_param(2); int flag = (int)smanager->get_param(3); int count = (int)smanager->get_param(4); int length; CHARACTER *p = (CHARACTER*)smanager->get_input(rbuf, 0); int rinkf2 = *(int*)smanager->get_input(rbuf, 1); if(flag == FALSE){ length = 1; smanager->set_outputSize(2, sizeof(ObjContainer)+sizeof(ObjData)*(length-1)); smanager->setup_outputData(); CHARACTER *q = (CHARACTER*)smanager->get_output(wbuf, 0); int *w_count = (int*)smanager->get_output(wbuf, 1); ObjContainerPtr sprite = (ObjContainerPtr)smanager->get_output(wbuf, 2); sprite->flag = true; sprite->length = length; Bom(p->x, p->y, &sprite->data[0]); p->f = FALSE; p->task = DELETE_CHARA; *w_count = count; *q = *p; return 0; } length = 1; smanager->set_outputSize(2, sizeof(ObjContainer)+sizeof(ObjData)*(length-1)); smanager->setup_outputData(); CHARACTER *q = (CHARACTER*)smanager->get_output(wbuf, 0); int *w_count = (int*)smanager->get_output(wbuf, 1); ObjContainerPtr sprite = (ObjContainerPtr)smanager->get_output(wbuf, 2); sprite->flag = false; p->x += rinkx - p->dt1; p->y += rinky - p->dt2; p->dt1 = rinkx; p->dt2 = rinky; if(rinkf2 == 1) { if(p->x > rinkx) { sprite->flag = true; sprite->length = length; Puttama(2, p->x + 32, p->y, &sprite->data[0]); } if(p->x < rinkx) { sprite->flag = true; sprite->length = length; Puttama(3, p->x, p->y, &sprite->data[0]); } } if(rinkf2 == 4) { sprite->flag = true; sprite->length = length; count++; PutSprite(count, p->x, p->y + 56, 58+filpcount % 4, &sprite->data[0]); } if(rinkf2 == 5) { if(p->x > rinkx) { sprite->flag = true; sprite->length = length; Puttama(5, p->x + 8, p->y + 24, &sprite->data[0]); } if(p->x < rinkx) { sprite->flag = true; sprite->length = length; Puttama(5, p->x + 8, p->y + 24, &sprite->data[0]); } } *q = *p; *w_count = count; return 0; }