Mercurial > hg > Members > kono > Cerium
changeset 556:7f595548daf9
get linda server addr from command line arg
author | kazz@e065701.local |
---|---|
date | Fri, 23 Oct 2009 14:13:03 +0900 |
parents | efbb6b527fa1 |
children | e3f3cfa8794f |
files | TaskManager/Test/test_render/Application/dynamic_create.cc TaskManager/Test/test_render/Application/send_linda.cc TaskManager/Test/test_render/main.cc TaskManager/Test/test_render/viewer.cc TaskManager/Test/test_render/viewer.h |
diffstat | 5 files changed, 18 insertions(+), 15 deletions(-) [+] |
line wrap: on
line diff
--- a/TaskManager/Test/test_render/Application/dynamic_create.cc Fri Oct 23 00:20:34 2009 +0900 +++ b/TaskManager/Test/test_render/Application/dynamic_create.cc Fri Oct 23 14:13:03 2009 +0900 @@ -150,7 +150,7 @@ SceneGraphPtr object; //sgroot->createFromXMLmemory(sgroot->tmanager, "xml_file/universe.xml"); - const char *objname = sgroot->createFromXMLmemory(sgroot->tmanager, (char *)data, len); + const char *objname = sgroot->createFromXMLmemory(manager, (char *)data, len); object = sgroot->createSceneGraph(objname); object->id = serial_id; object->set_move_collision(moon_move, moon_collision); @@ -217,12 +217,12 @@ } void -linda_init(TaskManager *manager, client_t *clist, SceneGraphPtr node) +linda_init(TaskManager *manager, client_t *clist, SceneGraphPtr node, const char *linda_serv) { init_linda(); callback_arg *carg = (callback_arg *)manager->allocate(sizeof(callback_arg)); - carg->tid = open_linda_java("localhost", PORT); + carg->tid = open_linda_java((char *)linda_serv, PORT); carg->read_id = SERIAL_REGIST_TUPLE_NO; carg->node = node; carg->manager = manager; @@ -231,7 +231,7 @@ } void -dynamic_init(TaskManager *manager) +dynamic_init(TaskManager *manager, const char *linda_serv) { //SceneGraphPtr earth; sgroot->tmanager = manager; @@ -245,7 +245,7 @@ parent->set_move_collision(earth_move, earth_collision); parent->xyz[0] += 300; - linda_init(manager, clist, parent); + linda_init(manager, clist, parent, linda_serv); // SceneGraphRoot に、使用する SceneGraph を設定する // このとき、ユーザーが記述した SceneGraph の root を渡す。
--- a/TaskManager/Test/test_render/Application/send_linda.cc Fri Oct 23 00:20:34 2009 +0900 +++ b/TaskManager/Test/test_render/Application/send_linda.cc Fri Oct 23 14:13:03 2009 +0900 @@ -137,7 +137,7 @@ */ void -send_linda_init(TaskManager *manager, const char *xml) +send_linda_init(TaskManager *manager, const char *xml, const char *linda_serv) { void *addr; int size;
--- a/TaskManager/Test/test_render/main.cc Fri Oct 23 00:20:34 2009 +0900 +++ b/TaskManager/Test/test_render/main.cc Fri Oct 23 14:13:03 2009 +0900 @@ -35,6 +35,7 @@ int height = 480; int spenum = 1; const char *xml = "xml_file/cube.xml"; + const char *linda_serv = "localhost"; video_type vtype = VTYPE_SDL; for(int i = 1; argv[i]; ++i) @@ -51,6 +52,9 @@ if (strcmp(argv[i], "-xml") == 0) { xml = argv[++i]; } + if (strcmp(argv[i], "-linda") == 0) { + linda_serv = argv[++i]; + } if (strcmp(argv[i], "-sg") == 0) { sg_number = (atoi)(argv[++i]); } @@ -77,7 +81,7 @@ } screen->video_init(manager); - screen->run_init(manager, xml, sg_number); + screen->run_init(manager, xml, sg_number, linda_serv); manager->set_TMend(TMend);
--- a/TaskManager/Test/test_render/viewer.cc Fri Oct 23 00:20:34 2009 +0900 +++ b/TaskManager/Test/test_render/viewer.cc Fri Oct 23 14:13:03 2009 +0900 @@ -107,11 +107,11 @@ extern void boss1_init(TaskManager *manager, int w, int h); extern void init_gaplant(TaskManager *manager, int w, int h); extern void vacuum_init2(TaskManager *manager, int w, int h); -extern void dynamic_init(TaskManager *manager); -extern void send_linda_init(TaskManager *manager, const char *xml); +extern void dynamic_init(TaskManager *manager, const char *linda_serv); +extern void send_linda_init(TaskManager *manager, const char *xml, const char *linda_serv); void -Viewer::run_init(TaskManager *manager, const char *xml, int sg_number) +Viewer::run_init(TaskManager *manager, const char *xml, int sg_number, const char *linda_serv) { this->manager = manager; @@ -176,11 +176,10 @@ chain_old_init(manager, this->width, this->height); break; case 18: - - dynamic_init(manager); - break; + dynamic_init(manager, linda_serv); + break; case 19: - send_linda_init(manager, xml); + send_linda_init(manager, xml, linda_serv); break; default: node_init(manager);
--- a/TaskManager/Test/test_render/viewer.h Fri Oct 23 00:20:34 2009 +0900 +++ b/TaskManager/Test/test_render/viewer.h Fri Oct 23 14:13:03 2009 +0900 @@ -45,7 +45,7 @@ virtual void swap_buffers(); virtual void clean_pixels() {} - virtual void run_init(TaskManager *manager, const char *xml, int sg_number); + virtual void run_init(TaskManager *manager, const char *xml, int sg_number, const char *linda_serv); virtual void run_loop(HTaskPtr task_next); virtual void run_draw(HTaskPtr task_next); virtual void run_finish();