7 #include "../lib/rfxswf.h"
11 typedef struct RENDERBUF
22 typedef struct _renderbuf_internal
28 void swf_RenderShape(RENDERBUF*dest, SHAPE2*shape)
30 renderbuf_internal*i = (renderbuf_internal)dest->internal;
32 SHAPELINE*line = shape->lines;
37 if(line->type == moveTo) {
38 /* max 31 bits + sign */
41 } else if(line->type == lineTo) {
42 /* max 17 bits + sign */
43 int diffx = line->x - x;
44 int diffy = line->y - y;
45 int stepx,posx=0,posy=0;
52 stepx = (diffx*0x1000) / diffy;
55 int xx = x + ((posx)/0x1000);
57 // TODO: add pixel to dest
64 } else if(line->type == splineTo) {
73 char*filename = "output.swf";
74 fi = open(filename, O_RDONLY|O_BINARY);
76 fprintf(stderr,"Couldn't open %s\n", filename);
81 if(swf_ReadSWF(fi,&swf)<0) {
82 fprintf(stderr,"%s is not a valid SWF file or contains errors.\n",argv[1]);
88 if(tag.id == ST_DEFINESHAPE3) {
90 swf_ParseDefineShape(tag, &shape);
91 swf_RenderShape(tag, MATRIX m);