changeset 1410:acfa426b277e draft

light fix
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Sat, 18 Feb 2012 10:25:42 +0900
parents e8a135048781
children 3361f2b7c63b
files Renderer/Engine/ChangeLog Renderer/Engine/Light.cc Renderer/Engine/Light.h
diffstat 3 files changed, 9 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/Renderer/Engine/ChangeLog	Sat Feb 18 00:24:00 2012 +0900
+++ b/Renderer/Engine/ChangeLog	Sat Feb 18 10:25:42 2012 +0900
@@ -1,3 +1,7 @@
+2012-2-18  Shinji Kono  <kono@ie.u-ryukyu.ac.jp>
+
+	SceneGraphRoot の light ってなんだよ?
+
 2011-9-7  Shinji Kono  <kono@ie.u-ryukyu.ac.jp>
 
 	allExecute 使わない方の Camera の処理をしないとだめ。
--- a/Renderer/Engine/Light.cc	Sat Feb 18 00:24:00 2012 +0900
+++ b/Renderer/Engine/Light.cc	Sat Feb 18 10:25:42 2012 +0900
@@ -15,7 +15,7 @@
     }
 
 
-    for(int i = 0;;) {
+    for(int i = 0;i<=spe_num;) { // including CPU_PPE==0
         HTaskPtr data_load = manager->create_task(DataAllocate);
 	data_load->set_param(0,(memaddr)3);                         // num of allocate block
 	data_load->set_param(1,(memaddr)(sizeof(float)*4*light_num)); // 1st allocate size
@@ -24,10 +24,8 @@
 	data_load->set_param(4,(memaddr)LightSwitch);               // 2nd id
 	data_load->set_param(5,(memaddr)16);                        // 3rd size
 	data_load->set_param(6,(memaddr)LightSysSwitch);            // 3rd id
-	data_load->set_cpu((CPU_TYPE)((int)SPE_0 + i));
+	data_load->set_cpu((CPU_TYPE)i);
 	data_load->spawn();
-	if (i==CPU_PPE) break;
-	if (i==spe_num-1) i=CPU_PPE;
 	i++;
     }
 
@@ -85,19 +83,16 @@
 
 
     HTask *data_update_wait = manager->create_task(Dummy);
-    for (int i = 0; ;) {
-      
+    for(int i = 0;i<=spe_num;) { // including CPU_PPE==0
 	HTaskPtr data_update = manager->create_task(DataUpdate);
 	data_update->set_param(0,3);
 	data_update->set_param(1,LightData);              // GlobalSet ID base
 	data_update->set_inData(0,light_xyz,size);                           // Light
 	data_update->set_inData(1,light_switch,light_num * sizeof(int));     // LightSwitch = Light+1
 	data_update->set_inData(2,light_sysswitch,16);                       // LightSysSwitch = Light+2
-        data_update->set_cpu((CPU_TYPE)(SPE_0+i));
+        data_update->set_cpu((CPU_TYPE)i);
         data_update_wait->wait_for(data_update);
 	data_update->spawn();
-	if (i==CPU_PPE) break;
-	if (i==spe_num-1) i=CPU_PPE;
 	i++;
     }
     return data_update_wait; 
--- a/Renderer/Engine/Light.h	Sat Feb 18 00:24:00 2012 +0900
+++ b/Renderer/Engine/Light.h	Sat Feb 18 10:25:42 2012 +0900
@@ -10,7 +10,7 @@
 class Light {
 public:
     Light(float w, float h,int spe_num_, SceneGraphRoot *sgroot_, TaskManager *manager_) {
-        spe_num_ = spe_num; 
+        spe_num = spe_num_; 
 	sgroot = sgroot_;
 	manager = manager_;
     }