Mercurial > hg > Game > Cerium
comparison Renderer/Engine/SceneGraphRoot.cc @ 1143:786e800abfb4 draft
minor fix
author | Yutaka_Kinjyo |
---|---|
date | Sat, 19 Feb 2011 01:59:14 +0900 |
parents | f326494ffdc7 |
children | b8adf4e95e96 |
comparison
equal
deleted
inserted
replaced
1142:801d57ae1e29 | 1143:786e800abfb4 |
---|---|
16 | 16 |
17 static TextureHash sgid_hash; | 17 static TextureHash sgid_hash; |
18 | 18 |
19 SceneGraphRoot *sgroot; | 19 SceneGraphRoot *sgroot; |
20 | 20 |
21 SceneGraphRoot::SceneGraphRoot(float w, float h) | 21 SceneGraphRoot::SceneGraphRoot(float w, float h, TaskManager *manager) |
22 { | 22 { |
23 | |
24 sgroot = this; | |
25 sgroot->tmanager = manager; | |
26 | |
23 // SGLIST_LENGTH 決め打ちかぁ、動的生成にする場合上限決めておいた方がいいのかな | 27 // SGLIST_LENGTH 決め打ちかぁ、動的生成にする場合上限決めておいた方がいいのかな |
24 // | 28 // |
25 sg_src = (SceneGraphPtr*) malloc(sizeof(SceneGraphPtr)*SGLIST_LENGTH); | 29 sg_src = (SceneGraphPtr*) malloc(sizeof(SceneGraphPtr)*SGLIST_LENGTH); |
26 | 30 |
27 camera = new Camera(w, h, this); | 31 camera = new Camera(w, h, this, sgroot->tmanager); |
28 | 32 |
29 iterator = new SceneGraphIterator; | 33 iterator = new SceneGraphIterator; |
30 controller = create_controller(); | 34 controller = create_controller(); |
31 | 35 |
32 sg_exec_tree = NULL; | 36 sg_exec_tree = NULL; |
33 sg_draw_tree = NULL; | 37 sg_draw_tree = NULL; |
34 sg_available_list = NULL; | 38 sg_available_list = NULL; |
35 sg_remove_list = NULL; | 39 sg_remove_list = NULL; |
36 | 40 |
37 sgroot = this; | |
38 | 41 |
39 screen_w = (int)w; | 42 screen_w = (int)w; |
40 screen_h = (int)h; | 43 screen_h = (int)h; |
41 int light_num = 4; | 44 int light_num = 4; |
42 light_sysswitch = 0; | 45 light_sysswitch = 0; |
43 | 46 |
44 for (int i = 0; i < light_num; i++) { | 47 for (int i = 0; i < light_num; i++) { |
45 light[i] = new SceneGraph; | 48 light[i] = new SceneGraph(sgroot->tmanager); |
46 light[i]->xyz[0] = 0; | 49 light[i]->xyz[0] = 0; |
47 light[i]->xyz[1] = 0; | 50 light[i]->xyz[1] = 0; |
48 light[i]->xyz[2] = 0; | 51 light[i]->xyz[2] = 0; |
49 | 52 |
50 light_switch[i] = 0; | 53 light_switch[i] = 0; |
268 * いずれ、Transform3D 的なものに回す予定 | 271 * いずれ、Transform3D 的なものに回す予定 |
269 */ | 272 */ |
270 SceneGraphPtr | 273 SceneGraphPtr |
271 SceneGraphRoot::createSceneGraph() | 274 SceneGraphRoot::createSceneGraph() |
272 { | 275 { |
273 SceneGraphPtr p = new SceneGraph; | 276 SceneGraphPtr p = new SceneGraph(sgroot->tmanager); |
274 | 277 |
275 /* move, collision に sgroot を渡したいのでここで sgroot を渡しておく*/ | 278 /* move, collision に sgroot を渡したいのでここで sgroot を渡しておく*/ |
276 p->sgroot = (void *)this; | 279 p->sgroot = (void *)this; |
277 | 280 |
278 addNext(p); | 281 addNext(p); |