git.asbjorn.biz
/
swftools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
some cleanups, extended testcases forward2, override_ns
[swftools.git]
/
lib
/
readers
/
swf.c
diff --git
a/lib/readers/swf.c
b/lib/readers/swf.c
index
132bf84
..
25edb17
100644
(file)
--- a/
lib/readers/swf.c
+++ b/
lib/readers/swf.c
@@
-149,21
+149,27
@@
static gfxgradient_t* convertGradient(GRADIENT*from)
gfxline_t* swfline_to_gfxline(SHAPELINE*line, int linestyle, int fillstyle0)
{
gfxdrawer_t d;
gfxline_t* swfline_to_gfxline(SHAPELINE*line, int linestyle, int fillstyle0)
{
gfxdrawer_t d;
- SCOORD x=0,y=0;
+ SCOORD x=0,y=0,xx=0,yy=0;
gfxline_t*l;
gfxdrawer_target_gfxline(&d);
if(line && line->type != moveTo) {
fprintf(stderr, "Warning: Shape doesn't start with a moveTo\n");
}
gfxline_t*l;
gfxdrawer_target_gfxline(&d);
if(line && line->type != moveTo) {
fprintf(stderr, "Warning: Shape doesn't start with a moveTo\n");
}
+ xx = line?line->x+1:0;
while(line) {
while(line) {
- if(line->fillstyle0 == fillstyle0 || line->fillstyle1 == fillstyle0 ||
+ if(line->fillstyle0 == fillstyle0 ||
+ line->fillstyle1 == fillstyle0 ||
line->linestyle == linestyle) {
if(line->type == lineTo) {
line->linestyle == linestyle) {
if(line->type == lineTo) {
- d.moveTo(&d, x/20.0,y/20.0);
+ if(xx!=x || yy!=y) d.moveTo(&d, x/20.0,y/20.0);
d.lineTo(&d, line->x/20.0,line->y/20.0);
d.lineTo(&d, line->x/20.0,line->y/20.0);
+ xx = line->x;
+ yy = line->y;
} else if(line->type == splineTo) {
} else if(line->type == splineTo) {
- d.moveTo(&d, x/20.0,y/20.0);
+ if(xx!=x || yy!=y) d.moveTo(&d, x/20.0,y/20.0);
d.splineTo(&d, line->sx/20.0, line->sy/20.0, line->x/20.0,line->y/20.0);
d.splineTo(&d, line->sx/20.0, line->sy/20.0, line->x/20.0,line->y/20.0);
+ xx = line->x;
+ yy = line->y;
}
}
x = line->x;
}
}
x = line->x;
@@
-228,7
+234,15
@@
static void renderFilled(render_t*r, gfxline_t*line, FILLSTYLE*f, CXFORM*cx, MAT
} else if(f->type == FILL_LINEAR || f->type == FILL_RADIAL) {
gfxmatrix_t m;
gfxgradient_t* g;
} else if(f->type == FILL_LINEAR || f->type == FILL_RADIAL) {
gfxmatrix_t m;
gfxgradient_t* g;
- convertMatrix(&f->m, &m);
+ MATRIX* m2 = &f->m;
+ //swf_MatrixJoin(&m2, po_m, &f->m);
+
+ double z = f->type==FILL_RADIAL?4:4;
+ m.m00 = m2->sx/z/20.0; m.m10 = m2->r1/z/20.0;
+ m.m01 = m2->r0/z/20.0; m.m11 = m2->sy/z/20.0;
+ m.tx = m2->tx/20.0;
+ m.ty = m2->ty/20.0;
+
g = convertGradient(&f->gradient);
r->device->fillgradient(r->device, line, g, f->type == FILL_LINEAR ? gfxgradient_linear : gfxgradient_radial, &m);
free(g);
g = convertGradient(&f->gradient);
r->device->fillgradient(r->device, line, g, f->type == FILL_LINEAR ? gfxgradient_linear : gfxgradient_radial, &m);
free(g);
@@
-592,15
+606,13
@@
void swfpage_render(gfxpage_t*page, gfxdevice_t*output)
int t;
for(t=0;t<65536;t++) {
int t;
for(t=0;t<65536;t++) {
+ if(depths->ids[t]) {
+ placeObject(&r, t, depths->ids[t]);
+ }
int i;
int i;
-
for(i=0; i<r.clips_waiting[t]; i++) {
output->endclip(output);
}
for(i=0; i<r.clips_waiting[t]; i++) {
output->endclip(output);
}
-
- if(depths->ids[t]) {
- placeObject(&r, t, depths->ids[t]);
- }
}
free(r.clips_waiting);
}
}
free(r.clips_waiting);
}