Mercurial > hg > Members > kono > Cerium
comparison Renderer/Test/gaplant_action.cc @ 656:d0b8860c17f8
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 | 306c9a7717c3 |
children |
comparison
equal
deleted
inserted
replaced
646:ffcc25c7c566 | 656:d0b8860c17f8 |
---|---|
47 } | 47 } |
48 node->xyz[1] -= 5;*/ | 48 node->xyz[1] -= 5;*/ |
49 } | 49 } |
50 | 50 |
51 void | 51 void |
52 gaplant_move(SceneGraphPtr node, int w, int h) | 52 gaplant_move(SceneGraphPtr node, void *sgroot_, int w, int h) |
53 { | 53 { |
54 SceneGraphRoot *sgroot = (SceneGraphRoot *)sgroot_; | |
54 Pad *pad = sgroot->getController(); | 55 Pad *pad = sgroot->getController(); |
55 | 56 |
56 if (pad->right.isHold() || pad->left.isHold() || pad->down.isHold() || pad->up.isHold()) { | 57 if (pad->right.isHold() || pad->left.isHold() || pad->down.isHold() || pad->up.isHold()) { |
57 if (pad->right.isHold()) { | 58 if (pad->right.isHold()) { |
58 move_right(node); | 59 move_right(node); |
73 } | 74 } |
74 } | 75 } |
75 } | 76 } |
76 | 77 |
77 void | 78 void |
78 gaplant_coll(SceneGraphPtr node, int w, int h, SceneGraphPtr tree) | 79 gaplant_coll(SceneGraphPtr node, void *sgroot_, int w, int h, SceneGraphPtr tree) |
79 { | 80 { |
81 SceneGraphRoot *sgroot = (SceneGraphRoot *)sgroot_; | |
80 SceneGraphIteratorPtr it = sgroot->getIterator(tree); | 82 SceneGraphIteratorPtr it = sgroot->getIterator(tree); |
81 //static int damage = 0; | 83 //static int damage = 0; |
82 | 84 |
83 for (; it->hasNext(sgroot->getSgid("Ball"));) { | 85 for (; it->hasNext(sgroot->getSgid("Ball"));) { |
84 it->next(sgroot->getSgid("Ball")); | 86 it->next(sgroot->getSgid("Ball")); |