Mercurial > hg > Members > koba > t_dandy
view ppe/chara_state26.cc @ 37:6989f8cb0259
fix.
author | koba <koba@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Sun, 09 Jan 2011 23:14:26 +0900 |
parents | 7aaaaf5dde40 |
children | 978097c6427a |
line wrap: on
line source
#include "task_base.h" #include "task_object.h" SchedDefineTask1(State26, state26); static int state26(SchedTask *smanager, void *rbuf, void *wbuf) { int length = 1; CHARACTER *p = (CHARACTER*)smanager->get_input(rbuf, 0); int count = *(int*)smanager->get_input(rbuf, 1); smanager->set_outputSize(4, 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); int *rinkf1 = (int*)smanager->get_output(wbuf, 3); ObjContainerPtr sprite = (ObjContainerPtr)smanager->get_output(wbuf, 4); sprite->flag = true; sprite->length = length; if((p->dt2 > 50) && (p->dt2 < 100)) { *rinkf1 = 2; } if(p->dt2 > 100) { *rinkf1 = 3; } if(p->dt2 == 400) { *rinkf1 = 4; } count++; *w_count = count; PutSprite(count, p->x - 42, p->y, 64, &sprite->data[0]); if(p->dt2 == 401) { p->dt2 = 0; *rinkf1 = 0; p->task = STATE25; *q = *p; return 0; } p->dt2++; *q = *p; return 0; }