Mercurial > hg > Members > kono > Cerium
changeset 587:bdeb424ce649
dynamic work
author | kazz@kazz187.st.ie.u-ryukyu.ac.jp |
---|---|
date | Wed, 28 Oct 2009 20:28:17 +0900 |
parents | e3e6f6fbbfc4 |
children | d5d8e1cf1899 |
files | Renderer/Test/dynamic_create.cc Renderer/Test/send_linda.cc |
diffstat | 2 files changed, 16 insertions(+), 12 deletions(-) [+] |
line wrap: on
line diff
--- 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);
--- 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; }