* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
+#define _GNU_SOURCE
#include <glib.h>
-
#include <stdio.h>
#include <stdlib.h>
+#include <ctype.h>
#include "point.h"
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;
Point last;
Point rect;
file = fopen (filename, "r");
- points = g_array_new (FALSE, TRUE, sizeof (SDL_Rect));
- names = g_ptr_array_new ();
+ points = g_array_new (FALSE, TRUE, sizeof (Point));
buffer = NULL;
len = 0;
rect.x = rect.y = 0;
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++;
}
fclose (file);
return points;
}
+
+void
+rescale_points (GArray *points)
+{
+ Point *point;
+ int i;
+ for (i = 0; i < points->len; i++)
+ {
+ point = &(g_array_index (points, Point, i));
+ point->rx = 4.0;
+ point->ry = 4.0;
+ point->x *= point->rx;
+ point->y *= point->ry;
+ }
+}