Mercurial > hg > Members > kono > Cerium
changeset 577:e3f3cfa8794f
merge
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Fri, 23 Oct 2009 17:18:41 +0900 |
parents | cc989924f469 (current diff) 7f595548daf9 (diff) |
children | a068627a0bc6 |
files | Renderer/Engine/lindaapi.h Renderer/Test/dynamic_create.cc Renderer/Test/send_linda.cc TaskManager/Test/test_render/Application/dynamic_create.cc TaskManager/Test/test_render/Application/send_linda.cc TaskManager/Test/test_render/viewer.cc TaskManager/Test/test_render/viewer.h |
diffstat | 3 files changed, 21 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/Renderer/Engine/lindaapi.h Fri Oct 23 17:02:47 2009 +0900 +++ b/Renderer/Engine/lindaapi.h Fri Oct 23 17:18:41 2009 +0900 @@ -69,6 +69,7 @@ extern unsigned char *psx_reply(unsigned int seq); extern void psx_sync_n(void); extern unsigned int psx_get_datalength(unsigned char *); +extern unsigned char *psx_get_data(unsigned char *); extern unsigned int psx_get_seq(unsigned char *); extern unsigned short psx_get_id(unsigned char *); extern unsigned char psx_get_mode(unsigned char *); @@ -79,7 +80,6 @@ extern int psx_ld(unsigned int tspace_id, unsigned int id, char mode, void(*callback)(unsigned char *,void *),void * obj); -#define psx_get_data(tuple) ((tuple)+LINDA_HEADER_SIZE) #define psx_in(tid, id) psx_ld(tid, id, 'i', NULL, NULL) #define psx_rd(tid, id) psx_ld(tid, id, 'r', NULL, NULL) #define psx_ck(tid, id) psx_ld(tid, id, 'c', NULL, NULL)
--- a/Renderer/Test/dynamic_create.cc Fri Oct 23 17:02:47 2009 +0900 +++ b/Renderer/Test/dynamic_create.cc Fri Oct 23 17:18:41 2009 +0900 @@ -177,13 +177,15 @@ psx_callback_in(carg->tid, carg->read_id, callbacker, arg); } +static char *linda = "localhost"; + void linda_init(TaskManager *manager, client_t *clist, SceneGraphPtr node) { 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, PORT); carg->read_id = SERIAL_REGIST_TUPLE_NO; carg->node = node; carg->manager = manager; @@ -229,6 +231,14 @@ { task_initialize(); manager->set_TMend(TMend); + + for(int i=0;i<argc;i++) { + if (strcmp(argv[i],"-linda") == 0 && i+1<=argc) { + linda = argv[i+1]; + } + } + + return init(manager, argc, argv); }
--- a/Renderer/Test/send_linda.cc Fri Oct 23 17:02:47 2009 +0900 +++ b/Renderer/Test/send_linda.cc Fri Oct 23 17:18:41 2009 +0900 @@ -84,11 +84,6 @@ } -void -linda_init(char *addr, int *size) -{ - -} int get_serial_id(int fd) { char *data; @@ -138,6 +133,7 @@ */ static char *xml; +static char *linda = HOSTNAME; MainLoopPtr send_linda::init(Viewer *sgroot, int screen_w, int screen_h) @@ -161,9 +157,8 @@ root->addChild(sgp); - init_linda(); addr = file_map(xml, &size); - tspace = open_linda_java(HOSTNAME, PORT_NUM); + tspace = open_linda_java(linda, PORT_NUM); serial = get_serial_id(tspace); xml_id = serial * 10; send_xml(tspace, xml_id, addr, size); @@ -196,9 +191,16 @@ for(int i=0;i<argc;i++) { if (strcmp(argv[i],"-xml") == 0 && i+1<=argc) { xml = argv[i+1]; + } else if (strcmp(argv[i],"-linda") == 0 && i+1<=argc) { + linda = argv[i+1]; } } + if (xml==0) { + printf("-xml xml-file is required\n"); + exit(0); + } + return init(manager, argc, argv); }