Mercurial > hg > Members > koba > t_dandy
view ppe/chara_state7.cc @ 55:2c33aa6a4a37
debug global_alloc.but new bugs appear
author | koba <koba@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Fri, 28 Jan 2011 19:05:00 +0900 |
parents | 7aaaaf5dde40 |
children | 978097c6427a |
line wrap: on
line source
#include "task_base.h" #include "task_object.h" SchedDefineTask1(State7, state7); static int state7(SchedTask *smanager, void *rbuf, void *wbuf) { int length; CHARACTER *p = (CHARACTER*)smanager->get_input(rbuf, 0); p->x += p->vx; p->y += p->vy; if((p->dt1 == 60) || (p->dt1 == 90) || (p->dt1 == 30)) { length = 1; smanager->set_outputSize(1, sizeof(ObjContainer)+sizeof(ObjData)*(length-1)); smanager->setup_outputData(); ObjContainerPtr tama = (ObjContainerPtr)smanager->get_output(wbuf, 1); tama->flag = true; tama->length = length; Puttama(1, p->x, p->y, &tama->data[0]); } CHARACTER *q = (CHARACTER*)smanager->get_output(wbuf, 0); p->dt1++; p->task = STATE7; *q = *p; return 0; }