Mercurial > hg > Members > koba > t_dandy
view ppe/chara_state31.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 | 6989f8cb0259 |
children | 978097c6427a 21ac9f57a6d4 |
line wrap: on
line source
#include "task_base.h" #include "task_object.h" SchedDefineTask1(State31, state31); static int state31(SchedTask *smanager, void *rbuf, void *wbuf) { int part3_f = (int)smanager->get_param(2); int length; CHARACTER *p = (CHARACTER*)smanager->get_input(rbuf, 0); CHARACTER *kyeenemyno = (CHARACTER*)smanager->get_input(rbuf, 1); int count = *(int*)smanager->get_input(rbuf, 2); int rinkf1 = *(int*)smanager->get_input(rbuf, 3); if((part3_f == FALSE) || (kyeenemyno->f == FALSE)) { length = 1; smanager->set_outputSize(2, sizeof(ObjContainer)+sizeof(ObjData)*(length-1)); smanager->setup_outputData(); CHARACTER *q = (CHARACTER*)smanager->get_output(wbuf, 0); ObjContainerPtr sprite = (ObjContainerPtr)smanager->get_output(wbuf, 2); sprite->flag = true; sprite->length = length; Bom(p->x, p->y, &sprite->data[0]); p->f = FALSE; p->task = DELETE_CHARA; *q = *p; return 0; } if(rinkf1 == 0) { p->x = kyeenemyno->x + 40; p->y = kyeenemyno->y + 28; p->dt2 = 0; } if(rinkf1 == 5) { length = 1; smanager->set_outputSize(2, sizeof(ObjContainer)+sizeof(ObjData)*(length-1)); smanager->setup_outputData(); ObjContainerPtr sprite = (ObjContainerPtr)smanager->get_output(wbuf, 2); sprite->flag = true; sprite->length = length; p->x = kyeenemyno->x + 52; p->y = kyeenemyno->y; count++; PutSprite(count, p->x - 4, p->y - 20, 80 + p->dt2 % 4, &sprite->data[0]); p->dt2++; } if(rinkf1 == 6) { if(p->y < 240 - 40) { p->y += 6; } else { CHARACTER *q = (CHARACTER*)smanager->get_output(wbuf, 0); *q = *p; return 0; } length = 1; smanager->set_outputSize(2, sizeof(ObjContainer)+sizeof(ObjData)*(length-1)); smanager->setup_outputData(); ObjContainerPtr sprite = (ObjContainerPtr)smanager->get_output(wbuf, 2); sprite->flag = true; sprite->length = length; count++; PutSprite(count, p->x - 4, p->y - 20, 90 + p->dt2 % 4, &sprite->data[0]); p->dt2++; } if(rinkf1 == 7) { length = 1; smanager->set_outputSize(2, sizeof(ObjContainer)+sizeof(ObjData)*(length-1)); smanager->setup_outputData(); CHARACTER *q = (CHARACTER*)smanager->get_output(wbuf, 0); ObjContainerPtr sprite = (ObjContainerPtr)smanager->get_output(wbuf, 2); sprite->flag = true; sprite->length = length; Putenemy(22, p->x + 14, p->y + 14, 0, 0, STATE40, &sprite->data[0]); *q = *p; return 0; } if(rinkf1 == 11) { if(p->y + 20 != p->y) { p->y--; } else { CHARACTER *q = (CHARACTER*)smanager->get_output(wbuf, 0); *q = *p; return 0; } length = 1; smanager->set_outputSize(2, sizeof(ObjContainer)+sizeof(ObjData)*(length-1)); smanager->setup_outputData(); ObjContainerPtr sprite = (ObjContainerPtr)smanager->get_output(wbuf, 2); sprite->flag = true; sprite->length = length; count++; PutSprite(count, p->x + 8, p->y + 44, 58 + p->dt2 % 4, &sprite->data[0]); p->dt2++; } CHARACTER *q = (CHARACTER*)smanager->get_output(wbuf, 0); int *w_count = (int*)smanager->get_output(wbuf, 1); *q = *p; *w_count = count; return 0; }