# HG changeset patch # User e095732 # Date 1326026882 -32400 # Node ID 8b60616fca4599bc32af9dcbe805c2d76963a528 # Parent 3f95f61faef69c88ee013527df9cbe9a53e94c29 minor change diff -r 3f95f61faef6 -r 8b60616fca45 Renderer/Engine/SceneGraphRoot.cc --- a/Renderer/Engine/SceneGraphRoot.cc Wed Dec 21 17:43:20 2011 +0900 +++ b/Renderer/Engine/SceneGraphRoot.cc Sun Jan 08 21:48:02 2012 +0900 @@ -407,7 +407,7 @@ int count = atoi((char*)xmlGetProp(cur, (xmlChar*)"count")); src->count = atoi((char*)xmlGetProp(cur, (xmlChar*)"count")); - src->u.array = (float*)malloc(sizeof(float) * src->count); + src->u.array = (float*)malloc(sizeof(float)*src->count); char *cont =(char*)xmlNodeGetContent(cur); //const char *id = get_property("id", cur); @@ -431,26 +431,30 @@ for (int i = 0;i < s->polylist_count;i++){ vcsum += s->vcount[i]; } - s->pcount = (float*)malloc(sizeof(float)*vcsum); + s->pcount = (float*)malloc(sizeof(float)*vcsum); for (int i=0; pcont != NULL; i++) { pcont = pickup_float(pcont, s->pcount+i); } - int vertexp[vcsum]; - for (int i = 0;i < vcsum;i++){ + int vertexp[vcsum]; + for (int i=0;ivertex_float->count) ; + float *vertex_table = (float*)malloc(sizeof(float)*s->vertex_float->count) ; float *normal_table = (float*)malloc(sizeof(float)*s->normal_float->count) ; float *texcoord_table = (float*)malloc(sizeof(float)*s->texcoord_float->count) ; + + //float *vertex_table = new float[s->vertex_float->count]; + //float *normal_table = new float[s->normal_float->count]; + //float *texcoord_table = new float[s->texcoord_float->count]; + int limit = vcsum * 2; if (s->texcoord_offset == 2){ limit = vcsum * 3; } /* p separate vertex position and nomal position. */ - for (int i = 0,j=0; i < limit; i+=2,j++) { + for (int i=0,j=0; i < limit; i+=2,j++) { vertexp[j] = s->pcount[i]; normal_table[j] = s->normal_float->u.array[(int)s->pcount[i+1]]; if (s->texcoord_offset == 2) { @@ -528,10 +532,13 @@ printf("vertexp = %d\n", vertexp[i]); // printf("vertex_table= %f\n", vertex_table[i]); } - - free(vertex_table); - free(normal_table); - free(texcoord_table); + free(vertexp); + //free(vertex_table); + //free(normal_table); + //free(texcoord_table); + //delete vertex_table; + //delete normal_table; + //delete texcoord_table; /* got out of polylist */ s->polylist = 0;