Mercurial > hg > Members > kono > Cerium
comparison Renderer/Test/chain_old.cc @ 671:f42b303044f7
fix several Renderer/Test with (void*)sgroot.
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Sat, 05 Dec 2009 17:26:58 +0900 |
parents | 987380738a50 |
children | 4dc02d3e98bb |
comparison
equal
deleted
inserted
replaced
670:9eefc1b24c87 | 671:f42b303044f7 |
---|---|
40 sg->xyz[2] = 0.0f; | 40 sg->xyz[2] = 0.0f; |
41 } | 41 } |
42 | 42 |
43 | 43 |
44 static void | 44 static void |
45 chain_old_move_ope(SceneGraphPtr node, int screen_w, int screen_h) | 45 chain_old_move_ope(SceneGraphPtr node, void *sgroot_, int screen_w, int screen_h) |
46 { | 46 { |
47 SceneGraphRoot *sgroot = (SceneGraphRoot *)sgroot_; | |
47 Pad *pad = sgroot->getController(); | 48 Pad *pad = sgroot->getController(); |
48 | 49 |
49 if (pad->start.isHold()) { | 50 if (pad->start.isHold()) { |
50 cv[CHAIN_LEN-1].can_move = FALSE; | 51 cv[CHAIN_LEN-1].can_move = FALSE; |
51 if (pad->left.isHold()) { | 52 if (pad->left.isHold()) { |
63 cv[CHAIN_LEN-1].can_move = TRUE; | 64 cv[CHAIN_LEN-1].can_move = TRUE; |
64 } | 65 } |
65 } | 66 } |
66 | 67 |
67 void | 68 void |
68 chain_old_move(SceneGraphPtr sg, int w, int h) | 69 chain_old_move(SceneGraphPtr sg, void *sgroot_, int w, int h) |
69 { | 70 { |
71 | |
70 int id = sg->id; | 72 int id = sg->id; |
71 if(id == 0) { | 73 if(id == 0) { |
72 for(int cnt = 0; cnt < 600; cnt++) { | 74 for(int cnt = 0; cnt < 600; cnt++) { |
73 for(int i = 0; i < CHAIN_LEN; i++) { | 75 for(int i = 0; i < CHAIN_LEN; i++) { |
74 if(cv[i].can_move) { | 76 if(cv[i].can_move) { |
119 sg->angle[2-(id%2)*2] | 121 sg->angle[2-(id%2)*2] |
120 = 90 + atan((cv[p].next_y - cv[n].next_y) / (cv[p].next_x - cv[n].next_x)) * 180 / M_PI; | 122 = 90 + atan((cv[p].next_y - cv[n].next_y) / (cv[p].next_x - cv[n].next_x)) * 180 / M_PI; |
121 } | 123 } |
122 | 124 |
123 void | 125 void |
124 chain_old_collision(SceneGraphPtr sg, int w, int h, SceneGraphPtr osg) | 126 chain_old_collision(SceneGraphPtr sg, void *sgroot_, int w, int h, SceneGraphPtr osg) |
125 { | 127 { |
126 | 128 |
127 } | 129 } |
128 | 130 |
129 MainLoopPtr | 131 MainLoopPtr |
157 | 159 |
158 sgroot->setSceneData(root_old_chain); | 160 sgroot->setSceneData(root_old_chain); |
159 return sgroot; | 161 return sgroot; |
160 } | 162 } |
161 | 163 |
164 MainLoopPtr | |
165 Chain::init_only_sg(SgChange *sgchange, int w, int h) | |
166 { | |
167 return sgchange; | |
168 } | |
169 | |
170 | |
162 extern Application * | 171 extern Application * |
163 application() { | 172 application() { |
164 return new Chain(); | 173 return new Chain(); |
165 } | 174 } |
166 | 175 |