int clips;
SWF swf;
int width,height;
+ MATRIX m;
} swf_doc_internal_t;
#define TYPE_SHAPE 1
U16 depth = swf_GetDepth(tag);
map16_remove_id(depthmap, depth);
}
- if(tag->id == ST_SHOWFRAME) {
+ if(tag->id == ST_SHOWFRAME || tag->id == ST_END) {
if(frame == frame_to_extract) {
return depthmap;
}
- frame++;
- map16_enumerate(depthmap, increaseAge, 0);
+ if(tag->id == ST_SHOWFRAME) {
+ frame++;
+ map16_enumerate(depthmap, increaseAge, 0);
+ }
}
}
+ fprintf(stderr, "gfxsource_swf: frame %d not found\n", frame_to_extract);
return depthmap;
}
{
map16_t*id2char;
gfxdevice_t*device;
+ MATRIX m;
int clips;
} render_t;
if(c->type == TYPE_SHAPE) {
SHAPE2 shape;
swf_ParseDefineShape(c->tag, &shape);
- swf_ApplyMatrixToShape(&shape, &p->po.matrix);
+ MATRIX m;
+ swf_MatrixJoin(&m, &r->m, &p->po.matrix);
+ swf_ApplyMatrixToShape(&shape, &m);
SHAPELINE*line = shape.lines;
int t;
for(t=1;t<=shape.numfillstyles;t++) {
r.id2char = pi->id2char;
r.clips = 0;
r.device = output;
+ r.m = pi->m;
map16_enumerate(depths, placeObject, &r);
}
TAG*tag = 0;
int f;
- SWF swf;
int frame;
render_t r;
gfxdevice_t d;
perror("Couldn't open file: ");
return 0;
}
- if FAILED(swf_ReadSWF(f,&swf)) {
+ if FAILED(swf_ReadSWF(f,&i->swf)) {
fprintf(stderr, "%s is not a valid SWF file or contains errors.\n",filename);
close(f);
return 0;
}
- swf_UnFoldAll(&swf);
+ swf_UnFoldAll(&i->swf);
+
+ i->id2char = extractDefinitions(&i->swf);
+ i->width = (i->swf.movieSize.xmax - i->swf.movieSize.xmin) / 20;
+ i->height = (i->swf.movieSize.ymax - i->swf.movieSize.ymin) / 20;
- i->id2char = extractDefinitions(&swf);
- i->width = (swf.movieSize.xmax - swf.movieSize.xmin) / 20;
- i->height = (swf.movieSize.ymax - swf.movieSize.ymin) / 20;
+ swf_GetMatrix(0, &i->m);
+ i->m.tx = -i->swf.movieSize.xmin;
+ i->m.ty = -i->swf.movieSize.ymin;
- swf_doc->num_pages = swf.frameCount;
+ swf_doc->num_pages = i->swf.frameCount;
swf_doc->internal = i;
swf_doc->get = 0;
swf_doc->destroy = swf_doc_destroy;