changeset 1360:e7a515fcd0fc draft

minor update
author Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
date Thu, 19 Jan 2012 22:10:47 +0900
parents 842e04373d3a
children 6dc0176a47d6 80e96b616196
files Renderer/Engine/SceneGraphRoot.cc
diffstat 1 files changed, 15 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/Renderer/Engine/SceneGraphRoot.cc	Thu Jan 19 21:22:22 2012 +0900
+++ b/Renderer/Engine/SceneGraphRoot.cc	Thu Jan 19 22:10:47 2012 +0900
@@ -519,20 +519,24 @@
     }
 
     /* make triangle */
+    int k=0,l=0;
     for (int i=0;i<s->vcsum;i++) {
         if (s->vcount[i] == 4) {
-	        for (int j=0; j < s->vcount[i]; j++) {
-	            vertex_table[i] = s->vertex_float->u.array[vertexp[i]];
-	           	vertex_table[i+3] = s->vertex_float->u.array[vertexp[i+1]];
-           		i += 2;
-	         }
-	    }else if (s->vcount[i]==3) {
-            for (int j=0; j < s->vcount[i]; j++) {
-	             vertex_table[i] = s->vertex_float->u.array[vertexp[i]];
-            }
-	    }
+            vertex_table[k++] = s->vertex_float->u.array[vertexp[l]];
+            vertex_table[k++] = s->vertex_float->u.array[vertexp[l+1]];
+            vertex_table[k++] = s->vertex_float->u.array[vertexp[l+2]];
+            vertex_table[k++] = s->vertex_float->u.array[vertexp[l+1]];
+            vertex_table[k++] = s->vertex_float->u.array[vertexp[l+2]];
+            vertex_table[k++] = s->vertex_float->u.array[vertexp[l+3]];
+            l+=4;
+        } else if (s->vcount[i]==3) {
+            vertex_table[k++] = s->vertex_float->u.array[vertexp[l++]];
+            vertex_table[k++] = s->vertex_float->u.array[vertexp[l++]];
+            vertex_table[k++] = s->vertex_float->u.array[vertexp[l++]];
+        }
     }
-    /**
+
+   /**
      * (SceneGraph.cc)
      * pickup_normal,pickup_coordinate,pickup_textureの処理
      * vcsumは頂点の数,countは面の数