# HG changeset patch # User kazz@kazz187.st.ie.u-ryukyu.ac.jp # Date 1256729297 -32400 # Node ID bdeb424ce649ff225322f9ae022522ab5df0f8e5 # Parent e3e6f6fbbfc43062e6f61b292adf55ac05b0c000 dynamic work diff -r e3e6f6fbbfc4 -r bdeb424ce649 Renderer/Test/dynamic_create.cc --- a/Renderer/Test/dynamic_create.cc Wed Oct 28 19:44:33 2009 +0900 +++ b/Renderer/Test/dynamic_create.cc Wed Oct 28 20:28:17 2009 +0900 @@ -133,7 +133,7 @@ data = tuple+LINDA_HEADER_SIZE; // clientのSerialIDを取得 serial_id = ntohl(*(int *)data); - +// serial_id = *(int *)data; printf("serial id = %d\n", serial_id); // タプルを解放 //psx_del(carg->tid, SERIAL_REGIST_TUPLE_NO); diff -r e3e6f6fbbfc4 -r bdeb424ce649 Renderer/Test/send_linda.cc --- a/Renderer/Test/send_linda.cc Wed Oct 28 19:44:33 2009 +0900 +++ b/Renderer/Test/send_linda.cc Wed Oct 28 20:28:17 2009 +0900 @@ -91,8 +91,10 @@ int seq; seq = psx_in(fd, 65535); - psx_sync_n(); - data = (char *)psx_reply(seq); + do { + psx_sync_n(); + data = (char *)psx_reply(seq); + } while (data == 0); serial = atoi(data + LINDA_HEADER_SIZE); psx_free(data); @@ -146,25 +148,27 @@ SceneGraphPtr sgp; SceneGraphPtr root; - root = sgr->createSceneGraph(); + + root = sgroot->createSceneGraph(); root->set_move_collision(root_move, root_collision); addr = file_map(xml, &size); - sgp = sgr->createSceneGraph(); - sgroot->createFromXMLmemory(sgroot->tmanager, sgp, xml, size); + sgp = sgroot->createSceneGraph(); + sgroot->createFromXMLmemory(sgroot->tmanager, sgp, (char *)addr, size); sgp->set_move_collision(move, collision); root->addChild(sgp); - tspace = open_linda_java(linda, 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); - - int client_id = htonl(serial); - send_xml(tspace, LISTEN_PORT, (void *)client_id, sizeof(int)); + send_xml(tspace, xml_id, addr, size); - sgr->setSceneData(root); + int client_id = htonl(serial); + printf("serial id = %d\n", client_id); + send_xml(tspace, LISTEN_PORT, (unsigned char *)&client_id, sizeof(int)); + + sgroot->setSceneData(root); return sgr; }