Mercurial > hg > Game > Cerium
comparison Renderer/Test/dynamic_create.cc @ 580:ec9dd24c2dc8 draft
add all object in file in dynamic_create
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Sat, 24 Oct 2009 16:32:29 +0900 |
parents | d2183b72251f |
children | c34956de8276 |
comparison
equal
deleted
inserted
replaced
579:d2183b72251f | 580:ec9dd24c2dc8 |
---|---|
46 } | 46 } |
47 | 47 |
48 void | 48 void |
49 client_list_update(TaskManager *manager, client_t *clist, int id, SceneGraphPtr sgp) | 49 client_list_update(TaskManager *manager, client_t *clist, int id, SceneGraphPtr sgp) |
50 { | 50 { |
51 //client_t *c; | |
52 // for (c = clist->next; c != clist; c = c->next) { | |
53 // if (c->id == id) { | |
54 // c->sgp = sgp; | |
55 // return; | |
56 // } | |
57 // } | |
58 | |
59 // c->next = (client_t *)manager->allocate(sizeof(client_t)); | |
60 // c->next->id = id; | |
61 // c->next->sgp = sgp; | |
62 // c->next->next = clist; | |
63 } | 51 } |
64 | 52 |
65 void | 53 void |
66 client_list_delete(TaskManager *manager, client_t *clist, int id) | 54 client_list_delete(TaskManager *manager, client_t *clist, int id) |
67 { | 55 { |
107 } | 95 } |
108 | 96 |
109 SceneGraphPtr | 97 SceneGraphPtr |
110 create_sg(TaskManager *manager, SceneGraphPtr node, unsigned char *data, int len, int serial_id) | 98 create_sg(TaskManager *manager, SceneGraphPtr node, unsigned char *data, int len, int serial_id) |
111 { | 99 { |
112 SceneGraphPtr object; | 100 SceneGraphPtr child = sgroot->createSceneGraph(); |
113 | 101 node->addChild(child); |
114 sgroot->createFromXMLmemory(sgroot->tmanager, (char *)data, len); | 102 child->set_move_collision(moon_move, moon_collision); |
115 object = sgroot->createSceneGraph(sgroot->getLast()); | 103 // 読み込んだオブジェクトは、すべて、child の child になる。 |
116 object->id = serial_id; | 104 sgroot->createFromXMLmemory(sgroot->tmanager, child, (char *)data, len); |
117 object->set_move_collision(moon_move, moon_collision); | 105 return node; |
118 node->addChild(object); | 106 } |
119 | 107 |
120 return object; | |
121 } | |
122 | |
123 // void | |
124 // del_callback(unsigned char *data, void *arg) | |
125 // { | |
126 // free(data); | |
127 // } | |
128 | |
129 // void | |
130 // psx_del(int t, int id) | |
131 // { | |
132 // psx_callback_in(t, id, del_callback, NULL); | |
133 // } | |
134 | 108 |
135 static void | 109 static void |
136 callback_get_xml(unsigned char *xml_tuple, void *arg) { | 110 callback_get_xml(unsigned char *xml_tuple, void *arg) { |
137 int xml_len = psx_get_datalength(xml_tuple); | 111 int xml_len = psx_get_datalength(xml_tuple); |
138 callback_arg *carg = (callback_arg *)arg; | 112 callback_arg *carg = (callback_arg *)arg; |