changeset 1313:857d3feaeb75 draft

collada file reader minor change.
author Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp>
date Thu, 15 Dec 2011 22:52:35 +0900
parents 78248082c56d
children a62cde2aaf7c
files Renderer/Engine/SceneGraphRoot.cc
diffstat 1 files changed, 8 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/Renderer/Engine/SceneGraphRoot.cc	Thu Dec 15 14:28:21 2011 +0900
+++ b/Renderer/Engine/SceneGraphRoot.cc	Thu Dec 15 22:52:35 2011 +0900
@@ -308,7 +308,7 @@
 static int
 strcmp_a(const char *a, const char *b)
 {
-    while (*a && *a++ = *b++);
+    while (*a && *a++ == *b++);
     if (*a) return 0;
     return a[-1] > b[-1] ? 1:-1;
 }
@@ -319,7 +319,7 @@
     SOURCE_P cur = list->first;
     for (;cur ; cur=cur->next) {
         if (!strcmp_a(id, cur->name)) {
-            if (list->count == 0) //alias
+            if (list->count == 0) //alias 
                 return get_point(list->u.alias, position, list);
             float *a = cur->u.array;
             if (position <= list->count) {
@@ -351,12 +351,13 @@
             char *semantic = (char*)xmlGetProp(cur, (xmlChar*)"semantic");
             if (!xmlStrcmp(semantic, (xmlChar*)"VERTEX") {
                 char *vertex_id = (char*)xmlGetProp(cur, (xmlChar*)"source");
-                int *vertex_offset = atoi((char*)xmlGetProp(cur, (xmlChar*)"offset"));
+                int vertex_offset = atoi((char*)xmlGetProp(cur, (xmlChar*)"offset"));
             }
+            get_point(vertex_id, , cur);
 
             if (!xmlStrcmp(semantic, (xmlChar*)"NORMAL") {
-                char *normal_id = (char*)xmlGetProp(cur, (xmlChar*)"id");
-                int *normal_offset = atoi((char*)xmlGetProp(cur, (xmlChar*)"offset"));
+                char *normal_id = (char*)xmlGetProp(cur, (xmlChar*)"source");
+                int normal_offset = atoi((char*)xmlGetProp(cur, (xmlChar*)"offset"));
             }
             /*
             if (!xmlStrcmp(semantic, (xmlChar*)"TEXTURE") {
@@ -364,10 +365,8 @@
                 int *normal_offset = atoi((char*)xmlGetProp(cur, (xmlChar*)"offset"));
             }
             */
-
-    }
-
-    if (!xmlStrcmp(cur->name, (xmlChar*)"float_array")) {
+            
+    } else if (!xmlStrcmp(cur->name, (xmlChar*)"float_array")) {
 
         SOURCE_P src = (SOURCE_P)malloc(sizeof(SOURCE));