diff Renderer/Engine/SceneGraph.cc @ 1136:f326494ffdc7 draft

not work ieshoot. not check Cell
author Yutaka_Kinjyo
date Thu, 17 Feb 2011 10:50:40 +0900
parents 5addc6c1d5c4
children 3975c384ff93
line wrap: on
line diff
--- a/Renderer/Engine/SceneGraph.cc	Wed Feb 16 02:08:17 2011 +0900
+++ b/Renderer/Engine/SceneGraph.cc	Thu Feb 17 10:50:40 2011 +0900
@@ -175,8 +175,13 @@
       printf("vertex size is error. size %% 3 = %lld\n", size % 3);
     }
 
-    pp_num = (size/3 + MAX_SIZE_TRIANGLE - 1) / MAX_SIZE_TRIANGLE;
-    pp = (PolygonPack*)manager->allocate(sizeof(PolygonPack)*pp_num);
+    if (size > 0) {
+      pp_num = (size/3 + MAX_SIZE_TRIANGLE - 1) / MAX_SIZE_TRIANGLE;
+      pp = (PolygonPack*)manager->allocate(sizeof(PolygonPack)*pp_num);
+    } else {
+      pp_num = 0;
+      pp = NULL;
+    }
 
     get_data(manager, surface->children);
 
@@ -653,8 +658,19 @@
  * @return clone SceneGraph
  */
 SceneGraphPtr
-SceneGraph::clone() {
+SceneGraph::clone(TaskManager *manager) {
     SceneGraphPtr p = new SceneGraph(this);
+    
+    p->matrix = (float*)manager->allocate(sizeof(float)*16);
+    p->real_matrix = (float*)manager->allocate(sizeof(float)*16);
+    //これはいらない?
+    //p->texture_info = (float*)sgroot->manager->allocate(sizeof(texrure_list));
+
+    for (int i = 0; i < 16; i++) {
+      p->matrix[i] = this->matrix[i];
+      p->real_matrix[i] = this->real_matrix[i];
+    }
+
     return p;
 }