Mercurial > hg > Game > Cerium
diff Renderer/Engine/SceneGraphRoot.cc @ 653:7a311860a76e draft
remove global variable "sgroot" , add SgChange.{cc, h} SgMain.cc SgRootChange.{cc, h}
author | hiroki@henri.cr.ie.u-ryukyu.ac.jp |
---|---|
date | Wed, 25 Nov 2009 21:56:14 +0900 |
parents | 1bfa45a08fa7 |
children | 24054155368c 18d31d18a6b2 |
line wrap: on
line diff
--- a/Renderer/Engine/SceneGraphRoot.cc Sat Nov 21 11:20:29 2009 +0900 +++ b/Renderer/Engine/SceneGraphRoot.cc Wed Nov 25 21:56:14 2009 +0900 @@ -24,7 +24,7 @@ // sg_src = (SceneGraphPtr*) malloc(sizeof(SceneGraphPtr)*SGLIST_LENGTH); - camera = new Camera(w, h); + camera = new Camera(w, h, this); light = new Light(w, h); iterator = new SceneGraphIterator; controller = create_controller(); @@ -183,6 +183,9 @@ /* ユーザーにはオリジナルの clone を返す */ p = src->clone(); + /* move, collision に sgroot を渡したいのでここで sgroot を渡しておく*/ + p->sgroot = (void *)this; + addNext(p); return p; @@ -207,6 +210,9 @@ /* ユーザーにはオリジナルの clone を返す */ p = src->clone(); + + /* move, collision に sgroot を渡したいのでここで sgroot を渡しておく*/ + p->sgroot = (void *)this; addNext(p); @@ -240,6 +246,9 @@ { SceneGraphPtr p = new SceneGraph; + /* move, collision に sgroot を渡したいのでここで sgroot を渡しておく*/ + p->sgroot = (void *)this; + addNext(p); p->flag_drawable = 0; @@ -392,9 +401,8 @@ list->move_execute(screen_w, screen_h); list->collision_check(screen_w, screen_h, list); - list->frame++; + list->frame++; list = list->next; - } if(sg_exec_tree != NULL) {