Mercurial > hg > Members > kono > Cerium
annotate TaskManager/Test/test_render/viewer.cpp @ 213:159519cdca1f
add SceneGraph "3D Super-Dandy"
author | gongo@localhost.localdomain |
---|---|
date | Sun, 01 Feb 2009 20:45:07 +0900 |
parents | fe2cc32cd94d |
children | 897aeb144569 |
rev | line source |
---|---|
140 | 1 #include <SDL.h> |
109 | 2 #include "viewer.h" |
120 | 3 #include "viewer_types.h" |
137
6cf991f28c6c
SceneGraphPack の代わりに、今は SceneGraph をそのまま使う様に設定。
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
133
diff
changeset
|
4 #include "SceneGraph.h" |
195 | 5 #include "SceneGraphRoot.h" |
137
6cf991f28c6c
SceneGraphPack の代わりに、今は SceneGraph をそのまま使う様に設定。
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
133
diff
changeset
|
6 #include "scene_graph_pack.h" |
109 | 7 #include "sys.h" |
8 #include "Func.h" | |
9 #include "error.h" | |
10 #include "TaskManager.h" | |
140 | 11 #include "Keyboard.h" |
12 #include "Joystick.h" | |
212 | 13 #include <wchar.h> |
14 | |
109 | 15 |
16 extern void post2runLoop(void *); | |
17 extern void post2runDraw(void *); | |
18 | |
19 /* measure for FPS (Frame Per Second) */ | |
20 int start_time; | |
21 int this_time; | |
22 int frames; | |
23 | |
198
57921c8d21c5
rename snake_bg to panel
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
195
diff
changeset
|
24 SceneGraphRootPtr sgroot; |
109 | 25 |
176 | 26 /* Data Pack sent to Other CPUs (ex. SPE) */ |
109 | 27 SceneGraphPack *sgpack; |
28 PolygonPack *ppack; | |
29 SpanPackPtr spackList; | |
30 SpanPackPtr *spackList_ptr; | |
210 | 31 |
109 | 32 int spackList_length; |
33 int spackList_length_align; | |
34 | |
140 | 35 /** |
176 | 36 * |
37 */ | |
38 | |
39 /** | |
140 | 40 * Joystick があればそれを使い、 |
41 * 無ければキーボードを返す | |
42 */ | |
43 static Pad* | |
44 create_controller(void) | |
45 { | |
46 if (SDL_NumJoysticks()) { | |
47 SDL_Joystick *joy = SDL_JoystickOpen(0); | |
48 if (!joy) { | |
194 | 49 printf("%s: failed to open joystick", __FUNCTION__); |
50 printf("Instead use Keyboard\n"); | |
140 | 51 return new Keyboard; |
52 } else { | |
53 printf("Use Joystick\n"); | |
54 return new Joystick(joy); | |
55 } | |
56 } else { | |
57 printf("Use Keyboard\n"); | |
58 return new Keyboard; | |
59 } | |
60 } | |
61 | |
62 | |
109 | 63 Viewer::Viewer(int b, int w, int h, int _num) |
64 { | |
65 bpp = b; | |
66 width = w; | |
67 height = h; | |
68 spe_num = _num; | |
69 } | |
70 | |
71 int | |
72 Viewer::get_ticks() | |
73 { | |
74 int time; | |
75 time = SDL_GetTicks(); | |
76 return time; | |
77 } | |
78 | |
79 bool | |
80 Viewer::quit_check() | |
81 { | |
82 SDL_Event event; | |
83 | |
84 while(SDL_PollEvent(&event)) { | |
85 if (event.type==SDL_QUIT) { | |
86 return true; | |
87 } | |
88 } | |
89 | |
90 Uint8 *keys=SDL_GetKeyState(NULL); | |
91 | |
92 if (keys[SDLK_q] == SDL_PRESSED) { | |
93 return true; | |
94 } | |
95 | |
96 return false; | |
97 } | |
98 | |
99 void | |
100 Viewer::quit() | |
101 { | |
102 SDL_Quit(); | |
103 } | |
104 | |
105 void | |
106 Viewer::swap_buffers() | |
107 { | |
108 SDL_GL_SwapBuffers(); | |
109 } | |
110 | |
137
6cf991f28c6c
SceneGraphPack の代わりに、今は SceneGraph をそのまま使う様に設定。
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
133
diff
changeset
|
111 extern void node_init(void); |
144 | 112 extern void create_cube_split(int); |
198
57921c8d21c5
rename snake_bg to panel
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
195
diff
changeset
|
113 extern void panel_init(int); |
199
eb20274baa7c
add SceneGraph(ieshoot), add SystemSceneGraph(Camera)
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
198
diff
changeset
|
114 extern void universe_init(void); |
eb20274baa7c
add SceneGraph(ieshoot), add SystemSceneGraph(Camera)
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
198
diff
changeset
|
115 extern void ieshoot_init(void); |
210 | 116 extern void ball_bound_init(int, int); |
212 | 117 extern void lcube_init(int, int); |
118 extern void direction_init(void); | |
213
159519cdca1f
add SceneGraph "3D Super-Dandy"
gongo@localhost.localdomain
parents:
212
diff
changeset
|
119 extern void init_position(int, int); |
142 | 120 |
109 | 121 void |
180
5cde66c926b4
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
177
diff
changeset
|
122 Viewer::run_init(const char *xml, int sg_number) |
109 | 123 { |
124 HTaskPtr task_next; | |
167
c8b868871dce
DrawSpan で使う Tile の Hash の扱いは class TileHash を生成する事に。
gongo@localhost.localdomain
parents:
158
diff
changeset
|
125 HTaskPtr task_tex; |
109 | 126 |
127 start_time = get_ticks(); | |
128 this_time = 0; | |
129 frames = 0; | |
130 | |
195 | 131 sgroot = new SceneGraphRoot; |
132 //sgroot->createFromXMLFile(xml); | |
140 | 133 |
144 | 134 switch (sg_number) { |
135 case 0: | |
136 case 1: | |
137 create_cube_split(sg_number); | |
138 break; | |
139 case 2: | |
153
c8c8bb4e9e58
画像のサイズテストを加える -sg = [2,3,4]
gongo@charles.cr.ie.u-ryukyu.ac.jp
parents:
150
diff
changeset
|
140 case 3: |
c8c8bb4e9e58
画像のサイズテストを加える -sg = [2,3,4]
gongo@charles.cr.ie.u-ryukyu.ac.jp
parents:
150
diff
changeset
|
141 case 4: |
198
57921c8d21c5
rename snake_bg to panel
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
195
diff
changeset
|
142 panel_init(sg_number); |
144 | 143 break; |
153
c8c8bb4e9e58
画像のサイズテストを加える -sg = [2,3,4]
gongo@charles.cr.ie.u-ryukyu.ac.jp
parents:
150
diff
changeset
|
144 case 5: |
198
57921c8d21c5
rename snake_bg to panel
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
195
diff
changeset
|
145 universe_init(); |
158 | 146 break; |
147 case 6: | |
199
eb20274baa7c
add SceneGraph(ieshoot), add SystemSceneGraph(Camera)
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
198
diff
changeset
|
148 ieshoot_init(); |
144 | 149 break; |
210 | 150 case 7: |
151 ball_bound_init(this->width, this->height); | |
152 break; | |
212 | 153 case 8: |
154 lcube_init(this->width, this->height); | |
155 break; | |
156 case 9: | |
157 direction_init(); | |
158 break; | |
213
159519cdca1f
add SceneGraph "3D Super-Dandy"
gongo@localhost.localdomain
parents:
212
diff
changeset
|
159 case 10: |
159519cdca1f
add SceneGraph "3D Super-Dandy"
gongo@localhost.localdomain
parents:
212
diff
changeset
|
160 init_position(this->width, this->height); |
159519cdca1f
add SceneGraph "3D Super-Dandy"
gongo@localhost.localdomain
parents:
212
diff
changeset
|
161 break; |
144 | 162 default: |
163 node_init(); | |
164 break; | |
165 } | |
142 | 166 |
195 | 167 sgroot->controller = create_controller(); |
109 | 168 |
169 sgpack = (SceneGraphPack*)manager->malloc(sizeof(SceneGraphPack)); | |
170 sgpack->init(); | |
171 ppack = (PolygonPack*)manager->malloc(sizeof(PolygonPack)); | |
172 | |
173 spackList_length = (this->height + split_screen_h - 1) / split_screen_h; | |
174 spackList = (SpanPack*)manager->malloc(sizeof(SpanPack)*spackList_length); | |
175 | |
176 | 176 /** |
177 * SPU に送る address list は 16 バイト倍数でないといけない。 | |
178 * spackList_length*sizeof(SpanPack*) が 16 バイト倍数になるような | |
179 * length_align を求めている。はみ出した部分は使われない | |
180 * (ex) spackList_length が 13 の場合 | |
181 * spackList_length_align = 16; | |
182 * 実際に送るデータは64バイトになるのでOK | |
183 * 14,15,16 の部分は何も入らない。 | |
184 */ | |
109 | 185 spackList_length_align = (spackList_length + 3)&(~3); |
186 | |
187 /* 各 SPU が持つ、SpanPack の address list */ | |
167
c8b868871dce
DrawSpan で使う Tile の Hash の扱いは class TileHash を生成する事に。
gongo@localhost.localdomain
parents:
158
diff
changeset
|
188 spackList_ptr = |
c8b868871dce
DrawSpan で使う Tile の Hash の扱いは class TileHash を生成する事に。
gongo@localhost.localdomain
parents:
158
diff
changeset
|
189 (SpanPack**)manager->malloc(sizeof(SpanPack*)*spackList_length_align); |
109 | 190 |
191 for (int i = 0; i < spackList_length; i++) { | |
192 spackList_ptr[i] = &spackList[i]; | |
193 } | |
194 | |
126
7635f223fc7d
fix RGBA mask (bgr -> rgba)
gongo@charles.cr.ie.u-ryukyu.ac.jp
parents:
123
diff
changeset
|
195 for (int i = 1; i <= spackList_length; i++) { |
7635f223fc7d
fix RGBA mask (bgr -> rgba)
gongo@charles.cr.ie.u-ryukyu.ac.jp
parents:
123
diff
changeset
|
196 spackList[i-1].init(i*split_screen_h); |
7635f223fc7d
fix RGBA mask (bgr -> rgba)
gongo@charles.cr.ie.u-ryukyu.ac.jp
parents:
123
diff
changeset
|
197 } |
7635f223fc7d
fix RGBA mask (bgr -> rgba)
gongo@charles.cr.ie.u-ryukyu.ac.jp
parents:
123
diff
changeset
|
198 |
109 | 199 task_next = manager->create_task(TASK_DUMMY); |
200 task_next->set_post(&post2runLoop, NULL); | |
201 | |
137
6cf991f28c6c
SceneGraphPack の代わりに、今は SceneGraph をそのまま使う様に設定。
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
133
diff
changeset
|
202 #if 0 |
6cf991f28c6c
SceneGraphPack の代わりに、今は SceneGraph をそのまま使う様に設定。
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
133
diff
changeset
|
203 // 諸事情で、今は SceneGraphPack を作らずに |
6cf991f28c6c
SceneGraphPack の代わりに、今は SceneGraph をそのまま使う様に設定。
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
133
diff
changeset
|
204 // そのまま SceneGraph でやっています |
6cf991f28c6c
SceneGraphPack の代わりに、今は SceneGraph をそのまま使う様に設定。
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
133
diff
changeset
|
205 HTaskPtr task_sgp; |
109 | 206 task_sgp = manager->create_task(TASK_CREATE_SGP); |
137
6cf991f28c6c
SceneGraphPack の代わりに、今は SceneGraph をそのまま使う様に設定。
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
133
diff
changeset
|
207 task_sgp->add_param((uint32)scene_graph); |
109 | 208 task_sgp->add_param((uint32)sgpack); |
209 task_next->wait_for(task_sgp); | |
210 task_sgp->spawn(); | |
137
6cf991f28c6c
SceneGraphPack の代わりに、今は SceneGraph をそのまま使う様に設定。
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
133
diff
changeset
|
211 #endif |
109 | 212 |
167
c8b868871dce
DrawSpan で使う Tile の Hash の扱いは class TileHash を生成する事に。
gongo@localhost.localdomain
parents:
158
diff
changeset
|
213 for (int i = 0; i < spe_num; i++) { |
c8b868871dce
DrawSpan で使う Tile の Hash の扱いは class TileHash を生成する事に。
gongo@localhost.localdomain
parents:
158
diff
changeset
|
214 task_tex = manager->create_task(TASK_INIT_TEXTURE); |
176 | 215 /* ここはもう少しわかりやすい使い方がいいかもしれぬ。こんなもん? */ |
167
c8b868871dce
DrawSpan で使う Tile の Hash の扱いは class TileHash を生成する事に。
gongo@localhost.localdomain
parents:
158
diff
changeset
|
216 task_tex->set_cpu((CPU_TYPE)((int)SPE_0 + i)); |
c8b868871dce
DrawSpan で使う Tile の Hash の扱いは class TileHash を生成する事に。
gongo@localhost.localdomain
parents:
158
diff
changeset
|
217 task_next->wait_for(task_tex); |
c8b868871dce
DrawSpan で使う Tile の Hash の扱いは class TileHash を生成する事に。
gongo@localhost.localdomain
parents:
158
diff
changeset
|
218 task_tex->spawn(); |
c8b868871dce
DrawSpan で使う Tile の Hash の扱いは class TileHash を生成する事に。
gongo@localhost.localdomain
parents:
158
diff
changeset
|
219 } |
120 | 220 |
109 | 221 task_next->spawn(); |
222 } | |
223 | |
224 void | |
225 Viewer::run_loop(void) | |
226 { | |
227 HTaskPtr task_create_pp = NULL; | |
228 HTaskPtr task_create_sp = NULL; | |
229 HTaskPtr task_next; | |
230 bool quit_flg; | |
231 | |
232 quit_flg = quit_check(); | |
233 | |
234 if (quit_flg == true) { | |
235 this_time = get_ticks(); | |
236 run_finish(); | |
237 return; | |
238 } | |
239 | |
200 | 240 //clean_pixels(); |
109 | 241 |
242 for (int i = 1; i <= spackList_length; i++) { | |
126
7635f223fc7d
fix RGBA mask (bgr -> rgba)
gongo@charles.cr.ie.u-ryukyu.ac.jp
parents:
123
diff
changeset
|
243 spackList[i-1].reinit(i*split_screen_h); |
109 | 244 } |
245 | |
246 task_next = manager->create_task(TASK_DUMMY); | |
247 task_next->set_post(post2runDraw, NULL); | |
248 | |
137
6cf991f28c6c
SceneGraphPack の代わりに、今は SceneGraph をそのまま使う様に設定。
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
133
diff
changeset
|
249 #if 0 |
157 | 250 // SceneGraphPack の update |
137
6cf991f28c6c
SceneGraphPack の代わりに、今は SceneGraph をそのまま使う様に設定。
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
133
diff
changeset
|
251 HTaskPtr task_update_sgp = NULL; |
109 | 252 task_update_sgp = manager->create_task(TASK_UPDATE_SGP); |
253 task_update_sgp->add_inData(sgpack, sizeof(SceneGraphPack)); | |
254 task_update_sgp->add_outData(sgpack, sizeof(SceneGraphPack)); | |
255 task_update_sgp->add_param(width); | |
256 task_update_sgp->add_param(height); | |
257 task_next->wait_for(task_update_sgp); | |
137
6cf991f28c6c
SceneGraphPack の代わりに、今は SceneGraph をそのまま使う様に設定。
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
133
diff
changeset
|
258 task_update_sgp->spawn(); |
6cf991f28c6c
SceneGraphPack の代わりに、今は SceneGraph をそのまま使う様に設定。
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
133
diff
changeset
|
259 #else |
195 | 260 sgroot->updateControllerState(); |
261 sgroot->allExecute(width, height); | |
262 sgroot->checkRemove(); | |
137
6cf991f28c6c
SceneGraphPack の代わりに、今は SceneGraph をそのまま使う様に設定。
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
133
diff
changeset
|
263 #endif |
109 | 264 |
137
6cf991f28c6c
SceneGraphPack の代わりに、今は SceneGraph をそのまま使う様に設定。
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
133
diff
changeset
|
265 #if 0 |
157 | 266 // SceneGraphPack(配列) -> PolygonPack |
109 | 267 task_create_pp = manager->create_task(TASK_CREATE_PP); |
268 task_create_pp->add_inData(sgpack, sizeof(SceneGraphPack)); | |
269 task_create_pp->add_param((uint32)ppack); | |
137
6cf991f28c6c
SceneGraphPack の代わりに、今は SceneGraph をそのまま使う様に設定。
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
133
diff
changeset
|
270 #else |
157 | 271 // SceneGraph(木構造) -> PolygonPack |
137
6cf991f28c6c
SceneGraphPack の代わりに、今は SceneGraph をそのまま使う様に設定。
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
133
diff
changeset
|
272 task_create_pp = manager->create_task(TASK_CREATE_PP2); |
195 | 273 task_create_pp->add_param((uint32)sgroot->getDrawSceneGraph()); |
137
6cf991f28c6c
SceneGraphPack の代わりに、今は SceneGraph をそのまま使う様に設定。
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
133
diff
changeset
|
274 task_create_pp->add_param((uint32)ppack); |
6cf991f28c6c
SceneGraphPack の代わりに、今は SceneGraph をそのまま使う様に設定。
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
133
diff
changeset
|
275 #endif |
109 | 276 task_next->wait_for(task_create_pp); |
277 | |
278 int range_base = spe_num; | |
279 // 切り上げのつもり | |
280 int range = (spackList_length + range_base - 1) / range_base; | |
281 | |
282 for (int i = 0; i < range_base; i++) { | |
283 int index_start = range*i; | |
284 int index_end = (index_start + range >= spackList_length) | |
285 ? spackList_length : index_start + range; | |
286 | |
287 task_create_sp = manager->create_task(TASK_CREATE_SPAN); | |
288 task_create_sp->add_inData(ppack, sizeof(PolygonPack)); | |
289 task_create_sp->add_inData(spackList_ptr, | |
290 sizeof(SpanPack*)*spackList_length_align); | |
291 task_create_sp->add_inData(&spackList[index_start], sizeof(SpanPack)); | |
292 | |
293 task_create_sp->add_param(index_start); | |
294 | |
295 /** | |
133
435e0d24db39
DrawSpan のテクスチャ座標を求める部分で、width と height が逆に使われてた。
gongo@charles.cr.ie.u-ryukyu.ac.jp
parents:
130
diff
changeset
|
296 * ex. screen_height が 480, spenum が 6 の場合、各SPEのy担当範囲 |
109 | 297 * [ 1.. 80] [ 81..160] [161..240] |
298 * [241..320] [321..400] [401..480] | |
299 * | |
300 * ex. screen_height が 1080, spenum が 5 の場合、 | |
301 * [ 1..216] [217..432] [433..648] | |
302 * [649..864] [865..1080] | |
303 */ | |
304 task_create_sp->add_param(index_start*split_screen_h + 1); | |
305 task_create_sp->add_param(index_end*split_screen_h); | |
306 | |
307 task_next->wait_for(task_create_sp); | |
308 task_create_sp->wait_for(task_create_pp); | |
309 | |
310 task_create_sp->set_cpu(SPE_ANY); | |
311 task_create_sp->spawn(); | |
312 } | |
313 | |
314 task_create_pp->spawn(); | |
315 task_next->spawn(); | |
316 } | |
317 | |
318 void | |
319 Viewer::run_draw(void) | |
320 { | |
321 HTaskPtr task_next; | |
322 HTaskPtr task_draw; | |
323 | |
324 task_next = manager->create_task(TASK_DUMMY); | |
325 task_next->set_post(post2runLoop, NULL); | |
326 | |
327 ppack->clear(); | |
328 for (int i = 0; i < spackList_length; i++) { | |
329 SpanPack *spack = &spackList[i]; | |
330 int startx = 1; | |
331 int endx = split_screen_w; | |
332 | |
180
5cde66c926b4
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
177
diff
changeset
|
333 int starty = spack->info.y_top - split_screen_h + 1; |
5cde66c926b4
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
177
diff
changeset
|
334 //int endy = spack->info.y_top; |
5cde66c926b4
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
177
diff
changeset
|
335 int rangey = (starty + split_screen_h - 1 > this->height) |
5cde66c926b4
いろいろ fix 。詳しくは TaskManager/Changelog、test_render/Changelog を
gongo@localhost.localdomain
parents:
177
diff
changeset
|
336 ? this->height - starty + 1 : split_screen_h; |
109 | 337 |
338 while (startx < this->width) { | |
339 if (spack->info.size > 0) { | |
340 // Draw SpanPack | |
341 task_draw = manager->create_task(TASK_DRAW_SPAN); | |
342 task_draw->add_inData(spack, sizeof(SpanPack)); | |
193 | 343 |
344 task_draw->add_param( | |
345 (uint32)&pixels[(startx-1) + this->width*(starty-1)]); | |
346 task_draw->add_param(this->width); | |
109 | 347 } else { |
200 | 348 #if 0 |
349 break; | |
109 | 350 // Draw Background (現在は塗りつぶし) |
351 task_draw = manager->create_task(TASK_DRAW_BACK); | |
170 | 352 task_draw->add_param(0xffffffff); |
205 | 353 |
193 | 354 for (int k = 0; k < rangey; k++) { |
355 task_draw->add_outData( | |
356 &pixels[(startx-1)+this->width*(k+starty-1)], | |
357 (endx - startx + 1)*sizeof(int)); | |
358 } | |
200 | 359 #else |
360 memset(&pixels[(startx-1)+this->width*(starty-1)], | |
213
159519cdca1f
add SceneGraph "3D Super-Dandy"
gongo@localhost.localdomain
parents:
212
diff
changeset
|
361 0, (this->width)*sizeof(int)*rangey); |
212 | 362 //wmemset((wchar_t*)&pixels[(startx-1)+this->width*(starty-1)], |
363 //0xFFFFFFFF, (this->width)*sizeof(int)*rangey/sizeof(wchar_t)); | |
200 | 364 break; |
365 #endif | |
109 | 366 } |
367 | |
368 task_draw->add_param(startx); | |
369 task_draw->add_param(endx); | |
370 task_draw->add_param(rangey); | |
371 task_draw->set_cpu(SPE_ANY); | |
372 task_next->wait_for(task_draw); | |
373 task_draw->spawn(); | |
374 | |
375 startx += split_screen_w; | |
376 endx += split_screen_w; | |
377 | |
378 if (endx > this->width) { | |
379 endx = this->width; | |
380 } | |
381 } | |
382 } | |
383 | |
384 task_next->spawn(); | |
385 | |
386 frames++; | |
387 } | |
388 | |
389 void | |
390 Viewer::run_finish(void) | |
391 { | |
392 if (this_time != start_time) { | |
393 printf("%f FPS\n", (((float)frames)/(this_time-start_time))*1000.0); | |
394 } | |
395 | |
195 | 396 //scene_graph->delete_data(); |
397 //scene_graph->controller->close(); | |
398 //delete scene_graph; | |
109 | 399 |
400 quit(); | |
401 } |