Mercurial > hg > Members > kono > Cerium
comparison Renderer/Engine/viewer.cc @ 1002:c79651141045
many changes.
author | koba <koba@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Sun, 24 Oct 2010 19:00:47 +0900 |
parents | 0b8f9d4d7dab |
children | 295b3c79fb44 |
comparison
equal
deleted
inserted
replaced
992:1b018a00cd17 | 1002:c79651141045 |
---|---|
96 | 96 |
97 if (spe_num == 0) spe_num = 1; | 97 if (spe_num == 0) spe_num = 1; |
98 | 98 |
99 sgroot = new SceneGraphRoot(this->width, this->height); | 99 sgroot = new SceneGraphRoot(this->width, this->height); |
100 sgroot->tmanager = manager; | 100 sgroot->tmanager = manager; |
101 | |
102 | 101 |
103 int light_num = 4; | 102 int light_num = 4; |
104 int size = sizeof(float)*4*light_num; //xyz+alfa(4) * light_num(4) | 103 int size = sizeof(float)*4*light_num; //xyz+alfa(4) * light_num(4) |
105 int light_size = size / sizeof(float); | 104 int light_size = size / sizeof(float); |
106 | 105 |
311 } | 310 } |
312 | 311 |
313 dev->clean_pixels(); | 312 dev->clean_pixels(); |
314 pixels = dev->flip_screen(pixels); | 313 pixels = dev->flip_screen(pixels); |
315 | 314 |
316 /* ここでGameTaskの終了を待つTaskを生成しておく */ | |
317 sgroot->wait_game_task = manager->create_task(Dummy,0,0,0,0); | |
318 sgroot->updateControllerState(); | 315 sgroot->updateControllerState(); |
319 sgroot->allExecute(width, height); | 316 sgroot->allExecute(width, height); |
317 sgroot->task_array_finish(); | |
320 light_xyz_stock = sgroot->getLightVector(); | 318 light_xyz_stock = sgroot->getLightVector(); |
321 light_switch_stock = sgroot->getLightSwitch(); | 319 light_switch_stock = sgroot->getLightSwitch(); |
322 light_sysswitch_stock = sgroot->getLightSysSwitch(); | 320 light_sysswitch_stock = sgroot->getLightSysSwitch(); |
323 //sgroot->checkRemove(); | 321 //sgroot->checkRemove(); |
324 | 322 |
685 | 683 |
686 | 684 |
687 #else | 685 #else |
688 | 686 |
689 HTaskPtr task_create_pp = manager->create_task(CreatePolygonFromSceneGraph); | 687 HTaskPtr task_create_pp = manager->create_task(CreatePolygonFromSceneGraph); |
690 HTaskPtr game_task = sgroot->wait_game_task; | |
691 // SceneGraph(木構造) -> PolygonPack | 688 // SceneGraph(木構造) -> PolygonPack |
692 | 689 |
693 task_create_pp->set_param(0,(memaddr)sgroot->getDrawSceneGraph()); | 690 task_create_pp->set_param(0,(memaddr)sgroot->getDrawSceneGraph()); |
694 task_create_pp->set_param(1,(memaddr)r[ppi].ppack); | 691 task_create_pp->set_param(1,(memaddr)r[ppi].ppack); |
695 /* GameTaskの終了を待ってからポリゴンを作る */ | 692 /* GameTaskの終了を待ってからポリゴンを作る */ |
696 task_create_pp->wait_for(game_task); | 693 task_create_pp->wait_for(sgroot->game_task_array); |
697 | 694 |
698 task_next->wait_for(task_create_pp); | 695 task_next->wait_for(task_create_pp); |
699 | 696 |
700 #endif | 697 #endif |
701 | 698 |
737 task_create_sp->set_cpu(SPE_ANY); | 734 task_create_sp->set_cpu(SPE_ANY); |
738 task_create_sp->spawn(); | 735 task_create_sp->spawn(); |
739 } | 736 } |
740 | 737 |
741 task_create_pp->spawn(); | 738 task_create_pp->spawn(); |
742 game_task->spawn(); | |
743 } | 739 } |
744 | 740 |
745 | 741 |
746 void | 742 void |
747 Viewer::common_draw(HTaskPtr task_next) | 743 Viewer::common_draw(HTaskPtr task_next) |
790 int starty = spack->info.y_top - split_screen_h + 1; | 786 int starty = spack->info.y_top - split_screen_h + 1; |
791 //int endy = spack->info.y_top; | 787 //int endy = spack->info.y_top; |
792 int rangey = (starty + split_screen_h - 1 > this->height) | 788 int rangey = (starty + split_screen_h - 1 > this->height) |
793 ? this->height - starty + 1 : split_screen_h; | 789 ? this->height - starty + 1 : split_screen_h; |
794 | 790 |
795 #if 1 | 791 #if 0 |
796 | 792 |
797 // mem_flag は spe 側で黒い部分を 0 で埋めるフラグ | 793 // mem_flag は spe 側で黒い部分を 0 で埋めるフラグ |
798 if(spack->info.size > 0 || mem_flag == 1) { | 794 if(spack->info.size > 0 || mem_flag == 1) { |
799 | 795 |
800 int array_task_num = (this->width + split_screen_w - 1) / split_screen_w; | 796 int array_task_num = (this->width + split_screen_w - 1) / split_screen_w; |