Mercurial > hg > Members > koba > t_dandy
view ppe/chara_state411.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 (2011-01-28) |
parents | c122e3d2302e |
children | f27a6af6514c |
line wrap: on
line source
#include "task_base.h" #include "task_object.h" #include "Sankaku.h" SchedDefineTask1(State411, state411); static int state411(SchedTask *smanager, void *rbuf, void *wbuf) { int length; CHARACTER *p = (CHARACTER*)smanager->get_input(rbuf, 0); player *jiki = (player*)smanager->get_input(rbuf, 1); if (p->dt2 > 356) { p->vx = -1; } if (p->dt2 < -398) { p->vx = 1; } if ((p->dt1) % 62 == 0) { 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; Putenemy(41, p->x, p->y, (int) -Mycos(p->dt1 / 16) * 4 / SANKAKU, (int) -Mysin(p->dt1 / 16) * 4 / SANKAKU, STATE7, &sprite->data[0]); } if ((p->dt1) % 13 == 0) { 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 + 32, p->y + 32, &sprite->data[0]); } p->dt2 += p->vx; p->dt1 += p->dt2 / 4; p->x = jiki->x - 16 + Mycos(p->dt1 / 16) * 128 / SANKAKU; p->y = jiki->y - 16 + Mysin(p->dt1 / 16) * 128 / SANKAKU; 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; }