Mercurial > hg > Members > tkaito > task_dandy
changeset 24:a131729d6e4d
not working.
author | koba <koba@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Wed, 24 Nov 2010 19:24:04 +0900 |
parents | 3fb8a6a34e24 |
children | aa37f220b7a8 |
files | Func.h dandy.h main.cc ppe/Property.h ppe/TitleMove.cc ppe/task_init.cc schedule.cc stage_init.cc |
diffstat | 8 files changed, 362 insertions(+), 231 deletions(-) [+] |
line wrap: on
line diff
--- a/Func.h Tue Oct 26 17:28:56 2010 +0900 +++ b/Func.h Wed Nov 24 19:24:04 2010 +0900 @@ -1,51 +1,12 @@ enum { #include "SysTasks.h" #include "RenderingTasks.h" - TITLE_MOVE, - CRAB_MOVE, - TITLE_COLL, - MOVE_00, - MOVE_01, - MOVE_02, - MOVE_03, - MOVE_04, - MOVE_05, - MOVE_06, - MOVE_07, - MOVE_08, - MOVE_09, - MOVE_10, - MOVE_11, - MOVE_12, - MOVE_13, - MOVE_20, - MOVE_21, - MOVE_22, - MOVE_23, - MOVE_24, - MOVE_25, - MOVE_26, - MOVE_27, - MOVE_28, - MOVE_29, - MOVE_30, - MOVE_31, - MOVE_32, - MOVE_33, - MOVE_34, - MOVE_35, - MOVE_40, - MOVE_41, - MOVE_400, - MOVE_401, - MOVE_402, - MOVE_410, - MOVE_411, - MOVE_500, - MOVE_501, - MOVE_600, - MOVE_601, - MOVE_602, - ASTEROID, +#include "game_task.h" +}; -}; +enum { +#include "RenderingGlobal.h" +#include "global_alloc.h" +#include "KeyID.h" +#include "global_id.h" +}
--- a/dandy.h Tue Oct 26 17:28:56 2010 +0900 +++ b/dandy.h Wed Nov 24 19:24:04 2010 +0900 @@ -9,6 +9,9 @@ #include "MainLoop.h" #include "Func.h" +#ifndef INCLUDE_DANDY_H +#define INCLUDE_DANDY_H + class Dandy : public Application { MainLoopPtr init(Viewer *viewer, int w, int h); }; @@ -17,94 +20,91 @@ typedef void (*coll)(SceneGraphPtr node, void *sgroot_, int w, int h, SceneGraphPtr tree); typedef struct { - double x, y; //16 - double vx, vy; //16 - int frame; //4 - const char *chara; //1 - int vital; //4 - int score; //4 - void *parent; //4 - void *root; //4 - int flag; //4 - char a, i, u; //3 + int chara_id; + const char *name; + float x, y; + float width, height; + float mid_w, mid_h; + float vx, vy; + int vital; + int score; + int frame; + void *parent; + void *root; + int flag; } *ObjPropertyPtr, ObjProperty; -extern ObjProperty back_property; -extern ObjPropertyPtr charactor; - -//キャラクターの総数 -static const int ENEMY_NUM = 2; - -//TaskArray 生成に必要な各値 -static const int TASK_NUM = 2; -static const int PARAMETER = 0; -static const int INDATA_NUM = 2; -static const int OUTDATA_NUM = 1; - -extern void create_title_back(Viewer *sgroot, int w, int h); -extern void create_stage(void *sgroot, int w, int h); -extern void schedule(SceneGraphPtr node, void *sgroot_, int w, int h); - -//extern create_enemy(SchedTask *s, void *enemy_, void *b); - typedef struct enemy_state { - const char *charano; + const int char_id; int score; int vital; } state; -//const state enemystate[50]; +//キャラの総数 +static const int CHAR_NUM = 300; +//敵の総数 +static const int ENEMY_NUM = 50; + +extern ObjPropertyPtr charactor; + +extern void init_game(Viewer *sgroot, int w, int h); +extern void schedule(SceneGraphPtr node, void *sgroot_, int w, int h); + +//extern create_enemy(SchedTask *s, void *enemy_, void *b); + -#define ENEMY_STATUS_TABLE {\ - ENEMY_STATUS("title001", 0, 0),\ - ENEMY_STATUS("greencrab", 330, 98),\ - ENEMY_STATUS("plane", 470, 37),\ - ENEMY_STATUS("e_redbullet", 30, 16),\ - ENEMY_STATUS("bass1_organ", 25000, 10000),\ - ENEMY_STATUS("boss1_parts1", 10000, 10000),\ - ENEMY_STATUS("bluebullet", 40, 39),\ - ENEMY_STATUS("e_laser", 100, 100000),\ - ENEMY_STATUS("lightning", 100, 100000),\ - ENEMY_STATUS("asteroid", 170, 500),\ - ENEMY_STATUS("asteroid_boss2body", 100, 500),\ - ENEMY_STATUS("boss2_leftshoulder", 10000, 12000),\ - ENEMY_STATUS("t", 0, 0),\ - ENEMY_STATUS("t", 0, 0),\ - ENEMY_STATUS("t", 0, 0),\ - ENEMY_STATUS("t", 0, 0),\ - ENEMY_STATUS("t", 0, 0),\ - ENEMY_STATUS("t", 0, 0),\ - ENEMY_STATUS("t", 0, 0),\ - ENEMY_STATUS("t", 0, 0),\ - ENEMY_STATUS("t", 0, 0),\ - ENEMY_STATUS("t", 0, 0),\ - ENEMY_STATUS("t", 0, 0),\ - ENEMY_STATUS("t", 0, 0),\ - ENEMY_STATUS("t", 0, 0),\ - ENEMY_STATUS("t", 0, 0),\ - ENEMY_STATUS("t", 0, 0),\ - ENEMY_STATUS("t", 0, 0),\ - ENEMY_STATUS("t", 0, 0),\ - ENEMY_STATUS("t", 0, 0),\ - ENEMY_STATUS("t", 0, 0),\ - ENEMY_STATUS("t", 0, 0),\ - ENEMY_STATUS("t", 0, 0),\ - ENEMY_STATUS("t", 0, 0),\ - ENEMY_STATUS("t", 0, 0),\ - ENEMY_STATUS("t", 0, 0),\ - ENEMY_STATUS("t", 0, 0),\ - ENEMY_STATUS("t", 0, 0),\ - ENEMY_STATUS("t", 0, 0),\ - ENEMY_STATUS("t", 0, 0),\ - ENEMY_STATUS("t", 0, 0),\ - ENEMY_STATUS("t", 0, 0),\ - ENEMY_STATUS("t", 0, 0),\ - ENEMY_STATUS("t", 0, 0),\ - ENEMY_STATUS("t", 0, 0),\ - ENEMY_STATUS("t", 0, 0),\ - ENEMY_STATUS("t", 0, 0),\ - ENEMY_STATUS("t", 0, 0),\ - ENEMY_STATUS("t", 0, 0),\ - ENEMY_STATUS("t", 0, 0),\ +#define ENEMY_STATUS_TABLE { \ + ENEMY_STATUS(0, 0, 0), \ + ENEMY_STATUS(ENEMY_GREENCRAB, 330, 98), \ + ENEMY_STATUS(ENEMY_PLANE, 470, 37), \ + ENEMY_STATUS(ENEMY_REDBULLET, 30, 16), \ + ENEMY_STATUS(BOSS1_ORGAN, 25000, 10000), \ + ENEMY_STATUS(BOSS1_ORGAN, 10000, 10000), \ + ENEMY_STATUS(ENEMY_BLUEBULLET, 40, 39), \ + ENEMY_STATUS(ENEMY_LASER, 100, 100000), \ + ENEMY_STATUS(ENEMY_LIGHTNING, 100, 100000), \ + ENEMY_STATUS(ASTEROID, 170, 500), \ + ENEMY_STATUS(BOSS2_BODY, 100, 500), \ + ENEMY_STATUS(BOSS2_LEFTSHOULDER, 10000, 12000), \ + ENEMY_STATUS(BOSS2_RIGHTSHOULDER, 10000, 12000), \ + ENEMY_STATUS(BOSS2_RIGHTARM, 5000, 15000), \ + ENEMY_STATUS(BOSS2_LEFTARM, 5000, 15000), \ + ENEMY_STATUS(BOSS2_BATTERY, 10000, 5000), \ + ENEMY_STATUS(BOSS2_OPENBATTERY, 10000, 5000), \ + ENEMY_STATUS(BOSS2_BROKENHATCH, 100, 500), \ + ENEMY_STATUS(BOSS2_DUMMY, 50000, 15000), \ + ENEMY_STATUS(BOSS2_RIGHTSHOULDERUP, 10000, 20000), \ + ENEMY_STATUS(BOSS2_LEFTSHOULDERUP, 10000, 15000), \ + ENEMY_STATUS(BOSS2_LEFTSHOULDERGIRD, 100, 20000), \ + ENEMY_STATUS(BOSS2_RIGHTARMBATTERY, 100, 500), \ + ENEMY_STATUS(BOSS2_LEFTARMBATTERY, 100, 500), \ + ENEMY_STATUS(ORBITMACHINE, 20, 1000000), \ + ENEMY_STATUS(0, 0, 0), \ + ENEMY_STATUS(0, 0, 0), \ + ENEMY_STATUS(0, 0, 0), \ + ENEMY_STATUS(0, 0, 0), \ + ENEMY_STATUS(0, 0, 0), \ + ENEMY_STATUS(BLACKHOLE, 200000, 30000), \ + ENEMY_STATUS(0, 0, 0), \ + ENEMY_STATUS(0, 0, 0), \ + ENEMY_STATUS(0, 0, 0), \ + ENEMY_STATUS(0, 0, 0), \ + ENEMY_STATUS(0, 0, 0), \ + ENEMY_STATUS(0, 0, 0), \ + ENEMY_STATUS(0, 0, 0), \ + ENEMY_STATUS(0, 0, 0), \ + ENEMY_STATUS(0, 0, 0), \ + ENEMY_STATUS(GUNBATTERY, 540, 137), \ + ENEMY_STATUS(PURPLECORE, 840, 287), \ + ENEMY_STATUS(SPACEFISH, 370, 137), \ + ENEMY_STATUS(MISSILE, 210, 24), \ + ENEMY_STATUS(BOSS3_BODY, 100000, 9600), \ + ENEMY_STATUS(0, 0, 0), \ + ENEMY_STATUS(0, 0, 0), \ + ENEMY_STATUS(0, 0, 0), \ + ENEMY_STATUS(0, 0, 0), \ + ENEMY_STATUS(BODD4_BODY, 300000, 20400) \ } + +#endif
--- a/main.cc Tue Oct 26 17:28:56 2010 +0900 +++ b/main.cc Wed Nov 24 19:24:04 2010 +0900 @@ -1,7 +1,7 @@ #include "dandy.h" #define ENEMY_STATUS(charano,score,hardness) {charano,score,hardness} -const state status[50] = ENEMY_STATUS_TABLE; +const state enemy_status[ENEMY_NUM] = ENEMY_STATUS_TABLE; extern void task_init(void); @@ -12,6 +12,52 @@ -length Number of data (default DATA_NUM (Func.h))\n\ -count Number of task (default 1)\n"; +HTaskPtr +pad_alloc(Viewer *sgroot) +{ + HTaskPtr task = sgroot->tmanager->create_task(PAD_ALLOCATE); + void *pad = (void*)sgroottmp->getController(); + int size = sizeof(Pad); + + task->set_param(0, PAD_INPUT); + task->set_param(1, size); + task->add_inData(pad, size); + task->set_cpu(SPE_ANY); + task->spawn(); + + return task; +} + +HTaskPtr +pad_update(Viewer *sgroot) +{ + HTaskPtr task = sgroot->tmanager->create_task(PAD_UPDATE); + void *pad = (void*)sgroottmp->getController(); + int size = sizeof(Pad); + + task->set_param(0, PAD_INPUT); + task->set_param(1, size); + task->add_inData(pad, size); + task->set_cpu(SPE_ANY); + task->spawn(); + + return task; +} + +HTaskPtr +pad_free(Viewer *sgroot) +{ + HTaskPtr task = sgroot->tmanager->create_task(PAD_FREE); + void *pad = (void*)sgroottmp->getController(); + int size = sizeof(Pad); + + task->set_param(0, PAD_INPUT); + task->set_cpu(SPE_ANY); + task->spawn(); + + return task; +} + int init(int argc, char **argv) { @@ -26,8 +72,24 @@ return 0; } +//旧APIとの互換関数 void -init_charactor(Viewer *sgroot, int w, int h) +PutSprite(float x, float y, int number) +{ + char* name = charactor[number].name; + SceneGraphPtr object = sgroot->createSceneGraph(name); + + title->xyz[0] = x; + title->xyz[1] = y; + + charactor[number].x = x; + charactor[number].y = y; + charactor[number].flag = 0; + charactor[number].root = (void*)object; +} + +void +create_sg(Viewer *sgroot, int w, int h) { sgroot->createFromXMLfile("xml/mydandy.xml"); sgroot->createFromXMLfile("xml/greencrab.xml"); @@ -36,20 +98,172 @@ sgroot->createFromXMLfile("xml/bluebullet.xml"); sgroot->createFromXMLfile("xml/redbullet.xml"); sgroot->createFromXMLfile("xml/title2.xml"); +} + +void +def_charactor(int number, char *name, float w, float h) +{ + charactor[number].chara_id = number; + charactor[number].name = name; + charactor[number].width = w; + charactor[number].height = h; + charactor[number].mid_w = w / 2; + charactor[number].mid_h = h / 2; +} + +void +set_parameter() +{ + /** + * 1引数:キャラクターID; + * 2引数:キャラクター名; + * 3引数:幅 + * 4引数:高さ + */ + + def_charactor(PLAYER_IDLE, "player_idle", 128, 128); + def_charactor(PLAYER_LEFTMOVE, "player_leftmove", 128, 128); + def_charactor(PLAYER_TURNTOLEFT, "player_turntoleft", 128, 128); + def_charactor(PLAYER_TURNTORIGHT, "player_turntoright", 128, 128); + def_charactor(PLAYER_RIGHTMOVE, "player_rightmove", 128, 128); + def_charactor(BLUEBULLET_LEFT, "bulebullet_left", 45, 128); + def_charactor(BLUEBULLET_RIGHT, "blebullet_right", 38, 128); + def_charactor(REDBULLET, "redbullet", 128, 256); + def_charactor(LONGLASER, "longlaser", 64, 256); + def_charactor(GAUGE_PANEL, "gauge_panel", 128, 512); + def_charactor(OFFENSIVEPOWER_GAUGE, "offensivepower_gauge", 27, 220); + def_charactor(BURNER, "burner", 63, 122); + def_charactor(LOCKON_SIGHT, "lockon_sight", 64, 64); + //def_charactor(SPECIAL_LASERGAUGE, "special_lasergauge", 0, 0); + def_charactor(DIFFENSIVEPOWER_GAUGE, "diffensivepower_gauge", 20, 215); + def_charactor(GREENBULLET, "greenbullet", 128, 128); + def_charactor(BULEBARRIER, "bulebarrier", 128, 128); + //def_charactor(FONT_PLAYER_1, "font_player1", 128, 32); + //def_charactor(FONT_GAMEOVER, "font_gameover", 256, 32); + def_charactor(FONT_0, "font_0", 32, 32); + def_charactor(FONT_1, "font_1", 32, 32); + def_charactor(FONT_2, "font_2", 32, 32); + def_charactor(FONT_3, "font_3", 32, 32); + def_charactor(FONT_4, "font_4", 32, 32); + def_charactor(FONT_5, "font_5", 32, 32); + def_charactor(FONT_6, "font_6", 32, 32); + def_charactor(FONT_7, "font_7", 32, 32); + def_charactor(FONT_8, "font_8", 32, 32); + def_charactor(FONT_9, "font_9", 32, 32); + def_charactor(REDBOMB_ANIM_0, "redbomb_anim_0", 64, 64); + def_charactor(REDBOMB_ANIM_1, "redbomb_anim_1", 64, 64); + def_charactor(REDBOMB_ANIM_2, "redbomb_anim_2", 64, 64); + def_charactor(REDBOMB_ANIM_3, "redbomb_anim_3", 64, 64); + def_charactor(REDBOMB_ANIM_4, "redbomb_anim_4", 64, 64); + def_charactor(REDBOMB_ANIM_5, "redbomb_anim_5", 64, 64); + def_charactor(REDBOMB_ANIM_6, "redbomb_anim_6", 64, 64); + def_charactor(REDBOMB_ANIM_7, "redbomb_anim_7", 64, 64); + def_charactor(FONT_HIGE, "font_hige", 128, 32); + def_charactor(GREENBOMB_ANIM_0, "greenbomb_anim_0", 64, 64); + def_charactor(GREENBOMB_ANIM_1, "greenbomb_anim_1", 64, 64); + def_charactor(GREENBOMB_ANIM_2, "greenbomb_anim_2", 64, 64); + //def_charactor(GREENBOMB_ANIM_3, "greenbomb_anim_3", 64, 64); + def_charactor(GREENBOMB_ANIM_4, "greenbomb_anim_4", 64, 64); + def_charactor(GREENBOMB_ANIM_5, "greenbomb_anim_5", 64, 64); + def_charactor(GREENBOMB_ANIM_6, "greenbomb_anim_6", 64, 64); + def_charactor(GREENBOMB_ANIM_7, "greenbomb_anim_7", 64, 64); + def_charactor(INFLATION_GAUGE, "inflation_gauge", 64, 512); + def_charactor(INFLATION_METER, "inflation_meter", 32, 512); + def_charactor(ENEMY_GREENCRAB, "enemy_greenclab", 128, 128); + def_charactor(ENEMY_PLANE, "enemy_plane", 128, 128); + def_charactor(ENEMY_REDBULLET, "enemy_redbullet", 32, 32); + def_charactor(FONT_PUSHSTART, "font_pushstart", 512, 32); + def_charactor(BOSS1_ORGAN, "boss1_organ", 128, 256); + def_charactor(ENEMY_LASER, "enemy_laser", 64, 251); + def_charactor(ENEMY_BLUEBULLET, "enemy_bluebullet", 36, 28); + def_charactor(ENEMY_LIGHTNING, "enemy_lightning", 64, 252); + def_charactor(ENEMY_LASERSPLOSH_0, "enemy_lasersplosh_0", 126, 127); + def_charactor(ENEMY_LASERSPLOSH_1, "enemy_lasersplosh_1", 124, 119); + def_charactor(ENEMY_LASERSPLOSH_2, "enemy_lasersplosh_2", 126, 127); + def_charactor(ENEMY_LASERSPLOSH_3, "enemy_lasersplosh_3", 112, 102); + def_charactor(ASTEROID, "meteo", 128, 128); //inseki + def_charactor(ORBITMACHINE, "orbitmachine", 128, 64); //inseki no shita maruiyatsu + def_charactor(BOSS2_BODY, "boss2_body", 512, 512); + def_charactor(BOSS2_RIGHTSHOULDER, "boss2_rightshoulder", 256, 256); + def_charactor(BOSS2_LEFTSHOULDER, "boss2_leftshoulder", 256, 256); + def_charactor(BOSS2_RIGHTARM, "boss2_rightarm", 128, 256); + def_charactor(BOSS2_LEFTARM, "boss2_leftarm", 128, 256); + def_charactor(BOSS2_BATTERY, "boss2_battery", 128, 128); + def_charactor(BOSS2_OPENBATTERY, "boss2_openbattery", 256, 128); + def_charactor(BOSS2_BROKENHATCH, "boss2_brokenhatch", 128, 64); + def_charactor(BOSS2_DUMMY, "boss2_dummy", 128, 64); + def_charactor(BOSS2_RIGHTSHOULDERUP, "boss2_r_shoulderup", 256, 128); + def_charactor(BOSS2_LEFTSHOULDERUP, "boss2_left_s_up", 256, 128); + def_charactor(BOSS2_LEFTSHOULDERGIRD, "boss2_left_s_gird", 256, 256); + def_charactor(BOSS2_RIGHTARMBATTERY, "boss2_rightarm_b", 64, 64); + def_charactor(BOSS2_LEFTARMBATTERY, "boss2_leftarmbattery", 64, 64); + def_charactor(BOSS2_RIGHTHAND, "boss2_righthand", 64, 64); + def_charactor(BOSS2_RIGHTPALM, "boss2_rightpalm", 64, 64); + def_charactor(BOSS2_LEFTHAND, "boss2_lefthand", 64, 64); + def_charactor(BOSS2_LEFTPALM, "boss2_leftpalm", 64, 64); + def_charactor(PLAYER_LASERSPLOSH_0, "player_lasersplosh_0", 115, 91); + def_charactor(PLAYER_LASERSPLOSH_1, "player_lasersplosh_1", 133, 121); + def_charactor(PLAYER_LASERSPLOSH_2, "player_lasersplosh_2", 135, 119); + def_charactor(PLAYER_LASERSPLOSH_3, "player_lasersplosh_3", 131, 120); + def_charactor(BOSS_POWERGAUGE, "boss_powergauge", 69, 762); + def_charactor(BLACKHOLE, "blackhole", 128, 128); + def_charactor(FONT_DOYOUCONTINUE, "font_doyoucontinue", 512, 32); + def_charactor(FONT_ALLSTAGECLEAR, "font_allstageclear", 512, 32); + def_charactor(FONT_REST, "font_rest", 128, 32); + def_charactor(FONT_STAGE, "font_stage", 256, 32); + def_charactor(FONT_LINEOFZERO_000000, "font_000000", 256, 32); + def_charactor(FONT_LINEOFZERO_0000000, "font_0000000", 256, 32); + def_charactor(FONT_THANKYOU, "font_thankyou", 512, 32); + def_charactor(FONT_NYSOFT, "font_nysoft", 512, 32); + def_charactor(FONT_1997YGGDRASIL, "font_1997yggdrasil", 512, 32); + def_charactor(FONT_SUPERDANDY, "font_superdandy", 256, 64); + def_charactor(FONT_1997YAS_K, "font_1997yas_k", 512, 32); + def_charactor(GUNBATTERY, "gunbattery", 128, 128); + def_charactor(PURPLECORE, "purplecore", 128, 128); + def_charactor(SPACEFISH, "spacefish", 128, 128); + def_charactor(MISSILE, "missile", 64, 128); + def_charactor(BOSS3_BODY, "boss3_body", 256, 256); + def_charactor(BODD4_BODY, "boss_4", 256, 256); + def_charactor(TITLEFONT_SUPER, "titlefont_super", 256, 256); + def_charactor(TITLEFONT_BATTLE, "titlefont_battle", 256, 256); + def_charactor(TITLEFONT_EMPEROR, "titlefont_emperor", 256, 256); + def_charactor(GREENBARRIER, "greenbarrier", 130, 133); + def_charactor(REMAINDER, "remainder", 126, 34); + def_charactor(EARTH, "earth", 256, 256); + def_charactor(BOSS_CORPSE, "boss_corpse", 64, 256); + def_charactor(211, "rank_c_mins", 64, 32); + def_charactor(210, "rank_c", 64, 32); + def_charactor(209, "rank_c_pla", 64, 32); + def_charactor(208, "rank_b_mins", 64, 32); + def_charactor(207, "rank_b", 64, 32); + def_charactor(206, "rank_b_pla", 64, 32); + def_charactor(205, "rank_a_mins", 64, 32); + def_charactor(204, "rank_a", 64, 32); + def_charactor(203, "rank_a_pla", 64, 32); + def_charactor(202, "rank_s", 64, 32); +} + +void +init_charactor(Viewer *sgroot, int w, int h) +{ + create_sg(sgroot, w, h); + set_parameter(); for (int i = 0; i < ENEMY_NUM; i++) { - charactor[i].root = (void*)sgroot->createSceneGraph(status[i].charano); - charactor[i].score = status[i].score; - charactor[i].vital = status[i].vital; + int char_id = enemy_status[i].char_id; + + charactor[char_id].score = enemy_status[i].score; + charactor[char_id].vital = enemy_status[i].vital; } - create_title_back(sgroot, w, h); } MainLoopPtr Dandy::init(Viewer *sgroot, int w, int h) { - charactor = (ObjPropertyPtr)sgroot->manager->allocate(sizeof(ObjProperty)*ENEMY_NUM); + charactor = (ObjPropertyPtr)sgroot->manager->allocate(sizeof(ObjProperty)*CHAR_NUM); init_charactor(sgroot, w, h); + init_game(sgroot, w, h); + return sgroot; } @@ -65,22 +279,10 @@ int TMmain(TaskManager *manager,int argc, char *argv[]) { - /* - if (init(argc, argv) < 0) { - return -1; - } - */ - // Task Register - // ppe/task_init.cc task_init(); - /* - for (int i = 0; i < task; ++i) { - twice_init(manager); - } - */ - //create_title(sgroot, w, h); task_initialize(); manager->set_TMend(TMend); + return init(manager,argc, argv); }
--- a/ppe/Property.h Tue Oct 26 17:28:56 2010 +0900 +++ b/ppe/Property.h Wed Nov 24 19:24:04 2010 +0900 @@ -6,16 +6,17 @@ #endif typedef struct { - double x, y; //16 - double vx, vy; //16 - int frame; //4 - const char *chara; //1 - int vital; //4 - int score; //4 - void *parent; //4 - void *root; //4 - int flag; //4 - char a, i, u; //3 + float x, y; + float vx, vy; + float width, height; + float mid_w, mid_h; + int frame; + const char *chara; + int vital; + int score; + void *parent; + void *root; + int flag; } *ObjPropertyPtr, ObjProperty; #endif
--- a/ppe/TitleMove.cc Tue Oct 26 17:28:56 2010 +0900 +++ b/ppe/TitleMove.cc Wed Nov 24 19:24:04 2010 +0900 @@ -10,18 +10,24 @@ static int titlemove(SchedTask *s,void *rbuf, void *wbuf) { - Pad* pad; - ObjPropertyPtr i_obj, o_obj; - - i_obj = (ObjPropertyPtr)s->get_input(rbuf, 0); - pad = (Pad*)s->get_input(rbuf, 1); - o_obj = (ObjPropertyPtr)s->get_output(wbuf, 0); + ObjPropertyPtr i_obj, o_obj; + + i_obj = (ObjPropertyPtr)s->get_input(rbuf, 0); + o_obj = (ObjPropertyPtr)s->get_output(wbuf, 0); - if(pad->start.isPush() || pad->start.isHold()) { - i_obj->flag = 1; - } - - o_obj = i_obj; - - return 0; + int pad_id = (int)s->get_param(0); + int size = (int)s->get_param(1); + Pad *pad = (Pad*)s->pad(pad_id); + + if (pad->start.isPush && pad->start.isHold) { + i_obj->flag = 1; + } + if ((pad->select.isPush && pad->select.isHold) && + (pad->start.isPush && pad->start.isHold)) { + i_obj->flag = 0; + } + + s->swap(); + + return 0; }
--- a/ppe/task_init.cc Tue Oct 26 17:28:56 2010 +0900 +++ b/ppe/task_init.cc Wed Nov 24 19:24:04 2010 +0900 @@ -4,7 +4,6 @@ /* 必ずこの位置に書いて */ SchedExternTask(TitleMove); SchedExternTask(CrabMove); -SchedExternTask(TitleColl); /* SchedExternTask(Move00); SchedExternTask(Move01); @@ -68,7 +67,6 @@ { SchedRegisterTask(TITLE_MOVE, TitleMove); SchedRegisterTask(CRAB_MOVE, CrabMove); - SchedRegisterTask(TITLE_COLL, TitleColl); /* SchedRegisterTask(MOVE_00, Move00); SchedRegisterTask(MOVE_01, Move01);
--- a/schedule.cc Tue Oct 26 17:28:56 2010 +0900 +++ b/schedule.cc Wed Nov 24 19:24:04 2010 +0900 @@ -1,5 +1,6 @@ #include "dandy.h" +#if 0 static const int FRAME_RATE = 32; void Putenemy(int charano, int x, int y, int sx, int sy, int move, int coll, @@ -291,5 +292,6 @@ int size = sizeof(ObjProperty)*16; //printf("size = %d\n", size); - sgroot->set_move_task(obj, move, (void*)e, size, create_enemy); + sgroot->set_move_task(obj, move, (void*)e, size); } +#endif
--- a/stage_init.cc Tue Oct 26 17:28:56 2010 +0900 +++ b/stage_init.cc Wed Nov 24 19:24:04 2010 +0900 @@ -1,82 +1,43 @@ -#include "dandy.h" +#include "collision.h" +#if 0 void -create_crab(SchedTask *s, void *charactor_, void *b) +opening() { - ObjPropertyPtr charactor = (ObjPropertyPtr)charactor_; - SceneGraphPtr crab = (SceneGraphPtr)charactor->root; - - crab->xyz[0] = charactor->x; - crab->xyz[1] = charactor->y; + PutSprite(700, 480, 53); // put `push start' string on screen. + PutSprite(224, 776, 119); // put `super dandy' +// Cerium に拡大縮小機能がないので +// PutSpriteEx(190, 800, 264, 2, 2, 5); + PutSprite(800, 264, 190); + PutSprite(396, 432, 191); + PutSprite(640, 640, 192); } void -create_title(SchedTask *s, void *charactor_, void *b) -{ - ObjPropertyPtr charactor = (ObjPropertyPtr)charactor_; - SceneGraphPtr title = (SceneGraphPtr)charactor->root; - - if (charactor->flag == 1) { - title->remove(); - charactor->flag = 0; - } -} - -void -create_title_back(Viewer *sgroot_, int w, int h) +init_game(Viewer *sgroot_, int w, int h) { Viewer *sgroot = sgroot_; SceneGraphPtr root = sgroot->createSceneGraph(); SceneGraphPtr title = (SceneGraphPtr)charactor[0].root; + title->set_move_collision(title_collision); charactor[0].x = w/2; charactor[0].y = h/2; - charactor[0].vx = 0.0; - charactor[0].vy = 0.0; + charactor[0].vx = 1.0; + charactor[0].vy = 1.0; charactor[0].flag = 0; charactor[0].parent = (void*)root; title->xyz[0] = charactor[0].x; title->xyz[1] = charactor[0].y; - SceneGraphPtr crab = (SceneGraphPtr)charactor[1].root; - charactor[1].x = w/2; - charactor[1].y = h/2; - charactor[1].vx = 1.0; - charactor[1].vy = 1.0; - charactor[1].flag = 0; - charactor[1].parent = (void*)root; - - crab->xyz[0] = charactor[1].x; - crab->xyz[1] = charactor[1].y; - crab->flag_drawable = 0; - int size = sizeof(ObjProperty); - sgroot->task_array_init(TITLE_MOVE, TASK_NUM, PARAMETER, INDATA_NUM, OUTDATA_NUM); - sgroot->set_pad_task(title, TITLE_MOVE, (void*)&charactor[0], size, create_title); - sgroot->set_pad_task(crab, CRAB_MOVE, (void*)&charactor[1], size, create_crab); + sgroot->set_pad_task(title, TITLE_MOVE, (void*)&charactor[0], size); +// sgroot->set_pad_task(crab, CRAB_MOVE, (void*)&charactor[1], size); root->addChild(title); - root->addChild(crab); +// root->addChild(crab); sgroot->setSceneData(root); } - -void -create_stage(void *sgroot_, int w, int h, ObjPropertyPtr charactor) -{ - SceneGraphRoot *sgroot = (SceneGraphRoot *)sgroot_; - - SceneGraphPtr stage = sgroot->createSceneGraph(); - SceneGraphPtr mydandy = sgroot->createSceneGraph("mydandy"); - - //mydandy->set_move_collision(dandy_move, dandy_coll); - //stage->set_move_collision(stage_move, stage_coll); - - mydandy->xyz[0] = w/2; - mydandy->xyz[1] = h*0.9; - mydandy->xyz[2] = 0.0f; - - stage->addChild(mydandy); - sgroot->setSceneData(stage); -} +#endif