Mercurial > hg > Members > kono > Cerium
diff Renderer/Test/boss1_action.cc @ 557:ec72b601b71f
fix examlples (on going)
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Thu, 22 Oct 2009 17:34:12 +0900 |
parents | f6daf964f483 |
children | b05bae017029 |
line wrap: on
line diff
--- a/Renderer/Test/boss1_action.cc Thu Oct 22 14:05:24 2009 +0900 +++ b/Renderer/Test/boss1_action.cc Thu Oct 22 17:34:12 2009 +0900 @@ -1,4 +1,5 @@ -#include "SGList.h" +#include "SceneGraphRoot.h" +#include "MainLoop.h" #include "boss1_action.h" /* @@ -202,6 +203,14 @@ } } +extern Application * +application() { + return new ball_bound(); +} + +const char *usr_help_str = "Usage: ./test_nogl [OPTION]\n"; + + static void blast_move(SceneGraphPtr node, int screen_w, int screen_h) { @@ -223,14 +232,9 @@ node->frame += 1; } -void -boss1_init(TaskManager *manager, int screen_w, int screen_h) +MainLoopPtr +bass1_action::boss1_init(Viewer *sgroot, int screen_w, int screen_h) { - SceneGraphPtr root; - SceneGraphPtr player; - SceneGraphPtr boss1; - SceneGraphPtr left_parts; - SceneGraphPtr right_parts; sgroot->createFromXMLfile(manager, "xml_file/boss1.xml"); sgroot->createFromXMLfile(manager, "xml_file/player1.xml"); @@ -238,16 +242,16 @@ sgroot->createFromXMLfile(manager, "xml_file/blast.xml"); //rootとなるSceneGraphを生成 - root = sgroot->createSceneGraph(); + SceneGraphPtr root = sgroot->createSceneGraph(); //自機の初期化 - player = sgroot->createSceneGraph(PLAYER); + SceneGraphPtr player = sgroot->createSceneGraph(PLAYER); player->xyz[0] = screen_w/2; player->xyz[1] = screen_h - player_radius; root->addChild(player); //ボスの初期化 - boss1 = sgroot->createSceneGraph(BOSS1); + SceneGraphPtr boss1 = sgroot->createSceneGraph(BOSS1); boss1->xyz[0] = screen_w/2; boss1->xyz[1] = boss_radius_y; // boss1->xyz[2] = first_boss1_depth; @@ -255,9 +259,9 @@ root->addChild(boss1); //ボスの左右パーツを追加 - left_parts = sgroot->createSceneGraph(BOSS1_L); + SceneGraphPtr left_parts = sgroot->createSceneGraph(BOSS1_L); boss1->addChild(left_parts); - right_parts = sgroot->createSceneGraph(BOSS1_R); + SceneGraphPtr right_parts = sgroot->createSceneGraph(BOSS1_R); boss1->addChild(right_parts); //各機体の動きと当たり判定をセット @@ -266,4 +270,26 @@ //仕上げ sgroot->setSceneData(root); + return sgroot; } + +extern int init(TaskManager *manager, int argc, char *argv[]); +extern void task_initialize(); +static void TMend(TaskManager *manager); + +int +TMmain(TaskManager *manager, int argc, char *argv[]) +{ + task_initialize(); + manager->set_TMend(TMend); + return init(manager, argc, argv); + +} + +void +TMend(TaskManager *manager) +{ + printf("test_nogl end\n"); +} + +