Mercurial > hg > Members > koba > t_dandy
view ppe/chara_state501.cc @ 37:6989f8cb0259
fix.
author | koba <koba@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Sun, 09 Jan 2011 23:14:26 +0900 |
parents | c122e3d2302e |
children |
line wrap: on
line source
#include "task_base.h" #include "task_object.h" SchedDefineTask1(State501, state501); static int state501(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 % 32 == 1) { length = 1; smanager->set_outputSize(1, sizeof(ObjContainer)+sizeof(ObjData)*(length-1)); smanager->setup_outputData(); ObjContainerPtr sprite = (ObjContainerPtr)smanager->get_output(wbuf, 1); sprite->flag = true; sprite->length = length; Puttama(11, p->x, p->y, &sprite->data[0]); } CHARACTER *q = (CHARACTER*)smanager->get_output(wbuf, 0); p->dt1++; *q = *p; return 0; }