Mercurial > hg > Members > koba > t_dandy
view spe/chara_state28.cc @ 60:cfd42ee2ad28
change makefile, spe/task. adjust scale api. worked on ps3-ppe.
author | yutaka@localhost.localdomain |
---|---|
date | Sun, 06 Feb 2011 17:16:43 +0900 |
parents | f4140672ef9f |
children |
line wrap: on
line source
#include "task_base.h" #include "task_object.h" #include "Sankaku.h" SchedDefineTask1(State28, state28); static int state28(SchedTask *smanager, void *rbuf, void *wbuf) { int rand = (int)smanager->get_param(0); int length = 2; CHARACTER *p = (CHARACTER*)smanager->get_input(rbuf, 0); int count = *(int*)smanager->get_input(rbuf, 1); 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; 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++; PutSprite(count, p->x - 42, p->y, 64, &sprite->data[0]); if (p->dt1 % 30 == 3) { Putenemy(24, p->x + 14, p->y + 14, (rand % 5 + 0.5) * (rand % 2 == 1 ? -1 : 1), (rand % 5 + 0.5) * (rand % 2 == 1 ? -1 : 1), STATE29, &sprite->data[1]); } else { length = 1; } p->dt1 += 3; sprite->length = length; *q = *p; *w_count = count; return 0; }