X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=lib%2Fgfxpoly%2Fconvert.c;h=aea0a171d57869da297aadffd5a3bfb7511ddc31;hb=33e9461da6b886671749d6cbabd80b355ab1f6d9;hp=f404dfc24b607e99891391cbb023fd7a1898be23;hpb=ae7c92fe5721f97e786a8bbe9153eadbf292460d;p=swftools.git diff --git a/lib/gfxpoly/convert.c b/lib/gfxpoly/convert.c index f404dfc..aea0a17 100644 --- a/lib/gfxpoly/convert.c +++ b/lib/gfxpoly/convert.c @@ -1,6 +1,5 @@ #include #include -#include #include #include "../gfxdevice.h" #include "../mem.h" @@ -105,6 +104,7 @@ gfxpoly_t* gfxpoly_from_file(const char*filename, double gridsize) return 0; } int count = 0; + double g = 0; double lastx=0,lasty=0; while(1) { char*line = readline(fi); @@ -125,10 +125,16 @@ gfxpoly_t* gfxpoly_from_file(const char*filename, double gridsize) } lastx = x; lasty = y; + } else if(sscanf(line, "%% gridsize %lf", &g) == 1) { + p->gridsize = g; } free(line); } fclose(fi); - printf("loaded %d points from %s\n", count, filename); + if(g) { + printf("loaded %d points from %s (gridsize %f)\n", count, filename, g); + } else { + printf("loaded %d points from %s\n", count, filename); + } return p; }