changeset 33:1c7c3d73ffc7

*** empty log message ***
author gongo
date Tue, 12 Feb 2008 15:41:38 +0900
parents f7fd92a1d7bb
children 34dd03a8a612
files TaskManager/Makefile.def TaskManager/Test/simple_render/create_pp.cpp TaskManager/Test/simple_render/create_sgp.cpp
diffstat 3 files changed, 44 insertions(+), 41 deletions(-) [+]
line wrap: on
line diff
--- a/TaskManager/Makefile.def	Tue Feb 12 14:48:35 2008 +0900
+++ b/TaskManager/Makefile.def	Tue Feb 12 15:41:38 2008 +0900
@@ -19,7 +19,7 @@
 IMPL_CELL_SRCS = $(wildcard $(IMPL_CELL_DIR)/*.cpp)
 IMPL_CELL_OBJS = $(IMPL_CELL_SRCS:.cpp=.o)
 
-CC     = g++
+CC     = g++ 
 CFLAGS = -Wall -g -D_PPE_DEBUG# -DDEBUG
 LIBS   = 
 
--- a/TaskManager/Test/simple_render/create_pp.cpp	Tue Feb 12 14:48:35 2008 +0900
+++ b/TaskManager/Test/simple_render/create_pp.cpp	Tue Feb 12 15:41:38 2008 +0900
@@ -10,44 +10,44 @@
   float xyz1[4],xyz2[4],xyz3[4];
 
   for (int i = 0; i < sgp->info.size; i++) {
-    SceneGraphNode node = sgp->node[i];
+    SceneGraphNodePtr node = &sgp->node[i];
 
     int n,nt,pt;
-    for(n=0,nt=0,pt=0; n<node.size*3; n+=9,nt+=6,pt++) {
-      xyz1[0] = node.vertex[n];
-      xyz1[1] = node.vertex[n+1];
-      xyz1[2] = node.vertex[n+2]*-1;
+    for(n=0,nt=0,pt=0; n<node->size*3; n+=9,nt+=6,pt++) {
+      xyz1[0] = node->vertex[n];
+      xyz1[1] = node->vertex[n+1];
+      xyz1[2] = node->vertex[n+2]*-1;
       xyz1[3] = 1;
-      xyz2[0] = node.vertex[n+3];
-      xyz2[1] = node.vertex[n+3+1];
-      xyz2[2] = node.vertex[n+3+2]*-1;
+      xyz2[0] = node->vertex[n+3];
+      xyz2[1] = node->vertex[n+3+1];
+      xyz2[2] = node->vertex[n+3+2]*-1;
       xyz2[3] = 1;
-      xyz3[0] = node.vertex[n+6];
-      xyz3[1] = node.vertex[n+6+1];
-      xyz3[2] = node.vertex[n+6+2]*-1;
+      xyz3[0] = node->vertex[n+6];
+      xyz3[1] = node->vertex[n+6+1];
+      xyz3[2] = node->vertex[n+6+2]*-1;
       xyz3[3] = 1;
 
-      rotate(xyz1, node.translation);
-      rotate(xyz2, node.translation);
-      rotate(xyz3, node.translation);
+      rotate(xyz1, node->translation);
+      rotate(xyz2, node->translation);
+      rotate(xyz3, node->translation);
 
       pp->tri[pt].x1 = xyz1[0];
       pp->tri[pt].y1 = xyz1[1];
       pp->tri[pt].z1 = xyz1[2];
-      pp->tri[pt].tex_x1 = node.texture[nt];
-      pp->tri[pt].tex_y1 = node.texture[nt+1];
+      pp->tri[pt].tex_x1 = node->texture[nt];
+      pp->tri[pt].tex_y1 = node->texture[nt+1];
 
       pp->tri[pt].x2 = xyz2[0];
       pp->tri[pt].y2 = xyz2[1];
       pp->tri[pt].z2 = xyz2[2];
-      pp->tri[pt].tex_x2 = node.texture[nt+2];
-      pp->tri[pt].tex_y2 = node.texture[nt+2+1];
+      pp->tri[pt].tex_x2 = node->texture[nt+2];
+      pp->tri[pt].tex_y2 = node->texture[nt+2+1];
 
       pp->tri[pt].x3 = xyz3[0];
       pp->tri[pt].y3 = xyz3[1];
       pp->tri[pt].z3 = xyz3[2];
-      pp->tri[pt].tex_x3 = node.texture[nt+4];
-      pp->tri[pt].tex_y3 = node.texture[nt+4+1];
+      pp->tri[pt].tex_x3 = node->texture[nt+4];
+      pp->tri[pt].tex_y3 = node->texture[nt+4+1];
 
     }
     pp->info.size = pt;
--- a/TaskManager/Test/simple_render/create_sgp.cpp	Tue Feb 12 14:48:35 2008 +0900
+++ b/TaskManager/Test/simple_render/create_sgp.cpp	Tue Feb 12 15:41:38 2008 +0900
@@ -8,40 +8,43 @@
 {
     int i = 0;
     int nnpn = -1;
+    SceneGraphNodePtr node;
 
     Polygon *t;
     t = sg;
 
     while(t)
     {
-	sgp->node[i].size = t->size;
+	node = &sgp->node[i];
+
+	node->size = t->size;
 	int d,tex;
 	for(d=0,tex=0; d<t->size*3; d+=3,tex+=2)
 	{
-	    sgp->node[i].vertex[d] = t->data[d];
-	    sgp->node[i].vertex[d+1] = t->data[d+1];
-	    sgp->node[i].vertex[d+2] = t->data[d+2];
-	    sgp->node[i].texture[tex] = t->data[d+t->size*6];
-	    sgp->node[i].texture[tex+1] = t->data[d+t->size*6+1];
+	    node->vertex[d] = t->data[d];
+	    node->vertex[d+1] = t->data[d+1];
+	    node->vertex[d+2] = t->data[d+2];
+	    node->texture[tex] = t->data[d+t->size*6];
+	    node->texture[tex+1] = t->data[d+t->size*6+1];
 	}
 
-	sgp->node[i].obj_pos[0] = 0;
-	sgp->node[i].obj_pos[1] = 0;
-	sgp->node[i].obj_pos[2] = 0;
-	sgp->node[i].obj_pos[3] = 1;
-	sgp->node[i].angle[0] = 0;
-	sgp->node[i].angle[1] = 0;
-	sgp->node[i].angle[2] = 0;
-	sgp->node[i].angle[3] = 1;
+	node->obj_pos[0] = 0;
+	node->obj_pos[1] = 0;
+	node->obj_pos[2] = 0;
+	node->obj_pos[3] = 1;
+	node->angle[0] = 0;
+	node->angle[1] = 0;
+	node->angle[2] = 0;
+	node->angle[3] = 1;
 
 	for(int tm=0; tm<16; tm++)
         {
-	    sgp->node[i].translation[tm] = 0;
+	    node->translation[tm] = 0;
         }
-	sgp->node[i].id = 0;
-	sgp->node[i].move = 0;
-	sgp->node[i].interaction = 0;
-	sgp->node[i].pn = nnpn;
+	node->id = 0;
+	node->move = 0;
+	node->interaction = 0;
+	node->pn = nnpn;
 
 	if(t->child != NULL)
 	{
@@ -50,7 +53,7 @@
 	}
 	else if(t->brother != NULL)
 	{
-	    nnpn = sgp->node[i].pn;
+	    nnpn = node->pn;
 	    t = t->brother;
 	}
 	else