Mercurial > hg > Members > koba > t_dandy
view spe/chara_state8.cc @ 49:f4140672ef9f
fix.
author | koba <koba@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Fri, 21 Jan 2011 22:18:28 +0900 |
parents | 39e643fc4f90 |
children | cfd42ee2ad28 |
line wrap: on
line source
#include "task_base.h" #include "task_object.h" SchedDefineTask1(State8, state8); static int state8(SchedTask *smanager, void *rbuf, void *wbuf) { CHARACTER *p = (CHARACTER*)smanager->get_input(rbuf, 0); int count = *(int*)smanager->get_input(rbuf, 1); int length; if(p->y < 520) { length = 2; smanager->set_outputSize(2, 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); ObjContainerPtr sprite = (ObjContainerPtr)smanager->get_output(wbuf, 2); sprite->flag = true; sprite->length = length; p->y += p->vy; count++; DefSpriteEx(p->charano, 16*4, 32*4, &sprite->data[0]); PutSpriteEx(p->charano, (p->x * 4), (p->y * 4), 0.2, 0.2, 1, &sprite->data[1]); p->dt1 = 512; p->s = 0.125; p->task = STATE8; *w_count = count; *q = *p; return 0; } CHARACTER *q = (CHARACTER*)smanager->get_output(wbuf, 0); p->task = STATE9; *q = *p; return 0; }