Stop over every face and only save the name for one point
[cascardo/movie.git] / movie.c
diff --git a/movie.c b/movie.c
index 56da26a..8fbbf6a 100644 (file)
--- a/movie.c
+++ b/movie.c
@@ -35,7 +35,7 @@ InsertLine (GArray *points, Point *src, Point *dst)
   int inc, err, thre, swap;
   int x1, y1, x2, y2;
   int x, y;
-  rect.name = src->name;
+  rect.name = NULL;
   err = 0;
   swap = 0;
   x1 = src->x;
@@ -91,10 +91,11 @@ ReadPoints (char *filename)
     rect.x = strtol (buffer, &next, 0);
     rect.y = strtol (next+1, &next, 0);
     strtol (next, &next, 0);
-    if (i > 0)
-      InsertLine (points, &last, &rect);
     while (isspace (*next)) next++;
     rect.name = g_strdup (next);
+    if (i > 0)
+      InsertLine (points, &last, &rect);
+    g_array_append_val (points, rect);
     last = rect;
     i++;
   }