changeset 1034:a0faa0cfc271

merge.
author koba <koba@cr.ie.u-ryukyu.ac.jp>
date Fri, 26 Nov 2010 04:35:34 +0900
parents 431936c0cc96 (current diff) 8892d0ea7985 (diff)
children ff0e6d00c060
files Renderer/Engine/viewer.cc TaskManager/Cell/spe/MailQueue.h
diffstat 39 files changed, 491 insertions(+), 146 deletions(-) [+]
line wrap: on
line diff
--- a/Renderer/Engine/Makefile.def	Fri Nov 26 04:32:59 2010 +0900
+++ b/Renderer/Engine/Makefile.def	Fri Nov 26 04:35:34 2010 +0900
@@ -5,7 +5,7 @@
 ABIBIT = 32 
 ABI = -m$(ABIBIT)
 CC      = g++
-OPT	= -g #-O9 -DSPE_CREATE_POLYGON_CHECK -DSPE_CREATE_POLYGON=1
+OPT	= -g -O9 #-DSPE_CREATE_POLYGON_CHECK -DSPE_CREATE_POLYGON=1
 CFLAGS  = -Wall $(ABI) $(OPT)  #  -DDEBUG
 
 INCLUDE = -I$(CERIUM)/include/TaskManager -I.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Renderer/Engine/spe/CreatePolygonFromSceneGraph.cc	Fri Nov 26 04:35:34 2010 +0900
@@ -0,0 +1,213 @@
+/**
+ * SceneGraph が増えてくると動かなくなるかもしれない。
+ * 一応 mainMem とかで動くようになるとは思うけど。
+ * だめだったら、そこら辺が怪しいと思うべき
+ */
+
+#include "CreatePolygonFromSceneGraph.h"
+#include "polygon_pack.h"
+#include "scene_graph_pack.h"
+
+SchedDefineTask1(CreatePolygonFromSceneGraph, createPolygonFromSceneGraph);
+
+#define SG_PACK_LOAD 10
+#define SG_NODE_LOAD 11
+#define PP_LOAD 12
+#define PP_STORE 13
+
+/**
+ *  ベクトルに行列を乗算する
+ * @param[out] v vector (float[4])
+ * @param[in] m matrix (float[16])
+ */
+static void
+ApplyMatrix(float *v, float *m)
+{
+    float t[4];
+
+    t[0] = v[0];
+    t[1] = v[1];
+    t[2] = v[2];
+    t[3] = v[3];
+
+    for (int i = 0; i < 4; i++) {
+	v[i] = t[0]*m[i] + t[1]*m[i+4] + t[2]*m[i+8] + t[3]*m[i+12];
+    }
+}
+
+static void
+ApplyNormalMatrix(float *v, float *m)
+{
+    float t[4];
+
+    t[0] = v[0];
+    t[1] = v[1];
+    t[2] = v[2];
+
+    for (int i = 0; i < 3; i++) {
+        v[i] = t[0]*m[i] + t[1]*m[i+4] + t[2]*m[i+8];
+    }
+}
+
+static int 
+createPolygonFromSceneGraph(SchedTask *smanager, void *rbuf, void *wbuf)
+{
+    float xyz1[4], xyz2[4], xyz3[4];
+    float normal1[4],normal2[4],normal3[4];
+
+    //coord_xyz, coord_tex, normal, matrix, real_matrix を受け取る
+    float *coord_xyz   = (float*)smanager->get_input(rbuf, 0);
+    float *coord_tex   = (float*)smanager->get_input(rbuf, 1);
+    float *normal      = (float*)smanager->get_input(rbuf, 2);
+    float *matrix      = (float*)smanager->get_input(rbuf, 3);
+    float *real_matrix = (float*)smanager->get_input(rbuf, 4);
+    uint32 *pixels     = (uint32*)smanager->get_input(rbuf, 5);
+
+    int sg_size   = (int)smanager->get_param(0);
+    int width     = (int)smanager->get_param(1);
+    int height    = (int)smanager->get_param(2);
+    int scale_max = (int)smanager->get_param(3);
+
+    // triangle を書き戻す
+    //TrianglePackPtr triangle = (TrianglePackPtr)smanager->get_output(wbuf, 0);
+
+    PolygonPackPtr pp
+	= (PolygonPackPtr)smanager->allocate(sizeof(PolygonPack));
+    PolygonPackPtr send_pp
+	= (PolygonPackPtr)smanager->allocate(sizeof(PolygonPack));
+    PolygonPackPtr pp_addr = (PolygonPackPtr)smanager->get_param(1);
+    PolygonPackPtr tmp_pp;
+
+
+    for (int i = 0; i < sg_size; i += 3) {
+      if (pp->info.size >= MAX_SIZE_TRIANGLE) {
+	PolygonPackPtr next;
+	
+	smanager->mainMem_alloc(0, sizeof(PolygonPack));
+	smanager->mainMem_wait();
+	next = (PolygonPackPtr)smanager->mainMem_get(0);
+	
+	pp->next = next;
+	
+	tmp_pp = pp;
+	pp = send_pp;
+	send_pp = tmp_pp;
+	
+	smanager->dma_wait(PP_STORE);
+	smanager->dma_store(send_pp, (memaddr)pp_addr,
+			    sizeof(PolygonPack), PP_STORE);
+	
+	pp_addr = next;
+	
+	smanager->dma_wait(PP_LOAD);
+	smanager->dma_load(pp, (memaddr)pp_addr,
+			   sizeof(PolygonPack), PP_LOAD);
+	smanager->dma_wait(PP_LOAD);
+	pp->init();
+      }
+      
+      xyz1[0] = coord_xyz[(i+0)*3];
+      xyz1[1] = coord_xyz[(i+0)*3+1];
+      xyz1[2] = coord_xyz[(i+0)*3+2]*-1.0f;
+      xyz1[3] = 1.0f;
+      
+      xyz2[0] = coord_xyz[(i+1)*3];
+      xyz2[1] = coord_xyz[(i+1)*3+1];
+      xyz2[2] = coord_xyz[(i+1)*3+2]*-1.0f;
+      xyz2[3] = 1.0f;
+      
+      xyz3[0] = coord_xyz[(i+2)*3];
+      xyz3[1] = coord_xyz[(i+2)*3+1];
+      xyz3[2] = coord_xyz[(i+2)*3+2]*-1.0f;
+      xyz3[3] = 1.0f;
+      
+      // matrix = 回転行列*透視変換行列
+      ApplyMatrix(xyz1, matrix);
+      ApplyMatrix(xyz2, matrix);
+      ApplyMatrix(xyz3, matrix);
+      
+      xyz1[0] /= xyz1[2];
+      xyz1[1] /= xyz1[2];
+      xyz2[0] /= xyz2[2];
+      xyz2[1] /= xyz2[2];
+      xyz3[0] /= xyz3[2];
+      xyz3[1] /= xyz3[2];
+   
+      TrianglePack *triangle = &pp->tri[pp->info.size++];
+
+      triangle->ver1.x = xyz1[0];
+      triangle->ver1.y = xyz1[1];
+      triangle->ver1.z = xyz1[2];
+      triangle->ver1.tex_x = coord_tex[(i+0)*3];
+      triangle->ver1.tex_y = coord_tex[(i+0)*3+1];
+      
+      triangle->ver2.x = xyz2[0];
+      triangle->ver2.y = xyz2[1];
+      triangle->ver2.z = xyz2[2];
+      triangle->ver2.tex_x = coord_tex[(i+1)*3];
+      triangle->ver2.tex_y = coord_tex[(i+1)*3+1];
+      
+      triangle->ver3.x = xyz3[0];
+      triangle->ver3.y = xyz3[1];
+      triangle->ver3.z = xyz3[2];
+      triangle->ver3.tex_x = coord_tex[(i+2)*3];
+      triangle->ver3.tex_y = coord_tex[(i+2)*3+1];
+      
+      normal1[0] = normal[(i+0)*3];
+      normal1[1] = normal[(i+0)*3+1];
+      normal1[2] = normal[(i+0)*3+2]*-1.0f;
+      //normal1[3] = 1.0f;
+      normal1[3] = 0.0f;
+      
+      normal2[0] = normal[(i+1)*3];
+      normal2[1] = normal[(i+1)*3+1];
+      normal2[2] = normal[(i+1)*3+2]*-1.0f;
+      //normal2[3] = 1.0f;
+      normal2[3] = 0.0f;
+      
+      normal3[0] = normal[(i+2)*3];
+      normal3[1] = normal[(i+2)*3+1];
+      normal3[2] = normal[(i+2)*3+2]*-1.0f;
+      //normal3[3] = 1.0f;
+      normal3[3] = 0.0f;
+      
+      ApplyNormalMatrix(normal1,real_matrix);
+      ApplyNormalMatrix(normal2,real_matrix);
+      ApplyNormalMatrix(normal3,real_matrix);
+      
+      normal1[0] /= normal1[2];
+      normal1[1] /= normal1[2];
+      
+      normal2[0] /= normal2[2];
+      normal2[1] /= normal2[2];
+      
+      normal3[0] /= normal3[2];
+      normal3[1] /= normal3[2];
+      
+      triangle->normal1.x = normal1[0];
+      triangle->normal1.y = normal1[1];
+      triangle->normal1.z = normal1[2];
+      
+      triangle->normal2.x = normal2[0];
+      triangle->normal2.y = normal2[1];
+      triangle->normal2.z = normal2[2];
+      
+      triangle->normal3.x = normal3[0];
+      triangle->normal3.y = normal3[1];
+      triangle->normal3.z = normal3[2];
+      
+      triangle->tex_info.addr   = pixels;
+      triangle->tex_info.width  = width;
+      triangle->tex_info.height = height;
+      triangle->tex_info.scale_max = scale_max;
+    }
+    smanager->dma_wait(PP_STORE);
+    smanager->dma_store(pp, (memaddr)pp_addr,
+			sizeof(PolygonPack), PP_STORE);
+    smanager->dma_wait(PP_STORE);
+
+    free(pp);
+    free(send_pp);
+
+    return 0;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Renderer/Engine/spe/CreatePolygonFromSceneGraph.h	Fri Nov 26 04:35:34 2010 +0900
@@ -0,0 +1,7 @@
+#ifndef INCLUDED_CREATE_POLYGON
+#define INCLUDED_CREATE_POLYGON
+
+#include "SchedTask.h"
+
+
+#endif
--- a/Renderer/Engine/spe/Makefile	Fri Nov 26 04:32:59 2010 +0900
+++ b/Renderer/Engine/spe/Makefile	Fri Nov 26 04:35:34 2010 +0900
@@ -5,7 +5,8 @@
 TOP = ../$(CERIUM)
 
 SRCS_TMP = $(wildcard *.cc)
-#SRCS_EXCLUDE = CreatePolygon.cc
+SRCS_EXCLUDE = CreatePolygonFromSceneGraph.cc #CreatePolygon.cc 
+#SRCS_EXCLUDE = CreatePolygon.cc 
 SRCS = $(filter-out $(SRCS_EXCLUDE),$(SRCS_TMP))
 OBJS = $(SRCS:.cc=.o)
 
--- a/Renderer/Engine/task/CreatePolygonFromSceneGraph.cc	Fri Nov 26 04:32:59 2010 +0900
+++ b/Renderer/Engine/task/CreatePolygonFromSceneGraph.cc	Fri Nov 26 04:35:34 2010 +0900
@@ -120,7 +120,6 @@
 		    pp->init();
 		}
 
-		TrianglePack *triangle = &pp->tri[pp->info.size++];
 
 		xyz1[0] = sg->coord_xyz[(i+0)*3];
 		xyz1[1] = sg->coord_xyz[(i+0)*3+1];
@@ -149,6 +148,8 @@
 		xyz3[0] /= xyz3[2];
 		xyz3[1] /= xyz3[2];
 
+		TrianglePack *triangle = &pp->tri[pp->info.size++];
+
 		triangle->ver1.x = xyz1[0];
 		triangle->ver1.y = xyz1[1];
 		triangle->ver1.z = xyz1[2];
@@ -185,9 +186,13 @@
 		//normal3[3] = 1.0f;
                 normal3[3] = 0.0f;
 
-                ApplyNormalMatrix(normal1,sg->real_matrix);
-                ApplyNormalMatrix(normal2,sg->real_matrix);
-                ApplyNormalMatrix(normal3,sg->real_matrix);
+                //ApplyNormalMatrix(normal1,sg->real_matrix);
+                //ApplyNormalMatrix(normal2,sg->real_matrix);
+                //ApplyNormalMatrix(normal3,sg->real_matrix);
+
+		ApplyMatrix(normal1,sg->real_matrix);
+		ApplyMatrix(normal2,sg->real_matrix);
+		ApplyMatrix(normal3,sg->real_matrix);
 
                 normal1[0] /= normal1[2];
                 normal1[1] /= normal1[2];
--- a/Renderer/Engine/task/DrawSpan.cc	Fri Nov 26 04:32:59 2010 +0900
+++ b/Renderer/Engine/task/DrawSpan.cc	Fri Nov 26 04:35:34 2010 +0900
@@ -199,7 +199,8 @@
 
 
     /*完全に透けているか判断, 法線ベクトルが奥を向いてるかどうか*/
-    int flag = (alpha != 0 && normal_z < 0);
+    //int flag = (alpha != 0 && normal_z < 0);
+    int flag = (alpha != 0);
 
     //printf("light_sysswitch %d\n",light_sysswitch);
 
--- a/Renderer/Engine/viewer.cc	Fri Nov 26 04:32:59 2010 +0900
+++ b/Renderer/Engine/viewer.cc	Fri Nov 26 04:35:34 2010 +0900
@@ -629,54 +629,120 @@
 
 }
 
+/* flag_drawable な Scenegraph の総数を求める */
+int
+sg_drawable_num(SceneGraphPtr scenegraph)
+{
+  SceneGraphPtr sg = scenegraph;
+
+  int sg_count = 0;
+  while (sg) {
+    if (sg->flag_drawable) {
+      sg_count++;
+    }
+    if (sg->children != NULL) {
+      sg = sg->children;
+    } else if (sg->brother != NULL) {
+      sg = sg->brother;
+    } else {
+      while (sg) {
+	if (sg->brother != NULL) {
+	  sg = sg->brother;
+	  break;
+	} else {
+	  if (sg->parent == NULL) {
+	    sg = NULL;
+	    break;
+	  } else {
+	    sg = sg->parent;
+	  }
+	}
+      }
+    }  
+  }
+  return sg_count;
+}
+
 void
-create_pp_task(SceneGraphPtr sg, TaskManager *manager, int spe_num, HTaskPtr task_next)
+create_pp_task(SceneGraphPtr sg, TaskManager *manager, int spe_num, HTaskPtr task_next, SceneGraphRootPtr sgroot)
 {
 
-  MatrixListInfo *matrix_info = (MatrixListInfo*)manager->allocate(sizeof(MatrixListInfo));
-  collect_matrix(sg, matrix_info, manager);
-
+  /*
+   * SceneGraph を辿って coord_xyz, coord_tex, normal, matrix, real_matrix 及び、
+   * PolygonPack の TrianglePack (空) を送る。pp->info.size の計算もここで。
+   * 
+   */
 
-  //HTaskPtr phase_wait = manager->create_task(Dummy);
-
-  for (MatrixListInfo* t = matrix_info; t != NULL; t = t->next) {
-
-    printf("list_length %d \n", t->list_length);
+  int sg_num = sg_drawable_num(sg);
+  int sg_division = sg_num / spe_num;
+  int residue = sg_num % spe_num;
 
-    int alloc_size = 16*1024;
+  HTask **task_array = (HTask**)manager->allocate(sizeof(HTask*)*spe_num);
+  Task **pptask = (Task**)manager->allocate(sizeof(Task*)*spe_num);
+  
+  for (int k = 0; k < spe_num-1; k++) {
+    task_array[k] = manager->create_task_array(CreatePolygonFromSceneGraph,sg_division,4,6,1);
+    pptask[k] = 0;
+  }
+  
+  task_array[spe_num] = manager->create_task_array(CreatePolygonFromSceneGraph,
+						   sg_division+residue,4,6,1);
+  pptask[spe_num] = 0;
 
-    if (t->coord_pack_size < alloc_size) {
-      alloc_size = t->coord_pack_size;
-    }
-
-
-    int division_num = (t->coord_pack_size + alloc_size - 1) / alloc_size;
-    int phase_num = (division_num + spe_num -1) / spe_num;
-    int cur_point = 0;
+  int k = 0;
 
-    for (int i = 0; i < phase_num; i++) {
-      
-      HTaskPtr alloc_wait = manager->create_task(Dummy);
-      coord_allocate(cur_point, t->coord_pack, spe_num,
-		     alloc_size, alloc_wait, manager);
-
-
-      for (MatrixList* u = t->first; u != NULL; u = u->next) {
-
-	//HTaskPtr free_wait = manager->create_task(Dummy);
+  while (sg) {
+    if (sg->flag_drawable) {
+      if(k < spe_num * sg_division) {
+	k %= spe_num-1;
+      } else {
+	k = spe_num;
+      }
+      pptask[k] = task_array[k]->next_task_array(CreatePolygonFromSceneGraph,pptask[k]);
+      pptask[k]->set_inData(0, &sg->coord_xyz, sizeof(float)*sg->size/3);
+      pptask[k]->set_inData(1, &sg->coord_tex, sizeof(float)*sg->size/3);
+      pptask[k]->set_inData(2, &sg->normal   , sizeof(float)*sg->size/3);
+      pptask[k]->set_inData(3, &sg->matrix   , sizeof(float)*12);
+      pptask[k]->set_inData(4, &sg->real_matrix, sizeof(float)*8);
+      pptask[k]->set_inData(5, &sg->texture_info.pixels, sizeof(uint32));
 	
-	//phase_wait = manager->create_task(Dummy);
-	
+      pptask[k]->set_param(0,(memaddr)sg->size);
+      pptask[k]->set_param(1,(memaddr)sg->texture_info.t_w);
+      pptask[k]->set_param(2,(memaddr)sg->texture_info.t_h);
+      pptask[k]->set_param(3,(memaddr)sg->texture_info.scale_max);
+      
+    }
+    if (sg->children != NULL) {
+      sg = sg->children;
+    } else if (sg->brother != NULL) {
+      sg = sg->brother;
+    } else {
+      while (sg) {
+	if (sg->brother != NULL) {
+	  sg = sg->brother;
+	  break;
+	} else {
+	  if (sg->parent == NULL) {
+	    sg = NULL;
+	    break;
+	  } else {
+	    sg = sg->parent;
+	  }
+	}
       }
-
-      coord_free(spe_num, manager, alloc_wait);
-      alloc_wait->spawn();
     }
+    k++;
   }
-
-  printf("-----------------------\n");
-  //return create_pp_wait;
-
+  for (int k = 0; k < spe_num; k++) {
+    task_array[k]->spawn_task_array(pptask[k]->next());
+    task_array[k]->set_cpu(SPE_ANY);
+    task_array[k]->spawn();
+    if (sgroot->gtask_array != NULL) {
+      HTaskPtr game_task_array = sgroot->gtask_array->get_task_array();
+      task_array[k]->wait_for(game_task_array);
+    }
+    task_next->wait_for(task_array[k]);	
+  }
 }
 
 void
@@ -687,7 +753,7 @@
 
     SceneGraphPtr sg = sgroot->getDrawSceneGraph();
 
-    create_pp_task(sg, manager, spe_num, task_next);
+    create_pp_task(sg, manager, spe_num, task_next, sgroot);
 
 #if SPE_CREATE_POLYGON_CHECK
     check_matrix(matrix_info,sg);
@@ -696,7 +762,8 @@
 
   
 #else
-    
+    //SceneGraphPtr sg = sgroot->getDrawSceneGraph();
+    //printf("sg->size = %lld\n", sg->size);
     HTaskPtr task_create_pp = manager->create_task(CreatePolygonFromSceneGraph);
     // SceneGraph(木構造) -> PolygonPack
 
@@ -708,7 +775,6 @@
 	HTaskPtr game_task_array = sgroot->gtask_array->get_task_array();
 	task_create_pp->wait_for(game_task_array);
     }
-
     task_next->wait_for(task_create_pp);
 
 #endif
--- a/Renderer/Engine/viewerGL.cc	Fri Nov 26 04:32:59 2010 +0900
+++ b/Renderer/Engine/viewerGL.cc	Fri Nov 26 04:35:34 2010 +0900
@@ -127,7 +127,8 @@
     glLoadIdentity( );
     
     //正射影
-    glOrtho( 0.0, width, height, 0.0, OPENGL_PARAM::near, OPENGL_PARAM::far );
+    //glOrtho( 0.0, width, height, 0.0, OPENGL_PARAM::near, OPENGL_PARAM::far );
+    glOrtho( 0.0, width, height, 0.0, OPENGL_PARAM::far, OPENGL_PARAM::near );
     
     glMatrixMode( GL_MODELVIEW );
     glLoadIdentity( );
@@ -145,7 +146,7 @@
     glEnable(GL_ALPHA_TEST);
     glAlphaFunc(GL_GREATER, 0);
     glDepthFunc(GL_LESS);
-    glShadeModel(GL_SMOOTH);
+    //glShadeModel(GL_SMOOTH);
 }
 
 void
@@ -210,16 +211,19 @@
 	  xyz1[0] = sg->coord_xyz[(i+0)*3];
 	  xyz1[1] = sg->coord_xyz[(i+0)*3+1];
 	  xyz1[2] = sg->coord_xyz[(i+0)*3+2]*-1.0f;
+	  //xyz1[2] = sg->coord_xyz[(i+0)*3+2];
 	  xyz1[3] = 1.0f;
 	  
 	  xyz2[0] = sg->coord_xyz[(i+1)*3];
 	  xyz2[1] = sg->coord_xyz[(i+1)*3+1];
 	  xyz2[2] = sg->coord_xyz[(i+1)*3+2]*-1.0f;
+	  //xyz2[2] = sg->coord_xyz[(i+1)*3+2];
 	  xyz2[3] = 1.0f;
 	  
 	  xyz3[0] = sg->coord_xyz[(i+2)*3];
 	  xyz3[1] = sg->coord_xyz[(i+2)*3+1];
 	  xyz3[2] = sg->coord_xyz[(i+2)*3+2]*-1.0f;
+	  //xyz3[2] = sg->coord_xyz[(i+2)*3+2];
 	  xyz3[3] = 1.0f;
 	  
 	  // sg->matrix = 回転行列*透視変換行列
@@ -227,47 +231,42 @@
 	  ApplyMatrix(xyz2, sg->matrix);
 	  ApplyMatrix(xyz3, sg->matrix);
 	  
+	  
 	  xyz1[0] /= xyz1[2];
 	  xyz1[1] /= xyz1[2];
 	  xyz2[0] /= xyz2[2];
 	  xyz2[1] /= xyz2[2];
 	  xyz3[0] /= xyz3[2];
 	  xyz3[1] /= xyz3[2];
-	  
+	  	  
 	  tex_xy1[0] = sg->coord_tex[(i+0)*3];
 	  tex_xy1[1] = sg->coord_tex[(i+0)*3+1];
 	  tex_xy2[0] = sg->coord_tex[(i+1)*3];
 	  tex_xy2[1] = sg->coord_tex[(i+1)*3+1];
 	  tex_xy3[0] = sg->coord_tex[(i+2)*3];
 	  tex_xy3[1] = sg->coord_tex[(i+2)*3+1];
-	  
+
 	  normal1[0] = sg->normal[(i+0)*3];
 	  normal1[1] = sg->normal[(i+0)*3+1];
 	  normal1[2] = sg->normal[(i+0)*3+2]*-1.0f;
+	  //normal1[2] = sg->normal[(i+0)*3+2];
 	  normal1[3] = 0.0f;
 	  
 	  normal2[0] = sg->normal[(i+1)*3];
 	  normal2[1] = sg->normal[(i+1)*3+1];
 	  normal2[2] = sg->normal[(i+1)*3+2]*-1.0f;
+	  //normal2[2] = sg->normal[(i+1)*3+2];
 	  normal2[3] = 0.0f;
 	  
 	  normal3[0] = sg->normal[(i+2)*3];
 	  normal3[1] = sg->normal[(i+2)*3+1];
 	  normal3[2] = sg->normal[(i+2)*3+2]*-1.0f;
+	  //normal3[2] = sg->normal[(i+2)*3+2];
 	  normal3[3] = 0.0f;
 	  
-	  ApplyNormalMatrix(normal1,sg->real_matrix);
-	  ApplyNormalMatrix(normal2,sg->real_matrix);
-	  ApplyNormalMatrix(normal3,sg->real_matrix);
-	  
-	  normal1[0] /= normal1[2];
-	  normal1[1] /= normal1[2];
-	  
-	  normal2[0] /= normal2[2];
-	  normal2[1] /= normal2[2];
-	  
-	  normal3[0] /= normal3[2];
-	  normal3[1] /= normal3[2];
+	  ApplyMatrix(normal1,sg->real_matrix);
+	  ApplyMatrix(normal2,sg->real_matrix);
+	  ApplyMatrix(normal3,sg->real_matrix);
 	  
 	  obj_draw(xyz1, tex_xy1, normal1);
 	  obj_draw(xyz2, tex_xy2, normal2);
@@ -302,6 +301,8 @@
 void
 ViewerGL::obj_draw(float *xyz, float *tex_xyz, float *normal_xyz)
 {  
+
+
     glTexCoord2f(tex_xyz[0], tex_xyz[1]);
     glVertex3f(xyz[0], xyz[1], xyz[2]);
     glNormal3f(normal_xyz[0], normal_xyz[1], normal_xyz[2]);
--- a/Renderer/Test/Makefile.cell	Fri Nov 26 04:32:59 2010 +0900
+++ b/Renderer/Test/Makefile.cell	Fri Nov 26 04:35:34 2010 +0900
@@ -14,7 +14,7 @@
 %.pb.cc: $(PROTODIR)/%.proto
 	$(PROTO) $(PROTOFLAGS) $<
 
-ALL = spe-main ball_bound boss1_action direction gaplant ieshoot node panel universe untitled vacuum dynamic viewer SgRootChange property_test create_task property_universe chain_old property_chain aquarium network init_aquarium 
+ALL = spe-main ball_bound boss1_action direction gaplant ieshoot node panel universe untitled vacuum dynamic viewer SgRootChange property_test create_task property_universe chain_old property_chain aquarium network init_aquarium
 
 all: $(ALL)
 
--- a/Renderer/Test/Makefile.macosx	Fri Nov 26 04:32:59 2010 +0900
+++ b/Renderer/Test/Makefile.macosx	Fri Nov 26 04:35:34 2010 +0900
@@ -13,7 +13,7 @@
 %.pb.cc: $(PROTODIR)/%.proto
 	$(PROTO) $(PROTOFLAGS) $<
 
-ALL =  ball_bound boss1_action direction gaplant ieshoot node panel universe untitled vacuum property_test send_linda dynamic writer chain_old SgRootChange viewer aquarium network init_aquarium test_linda
+ALL =  ball_bound boss1_action direction gaplant ieshoot node panel universe untitled vacuum property_test send_linda dynamic writer chain_old SgRootChange viewer aquarium network init_aquarium test_linda 
 
 oFLAGS=-g -O2
 CFLAGt=-g -O2
@@ -103,6 +103,7 @@
 test_linda : $(TEST_LINDA_OBJ)
 	$(CC) -o $@ $? $(LIBS) $(PROTOLIBS)
 
+
 run: $(TARGET)
 	sudo ./$(TARGET) -width 576 -height 384 -bpp 32
 
--- a/Renderer/Test/aquarium.cc	Fri Nov 26 04:32:59 2010 +0900
+++ b/Renderer/Test/aquarium.cc	Fri Nov 26 04:35:34 2010 +0900
@@ -32,10 +32,13 @@
     return new aquarium();
 }
 
+/*
 static void
 null_move(SceneGraphPtr node, void *sgroot_, int screen_w, int screen_h)
 {
 }
+*/
+
 static void
 null_collision(SceneGraphPtr node, void *sgroot_, int screen_w, int screen_h, SceneGraphPtr tree)
 {
--- a/Renderer/Test/ball_bound.cc	Fri Nov 26 04:32:59 2010 +0900
+++ b/Renderer/Test/ball_bound.cc	Fri Nov 26 04:35:34 2010 +0900
@@ -81,8 +81,8 @@
 static void
 ball_move(SceneGraphPtr node, void *sgroot_, int screen_w, int screen_h)
 {
-    vy += g * dt;
-    node->xyz[1] += vy * dt;
+  vy += g * dt;
+   node->xyz[1] += vy * dt;
     //    node->xyz[0] += 10.0f;
 }
 
@@ -95,15 +95,15 @@
 ball_collision(SceneGraphPtr node, void *sgroot_, int screen_w, int screen_h,
 			   SceneGraphPtr tree)
 {
-    if (node->xyz[1] > screen_h - ball_radius) {
-		node->xyz[1] = screen_h - ball_radius;
-
-		vy *= e;
-		if (vy > -g && vy < 0) {
-			vy = 0.0;
-			node->set_move_collision(ball_move_idle, ball_collision_idle);
-		}
-    }
+  if (node->xyz[1] > screen_h - ball_radius) {
+  		node->xyz[1] = screen_h - ball_radius;
+  
+  		vy *= e;
+  		if (vy > -g && vy < 0) {
+  			vy = 0.0;
+  			node->set_move_collision(ball_move_idle, ball_collision_idle);
+  		}
+  }
 }
 
 MainLoopPtr 
--- a/Renderer/Test/network.cc	Fri Nov 26 04:32:59 2010 +0900
+++ b/Renderer/Test/network.cc	Fri Nov 26 04:35:34 2010 +0900
@@ -32,10 +32,13 @@
     return new NetworkGame();
 }
 
+/*
 static void
 null_move(SceneGraphPtr node, void *sgroot_, int screen_w, int screen_h)
 {
 }
+*/
+
 static void
 null_collision(SceneGraphPtr node, void *sgroot_, int screen_w, int screen_h, SceneGraphPtr tree)
 {
--- a/SceneGraph/BlenderScript/export_xml.py	Fri Nov 26 04:32:59 2010 +0900
+++ b/SceneGraph/BlenderScript/export_xml.py	Fri Nov 26 04:35:34 2010 +0900
@@ -447,8 +447,8 @@
 def loadTexture(texture):
 	global images, imageCount
 	name = texture.getName()
-	if name in images:
-		return "\t\t<image name=\"" + name + "\"/>\n"	
+	#if name in images:
+	#	return "\t\t<image name=\"" + name + "\"/>\n"	
 	out = "\t\t<image name=\"" + name + "\">\n"
 	imageCount += 1
 	images[name] = imageCount
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SceneGraph/BlenderScript/script_copy.sh	Fri Nov 26 04:35:34 2010 +0900
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+cp $1 /Applications/*blender*/blender.app/Contents/MacOS/.blender/scripts/
--- a/TaskManager/Cell/SpeThreads.cc	Fri Nov 26 04:32:59 2010 +0900
+++ b/TaskManager/Cell/SpeThreads.cc	Fri Nov 26 04:35:34 2010 +0900
@@ -127,7 +127,7 @@
  *  does not work.
  */
     if (spe_out_mbox_status(spe_ctx[speid]) >= 1) {    
-	return spe_out_mbox_read(spe_ctx[speid], (unsigned int*)ret, count*(sizeof(memaddr)/sizeof(int)));   
+      return spe_out_mbox_read(spe_ctx[speid], (unsigned int*)ret, count*(sizeof(memaddr)/sizeof(int)));   
     } else {
 	return 0;            
     }
--- a/TaskManager/Cell/spe/CellDmaManager.cc	Fri Nov 26 04:32:59 2010 +0900
+++ b/TaskManager/Cell/spe/CellDmaManager.cc	Fri Nov 26 04:35:34 2010 +0900
@@ -5,8 +5,6 @@
 
 
 unsigned long long alloc_flag = 0;
-// singleton
-QueueInfo<MailQueue> *MailPool = new QueueInfo<MailQueue>() ;
 
 /**
  * DMA Load
@@ -90,24 +88,22 @@
 void CellDmaManager::mail_write_queue(memaddr data)
 {
     (this->*start_dmawait_profile)();
+
     if (0 != spu_readchcnt(SPU_WrOutMbox)) {
-      if (mail_queue->empty()) {
+      if (mail_queue->count()) {
           spu_write_out_mbox((uint32)data);
       } else {
-	  MailQueuePtr mail = mail_queue->poll();
-	  if (0 == mail->data) {
-	    printf("hoge\n");
-	  }
-	  spu_write_out_mbox((uint32)mail->data);
-	  mail_queue->free_(mail);
-	  mail = mail_queue->create();
-	  mail->data = data;
-	  mail_queue->addLast(mail);
+
+	//mail_queue から poll する
+	spu_write_out_mbox((uint32)mail_queue->recv());
+	//mail_queue に加える
+	mail_queue->send(data);
+
       }
     } else {
-        MailQueuePtr mail = mail_queue->create();
-	mail->data = data;
-	mail_queue->addLast(mail);
+
+      mail_queue->send(data);
+
     }
     (this->*end_dmawait_profile)(&global_mail_time);
 }
@@ -118,31 +114,55 @@
 
     (this->*start_dmawait_profile)();
 
-    while (!mail_queue->empty()) {
-      MailQueuePtr mail = mail_queue->poll();
-      spu_write_out_mbox((uint32)mail->data);
-      mail_queue->free_(mail);
+    while (mail_queue->count()) {
+
+      spu_write_out_mbox((uint32)mail_queue->recv());      
+
     }
 
     spu_write_out_mbox((uint32)data);
-    //mail_queue.freePool();
 
     (this->*end_dmawait_profile)(&global_mail_time);
+
+
 }
 
 memaddr CellDmaManager::mail_read()
 {
+
+
     (this->*start_dmawait_profile)();
     memaddr data = (memaddr)spu_read_in_mbox();
+    
 #if 0 
     if (ABIBIT>32) {
 	data += (spu_read_in_mbox()<<32);
     }
 #endif
     (this->*end_dmawait_profile)(&global_mail_time);
+
+
+
     return data;
 }
 
+memaddr CellDmaManager::task_list_mail_read()
+{
+
+    unsigned long long wait = 0;
+
+    (this->*start_dmawait_profile)();
+    memaddr data = (memaddr)spu_read_in_mbox();
+    (this->*end_dmawait_profile)(&wait);
+
+    task_list_mail_time += wait;
+    global_mail_time += wait;
+
+    return data;
+}
+
+
+
 void CellDmaManager::dma_loadList(ListDataPtr list, void *buff, uint32 mask)
 {
     mfc_getl(buff, 0, list->element, sizeof(mfc_list_element_t)*list->length,
@@ -159,7 +179,7 @@
 CellDmaManager::CellDmaManager() 
 {
 
-    mail_queue = new QueueInfo<MailQueue>(MailPool);
+    mail_queue = new MailManager();
     stop_profile();
 }
 void
@@ -169,6 +189,7 @@
     global_mail_time = 0;
     global_wait_time = 0;
     task_array_load_time = 0;
+    task_list_mail_time = 0;
     start_dmawait_profile =  &CellDmaManager::do_start_dmawait_profile;
     end_dmawait_profile =  &CellDmaManager::do_end_dmawait_profile;  
 
@@ -189,8 +210,10 @@
 void
 CellDmaManager::do_start_dmawait_profile()
 {
+
     wait_time = spu_readch(SPU_RdDec); 
     global_busy_time += busy_time - wait_time;
+
     spu_writech(SPU_WrDec, 0xffffffff);
 
     // Measurement of mainMem_alloc
@@ -228,14 +251,21 @@
 	global_busy_time+global_wait_time+global_mail_time
 	))*100.0;
 
+  double t = ((double)task_list_mail_time)/((double)(
+	global_busy_time+global_wait_time+global_mail_time
+	))*100.0;
+
+
   s->printf("spu%d: busy_time = %lld"
   " wait_time = %lld(%.3g%%), "
   " mail_time = %lld(%.3g%%), " 
-  " busy_ratio = %.3g%%"
-  " array_load_time = %lld\n"
+  " task_list_mail_time = %lld(%.3g%%), " 
+  " busy_ratio = %.3g%%, "
+  " array_load_time = %lld, "
   " mainMem_alloc_time = %lld\n"
     ,cpu, global_busy_time,
-    global_wait_time, d, global_mail_time, m, r,
+    global_wait_time, d, global_mail_time, m, 
+    task_list_mail_time, t, r,
     task_array_load_time,
     mainMemalloc_time);
 
@@ -243,6 +273,7 @@
     global_mail_time = 0;
     global_wait_time = 0;
     task_array_load_time = 0;
+    task_list_mail_time = 0;
     mainMemalloc_time = 0;
     alloc_flag = 0;
 }
--- a/TaskManager/Cell/spe/CellDmaManager.h	Fri Nov 26 04:32:59 2010 +0900
+++ b/TaskManager/Cell/spe/CellDmaManager.h	Fri Nov 26 04:35:34 2010 +0900
@@ -4,8 +4,7 @@
 #include "base.h"
 #include "types.h"
 #include "DmaManager.h"
-#include "QueueInfo.h"
-#include "MailQueue.h"
+#include "MailManager.h"
 
 #include <spu_mfcio.h>
 #include <spu_intrinsics.h>
@@ -23,7 +22,6 @@
 	uint32 size;
     }  __attribute__ ((aligned (DEFAULT_ALIGNMENT))) DmaList, *DmaListPtr;
 
-    QueueInfo<MailQueue> *mail_queue;
 
     CellDmaManager() ;
 
@@ -31,6 +29,7 @@
     unsigned int wait_time, busy_time, alloc_busy_time;
     unsigned long long global_busy_time, global_wait_time, global_mail_time, mainMemalloc_time;
     unsigned long long task_array_load_time;
+    unsigned long long task_list_mail_time;
 
     /* functions */
     void dma_load(void *buf, memaddr addr, uint32 size, uint32 mask);
@@ -49,6 +48,7 @@
     void mail_write_queue(memaddr data);
     void mail_write_finish_list(memaddr data);
     memaddr mail_read();
+    memaddr task_list_mail_read();
     void dma_loadList(ListDataPtr list, void *buff, uint32 mask);
     void dma_storeList(ListDataPtr, void *buff, uint32 mask);
 
@@ -59,6 +59,8 @@
     void null_start_dmawait_profile();
     void null_end_dmawait_profile(unsigned long long *counter);
 
+    MailManagerPtr mail_queue;
+
 
 /* end */
 }  ;
--- a/TaskManager/Cell/spe/MailQueue.h	Fri Nov 26 04:32:59 2010 +0900
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,19 +0,0 @@
-#ifndef INCLUDED_MAILQUEUE
-#define INCLUDED_MAILQUEUE
-
-class MailQueue {
-public:
-    memaddr data;
-    MailQueue *next; // 4 byte
-    MailQueue *prev; // 4 byte
-    MailQueue *waiter; // 4 byte
-
-    void init() { data = 0; }
-    void initOnce() {}
-    void freeOnce() {}
-
-} ;
-
-typedef MailQueue* MailQueuePtr;
-
-#endif
--- a/TaskManager/Fifo/FifoDmaManager.h	Fri Nov 26 04:32:59 2010 +0900
+++ b/TaskManager/Fifo/FifoDmaManager.h	Fri Nov 26 04:35:34 2010 +0900
@@ -34,6 +34,7 @@
     void mail_write_queue(memaddr data) { mail_queue1->send(data); }
     void mail_write_finish_list(memaddr data) { mail_queue1->send(data); }
     memaddr mail_read() { return mail_queue2->recv(); }
+    memaddr task_list_mail_read() { return mail_queue2->recv(); }
 
     void mail_write_from_host(memaddr data) { mail_queue2->send(data); }
     memaddr mail_read_from_host() { return mail_queue1->recv(); }
--- a/TaskManager/Makefile.cell	Fri Nov 26 04:32:59 2010 +0900
+++ b/TaskManager/Makefile.cell	Fri Nov 26 04:35:34 2010 +0900
@@ -17,7 +17,8 @@
     $(CELL_SPE_DIR)/Scheduler.cc\
     $(CELL_SPE_DIR)/SchedNop.cc        \
     $(CELL_SPE_DIR)/MemList.cc        \
-    $(CELL_SPE_DIR)/MemHash.cc        
+    $(CELL_SPE_DIR)/MemHash.cc    \
+    $(CELL_SPE_DIR)/MailManager.cc        
 CELL_SPE_SCHEDULE_OBJ = $(CELL_SPE_SCHEDULE_SRC:.cc=.o)
 
 CELL_SPE_SRCS =  \
@@ -60,7 +61,7 @@
 $(CELL_SPE_SCHEDULE_SRC): kernel/schedule/*.cc kernel/memory/*.cc kernel/ppe/*.cc
 	cp kernel/schedule/*.cc $(CELL_SPE_DIR)/
 	cp kernel/memory/*.cc $(CELL_SPE_DIR)/
-	cp kernel/ppe/{TaskQueue.cc,Task.cc} $(CELL_SPE_DIR)/
+	cp kernel/ppe/{TaskQueue.cc,Task.cc,MailManager.cc} $(CELL_SPE_DIR)/
 
 $(CELL_SPE_OBJS): %.o : %.cc
 	$(SPUCC)  $(SPE_CFLAGS) $(INCLUDE) -c $< -o $@
--- a/TaskManager/Makefile.def	Fri Nov 26 04:32:59 2010 +0900
+++ b/TaskManager/Makefile.def	Fri Nov 26 04:35:34 2010 +0900
@@ -29,7 +29,7 @@
 
 ABIBIT = 32
 
-OPT = -g -O9 #-DMAIL_QUEUE
+OPT = -g -O9 -DMAIL_QUEUE
 # -DEARLY_TOUCH
 # -g -DTASK_LIST_MAIL -O9
 
--- a/TaskManager/kernel/schedule/DmaManager.h	Fri Nov 26 04:32:59 2010 +0900
+++ b/TaskManager/kernel/schedule/DmaManager.h	Fri Nov 26 04:35:34 2010 +0900
@@ -35,6 +35,7 @@
     virtual void mail_write_queue(memaddr data) {}
     virtual void mail_write_finish_list(memaddr data) {}
     virtual memaddr mail_read() { return 0; }
+    virtual memaddr task_list_mail_read() { return 0; }
     
     // API for MFC list DMA transfer
     virtual void dma_loadList(ListDataPtr list, void *,uint32 mask) {}
--- a/TaskManager/kernel/schedule/SchedMail.cc	Fri Nov 26 04:32:59 2010 +0900
+++ b/TaskManager/kernel/schedule/SchedMail.cc	Fri Nov 26 04:35:34 2010 +0900
@@ -7,7 +7,7 @@
 SchedMail::next(Scheduler *scheduler, SchedTaskBase *p)
 {
     
-    params_addr = scheduler->mail_read();
+   params_addr = scheduler->task_list_mail_read();
 
     __debug("[SchedMail:%s]\n", __FUNCTION__);
 
--- a/TaskManager/kernel/schedule/SchedNop2Ready.cc	Fri Nov 26 04:32:59 2010 +0900
+++ b/TaskManager/kernel/schedule/SchedNop2Ready.cc	Fri Nov 26 04:35:34 2010 +0900
@@ -16,8 +16,8 @@
 
 }
 
-SchedTaskBase*
-SchedNop2Ready::next(Scheduler *scheduler,SchedTaskBase *p)
+void
+SchedNop2Ready::write(void)
 {
     __debug("[SchedNop2Ready:%s]\n", __FUNCTION__);
 
@@ -26,5 +26,16 @@
 #else
     scheduler->mail_write((memaddr)MY_SPE_STATUS_READY);
 #endif
-    return new SchedMail();
+
+
 }
+
+SchedTaskBase*
+SchedNop2Ready::next(Scheduler *scheduler,SchedTaskBase *p)
+{
+    __debug("[SchedNop2Ready:%s]\n", __FUNCTION__);
+
+
+    return new SchedNop();
+    
+}
--- a/TaskManager/kernel/schedule/SchedNop2Ready.h	Fri Nov 26 04:32:59 2010 +0900
+++ b/TaskManager/kernel/schedule/SchedNop2Ready.h	Fri Nov 26 04:35:34 2010 +0900
@@ -20,11 +20,12 @@
 
     /* functions */
     void exec(void);
+    void write(void);
     SchedTaskBase* next(Scheduler *, SchedTaskBase *);
 
 #if DEBUG
     void read(void)  { __debug("[SchedNop2Ready:%s]\n", __FUNCTION__); }
-    void write(void) { __debug("[SchedNop2Ready:%s]\n", __FUNCTION__); }
+    //void write(void) { __debug("[SchedNop2Ready:%s]\n", __FUNCTION__); }
 #endif
 };
 
--- a/TaskManager/kernel/schedule/SchedTask.cc	Fri Nov 26 04:32:59 2010 +0900
+++ b/TaskManager/kernel/schedule/SchedTask.cc	Fri Nov 26 04:35:34 2010 +0900
@@ -129,6 +129,7 @@
 	// Task List が残っているので、次を準備
 
 	TaskPtr nextTask = &list->tasks[cur_index];
+	
         SchedTask *nextSched = new SchedTask();
 	nextSched->init(list, nextTask, cur_index+1, scheduler, this->tag^1);
 	// この時点で、TaskList は down load が済んでないことがある
@@ -149,6 +150,7 @@
         memaddr nextList = (memaddr)list->next;
         if (nextList == 0) {
 	    // もう何もする必要がない
+	    
             return new SchedNop2Ready(scheduler);
         } else {
 	    // 新しいリストに取り掛かる
--- a/TaskManager/kernel/schedule/Scheduler.cc	Fri Nov 26 04:32:59 2010 +0900
+++ b/TaskManager/kernel/schedule/Scheduler.cc	Fri Nov 26 04:35:34 2010 +0900
@@ -75,14 +75,15 @@
     // main loop
     do {
 
-	task3->write();
 	task1->read();
       	task2->exec();
+	task3->write();
 
 	delete task3; 
 
         task3 = task2;
         task2 = task1;
+	//SchedMailの場合、Mailの待ちが入る
 	task1 = task1->next(this, 0);
 
     } while (task1);
@@ -173,6 +174,12 @@
     return connector->mail_read();
 }
 
+memaddr
+Scheduler::task_list_mail_read()
+{
+    return connector->task_list_mail_read();
+}
+
 
 
 /*
--- a/TaskManager/kernel/schedule/Scheduler.h	Fri Nov 26 04:32:59 2010 +0900
+++ b/TaskManager/kernel/schedule/Scheduler.h	Fri Nov 26 04:35:34 2010 +0900
@@ -126,6 +126,7 @@
     void mail_write_queue(memaddr data);
     void mail_write_finish_list(memaddr data);
     memaddr mail_read();
+    memaddr task_list_mail_read();
     void dma_loadList(ListDataPtr list, void *, uint32 mask);
     void dma_storeList(ListDataPtr list, void *, uint32 mask);
 
--- a/example/HelloWorld/Func.h	Fri Nov 26 04:32:59 2010 +0900
+++ b/example/HelloWorld/Func.h	Fri Nov 26 04:35:34 2010 +0900
@@ -1,6 +1,6 @@
 enum {
 #include "SysTasks.h"
-    HELLO_TASK,
+    Hello,
     RUN_FINISH,
 };
 
--- a/example/HelloWorld/main.cc	Fri Nov 26 04:32:59 2010 +0900
+++ b/example/HelloWorld/main.cc	Fri Nov 26 04:35:34 2010 +0900
@@ -38,7 +38,7 @@
 	 *   create_task(Task ID);
 	 */
 
-	HTask *hello = manager->create_task(HELLO_TASK);
+	HTask *hello = manager->create_task(Hello);
 
 	/**
 	 * Select CPU
--- a/example/HelloWorld/ppe/Hello.cc	Fri Nov 26 04:32:59 2010 +0900
+++ b/example/HelloWorld/ppe/Hello.cc	Fri Nov 26 04:35:34 2010 +0900
@@ -4,10 +4,10 @@
 #include "Func.h"
 
 /* これは必須 */
-SchedDefineTask(Hello);
+SchedDefineTask1(Hello,hello);
 
 static int
-run(SchedTask *smanager, void *rbuf, void *wbuf)
+hello(SchedTask *smanager, void *rbuf, void *wbuf)
 {
     int task_id = (long)smanager->get_param(0);
 
--- a/example/HelloWorld/ppe/task_init.cc	Fri Nov 26 04:32:59 2010 +0900
+++ b/example/HelloWorld/ppe/task_init.cc	Fri Nov 26 04:35:34 2010 +0900
@@ -13,5 +13,5 @@
 void
 task_init()
 {
-  SchedRegisterTask(HELLO_TASK, Hello);
+  SchedRegister(Hello);
 }
--- a/example/HelloWorld/spe/Hello.cc	Fri Nov 26 04:32:59 2010 +0900
+++ b/example/HelloWorld/spe/Hello.cc	Fri Nov 26 04:35:34 2010 +0900
@@ -3,10 +3,10 @@
 #include "Func.h"
 
 /* これは必須 */
-SchedDefineTask(Hello);
+SchedDefineTask1(Hello,hello);
 
 static int
-run(SchedTask *smanager, void *rbuf, void *wbuf)
+hello(SchedTask *smanager, void *rbuf, void *wbuf)
 {
     long task_id = (long)smanager->get_param(0);
 
--- a/example/HelloWorld/spe/spe-main.cc	Fri Nov 26 04:32:59 2010 +0900
+++ b/example/HelloWorld/spe/spe-main.cc	Fri Nov 26 04:35:34 2010 +0900
@@ -10,5 +10,5 @@
 void
 task_init(Scheduler *s)
 {
-    SchedRegisterTask(HELLO_TASK, Hello);
+    SchedRegister(Hello);
 }
--- a/example/dependency_task/Makefile.def	Fri Nov 26 04:32:59 2010 +0900
+++ b/example/dependency_task/Makefile.def	Fri Nov 26 04:35:34 2010 +0900
@@ -10,7 +10,7 @@
 ABIBIT=32
 
 CC      = g++ -m$(ABIBIT)
-CFLAGS  = -g -Wall -O9
+CFLAGS  = -g -Wall #-O9
 
 INCLUDE = -I${CERIUM}/include/TaskManager -I. -I..
 LIBS = -L${CERIUM}/TaskManager
--- a/example/dependency_task/spe/Exec.cc	Fri Nov 26 04:32:59 2010 +0900
+++ b/example/dependency_task/spe/Exec.cc	Fri Nov 26 04:35:34 2010 +0900
@@ -8,6 +8,7 @@
 static int
 run(SchedTask *s, void *rbuf, void *wbuf)
 {
+
     int *idata = (int*)s->get_input(rbuf, 0);
     int *odata = (int*)s->get_output(wbuf, 0);
     int length = (long)s->get_param(0);
--- a/example/word_count/main.cc	Fri Nov 26 04:32:59 2010 +0900
+++ b/example/word_count/main.cc	Fri Nov 26 04:35:34 2010 +0900
@@ -77,7 +77,7 @@
 static void
 run_tasks(SchedTask *manager, WordCount *w, int task_count, HTaskPtr t_next, int size) 
 {
-  
+ 
   if (task_count < array_task_num) {
     array_task_num = task_count;
     if (task_count<=0) return;
@@ -172,7 +172,7 @@
   
   for (int i = 0; i < task_count; i += array_task_num) {
 
-  HTask *h_exec = 0;
+    HTask *h_exec = 0;
     for (int j = 0; j < array_task_num; j++) {
 	int i = w->task_spwaned++;
 	if (w->size < size) size = w->size;
@@ -183,6 +183,7 @@
 	    h_exec->set_inData(0,w->file_mmap + i*w->division_size, size);
 	    h_exec->set_outData(0,w->o_data + i*w->out_size, w->division_out_size);
 
+
 	    if (all) {
 	      w->t_print->wait_for(h_exec);
 	    } else {
--- a/example/word_count/spe/Exec.cc	Fri Nov 26 04:32:59 2010 +0900
+++ b/example/word_count/spe/Exec.cc	Fri Nov 26 04:35:34 2010 +0900
@@ -17,7 +17,7 @@
     int word_num = 0;
     int line_num = 0;
     int i = 0;
-    
+
     head_tail_flag[0] = (i_data[0] != 0x20) && (i_data[0] != 0x0A);
     word_num -= 1-head_tail_flag[0];