comparison Renderer/Engine/viewer.cc @ 984:dbebc7afd08e draft

minor fix
author root@henri.cr.ie.u-ryukyu.ac.jp
date Fri, 01 Oct 2010 01:25:45 +0900
parents ad2bc8afc7b9
children 37bd2b0694e2
comparison
equal deleted inserted replaced
983:ad2bc8afc7b9 984:dbebc7afd08e
96 void 96 void
97 Viewer::run_init(TaskManager *manager, Application *app) 97 Viewer::run_init(TaskManager *manager, Application *app)
98 { 98 {
99 this->manager = manager; 99 this->manager = manager;
100 100
101 start_time = get_ticks();
102 this_time = 0;
103 frames = 0;
104
105 if (spe_num == 0) spe_num = 1; 101 if (spe_num == 0) spe_num = 1;
106 102
107 sgroot = new SceneGraphRoot(this->width, this->height); 103 sgroot = new SceneGraphRoot(this->width, this->height);
108 sgroot->tmanager = manager; 104 sgroot->tmanager = manager;
109 105
158 data_load->set_param(1,(memaddr)LightSysSwitch); 154 data_load->set_param(1,(memaddr)LightSysSwitch);
159 data_load->set_cpu((CPU_TYPE)((int)SPE_0 + i)); 155 data_load->set_cpu((CPU_TYPE)((int)SPE_0 + i));
160 data_load->spawn(); 156 data_load->spawn();
161 } 157 }
162 158
159 start_time = get_ticks();
160 this_time = 0;
161 frames = 0;
162
163 MainLoop *mainloop = app->init(this, this->width, this->height); 163 MainLoop *mainloop = app->init(this, this->width, this->height);
164 mainloop->mainLoop(); 164 mainloop->mainLoop();
165 } 165 }
166 166
167 167
945 } 945 }
946 946
947 data_update_wait->spawn(); 947 data_update_wait->spawn();
948 if (profile) { 948 if (profile) {
949 if (frames % 50 == 49) { 949 if (frames % 50 == 49) {
950 manager->show_profile();
950 this_time = get_ticks(); 951 this_time = get_ticks();
951 manager->show_profile();
952 if (this_time != start_time) { 952 if (this_time != start_time) {
953 printf("\n%f FPS\n", (((float)frames)/(this_time-start_time))*1000.0); 953 printf("\n%f FPS\n", ((((float)frames)*1000.0)/(this_time-start_time)));
954 start_time = this_time; frames = 0; 954 start_time = this_time; frames = 0;
955 } 955 }
956 } 956 }
957 } 957 }
958 } 958 }