# HG changeset patch # User aaa # Date 1256126734 -32400 # Node ID 519a1bba9b05ab3d045f5bec9d4fc276c6b2b5d3 # Parent 9f9d51b6006263e7faac5bb6d4daef7728680204# Parent 4bd51a6f6d083f4d7de2114ee9bb7d7a44917a33 merge diff -r 9f9d51b60062 -r 519a1bba9b05 TaskManager/Test/test_render/Application/Chain.cc --- a/TaskManager/Test/test_render/Application/Chain.cc Wed Oct 21 21:00:48 2009 +0900 +++ b/TaskManager/Test/test_render/Application/Chain.cc Wed Oct 21 21:05:34 2009 +0900 @@ -2,7 +2,6 @@ #include #include "SceneGraphRoot.h" #include "SceneGraph.h" -#include "SGList.h" #include "TaskManager.h" #include "Func.h" #include "Chain.h" @@ -97,7 +96,7 @@ createSceneGraphFromProperty(void* p) { ChainPropertyPtr chain_p = (ChainPropertyPtr)p; - SceneGraphPtr chain_copy = sgroot->createSceneGraph(CHAIN); + SceneGraphPtr chain_copy = sgroot->createSceneGraph("CHAIN"); chain_copy->propertyptr = (void*)chain_p; chain_copy->property_size = sizeof(ChainProperty); set_vector(chain_p, chain_copy); @@ -209,17 +208,17 @@ Chain::init(TaskManager *manager_, int w, int h) { SceneGraphPtr root_chain, chain; - ChainProperty r; + //ChainProperty r; manager = manager_; - sgroot->createFromXMLfile(manager, "xml_file/chain.xml"); + sgroot->createFromXMLmemory(manager, "xml_file/chain.xml"); /* SPE に送る property の配列の領域確保 */ properties[0] = (ChainPropertyPtr)manager->allocate(sizeof(ChainProperty)*CHAIN_LEN); properties[1] = (ChainPropertyPtr)manager->allocate(sizeof(ChainProperty)*CHAIN_LEN); property = properties[0]; - root_chain = sgroot->createSceneGraph(CHAIN); + root_chain = sgroot->createSceneGraph("CHAIN"); init_chain_vars(&property[0]); property[0].next_x = w / 2; property[0].next_y = 0.0; @@ -230,7 +229,7 @@ set_vector(&property[0], root_chain); for(int i = 1; i < CHAIN_LEN; i++) { - chain = sgroot->createSceneGraph(CHAIN); + chain = sgroot->createSceneGraph("CHAIN"); property[i].id = i; init_chain_vars(&property[i]); property[i].x = 0; diff -r 9f9d51b60062 -r 519a1bba9b05 TaskManager/Test/test_render/Application/back_action.cc --- a/TaskManager/Test/test_render/Application/back_action.cc Wed Oct 21 21:00:48 2009 +0900 +++ b/TaskManager/Test/test_render/Application/back_action.cc Wed Oct 21 21:05:34 2009 +0900 @@ -1,6 +1,5 @@ #include #include "SceneGraphRoot.h" -#include "SGList.h" #include "ball_action.h" using namespace std; @@ -10,7 +9,7 @@ Pad *pad = sgroot->getController(); if (pad->triangle.isPush()) { - SceneGraphPtr ball = sgroot->createSceneGraph(Ball); + SceneGraphPtr ball = sgroot->createSceneGraph("Ball"); ball->xyz[0] = -100; ball->set_move_collision(ball_move, ball_coll); node->addChild(ball); diff -r 9f9d51b60062 -r 519a1bba9b05 TaskManager/Test/test_render/Application/ball_action.cc --- a/TaskManager/Test/test_render/Application/ball_action.cc Wed Oct 21 21:00:48 2009 +0900 +++ b/TaskManager/Test/test_render/Application/ball_action.cc Wed Oct 21 21:05:34 2009 +0900 @@ -1,6 +1,5 @@ #include #include "SceneGraphRoot.h" -#include "SGList.h" using namespace std; void diff -r 9f9d51b60062 -r 519a1bba9b05 TaskManager/Test/test_render/Application/ball_bound.cc --- a/TaskManager/Test/test_render/Application/ball_bound.cc Wed Oct 21 21:00:48 2009 +0900 +++ b/TaskManager/Test/test_render/Application/ball_bound.cc Wed Oct 21 21:05:34 2009 +0900 @@ -1,7 +1,6 @@ #include #include #include "SceneGraphRoot.h" -#include "SGList.h" // prototype static void ball_move(SceneGraphPtr node, int screen_w, int screen_h); @@ -112,8 +111,8 @@ // random な値が欲しいなら、man random に方法が書いてあります。 srandom(100); - sgroot->createFromXMLfile(manager, "xml_file/Ball.xml"); - ball = sgroot->createSceneGraph(Ball); + sgroot->createFromXMLmemory(manager, "xml_file/Ball.xml"); + ball = sgroot->createSceneGraph("Ball"); ball->set_move_collision(ball_move, ball_collision); h0 = screen_h/2; diff -r 9f9d51b60062 -r 519a1bba9b05 TaskManager/Test/test_render/Application/boss1_action.cc --- a/TaskManager/Test/test_render/Application/boss1_action.cc Wed Oct 21 21:00:48 2009 +0900 +++ b/TaskManager/Test/test_render/Application/boss1_action.cc Wed Oct 21 21:05:34 2009 +0900 @@ -1,4 +1,3 @@ -#include "SGList.h" #include "boss1_action.h" /* @@ -71,7 +70,7 @@ || pad->left.isHold()) { #if 0 SceneGraphPtr player_left; - player_left = sgroot->createSceneGraph(PLAYER_L); + player_left = sgroot->createSceneGraph("PLAYER_L"); player_left->set_move_collision(player_move_left, null_collision); player_left->xyz[0] = node->xyz[0]; player_left->xyz[1] = node->xyz[1]; @@ -114,7 +113,7 @@ } if (pad->circle.isPush()) { - SceneGraphPtr shot = sgroot->createSceneGraph(P_SHOT1); + SceneGraphPtr shot = sgroot->createSceneGraph("P_SHOT1"); shot->set_move_collision(shot_move, shot_collision); shot->xyz[0] = node->xyz[0]; shot->xyz[1] = node->xyz[1] - player_radius; @@ -126,15 +125,15 @@ player_collision(SceneGraphPtr node, int screen_w, int screen_h, SceneGraphPtr tree) { +#if 0 //自機とボスのx,y座標での距離と2点間の距離 static float x_distant, y_distant, distance; //ボスの四角形の四隅の座標 // static float boss_low_x, boss_low_y, boss_high_x, boss_high_y; SceneGraphIteratorPtr it = sgroot->getIterator(tree); - - - for (; it->hasNext(BOSS1);) { + + for (; it->hasNext("BOSS1");) { it->next(BOSS1); SceneGraphPtr enemy = it->get(); @@ -154,6 +153,7 @@ printf("!!!CAUTION!!!\n"); } } +#endif } static void @@ -171,6 +171,7 @@ shot_collision(SceneGraphPtr node, int screen_2, int screen_h, SceneGraphPtr tree) { +#if 0 //自機とボスのx,y座標での距離と2点間の距離 static float x_distant, y_distant, distance; //ボスの四角形の四隅の座標 @@ -191,7 +192,7 @@ //円同士のcollision if(distance < boss_radius_y) { - SceneGraphPtr blast = sgroot->createSceneGraph(BLAST1); + SceneGraphPtr blast = sgroot->createSceneGraph("BLAST1"); blast->set_move_collision(blast_move, null_collision); blast->xyz[0] = node->xyz[0]; @@ -200,11 +201,13 @@ node->remove(); } } +#endif } - +#if 0 static void blast_move(SceneGraphPtr node, int screen_w, int screen_h) { + if(node->sgid > BLAST8) { SceneGraphPtr blast = sgroot->createSceneGraph(node->sgid - 1); blast->set_move_collision(blast_move, null_collision); @@ -222,6 +225,7 @@ } node->frame += 1; } +#endif void boss1_init(TaskManager *manager, int screen_w, int screen_h) @@ -232,22 +236,22 @@ SceneGraphPtr left_parts; SceneGraphPtr right_parts; - sgroot->createFromXMLfile(manager, "xml_file/boss1.xml"); - sgroot->createFromXMLfile(manager, "xml_file/player1.xml"); - sgroot->createFromXMLfile(manager, "xml_file/p_shot.xml"); - sgroot->createFromXMLfile(manager, "xml_file/blast.xml"); + sgroot->createFromXMLmemory(manager, "xml_file/boss1.xml"); + sgroot->createFromXMLmemory(manager, "xml_file/player1.xml"); + sgroot->createFromXMLmemory(manager, "xml_file/p_shot.xml"); + sgroot->createFromXMLmemory(manager, "xml_file/blast.xml"); //rootとなるSceneGraphを生成 root = sgroot->createSceneGraph(); //自機の初期化 - player = sgroot->createSceneGraph(PLAYER); + player = sgroot->createSceneGraph("PLAYER"); player->xyz[0] = screen_w/2; player->xyz[1] = screen_h - player_radius; root->addChild(player); //ボスの初期化 - boss1 = sgroot->createSceneGraph(BOSS1); + 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); + left_parts = sgroot->createSceneGraph("BOSS1_L"); boss1->addChild(left_parts); - right_parts = sgroot->createSceneGraph(BOSS1_R); + right_parts = sgroot->createSceneGraph("BOSS1_R"); boss1->addChild(right_parts); //各機体の動きと当たり判定をセット diff -r 9f9d51b60062 -r 519a1bba9b05 TaskManager/Test/test_render/Application/boss1_action.h --- a/TaskManager/Test/test_render/Application/boss1_action.h Wed Oct 21 21:00:48 2009 +0900 +++ b/TaskManager/Test/test_render/Application/boss1_action.h Wed Oct 21 21:05:34 2009 +0900 @@ -3,7 +3,6 @@ #include #include "SceneGraphRoot.h" -#include "SGList.h" static const float player_speed = 10.0f; static const float player_radius = 42.0f; diff -r 9f9d51b60062 -r 519a1bba9b05 TaskManager/Test/test_render/Application/bullet_action.cc --- a/TaskManager/Test/test_render/Application/bullet_action.cc Wed Oct 21 21:00:48 2009 +0900 +++ b/TaskManager/Test/test_render/Application/bullet_action.cc Wed Oct 21 21:05:34 2009 +0900 @@ -1,6 +1,5 @@ #include #include "SceneGraphRoot.h" -#include "SGList.h" #include "hit_judge.h" #define PI M_PI @@ -36,6 +35,7 @@ void bullet_collision(SceneGraphPtr node, int screen_w, int screen_h, SceneGraphPtr tree) { +#if 0 SceneGraphIteratorPtr it = sgroot->getIterator(tree); //static int damage = 0; @@ -62,4 +62,5 @@ //i -= 1; //printf("bullet_delete:残り弾数=%d\n",i); } +#endif } diff -r 9f9d51b60062 -r 519a1bba9b05 TaskManager/Test/test_render/Application/camera_action.cc --- a/TaskManager/Test/test_render/Application/camera_action.cc Wed Oct 21 21:00:48 2009 +0900 +++ b/TaskManager/Test/test_render/Application/camera_action.cc Wed Oct 21 21:05:34 2009 +0900 @@ -1,5 +1,4 @@ #include "SceneGraphRoot.h" -#include "SGList.h" #include "camera_action.h" #define MOVE_SPEED 0.10 diff -r 9f9d51b60062 -r 519a1bba9b05 TaskManager/Test/test_render/Application/chain_old.cc --- a/TaskManager/Test/test_render/Application/chain_old.cc Wed Oct 21 21:00:48 2009 +0900 +++ b/TaskManager/Test/test_render/Application/chain_old.cc Wed Oct 21 21:05:34 2009 +0900 @@ -1,7 +1,6 @@ #include #include #include "SceneGraphRoot.h" -#include "SGList.h" #include "SceneGraph.h" #include "TaskManager.h" #include "Func.h" @@ -132,9 +131,9 @@ SceneGraphPtr root_old_chain, chain; CHAIN_VARS rcv; - sgroot->createFromXMLfile(manager,"xml_file/chain.xml"); + sgroot->createFromXMLmemory(manager,"xml_file/chain.xml"); - root_old_chain = sgroot->createSceneGraph(CHAIN); + root_old_chain = sgroot->createSceneGraph("CHAIN"); root_old_chain->set_move_collision(chain_old_move_ope, chain_old_collision); init_chainold_vars(&rcv); rcv.next_x = w / 2; @@ -142,7 +141,7 @@ set_old_vector(&rcv, root_old_chain); for(int i = 0; i < CHAIN_LEN; i++) { - chain = sgroot->createSceneGraph(CHAIN); + chain = sgroot->createSceneGraph("CHAIN"); chain->id = i; init_chainold_vars(&cv[i]); cv[i].x = 0; diff -r 9f9d51b60062 -r 519a1bba9b05 TaskManager/Test/test_render/Application/cube.cc --- a/TaskManager/Test/test_render/Application/cube.cc Wed Oct 21 21:00:48 2009 +0900 +++ b/TaskManager/Test/test_render/Application/cube.cc Wed Oct 21 21:05:34 2009 +0900 @@ -1,7 +1,6 @@ #include #include "SceneGraphRoot.h" #include "vacuum.h" -#include "SGList.h" #define SELECT 2 void @@ -62,10 +61,10 @@ // SceneGraphPtr root_common_move = root->parent; if(random()%SELECT) { - p = sgroot->createSceneGraph(REDCUBE); + p = sgroot->createSceneGraph("REDCUBE"); } else { - p = sgroot->createSceneGraph(ENEMY); + p = sgroot->createSceneGraph("ENEMY"); } root->set_move_collision(cube_move_right, cube_collision); @@ -95,6 +94,7 @@ void collision_red(SceneGraphIteratorPtr it,SceneGraphPtr node) { +#if 0 float dx, dy,ddx,ddy, r; float q = 0; @@ -130,11 +130,13 @@ } } } +#endif } void collision_purple(SceneGraphIteratorPtr it,SceneGraphPtr node,int w,int h) { +#if 0 float dx, dy,ddx,ddy, r; float q = 0; @@ -171,4 +173,5 @@ } } } +#endif } diff -r 9f9d51b60062 -r 519a1bba9b05 TaskManager/Test/test_render/Application/cube_action.cc --- a/TaskManager/Test/test_render/Application/cube_action.cc Wed Oct 21 21:00:48 2009 +0900 +++ b/TaskManager/Test/test_render/Application/cube_action.cc Wed Oct 21 21:05:34 2009 +0900 @@ -1,6 +1,5 @@ #include #include "SceneGraphRoot.h" -#include "SGList.h" static void cube_move_left(SceneGraphPtr node, int screen_w, int screen_h); static void cube_move_right(SceneGraphPtr node, int screen_w, int screen_h); @@ -114,14 +113,14 @@ SceneGraphPtr cube; SceneGraphPtr back; - sgroot->createFromXMLfile(manager, "xml_file/cube.xml"); + sgroot->createFromXMLmemory(manager, "xml_file/cube.xml"); // 何もしない親 // cube は brother として繋がっていくので // 親が居ないとだめ。 back = sgroot->createSceneGraph(); - cube = sgroot->createSceneGraph(Cube); + cube = sgroot->createSceneGraph("Cube"); cube->xyz[0] = 960.0f; cube->xyz[1] = 540.0f; cube->set_move_collision(cube_move_idle, cube_collision); diff -r 9f9d51b60062 -r 519a1bba9b05 TaskManager/Test/test_render/Application/direction.cc --- a/TaskManager/Test/test_render/Application/direction.cc Wed Oct 21 21:00:48 2009 +0900 +++ b/TaskManager/Test/test_render/Application/direction.cc Wed Oct 21 21:05:34 2009 +0900 @@ -1,5 +1,4 @@ #include "SceneGraphRoot.h" -#include "SGList.h" static void x_move(SceneGraphPtr node, int w, int h) @@ -69,11 +68,11 @@ SceneGraphPtr dz; SceneGraphPtr back; - sgroot->createFromXMLfile(manager, "xml_file/direction.xml"); + sgroot->createFromXMLmemory(manager, "xml_file/direction.xml"); - dx = sgroot->createSceneGraph(Dirx); - dy = sgroot->createSceneGraph(Diry); - dz = sgroot->createSceneGraph(Dirz); + dx = sgroot->createSceneGraph("Dirx"); + dy = sgroot->createSceneGraph("Diry"); + dz = sgroot->createSceneGraph("Dirz"); back = sgroot->createSceneGraph(); back->addChild(dx); diff -r 9f9d51b60062 -r 519a1bba9b05 TaskManager/Test/test_render/Application/dynamic_create.cc --- a/TaskManager/Test/test_render/Application/dynamic_create.cc Wed Oct 21 21:00:48 2009 +0900 +++ b/TaskManager/Test/test_render/Application/dynamic_create.cc Wed Oct 21 21:05:34 2009 +0900 @@ -102,7 +102,16 @@ node->stack_xyz[1] = -node->stack_xyz[1]; } +<<<<<<< local //Pad *pad = sgroot->getController(); +======= + Pad *pad = sgroot->getController(); +<<<<<<< local + if (pad->circle.isPush()) { + SceneGraphPtr earth; + sgroot->createFromXMLmemory(sgroot->tmanager, "xml_file/universe.xml"); +======= +>>>>>>> other /* if (pad->right.isPush()) { @@ -112,6 +121,7 @@ //sgroot->createFromXMLmemory(sgroot->tmanager, "xml_file/universe.xml"); sgroot->createFromXMLmemory(sgroot->tmanager, m); +>>>>>>> other earth = sgroot->createSceneGraph("Earth"); earth->set_move_collision(moon_move, moon_collision); node->addChild(earth); @@ -169,7 +179,7 @@ void dynamic_init(TaskManager *manager) { - SceneGraphPtr earth; + //SceneGraphPtr earth; sgroot->tmanager = manager; #if 0 diff -r 9f9d51b60062 -r 519a1bba9b05 TaskManager/Test/test_render/Application/game_over.cc --- a/TaskManager/Test/test_render/Application/game_over.cc Wed Oct 21 21:00:48 2009 +0900 +++ b/TaskManager/Test/test_render/Application/game_over.cc Wed Oct 21 21:05:34 2009 +0900 @@ -1,6 +1,5 @@ #include "SceneGraphRoot.h" #include "vacuum.h" -#include "SGList.h" void @@ -9,7 +8,7 @@ SceneGraphPtr over; - over = sgroot->createSceneGraph(GAMEOVER); + over = sgroot->createSceneGraph("GAMEOVER"); over->xyz[0] = w/2; over->xyz[1] = h/2; over->set_move_collision(gameover_idle,gameover_collision); @@ -31,7 +30,7 @@ SceneGraphPtr title; - title = sgroot->createSceneGraph(TITLE); + title = sgroot->createSceneGraph("TITLE"); title->xyz[0] = screen_w/2; title->xyz[1] = screen_h/2; title->set_move_collision(no_move_idle, title_collision); diff -r 9f9d51b60062 -r 519a1bba9b05 TaskManager/Test/test_render/Application/gaplant.cc --- a/TaskManager/Test/test_render/Application/gaplant.cc Wed Oct 21 21:00:48 2009 +0900 +++ b/TaskManager/Test/test_render/Application/gaplant.cc Wed Oct 21 21:05:34 2009 +0900 @@ -1,5 +1,4 @@ #include "SceneGraphRoot.h" -#include "SGList.h" #include "gaplant_action.h" #include "back_action.h" @@ -8,8 +7,8 @@ { SceneGraphPtr back; SceneGraphPtr gaplant; - sgroot->createFromXMLfile(manager, "xml_file/gap_plane_test.xml"); - sgroot->createFromXMLfile(manager, "xml_file/Ball.xml"); + sgroot->createFromXMLmemory(manager, "xml_file/gap_plane_test.xml"); + sgroot->createFromXMLmemory(manager, "xml_file/Ball.xml"); back = sgroot->createSceneGraph(); back->set_move_collision(back_move, back_coll); @@ -19,12 +18,12 @@ gaplant->angle[1] = 0; gaplant->angle[2] = 0; gaplant->set_move_collision(gaplant_move, gaplant_coll); - +#if 0 for (int i = arm_L_D; i <= foot_L_A; i++) { SceneGraphPtr p = sgroot->createSceneGraph(i); gaplant->addChild(p); } - +#endif back->addChild(gaplant); sgroot->setSceneData(back); } diff -r 9f9d51b60062 -r 519a1bba9b05 TaskManager/Test/test_render/Application/gaplant_action.cc --- a/TaskManager/Test/test_render/Application/gaplant_action.cc Wed Oct 21 21:00:48 2009 +0900 +++ b/TaskManager/Test/test_render/Application/gaplant_action.cc Wed Oct 21 21:05:34 2009 +0900 @@ -1,7 +1,6 @@ #include #include #include "SceneGraphRoot.h" -#include "SGList.h" #include "gaplant.h" using namespace std; @@ -78,9 +77,9 @@ void gaplant_coll(SceneGraphPtr node, int w, int h, SceneGraphPtr tree) { - SceneGraphIteratorPtr it = sgroot->getIterator(tree); + //SceneGraphIteratorPtr it = sgroot->getIterator(tree); //static int damage = 0; - +#if 0 for (; it->hasNext(Ball);) { it->next(Ball); SceneGraphPtr ball = it->get(); @@ -95,4 +94,5 @@ ball->remove(); } } +#endif } diff -r 9f9d51b60062 -r 519a1bba9b05 TaskManager/Test/test_render/Application/hit_judge.cc --- a/TaskManager/Test/test_render/Application/hit_judge.cc Wed Oct 21 21:00:48 2009 +0900 +++ b/TaskManager/Test/test_render/Application/hit_judge.cc Wed Oct 21 21:05:34 2009 +0900 @@ -1,6 +1,5 @@ #include "SceneGraph.h" #include "hit_judge.h" -#include "SGList.h" #define FUSELAGE_W 6 #define FUSELAGE_H 6 @@ -15,6 +14,7 @@ int square_judge(SceneGraphPtr oneself, SceneGraphPtr partner) { +#if 0 int ow = 0, oh = 0, oz = 0; int pw = 0, ph = 0, pz = 0; if (oneself->sgid == IDLE) @@ -76,5 +76,6 @@ } else { return HIT; } +#endif return 0; } diff -r 9f9d51b60062 -r 519a1bba9b05 TaskManager/Test/test_render/Application/ieshoot.cc --- a/TaskManager/Test/test_render/Application/ieshoot.cc Wed Oct 21 21:00:48 2009 +0900 +++ b/TaskManager/Test/test_render/Application/ieshoot.cc Wed Oct 21 21:05:34 2009 +0900 @@ -1,5 +1,4 @@ #include "SceneGraphRoot.h" -#include "SGList.h" static const float jiki_speed = 6.0f; static const float jiki_radius = 32.0f; @@ -38,6 +37,7 @@ ieboss_collision(SceneGraphPtr node, int screen_w, int screen_h, SceneGraphPtr tree) { +#if 0 SceneGraphIteratorPtr it = sgroot->getIterator(tree); static int damage = 0; @@ -52,7 +52,7 @@ node->set_move_collision(ieboss_move, ieboss_collision_invincibil); - SceneGraphPtr iebosstama = sgroot->createSceneGraph(Earth); + SceneGraphPtr iebosstama = sgroot->createSceneGraph("Earth"); iebosstama->set_move_collision(iebosstama_move, ietama_collision); iebosstama->xyz[0] = node->xyz[0]; iebosstama->xyz[1] = node->xyz[1] + boss_radius_y; @@ -66,6 +66,7 @@ if (damage > 10) { node->remove(); } +#endif } static void @@ -97,7 +98,7 @@ z_speed = -z_speed; } } - +#if 0 static void ieboss_collision_invincibil(SceneGraphPtr node, int screen_w, int screen_h, SceneGraphPtr tree) @@ -125,6 +126,7 @@ node->remove(); } } +#endif static void ietama_move(SceneGraphPtr node, int screen_w, int screen_h) @@ -179,7 +181,7 @@ } if (pad->circle.isPush()) { - SceneGraphPtr ietama = sgroot->createSceneGraph(IETAMA); + SceneGraphPtr ietama = sgroot->createSceneGraph("IETAMA"); ietama->set_move_collision(ietama_move, ietama_collision); ietama->xyz[0] = node->xyz[0]; ietama->xyz[1] = node->xyz[1]; @@ -195,19 +197,19 @@ SceneGraphPtr enemy; SceneGraphPtr back; - sgroot->createFromXMLfile(manager, "xml_file/ietama.xml"); - sgroot->createFromXMLfile(manager, "xml_file/ieboss.xml"); - sgroot->createFromXMLfile(manager, "xml_file/iejiki.xml"); - sgroot->createFromXMLfile(manager, "xml_file/universe.xml"); + sgroot->createFromXMLmemory(manager, "xml_file/ietama.xml"); + sgroot->createFromXMLmemory(manager, "xml_file/ieboss.xml"); + sgroot->createFromXMLmemory(manager, "xml_file/iejiki.xml"); + sgroot->createFromXMLmemory(manager, "xml_file/universe.xml"); back = sgroot->createSceneGraph(); - iejiki = sgroot->createSceneGraph(IEJIKI); + iejiki = sgroot->createSceneGraph("IEJIKI"); iejiki->set_move_collision(iejiki_move, iejiki_collision); iejiki->xyz[2] = 20; back->addChild(iejiki); - enemy = sgroot->createSceneGraph(IEBOSS); + enemy = sgroot->createSceneGraph("IEBOSS"); enemy->set_move_collision(ieboss_move, ieboss_collision); enemy->xyz[1] = boss_radius_y; back->addChild(enemy); diff -r 9f9d51b60062 -r 519a1bba9b05 TaskManager/Test/test_render/Application/init_position.cc --- a/TaskManager/Test/test_render/Application/init_position.cc Wed Oct 21 21:00:48 2009 +0900 +++ b/TaskManager/Test/test_render/Application/init_position.cc Wed Oct 21 21:05:34 2009 +0900 @@ -1,5 +1,4 @@ #include "SceneGraphRoot.h" -#include "SGList.h" #include "player_action.h" #include "enemy_action.h" #include "camera_action.h" @@ -12,11 +11,11 @@ SceneGraphPtr enemy; //SceneGraphPtr bullet; - sgroot->createFromXMLfile(manager, "xml_file/player.xml"); - back = sgroot->createSceneGraph(BACK); + sgroot->createFromXMLmemory(manager, "xml_file/player.xml"); + back = sgroot->createSceneGraph("BACK"); //back = sgroot->createSceneGraph(); - player = sgroot->createSceneGraph(IDLE); - //bullet = sgroot->createSceneGraph(BULEBULLET); + player = sgroot->createSceneGraph("IDLE"); + //bullet = sgroot->createSceneGraph("BULEBULLET"); camera_init(back, w, h); back->set_move_collision(camera_init, camera_collision); @@ -26,7 +25,7 @@ back->addChild(player); for (int i = 0; i < 10; i++) { - enemy = sgroot->createSceneGraph(E_PLANE); + enemy = sgroot->createSceneGraph("E_PLANE"); enemy->set_move_collision(enemy_move, enemy_collision); enemy->xyz[0] = 50.0*i; back->addChild(enemy); diff -r 9f9d51b60062 -r 519a1bba9b05 TaskManager/Test/test_render/Application/long_cube.cc --- a/TaskManager/Test/test_render/Application/long_cube.cc Wed Oct 21 21:00:48 2009 +0900 +++ b/TaskManager/Test/test_render/Application/long_cube.cc Wed Oct 21 21:05:34 2009 +0900 @@ -1,5 +1,4 @@ #include "SceneGraphRoot.h" -#include "SGList.h" // prototype static void lcube_move(SceneGraphPtr node, int screen_w, int screen_h); @@ -23,8 +22,8 @@ { SceneGraphPtr lcube; - sgroot->createFromXMLfile(manager, "xml_file/LongCube.xml"); - lcube = sgroot->createSceneGraph(LongCube); + sgroot->createFromXMLmemory(manager, "xml_file/LongCube.xml"); + lcube = sgroot->createSceneGraph("LongCube"); lcube->set_move_collision(lcube_move, lcube_collision); sgroot->setSceneData(lcube); diff -r 9f9d51b60062 -r 519a1bba9b05 TaskManager/Test/test_render/Application/node.cc --- a/TaskManager/Test/test_render/Application/node.cc Wed Oct 21 21:00:48 2009 +0900 +++ b/TaskManager/Test/test_render/Application/node.cc Wed Oct 21 21:05:34 2009 +0900 @@ -65,7 +65,7 @@ void node_init(TaskManager *manager) { - sgroot->createFromXMLfile(manager, "xml_file/cube.xml"); + sgroot->createFromXMLmemory(manager, "xml_file/cube.xml"); Cube->set_move_collision(cube_move, cube_collision); Cube->stack_xyz[0] = 2.0f; Cube->stack_xyz[1] = 2.0f; diff -r 9f9d51b60062 -r 519a1bba9b05 TaskManager/Test/test_render/Application/panel.cc --- a/TaskManager/Test/test_render/Application/panel.cc Wed Oct 21 21:00:48 2009 +0900 +++ b/TaskManager/Test/test_render/Application/panel.cc Wed Oct 21 21:05:34 2009 +0900 @@ -1,5 +1,4 @@ #include "SceneGraphRoot.h" -#include "SGList.h" static void panel_move(SceneGraphPtr node, int screen_w, int screen_h); static void panel_collision(SceneGraphPtr node, int screen_w, int screen_h, @@ -22,14 +21,14 @@ SceneGraphPtr panel; if (bg == 2) { - sgroot->createFromXMLfile(manager, "xml_file/panel_512.xml"); - panel = sgroot->createSceneGraph(PANEL_512); + sgroot->createFromXMLmemory(manager, "xml_file/panel_512.xml"); + panel = sgroot->createSceneGraph("PANEL_512"); } else if (bg == 3) { - sgroot->createFromXMLfile(manager, "xml_file/panel_1024.xml"); - panel = sgroot->createSceneGraph(PANEL_1024); + sgroot->createFromXMLmemory(manager, "xml_file/panel_1024.xml"); + panel = sgroot->createSceneGraph("PANEL_1024"); } else { - sgroot->createFromXMLfile(manager, "xml_file/panel_2048.xml"); - panel = sgroot->createSceneGraph(PANEL_2048); + sgroot->createFromXMLmemory(manager, "xml_file/panel_2048.xml"); + panel = sgroot->createSceneGraph("PANEL_2048"); } panel->set_move_collision(panel_move, panel_collision); diff -r 9f9d51b60062 -r 519a1bba9b05 TaskManager/Test/test_render/Application/player_action.cc --- a/TaskManager/Test/test_render/Application/player_action.cc Wed Oct 21 21:00:48 2009 +0900 +++ b/TaskManager/Test/test_render/Application/player_action.cc Wed Oct 21 21:05:34 2009 +0900 @@ -1,6 +1,5 @@ #include "SceneGraphRoot.h" #include "bullet_action.h" -#include "SGList.h" #define MOVE_SPEED 5.00 @@ -123,7 +122,7 @@ } if (pad->circle.isPush()) { - SceneGraphPtr bullet = sgroot->createSceneGraph(BULEBULLET); + SceneGraphPtr bullet = sgroot->createSceneGraph("BULEBULLET"); bullet->set_move_collision(bluebullet_move, bullet_collision); bullet_init(bullet, node); node->addBrother(bullet); diff -r 9f9d51b60062 -r 519a1bba9b05 TaskManager/Test/test_render/Application/title.cc --- a/TaskManager/Test/test_render/Application/title.cc Wed Oct 21 21:00:48 2009 +0900 +++ b/TaskManager/Test/test_render/Application/title.cc Wed Oct 21 21:05:34 2009 +0900 @@ -1,6 +1,5 @@ #include "SceneGraphRoot.h" #include "vacuum.h" -#include "SGList.h" void title_collision(SceneGraphPtr node, int w, int h,SceneGraphPtr tree) @@ -13,14 +12,14 @@ SceneGraphPtr vacuum; SceneGraphPtr back = sgroot->createSceneGraph(); - vacuum = sgroot->createSceneGraph(BIGCUBE); + vacuum = sgroot->createSceneGraph("BIGCUBE"); vacuum->xyz[0] = w/2; vacuum->xyz[1] = h*0.8; vacuum->set_move_collision(vacuum_move, vacuum_coll); back->addChild(vacuum); - add_cubecollision_object(REDCUBE,vacuum,w,h); + //add_cubecollision_object(REDCUBE,vacuum,w,h); sgroot->setSceneData(back); diff -r 9f9d51b60062 -r 519a1bba9b05 TaskManager/Test/test_render/Application/universe.cc --- a/TaskManager/Test/test_render/Application/universe.cc Wed Oct 21 21:00:48 2009 +0900 +++ b/TaskManager/Test/test_render/Application/universe.cc Wed Oct 21 21:05:34 2009 +0900 @@ -1,6 +1,6 @@ #include #include "SceneGraphRoot.h" -#include "SGList.h" + static void earth_collision(SceneGraphPtr node, int screen_w, int screen_h, @@ -46,17 +46,17 @@ SceneGraphPtr earth; SceneGraphPtr moon; - sgroot->createFromXMLfile(manager, "xml_file/universe.xml"); + sgroot->createFromXMLmemory(manager, "xml_file/universe.xml"); // SGList.h にある SceneGraph ID から SceneGraph を生成する - earth = sgroot->createSceneGraph(Earth); + earth = sgroot->createSceneGraph("Earth"); // SceneGraph の move と collision を設定 earth->set_move_collision(earth_move, earth_collision); earth->stack_xyz[0] = 3.0f; earth->stack_xyz[1] = 3.0f; - moon = sgroot->createSceneGraph(Moon); + moon = sgroot->createSceneGraph("Moon"); moon->set_move_collision(moon_move, moon_collision); // SceneGraph 同士の親子関係を設定 (今回は 親 earth、子 moon) diff -r 9f9d51b60062 -r 519a1bba9b05 TaskManager/Test/test_render/Application/untitled.cc --- a/TaskManager/Test/test_render/Application/untitled.cc Wed Oct 21 21:00:48 2009 +0900 +++ b/TaskManager/Test/test_render/Application/untitled.cc Wed Oct 21 21:05:34 2009 +0900 @@ -1,6 +1,5 @@ #include #include "SceneGraphRoot.h" -#include "SGList.h" #include static void @@ -87,7 +86,7 @@ SceneGraphPtr test08; SceneGraphPtr test09; - sgroot->createFromXMLfile(manager, "xml_file/Venus.xml"); + sgroot->createFromXMLmemory(manager, "xml_file/Venus.xml"); // SGList.h にある SceneGraph ID から SceneGraph を生成する /* @@ -102,16 +101,16 @@ test08 = sgroot->createSceneGraph(cubetest002); test09 = sgroot->createSceneGraph(cubetest001); */ - test00 = sgroot->createSceneGraph(Venus000); - test01 = sgroot->createSceneGraph(Venus009); - test02 = sgroot->createSceneGraph(Venus008); - test03 = sgroot->createSceneGraph(Venus007); - test04 = sgroot->createSceneGraph(Venus006); - test05 = sgroot->createSceneGraph(Venus005); - test06 = sgroot->createSceneGraph(Venus004); - test07 = sgroot->createSceneGraph(Venus003); - test08 = sgroot->createSceneGraph(Venus002); - test09 = sgroot->createSceneGraph(Venus001); + test00 = sgroot->createSceneGraph("Venus000"); + test01 = sgroot->createSceneGraph("Venus009"); + test02 = sgroot->createSceneGraph("Venus008"); + test03 = sgroot->createSceneGraph("Venus007"); + test04 = sgroot->createSceneGraph("Venus006"); + test05 = sgroot->createSceneGraph("Venus005"); + test06 = sgroot->createSceneGraph("Venus004"); + test07 = sgroot->createSceneGraph("Venus003"); + test08 = sgroot->createSceneGraph("Venus002"); + test09 = sgroot->createSceneGraph("Venus001"); // SceneGraph の move と collision を設定 test00->set_move_collision(cubetest_move, cubetest_collision); diff -r 9f9d51b60062 -r 519a1bba9b05 TaskManager/Test/test_render/Application/vacuum.cc --- a/TaskManager/Test/test_render/Application/vacuum.cc Wed Oct 21 21:00:48 2009 +0900 +++ b/TaskManager/Test/test_render/Application/vacuum.cc Wed Oct 21 21:05:34 2009 +0900 @@ -1,7 +1,6 @@ #include #include "vacuum.h" #include "SceneGraphRoot.h" -#include "SGList.h" #define ENCOUNT 55 using namespace std; @@ -31,6 +30,7 @@ vacuum_coll(SceneGraphPtr node, int screen_w, int screen_h, SceneGraphPtr tree) { +#if 0 Pad *pad = sgroot->getController(); if(node->frame%ENCOUNT == ENCOUNT-1) { @@ -53,13 +53,13 @@ SceneGraphIteratorPtr it = sgroot->getIterator(tree); lock_attack(node,it); } - +#endif } void lock_attack(SceneGraphPtr node,SceneGraphIteratorPtr it) { - +#if 0 SceneGraphPtr enemy; SceneGraphPtr near_enemy = NULL; float dx,dy,r,range = 100; @@ -85,12 +85,12 @@ SceneGraphPtr lockon; // SceneGraphPtr near_enemy_common_move = near_enemy->parent; near_enemy->stack_xyz[2] = 1; - lockon = sgroot->createSceneGraph(LOCK); + lockon = sgroot->createSceneGraph("LOCK"); lockon->set_move_collision(no_move_idle,lockon_collision); //near_enemy_common_move->addChild(lockon); near_enemy->addChild(lockon); } - +#endif } void @@ -161,11 +161,11 @@ { SceneGraphPtr title; - sgroot->createFromXMLfile(manager, "xml_file/gamecube.xml"); - sgroot->createFromXMLfile(manager, "xml_file/title.xml"); - sgroot->createFromXMLfile(manager, "xml_file/gameover.xml"); + sgroot->createFromXMLmemory(manager, "xml_file/gamecube.xml"); + sgroot->createFromXMLmemory(manager, "xml_file/title.xml"); + sgroot->createFromXMLmemory(manager, "xml_file/gameover.xml"); - title = sgroot->createSceneGraph(TITLE); + title = sgroot->createSceneGraph("TITLE"); title->xyz[0] = w/2; title->xyz[1] = h/2; title->set_move_collision(no_move_idle, title_collision); diff -r 9f9d51b60062 -r 519a1bba9b05 TaskManager/Test/test_render/Application/vacuum.h --- a/TaskManager/Test/test_render/Application/vacuum.h Wed Oct 21 21:00:48 2009 +0900 +++ b/TaskManager/Test/test_render/Application/vacuum.h Wed Oct 21 21:05:34 2009 +0900 @@ -1,7 +1,6 @@ #ifndef VACUUM_H #define VACUUM_H -#include "SGList.h" #include "SceneGraphRoot.h" void cube_move_left(SceneGraphPtr node, int screen_w, int screen_h); diff -r 9f9d51b60062 -r 519a1bba9b05 TaskManager/Test/test_render/Makefile --- a/TaskManager/Test/test_render/Makefile Wed Oct 21 21:00:48 2009 +0900 +++ b/TaskManager/Test/test_render/Makefile Wed Oct 21 21:05:34 2009 +0900 @@ -1,37 +1,32 @@ default: macosx -macosx: FORCE SGList.h +macosx: @echo "Make for Mac OS X" @$(MAKE) -f Makefile.macosx -cell: FORCE SGList.h +cell: @echo "Make for PS3 (Cell)" @$(MAKE) -f Makefile.cell -linux: FORCE SGList.h +linux: @echo "Make for Linux" @$(MAKE) -f Makefile.linux -macosx-depend: FORCE +macosx-depend: @$(MAKE) -f Makefile.macosx depend -cell-depend: FORCE +cell-depend: @$(MAKE) -f Makefile.cell depend -linux-depend: FORCE +linux-depend: @$(MAKE) -f Makefile.linux depend -FORCE: - clean: @$(MAKE) -f Makefile.macosx clean @$(MAKE) -f Makefile.cell clean @$(MAKE) -f Makefile.linux clean rm -f depend.inc -SGList.h: xml_file/*.xml - perl tools/create_sglist.pl xml_file/*.xml - run-ps3: /usr/*bin/ps3-video-mode -v 133 ./test_nogl -video fb -width 1920 -height 1080 $(CPU) $(SG) diff -r 9f9d51b60062 -r 519a1bba9b05 TaskManager/Test/test_render/Makefile.cell --- a/TaskManager/Test/test_render/Makefile.cell Wed Oct 21 21:00:48 2009 +0900 +++ b/TaskManager/Test/test_render/Makefile.cell Wed Oct 21 21:05:34 2009 +0900 @@ -28,15 +28,6 @@ $(TARGET): $(OBJS) $(TASK_OBJS) $(CC) -o $@ $(OBJS) $(TASK_OBJS) $(LIBS) -SGList.o: create_sg_list - $(CC) $(CFLAGS) $(INCLUDE) -c SGList.cc -o $@ - -create_sg_list: - @if [ ! -f SGList.h ]; then \ - cd tools/;\ - ./create_sglist.pl ../xml_file/*.xml;\ - fi - speobject: cd spe; $(MAKE) diff -r 9f9d51b60062 -r 519a1bba9b05 TaskManager/Test/test_render/Makefile.macosx --- a/TaskManager/Test/test_render/Makefile.macosx Wed Oct 21 21:00:48 2009 +0900 +++ b/TaskManager/Test/test_render/Makefile.macosx Wed Oct 21 21:05:34 2009 +0900 @@ -22,7 +22,7 @@ .cc.o: $(CC) $(CFLAGS) $(INCLUDE) -c $< -o $@ -all: SGList.o $(TARGET) +all: $(TARGET): $(OBJS) $(TASK_OBJS) $(CC) -o $@ $(OBJS) $(TASK_OBJS) $(LIBS) diff -r 9f9d51b60062 -r 519a1bba9b05 TaskManager/Test/test_render/SceneGraphRoot.cc --- a/TaskManager/Test/test_render/SceneGraphRoot.cc Wed Oct 21 21:00:48 2009 +0900 +++ b/TaskManager/Test/test_render/SceneGraphRoot.cc Wed Oct 21 21:05:34 2009 +0900 @@ -6,14 +6,16 @@ #include "sys.h" #include "TextureHash.h" #include "texture.h" -#include "SGList.h" +//#include "SGList.h" #include "Application.h" int cnt = 0; +static const int SGLIST_LENGTH = 138; SceneGraphRoot::SceneGraphRoot(float w, float h) { // SGLIST_LENGTH 決め打ちかぁ、動的生成にする場合上限決めておいた方がいいのかな + // sg_src = new SceneGraphPtr[SGLIST_LENGTH]; camera = new Camera(w, h); iterator = new SceneGraphIterator; @@ -65,6 +67,7 @@ void SceneGraphRoot::registSceneGraph(SceneGraphPtr sg) { +#if 0 for (int i = 0; i < SGLIST_LENGTH; i++) { if (strcmp(sg->name, sglist_table[i]) == 0) { sg->sgid = i; @@ -75,6 +78,7 @@ fprintf(stderr, "error: (%s:%3d) Can't find Scene \"%s\"\n", __FUNCTION__, __LINE__, sg->name); +#endif } void @@ -181,6 +185,10 @@ SceneGraphPtr tmp; // size は取れるはず、テスト用に mmap したデータを使う +<<<<<<< local + //int size = 10; +======= +>>>>>>> other /* パース DOM生成 */ //doc = xmlParseFile(xmlfile); //int size = (int)mmap_t.size;