X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=lib%2Fdevices%2Fswf.c;h=83a5e675020040df8839cffab2b3f7b8a64131d5;hb=35727bd4787aeef582c43772cb13a79c0b680873;hp=3bbf8ee258d871ff535a0279c908f37a442e1c14;hpb=76fe35b774bd7b7376eb85464a7afe3c81330eea;p=swftools.git diff --git a/lib/devices/swf.c b/lib/devices/swf.c index 3bbf8ee..83a5e67 100644 --- a/lib/devices/swf.c +++ b/lib/devices/swf.c @@ -91,6 +91,7 @@ typedef struct _swfoutput_internal char* config_linktarget; char*config_internallinkfunction; char*config_externallinkfunction; + char config_animate; SWF* swf; @@ -753,7 +754,7 @@ static void endtext(gfxdevice_t*dev) swf_SetU8(i->tag, 0);//reserved } i->tag = swf_InsertTag(i->tag,ST_PLACEOBJECT2); - + swf_ObjectPlace(i->tag,i->textid,getNewDepth(dev),&i->page_matrix,NULL,NULL); i->textid = -1; } @@ -1131,6 +1132,10 @@ static void endshape(gfxdevice_t*dev) m.ty += i->shapeposy; swf_ObjectPlace(i->tag,i->shapeid,getNewDepth(dev),&m,NULL,NULL); + if(i->config_animate) { + i->tag = swf_InsertTag(i->tag,ST_SHOWFRAME); + } + swf_ShapeFree(i->shape); i->shape = 0; i->shapeid = -1; @@ -1788,6 +1793,8 @@ int swf_setparameter(gfxdevice_t*dev, const char*name, const char*value) i->config_linktarget = strdup(value); } else if(!strcmp(name, "dumpfonts")) { i->config_dumpfonts = atoi(value); + } else if(!strcmp(name, "animate")) { + i->config_animate = atoi(value); } else if(!strcmp(name, "next_bitmap_is_jpeg")) { i->jpeg = 1; } else if(!strcmp(name, "jpegquality")) { @@ -1876,16 +1883,20 @@ static int add_image(swfoutput_internal*i, gfximage_t*img, int targetwidth, int /// { if(is_jpeg && i->config_jpegsubpixels) { - newsizex = (int)(targetwidth*i->config_jpegsubpixels+0.5); - newsizey = (int)(targetheight*i->config_jpegsubpixels+0.5); + newsizex = (int)(targetwidth*i->config_jpegsubpixels + 0.5); + newsizey = (int)(targetheight*i->config_jpegsubpixels + 0.5); } else if(!is_jpeg && i->config_ppmsubpixels) { - newsizex = (int)(targetwidth*i->config_ppmsubpixels+0.5); - newsizey = (int)(targetheight*i->config_ppmsubpixels+0.5); + newsizex = (int)(targetwidth*i->config_ppmsubpixels + 0.5); + newsizey = (int)(targetheight*i->config_ppmsubpixels + 0.5); } /// } - if(sizex<=0 || sizey<=0 || newsizex<=0 || newsizey<=0) + if(sizex<=0 || sizey<=0) return -1; + if(newsizex<=0) + newsizex = 1; + if(newsizey<=0) + newsizey = 1; /* TODO: cache images */