Mercurial > hg > Members > koba > t_dandy
changeset 17:927401604461
add spe object
author | koba <koba@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Fri, 17 Dec 2010 04:16:25 +0900 |
parents | 5e10d43156bd |
children | c330ded6d728 |
files | Makefile Makefile.def Makefile.demo Makefile.mac Makefile.ps3 spe/Atari.cc spe/Atari.h spe/Bom.cc spe/Character_state.h spe/Makefile spe/SimpleState.cc spe/SimpleState.h spe/spe-main.cc spe/tobject.h |
diffstat | 14 files changed, 617 insertions(+), 22 deletions(-) [+] |
line wrap: on
line diff
--- a/Makefile Wed Dec 15 19:06:42 2010 +0900 +++ b/Makefile Fri Dec 17 04:16:25 2010 +0900 @@ -10,12 +10,15 @@ dandy: @$(MAKE) -f Makefile.mac dandy +t_dandy: + @$(MAKE) -f Makefile.mac t_dandy + fifo64: @$(MAKE) -f Makefile.macosx ABIBIT=64 cell: @echo "Make for PS3 (Cell)" - @$(MAKE) -f Makefile.ps3 + @$(MAKE) -f Makefile.ps3 t_dandy clean: @$(MAKE) -f Makefile.mac clean
--- a/Makefile.def Wed Dec 15 19:06:42 2010 +0900 +++ b/Makefile.def Fri Dec 17 04:16:25 2010 +0900 @@ -8,7 +8,7 @@ ABI = -m$(ABIBIT) CC = g++ OPT = -g #-O9 -CFLAGS = -Wall $(OPT) +CFLAGS = -Wall $(OPT) $(ABI) INCLUDE = -I. -I.. -I${CERIUM}/include/TaskManager -I$(CERIUM)/Renderer/Engine -I$(CERIUM)/include/Cerium
--- a/Makefile.demo Wed Dec 15 19:06:42 2010 +0900 +++ b/Makefile.demo Fri Dec 17 04:16:25 2010 +0900 @@ -6,7 +6,7 @@ CFLAGS = -g -O2 -Wall `sdl-config --cflags` `xml2-config --cflags` LIBS = `sdl-config --libs`,-framework,OpenGL -lSDL_mixer -lSDL_image `xml2-config --libs` TARGET = demo -OBJS = sankaku.o sgoex.o Character.o Bom.o tokuten.o collision.o count2.o Character_state.o schedule3.o tama2.o syokika.o Ss.o sound.o main.o profile.o debug.o trace.o LoadSprite.o xml.o b64_de.o tree_controll.o object.o sys.o #back.o +OBJS = sgoex.o Character.o Bom.o tokuten.o collision.o count2.o Character_state.o schedule3.o tama2.o syokika.o Ss.o sound.o main.o profile.o debug.o trace.o LoadSprite.o xml.o b64_de.o tree_controll.o object.o sys.o #back.o all: $(TARGET)
--- a/Makefile.mac Wed Dec 15 19:06:42 2010 +0900 +++ b/Makefile.mac Fri Dec 17 04:16:25 2010 +0900 @@ -1,28 +1,35 @@ # Makefile to build the SDL tests include ./Makefile.def -srcdir = . +TARGET = demo dandy t_dandy +OBJS = Character.o Bom.o tokuten.o count2.o Character_state.o schedule3.o tama2.o syokika.o Ss.o sound.o profile.o debug.o trace.o LoadSprite.o xml.o b64_de.o tree_controll.o object.o sys.o -TARGET = demo dandy -OBJS = Character.o Bom.o tokuten.o collision.o count2.o Character_state.o schedule3.o tama2.o syokika.o Ss.o sound.o profile.o debug.o trace.o LoadSprite.o xml.o b64_de.o tree_controll.o object.o sys.o +TASK_DIR = ppe +TASK_SRCS_TMP = $(wildcard $(TASK_DIR)/*.cc) +TASK_SRCS_EXCLUDE = +TASK_SRCS = $(filter-out $(TASK_SRCS_EXCLUDE),$(TASK_SRCS_TMP)) +TASK_OBJS = $(TASK_SRCS:.cc=.o) CFLAGS += -g $(ABI) -O2 -Wall `sdl-config --cflags` `xml2-config --cflags` $(INCLUDE) -LIBS += `sdl-config --libs`, -lSDL_mixer -lSDL_image `xml2-config --libs` #-framework,OpenGL +LIBS += `sdl-config --libs`,-framework,OpenGL -lSDL_mixer -lSDL_image `xml2-config --libs` LIBS += -lCerium -lFifoManager all: $(TARGET) test: $(TARGET) - ./demo -test + ./demo -test + +demo: $(OBJS) sgoex.o main.o collision.o + $(CC) $(ABI) -o $@ main.o sgoex.o collision.o $(OBJS) $(LIBS) -demo: $(OBJS) sgoex.o main.o - $(CC) $(ABI) -o $@ main.o sgoex.o $(OBJS) $(LIBS) +dandy: $(OBJS) Dandy.o collision.o + $(CC) $(ABI) -o $@ $(OBJS) Dandy.o collision.o $(LIBS) -dandy: $(OBJS) Dandy.o - $(CC) $(ABI) -o $@ $(OBJS) Dandy.o $(LIBS) +t_dandy: $(OBJS) TaskDandy.o collision_task.o $(TASK_OBJS) + $(CC) $(ABI) -o $@ $(OBJS) TaskDandy.o collision_task.o $(TASK_OBJS) $(LIBS) clean: - rm -f $(TARGET) $(OBJS) + rm -f $(TARGET) $(OBJS) $(TASK_OBJS) Dandy.o TaskDandy.o sgoex.o main.o .c.o: $(CC) $(CFLAGS) $(INCLUDES) -c $<
--- a/Makefile.ps3 Wed Dec 15 19:06:42 2010 +0900 +++ b/Makefile.ps3 Fri Dec 17 04:16:25 2010 +0900 @@ -1,23 +1,27 @@ # Makefile to build the SDL tests include ./Makefile.def -srcdir = . ABI = -m32 CFLAGS += -g $(ABI) -O2 -Wall `/usr/bin/sdl-config --cflags` `xml2-config --cflags` $(INCLUDE) LIBS += `/usr/bin/sdl-config --libs` -lGL -lGLU -lSDL_mixer -lSDL_image `xml2-config --libs` LIBS += -lCerium -lCellManager -lspe2 -lpthread +TASK_DIR = ppe +TASK_SRCS_TMP = $(wildcard $(TASK_DIR)/*.cc) +TASK_SRCS_EXCLUDE = +TASK_SRCS = $(filter-out $(TASK_SRCS_EXCLUDE),$(TASK_SRCS_TMP)) +TASK_OBJS = $(TASK_SRCS:.cc=.o) -TARGET = dandy spe-main -OBJS = Character.o Bom.o tokuten.o collision.o count2.o Character_state.o schedule3.o tama2.o syokika.o Ss.o sound.o profile.o debug.o trace.o LoadSprite.o xml.o b64_de.o tree_controll.o object.o sys.o +TARGET = dandy t_dandy spe-main +OBJS = Character.o Bom.o tokuten.o collision.o count2.o Character_state.o schedule3.o tama2.o syokika.o Ss.o sound.o profile.o debug.o trace.o LoadSprite.o xml.o b64_de.o tree_controll.o object.o sys.o all: $(TARGET) speobject: cd spe; $(MAKE) -spe-main: +link: ln -s $(CERIUM)/Renderer/Engine/spe-main . run: $(TARGET) @@ -29,14 +33,18 @@ test: $(TARGET) ./demo -test -demo: $(OBJS) sgoex.o main.o - $(CC) $(ABI) -o $@ main.o sgoex.o $(OBJS) $(LIBS) +demo: $(OBJS) sgoex.o main.o collision.o + $(CC) $(ABI) -o $@ main.o sgoex.o collision.o $(OBJS) $(LIBS) -dandy: $(OBJS) Dandy.o - $(CC) $(ABI) -o $@ $(OBJS) Dandy.o $(LIBS) +dandy: $(OBJS) Dandy.o collision.o + $(CC) $(ABI) -o $@ $(OBJS) Dandy.o collision.o $(LIBS) + +t_dandy: $(OBJS) $(TASK_OBJS) TaskDandy.o collision_task.o + $(CC) $(ABI) -o $@ $(OBJS) $(TASK_OBJS) TaskDandy.o collision_task.o $(LIBS) clean: - rm -f $(TARGET) $(OBJS) + rm -f $(TARGET) $(OBJS) sgoex.o main.o Dandy.o $(TASK_DIR)/*.o + cd spe;$(MAKE) clean .c.o: $(CC) $(CFLAGS) $(INCLUDES) -c $<
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/spe/Atari.cc Fri Dec 17 04:16:25 2010 +0900 @@ -0,0 +1,311 @@ +#include "Atari.h" +#include "tobject.h" + +SchedDefineTask(Atari); + +static int +run(SchedTask *smanager, void *rbuf, void *wbuf) +{ + int w = (int)smanager->get_param(0); + int h = (int)smanager->get_param(1); + int enemycount = (int)smanager->get_param(2); + int bomend = (int)smanager->get_param(3); + int tama_lv1_end = (int)smanager->get_param(4); + int tama_lv2_end = (int)smanager->get_param(5); + int laser_lv1_end = (int)smanager->get_param(6); + + CollisionPropertyPtr property + = (CollisionPropertyPtr)smanager->get_input(rbuf, 0); + + int infg_level = property->infg_level; + player *jiki = &property->jiki; + CHARACTER *p = &property->p; + tama1 *tlv3 = &property->tlv3; + stge lg = property->lg; + stge infg = property->infg; + + tama1 *tama_lv1 = property->tama_lv1; + tama2 *tama_lv2 = property->tama_lv2; + laser *laser_lv1 = property->laser_lv1; + laser *laser_lv2 = property->laser_lv2; + laser *laser_lv3 = property->laser_lv3; + bomchar *bchar = property->bchar; + + int i1, ex, ey; + int n; + ex = p->x; + ey = p->y; + +//自機やられ +#ifndef INVISIBLE_MODE + if ((ex < jiki->x + 128 / 2) && (ex + w > jiki->x + 128 / 2) + && (ey < jiki->y + 128 / 2) && (ey + h > jiki->y + 128 / 2) + && jiki->muteki == 0) { + Bom(jiki->x + 16, jiki->y + 16, bomend, bchar); + jiki->bf = FALSE; + jiki->zanki--; + jiki->muteki = 120; + + infg.stg = 0; + infg_level--; + if (infg_level < 0) + infg_level = 0; + + property->infg_level = infg_level; + property->infg = infg; + smanager->swap(); + return 0; + } +#endif + + if (p->tama == TRUE) + goto jumping; + for (i1 = 0; i1 < tama_lv1_end + 1; i1++) { + + if ((tama_lv1[i1].x + 64 + 64 > ex) + && (ex + w > tama_lv1[i1].x + 16) + && (tama_lv1[i1].y + 128 > ey) && (tama_lv1[i1].y < ey + h) + && (tama_lv1[i1].r != -1)) { + tama_lv1[i1].r = -1; + p->vit -= TAMALV1P; + infg.stg++; + if (p->vit <= 0) { + infg.stg += 4; + Bom(p->x, p->y, bomend, bchar); + enemycount += (p->score * + ((infg.stg / 128) + infg_level + 1)); + p->state = delete_chara; + p->collision = noaction; + p->f = FALSE; + + property->infg = infg; + smanager->swap(); + return 0; + } + } + if ((tama_lv1[i1].x + 64 > ex) && (ex + w > tama_lv1[i1].x) + && (tama_lv1[i1].y + 128 > ey) && (tama_lv1[i1].y < ey + h) + && (tama_lv1[i1].l != -1)) { + tama_lv1[i1].l = -1; + p->vit -= TAMALV1P; + infg.stg++; + if (p->vit <= 0) { + infg.stg += 4; + Bom(p->x, p->y, bomend, bchar); + enemycount += (p->score * + ((infg.stg / 128) + infg_level + 1)); + p->state = delete_chara; + p->collision = noaction; + p->f = FALSE; + + property->infg = infg; + smanager->swap(); + return 0; + } + } + } + + for (i1 = 0; i1 < tama_lv2_end + 1; i1++) { + if ((tama_lv2[i1].x + 128 + 64 > ex) + && (ex + w > tama_lv2[i1].x + 128) + && (tama_lv2[i1].y + 192 > ey) && (tama_lv2[i1].y < ey + h) + && (tama_lv2[i1].rr != -1)) { + tama_lv2[i1].rr = -1; + p->vit -= TAMALV2P; + infg.stg++; + if (p->vit <= 0) { + infg.stg += 4; + Bom(p->x, p->y, bomend, bchar); + enemycount += (p->score * + ((infg.stg / 128) + infg_level + 1)); + p->state = delete_chara; + p->collision = noaction; + p->f = FALSE; + + property->infg = infg; + smanager->swap(); + return 0; + } + } + + if ((tama_lv2[i1].x + 64 + 64 > ex) + && (ex + w > tama_lv2[i1].x + 16) + && (tama_lv2[i1].y - 32 + 192 > ey) + && (tama_lv2[i1].y - 32 < ey + h) + && (tama_lv2[i1].sr != -1)) { + tama_lv2[i1].sr = -1; + p->vit -= TAMALV2P; + infg.stg++; + if (p->vit <= 0) { + infg.stg += 4; + Bom(p->x, p->y, bomend, bchar); + enemycount += (p->score * + ((infg.stg / 128) + infg_level + 1)); + p->state = delete_chara; + p->collision = noaction; + p->f = FALSE; + + property->infg = infg; + smanager->swap(); + return 0; + } + } + if ((tama_lv2[i1].x + 64 > ex) && (ex + w > tama_lv2[i1].x) + && (tama_lv2[i1].y - 32 + 192 > ey) + && (tama_lv2[i1].y - 32 < ey + h) + && (tama_lv2[i1].sl != -1)) { + tama_lv2[i1].sl = -1; + p->vit -= TAMALV2P; + infg.stg++; + if (p->vit <= 0) { + infg.stg += 4; + Bom(p->x, p->y, bomend, bchar); + enemycount += (p->score * + ((infg.stg / 128) + infg_level + 1)); + p->state = delete_chara; + p->collision = noaction; + p->f = FALSE; + + property->infg = infg; + smanager->swap(); + return 0; + } + } + if ((tama_lv2[i1].x - 64 + 64 > ex) + && (ex + w > tama_lv2[i1].x - 64) + && (tama_lv2[i1].y + 192 > ey) && (tama_lv2[i1].y < ey + h) + && (tama_lv2[i1].ll != -1)) { + tama_lv2[i1].ll = -1; + p->vit -= TAMALV2P; + infg.stg++; + if (p->vit <= 0) { + infg.stg += 4; + Bom(p->x, p->y, bomend, bchar); + enemycount += (p->score * + ((infg.stg / 128) + infg_level + 1)); + p->state = delete_chara; + p->collision = noaction; + p->f = FALSE; + + property->infg = infg; + smanager->swap(); + return 0; + } + } + } + if ((tlv3[0].r > 0) && (jiki->x < ex + w) && (jiki->x + 128 > ex) + && (jiki->y > ey + h)) { + p->vit -= TAMALV3P; + infg.stg++; + if (p->vit <= 0) { + infg.stg += 4; + Bom(p->x, p->y, bomend, bchar); + enemycount += (p->score * + ((infg.stg / 128) + infg_level + 1)); + p->state = delete_chara; + p->collision = noaction; + p->f = FALSE; + + property->infg = infg; + smanager->swap(); + return 0; + } + } + jumping: + if ((tlv3[0].r > 0) && (jiki->x < ex + w) && (jiki->x + 128 > ex) + && (jiki->y + 128 > ey) && (jiki->y < ey + h)) { + p->vit -= TAMALV3P; + infg.stg++; + if (p->vit <= 0) { + infg.stg += 4; + Bom(p->x, p->y, bomend, bchar); + enemycount += (p->score * + ((infg.stg / 128) + infg_level + 1)); + p->state = delete_chara; + p->collision = noaction; + p->f = FALSE; + + property->infg = infg; + smanager->swap(); + return 0; + } + } + /*laser lv1 */ + for (i1 = 0; i1 < laser_lv1_end + 1; i1++) { + n = laser_lv1[i1].r * 128 / 4096; + + if ((laser_lv1[i1].x + n > ex) && (ex + w > laser_lv1[i1].x) + && (laser_lv1[i1].y + n > ey) && (laser_lv1[i1].y < ey + h) + && (laser_lv1[i1].r != -1)) { + laser_lv1[i1].r = -1; + laser_lv1[i1].y = -1; + p->vit -= LASERLV1P; + infg.stg++; + if (p->vit <= 0) { + infg.stg += 4; + Bom(p->x, p->y, bomend, bchar); + enemycount += (p->score * + ((infg.stg / 128) + infg_level + 1)); + p->state = delete_chara; + p->collision = noaction; + p->f = FALSE; + + property->infg = infg; + smanager->swap(); + return 0; + } + } + } + /*shield(laser lv2) */ + if ((p->tama == TRUE) && (lg.stg > 0) && + (laser_lv2[0].x + 128 > ex) && (ex + w > laser_lv2[0].x - 128) + && (laser_lv2[0].y + 128 > ey) && (laser_lv2[0].y - 128 < ey + h) + && (laser_lv2[0].r != 0)) { + p->vit -= LASERLV2P; + lg.stg -= 26; + infg.stg++; + if (p->vit <= 0) { + infg.stg += 4; + Bom(p->x, p->y, bomend, bchar); + enemycount += (p->score * + ((infg.stg / 128) + infg_level + 1)); + p->state = delete_chara; + p->collision = noaction; + p->f = FALSE; + + property->lg = lg; + property->infg = infg; + smanager->swap(); + return 0; + } + } + /*bomber(laser lv3) */ + if (laser_lv3[0].r < 62) { + for (i1 = 1; i1 < 128; i1++) { + if ((laser_lv3[i1].x + 128 > ex) && (ex + w > laser_lv3[i1].x) + && (laser_lv3[i1].y + 128 > ey) + && (laser_lv3[i1].y < ey + h) + && (laser_lv3[i1].r > 0)) { + tama_lv2[i1].rr = -1; + p->vit -= LASERLV3P; + infg.stg++; + if (p->vit <= 0) { + infg.stg += 4; + Bom(p->x, p->y, bomend, bchar); + enemycount += (p->score * + ((infg.stg / 128) + infg_level + 1)); + p->state = delete_chara; + p->collision = noaction; + p->f = FALSE; + + property->infg = infg; + smanager->swap(); + return 0; + } + } + } + } + property->infg = infg; + smanager->swap(); + return 0; +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/spe/Atari.h Fri Dec 17 04:16:25 2010 +0900 @@ -0,0 +1,8 @@ +#ifndef INCLUDE_COLLISION +#define INCLUDE_COLLISION + +#ifndef INCLUDED_SCHED_TASK +#include "SchedTask.h" +#endif + +#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/spe/Bom.cc Fri Dec 17 04:16:25 2010 +0900 @@ -0,0 +1,19 @@ +#include "tobject.h" + +void +Bom(int x, int y, int bomend, bomchar *bchar) +{ + int i; + bomend++; + if (bomend > 49) { + bomend = 49; + return; + } + + i = bomend; + bchar[i].x = x; + bchar[i].y = y; + bchar[i].no = 0; + bchar[i].f = 0; + return; +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/spe/Character_state.h Fri Dec 17 04:16:25 2010 +0900 @@ -0,0 +1,57 @@ +#ifndef INCLUDE_CHARACTER_STATE +#define INCLUDE_CHARACTER_STATE + +#ifndef INCLUDE_OBJECT +#include "tobject.h" +#endif + +CHARACTER * noaction(CHARACTER *p); +CHARACTER * chara_state0(CHARACTER *p); +CHARACTER * chara_state1(CHARACTER *p); +CHARACTER * chara_state2(CHARACTER *p); +CHARACTER * chara_state3(CHARACTER *p); +CHARACTER * chara_state4(CHARACTER *p); +CHARACTER * chara_state5(CHARACTER *p); +CHARACTER * chara_state6(CHARACTER *p); +CHARACTER * chara_state7(CHARACTER *p); +CHARACTER * chara_state8(CHARACTER *p); +CHARACTER * chara_state9(CHARACTER *p); +CHARACTER * chara_state10(CHARACTER *p); +CHARACTER * chara_state11(CHARACTER *p); +CHARACTER * chara_state12(CHARACTER *p); +CHARACTER * chara_state13(CHARACTER *p); +CHARACTER * chara_state20(CHARACTER *p); +CHARACTER * chara_state21(CHARACTER *p); +CHARACTER * chara_state22(CHARACTER *p); +CHARACTER * chara_state23(CHARACTER *p); +CHARACTER * chara_state24(CHARACTER *p); +CHARACTER * chara_state25(CHARACTER *p); +CHARACTER * chara_state26(CHARACTER *p); +CHARACTER * chara_state27(CHARACTER *p); +CHARACTER * chara_state28(CHARACTER *p); +CHARACTER * chara_state29(CHARACTER *p); +CHARACTER * chara_state30(CHARACTER *p); +CHARACTER * chara_state31(CHARACTER *p); +CHARACTER * chara_state32(CHARACTER *p); +CHARACTER * chara_state33(CHARACTER *p); +CHARACTER * chara_state34(CHARACTER *p); +CHARACTER * chara_state35(CHARACTER *p); +CHARACTER * chara_state40(CHARACTER *p); +CHARACTER * chara_state41(CHARACTER *p); +CHARACTER * chara_state400(CHARACTER *p); +CHARACTER * chara_state401(CHARACTER *p); +CHARACTER * chara_state402(CHARACTER *p); +CHARACTER * chara_state410(CHARACTER *p); +CHARACTER * chara_state411(CHARACTER *p); +CHARACTER * chara_state500(CHARACTER *p); +CHARACTER * chara_state501(CHARACTER *p); +CHARACTER * chara_state600(CHARACTER *p); +CHARACTER * chara_state601(CHARACTER *p); +CHARACTER * chara_state602(CHARACTER *p); +CHARACTER * asteroid(CHARACTER *p); + +extern int enemyfaste; +extern int fastebos; +extern int asteroidi; + +#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/spe/Makefile Fri Dec 17 04:16:25 2010 +0900 @@ -0,0 +1,26 @@ +include ../Makefile.def + +TARGET = ../spe-main + +SRCS_TMP = $(wildcard *.cc) +SRCS = $(filter-out $(SRCS_EXCLUDE),$(SRCS_TMP)) +OBJS = $(SRCS:.cc=.o) + +CC = spu-g++ +CFLAGS = -Wall -fno-exceptions -fno-rtti $(OPT) +INCLUDE = -I../${CERIUM}/include/TaskManager -I. -I.. +LIBS = -L../${CERIUM}/TaskManager -lspemanager + +.SUFFIXES: .cc .o + +.cc.o: + $(CC) $(CFLAGS) $(INCLUDE) -c $< -o $@ + +all: $(TARGET) + +$(TARGET): $(OBJS) + $(CC) -o $@ $(OBJS) $(TASK_OBJS) $(LIBS) + +clean: + rm -f $(TARGET) $(OBJS) + rm -f *~ \#* \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/spe/SimpleState.cc Fri Dec 17 04:16:25 2010 +0900 @@ -0,0 +1,15 @@ +#include "SimpleState.h" +#include "Character_state.h" +#include "tobject.h" + +SchedDefineTask(SimpleState); + +static int +run(SchedTask *smanager, void *rbuf, void *wbuf) +{ + CHARACTER *p = (CHARACTER*)smanager->get_input(rbuf, 0); + p = (*p->state)(p); + + smanager->swap(); + return 0; +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/spe/SimpleState.h Fri Dec 17 04:16:25 2010 +0900 @@ -0,0 +1,8 @@ +#ifndef INCLUDE_SIMPLE_STATE +#define INCLUDE_SIMPLE_STATE + +#ifndef INCLUDED_SCHED_TASK +#include "SchedTask.h" +#endif + +#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/spe/spe-main.cc Fri Dec 17 04:16:25 2010 +0900 @@ -0,0 +1,18 @@ +#include "Func.h" +#include "Scheduler.h" + +/* 必ずこの位置に書いて */ +SchedExternTask(Atari); +SchedExternTask(SimpleState); + +/** + * この関数は ../spe/spe-main と違って + * 自分で呼び出せばいい関数なので + * 好きな関数名でおk (SchedRegisterTask は必須) + */ +void +task_init(void) +{ + SchedRegisterTask(ATARI, Atari); + SchedRegisterTask(SIMPLE_STATE, SimpleState); +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/spe/tobject.h Fri Dec 17 04:16:25 2010 +0900 @@ -0,0 +1,115 @@ +#ifndef INCLUDE_OBJECT +#define INCLUDE_OBJECT + +#define TAMALV1P 14 +#define TAMALV2P 50 +#define TAMALV3P 24 + +#define LASERLV1P 17 +#define LASERLV2P 154 +#define LASERLV3P 51 + +#define TRUE 1 +#define FALSE 0 +#define BOOL char + +typedef struct player { + int x; + int y; + int ch; + int point; + BOOL bf; + int muteki; + int zanki; + int ccount; +} player; + +typedef struct tama { + int x; + int y; +} tama; + +typedef struct tama1 { + int x; + int y; + int r; + int l; +} tama1; + +typedef struct tama2 { + int x; + int y; + int rr; + int sr; + int sl; + int ll; +} tama2; + +typedef struct stge { + int stg; +} stge; + +typedef struct laser { + float x; + float y; + float sx; + float sy; + int r; + int enemyno; + float s; +} laser; + +typedef struct bomchar { + int x; + int y; + int f; + int no; +} bomchar; + +typedef struct CHARACTER{ + float x; //position + float y; + + float vx; //velocity + float vy; + + float vit; //vitality + int score; + int dt1; + int dt2; + int charano; //sprite_number + BOOL tama; //bullet identifier + BOOL f; //apiarance idenfifier + float s; + + struct CHARACTER * (*state)(struct CHARACTER *p); + struct CHARACTER * (*collision)(struct CHARACTER *p); + struct CHARACTER *next; + struct CHARACTER *prev; + +} CHARACTER; + +typedef struct CollisionProperty { + int infg_level; + int enemycount; + + player jiki; + CHARACTER p; + stge lg; + stge infg; + + tama1 tama_lv1[20]; + tama2 tama_lv2[20]; + tama1 tlv3; + laser laser_lv1[20]; + laser laser_lv2[20]; + laser laser_lv3[128]; + bomchar bchar[100]; + +} CollisionProperty, *CollisionPropertyPtr; + +CHARACTER * noaction(CHARACTER *p); +CHARACTER * delete_chara(CHARACTER *p); +void Bom(int x, int y, int bchar, bomchar *bchar); + +#endif