Mercurial > hg > Members > koba > t_dandy
view ppe/chara_state13.cc @ 70:cee55c8365e9 default tip
fix
author | Kazuma |
---|---|
date | Thu, 19 May 2016 18:52:26 +0900 |
parents | 21ac9f57a6d4 |
children |
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) { long rinkx = (long)smanager->get_param(0); long rinky = (long)smanager->get_param(1); long filpcount = (long)smanager->get_param(2); long flag = (long)smanager->get_param(3); long count = (long)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; }