X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=src%2Fswfcombine.c;h=0891044cee1e599f6f143f61656009a7d3dc2756;hb=38c19185b95fb1c520088809254ab915db31ff5c;hp=136ac79445e0c7484b80cfea9a7e970a00a72310;hpb=cbc6baaa2cbb83ceb6f13be79051bcceaaa462f3;p=swftools.git diff --git a/src/swfcombine.c b/src/swfcombine.c index 136ac79..0891044 100644 --- a/src/swfcombine.c +++ b/src/swfcombine.c @@ -306,6 +306,7 @@ static void makestackmaster(SWF*swf) exit(1); } close(fi); + swf_RemoveJPEGTables(&head); msg(" File %s has bounding box %d:%d:%d:%d\n", slave_filename[t], head.movieSize.xmin, head.movieSize.ymin, @@ -666,9 +667,10 @@ static char tag_ok_for_slave(int id) TAG* write_master(TAG*tag, SWF*master, SWF*slave, int spriteid, int replaceddefine, int flags) { int outputslave = 0; - int frame = 0; + int frame = 1; int sframe = 0; int slavewritten = 0; + int deletedepth = -1; TAG* rtag = master->firstTag; TAG* stag = slave->firstTag; @@ -693,6 +695,14 @@ TAG* write_master(TAG*tag, SWF*master, SWF*slave, int spriteid, int replaceddefi if(rtag->id == ST_SHOWFRAME) { frame ++; + tag = swf_InsertTag(tag, ST_SHOWFRAME); + if(deletedepth>=0) { + tag = swf_InsertTag(tag, ST_REMOVEOBJECT2); + swf_SetU16(tag, deletedepth); + deletedepth=-1; + } + rtag = rtag->next; + continue; } if(swf_isDefiningTag(rtag) && (flags&FLAGS_WRITEDEFINES)) @@ -726,7 +736,7 @@ TAG* write_master(TAG*tag, SWF*master, SWF*slave, int spriteid, int replaceddefi swf_SetBlock(tag, rtag->data, rtag->len); } } - if(frame == slaveframe) + if(frame == slaveframe) /* only happens with config.isframe: put slave at specific frame */ { if(flags&FLAGS_WRITESLAVE) { outputslave = 1; @@ -736,6 +746,7 @@ TAG* write_master(TAG*tag, SWF*master, SWF*slave, int spriteid, int replaceddefi { int id = get_free_id(masterbitmap); int depth = 65535; + deletedepth = 65535; if(config.clip) { msg(" Can't combine --clip and --frame"); } @@ -776,6 +787,7 @@ TAG* write_master(TAG*tag, SWF*master, SWF*slave, int spriteid, int replaceddefi rtag->id, rtag->len); tag = swf_InsertTag(tag, rtag->id); write_changepos(tag, rtag, config.mastermovex, config.mastermovey, config.masterscalex, config.masterscaley, 1); + } } rtag = rtag->next; @@ -1140,6 +1152,7 @@ int main(int argn, char *argv[]) msg(" Failed to read from %s\n", master_filename); exit(1); } + swf_RemoveJPEGTables(&master); msg(" Read %d bytes from masterfile\n", ret); close(fi); } @@ -1207,6 +1220,7 @@ int main(int argn, char *argv[]) } msg(" Read %d bytes from slavefile\n", ret); close(fi); + swf_RemoveJPEGTables(&slave); } else {