Mercurial > hg > Game > Cerium
comparison Renderer/Test/game_over.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 | 338ad9c856fc |
children |
comparison
equal
deleted
inserted
replaced
646:9f9390b45f78 | 653:7a311860a76e |
---|---|
1 #include "SceneGraphRoot.h" | 1 #include "SceneGraphRoot.h" |
2 #include "vacuum.h" | 2 #include "vacuum.h" |
3 | 3 |
4 | 4 |
5 void | 5 void |
6 gameover_scene(int w,int h,SceneGraphPtr node) | 6 gameover_scene(int w,int h,SceneGraphPtr node, SceneGraphRoot *sgroot) |
7 { | 7 { |
8 | |
9 SceneGraphPtr over; | 8 SceneGraphPtr over; |
10 | 9 |
11 over = sgroot->createSceneGraph("GAMEOVER"); | 10 over = sgroot->createSceneGraph("GAMEOVER"); |
12 over->xyz[0] = w/2; | 11 over->xyz[0] = w/2; |
13 over->xyz[1] = h/2; | 12 over->xyz[1] = h/2; |
14 over->set_move_collision(gameover_idle,gameover_collision); | 13 over->set_move_collision(gameover_idle,gameover_collision); |
15 node->addBrother(over); | 14 node->addBrother(over); |
16 } | 15 } |
17 | 16 |
18 void | 17 void |
19 gameover_idle(SceneGraphPtr node,int screen_w,int screen_h) | 18 gameover_idle(SceneGraphPtr node, void *sgroot_, int screen_w,int screen_h) |
20 { | 19 { |
21 } | 20 } |
22 | 21 |
23 void | 22 void |
24 gameover_collision(SceneGraphPtr node,int screen_w,int screen_h,SceneGraphPtr tree) | 23 gameover_collision(SceneGraphPtr node, void *sgroot_, int screen_w,int screen_h,SceneGraphPtr tree) |
25 { | 24 { |
26 | 25 SceneGraphRoot *sgroot = (SceneGraphRoot *)sgroot_; |
27 Pad *pad = sgroot->getController(); | 26 Pad *pad = sgroot->getController(); |
28 | 27 |
29 if(pad->start.isPush()) { | 28 if(pad->start.isPush()) { |
30 | 29 |
31 SceneGraphPtr title; | 30 SceneGraphPtr title; |