# HG changeset patch # User e095732 # Date 1324379514 -32400 # Node ID e5894cf1d2cae71698c652e11185b23330d985f1 # Parent 0f41ff4ca2abdcc2b49a7f5cc24bd91fc4949aac minor changes. diff -r 0f41ff4ca2ab -r e5894cf1d2ca Renderer/Engine/SceneGraphRoot.cc --- a/Renderer/Engine/SceneGraphRoot.cc Tue Dec 20 18:54:19 2011 +0900 +++ b/Renderer/Engine/SceneGraphRoot.cc Tue Dec 20 20:11:54 2011 +0900 @@ -311,7 +311,7 @@ if (*a) return 0; return a[-1] > b[-1] ? 1:-1; } - +/* static float get_point(char *id, int position, LIST_P list) { @@ -327,7 +327,7 @@ } } } - +*/ /** * co */ @@ -366,12 +366,13 @@ char *texcoord_src; int texcoord_offset; int texcoord_count; - + float *vcount; float *pcount; - + SOURCE_P normal_float; SOURCE_P vertex_float; + SOURCE_P texcoord_float; char *vertices_src; int polylist_count; @@ -425,7 +426,7 @@ s->texcoord_src = (char*)xmlGetProp(cur, (xmlChar*)"source"); s->texcoord_offset = atoi((char*)xmlGetProp(cur, (xmlChar*)"offset")); - s->texcoord_float = most_match(s->normal_src+1, list); + s->texcoord_float = most_match(s->texcoord_src+1, list); } } else if (!xmlStrcmp(cur->name, (xmlChar*)"vcount")) { @@ -454,13 +455,15 @@ 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) ; /* p separate vertex position and nomal position. */ for (int i = 0; i < s->polylist_count; i+=2) { vertexp[i] = s->pcount[i]; normal_table[i] = s->normal_float->u.array[(int)s->pcount[i+1]]; - if (texcoord_offset < 0) { - i++; + if (s->texcoord_offset == 2) { + i++; + texcoord_table[i] = s->texcoord_float->u.array[(int)s->pcount[i+1]]; } } @@ -476,7 +479,8 @@ vertex_table[i] = s->vertex_float->u.array[vertexp[i]]; } } - for (int i=0; vertex_table; i++) { + /*TEST*/ + for (int i=0; vertex_table==0; i++) { printf("normal_table= %f\n", normal_table[i]); printf("vertex_table= %f\n", vertex_table[i]); }