comparison TaskManager/Test/test_render/SceneGraphRoot.cpp @ 215:7ca6a2ef5be9

fix SceneGraph Constructor, Destructor
author gongo@gendarme.local
date Sun, 01 Feb 2009 22:14:44 +0900
parents 159519cdca1f
children 0f1ff7b06157
comparison
equal deleted inserted replaced
214:5bd1425fb561 215:7ca6a2ef5be9
43 void 43 void
44 SceneGraphRoot::registSceneGraph(SceneGraphPtr sg) 44 SceneGraphRoot::registSceneGraph(SceneGraphPtr sg)
45 { 45 {
46 for (int i = 0; i < SGLIST_LENGTH; i++) { 46 for (int i = 0; i < SGLIST_LENGTH; i++) {
47 if (strcmp(sg->name, sglist_table[i]) == 0) { 47 if (strcmp(sg->name, sglist_table[i]) == 0) {
48 sg->sgid = i;
48 sg_src[i] = sg; 49 sg_src[i] = sg;
49 return; 50 return;
50 } 51 }
51 } 52 }
52 53
114 /* オリジナルの SceneGraph */ 115 /* オリジナルの SceneGraph */
115 src = sg_src[id]; 116 src = sg_src[id];
116 117
117 /* ユーザーにはオリジナルの clone を返す */ 118 /* ユーザーにはオリジナルの clone を返す */
118 p = src->clone(); 119 p = src->clone();
119 p->sgid = id;
120 120
121 addNext(p); 121 addNext(p);
122 122
123 return p; 123 return p;
124 } 124 }
129 */ 129 */
130 SceneGraphPtr 130 SceneGraphPtr
131 SceneGraphRoot::createSceneGraph(void) 131 SceneGraphRoot::createSceneGraph(void)
132 { 132 {
133 SceneGraphPtr p = new SceneGraph; 133 SceneGraphPtr p = new SceneGraph;
134
134 addNext(p); 135 addNext(p);
135 p->flag_drawable = 0; 136 p->flag_drawable = 0;
137
136 return p; 138 return p;
137 } 139 }
138 140
139 void 141 void
140 SceneGraphRoot::allExecute(int screen_w, int screen_h) 142 SceneGraphRoot::allExecute(int screen_w, int screen_h)
141 { 143 {
142 SceneGraphPtr top = sg_exec_list; 144 SceneGraphPtr top = sg_exec_list;
143 SceneGraphPtr t = top; /* top = Camera (090128 現在) */ 145 SceneGraphPtr t = top; /* top = Camera (090128 現在) */
144 CameraPtr camera = (CameraPtr)t; 146 CameraPtr camera = (CameraPtr)t;
145 147
146 //camera->move_execute(screen_w, screen_h); 148 camera->move_execute(screen_w, screen_h);
147 camera->update(screen_w, screen_h); 149 camera->update(screen_w, screen_h);
148 150
149 t = camera->children; 151 t = camera->children;
150 152
151 while (t) { 153 while (t) {