Mercurial > hg > Members > koba > t_dandy
view ppe/chara_state9.cc @ 70:cee55c8365e9 default tip
fix
author | Kazuma |
---|---|
date | Thu, 19 May 2016 18:52:26 +0900 |
parents | 7aaaaf5dde40 |
children | 978097c6427a |
line wrap: on
line source
#include "task_base.h" #include "task_object.h" SchedDefineTask1(State9, state9); static int state9(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->s <= 2) { length = 2; 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); ObjContainerPtr sprite = (ObjContainerPtr)smanager->get_output(wbuf, 4); sprite->flag = true; sprite->length = length; p->s += 0.05; p->y -= 12; count++; *w_count = count; DefSpriteEx(54, 16*4, 32*4, &sprite->data[0]); PutSpriteEx(54, (p->x * 4), (p->y * 4), p->s, p->s, 1, &sprite->data[1]); p->task = STATE9; *q = *p; return 0; } length = 4; smanager->set_outputSize(4, sizeof(ObjContainer)+sizeof(ObjData)*(length-1)); smanager->setup_outputData(); CHARACTER *q = (CHARACTER*)smanager->get_output(wbuf, 0); int *w_rinkx = (int*)smanager->get_output(wbuf, 2); int *w_rinky = (int*)smanager->get_output(wbuf, 3); ObjContainerPtr sprite = (ObjContainerPtr)smanager->get_output(wbuf, 4); sprite->flag = true; sprite->length = length; count++; DefSpriteEx(54, 16, 32, &sprite->data[0]); PutSpriteEx(54, p->x, p->y, p->s, p->s, 1, &sprite->data[1]); *w_rinkx = p->x; *w_rinky = p->y; Putenemy(5, *w_rinkx - 16, *w_rinky - 16, 1, 0, STATE10, &sprite->data[2]); Putenemy(5, *w_rinkx - 16, *w_rinky - 16, -1, 0, STATE10, &sprite->data[3]); p->dt1 = 8192; p->task = STATE11; *q = *p; return 0; }