Mercurial > hg > Members > koba > t_dandy
view spe/chara_state25.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 | f4140672ef9f |
children | cfd42ee2ad28 |
line wrap: on
line source
#include "task_base.h" #include "task_object.h" #include "Sankaku.h" SchedDefineTask1(State25, state25); static int state25(SchedTask *smanager, void *rbuf, void *wbuf) { int length = 1; int amari; int part1_f = (int)smanager->get_param(0); int part5_f = (int)smanager->get_param(1); int rand = (int)smanager->get_param(2); 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 *rinkx = (int*)smanager->get_output(wbuf, 2); int *rinkf1 = (int*)smanager->get_output(wbuf, 3); ObjContainerPtr sprite = (ObjContainerPtr)smanager->get_output(wbuf, 4); sprite->flag = true; sprite->length = length; if(p->dt1 <= 360) { p->x = Mycos(p->dt1) * 30 / SANKAKU + 82 + 32; p->y = Mysin(p->dt1) * 30 / SANKAKU + 30; } if(p->dt1 > 360) { p->x = Mycos(p->dt1) * 30 * -1 /SANKAKU + 142 + 32; p->y = Mysin(p->dt1) * 30 / SANKAKU + 30; } count++; *w_count = count; PutSprite(count, p->x - 42, p->y, 64, &sprite->data[0]); amari = rand % 160; if((amari == 1) && (part5_f == TRUE)) { p->task = STATE26; *rinkf1 = 1; } if((amari == 2) && (part1_f == TRUE)) { p->task = STATE27; *rinkf1 = 5; *rinkx = 0; *q = *p; return 0; } if((part5_f == TRUE) && (part1_f != TRUE)) { p->task = STATE28; } p->dt1 += 3; if(p->dt1 == 720) { p->dt1 = 0; } *q = *p; return 0; }