Mercurial > hg > Members > koba > t_dandy
view ppe/chara_state600.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 | 978097c6427a |
line wrap: on
line source
#include "task_base.h" #include "task_object.h" #include "Sankaku.h" SchedDefineTask1(State600, state600); static int state600(SchedTask *smanager, void *rbuf, void *wbuf) { CHARACTER *p = (CHARACTER*)smanager->get_input(rbuf, 0); int length = 3; 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; p->dt1 += 30; p->dt2++; p->dt1 %= 360; p->x += Mycos(p->dt1) * 4 / SANKAKU; p->y += Mysin(p->dt1) * 4 / SANKAKU; Puttama(11, p->x + 16, p->y + 16, &sprite->data[0]); Puttama(11, p->x + 32, p->y + 48, &sprite->data[1]); Puttama(11, p->x + 48, p->y + 16, &sprite->data[2]); if (p->dt2 > 240) p->task = STATE601; if (p->x < 0) p->x = 0; if (p->x > 260) p->x = 260; if (p->y < 0) p->y = 0; if (p->y > 232) p->y = 232; CHARACTER *q = (CHARACTER*)smanager->get_output(wbuf, 0); *q = *p; return 0; }