X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=src%2Fswfcombine.c;h=72d1147b64ef2272c34656fe0a5dd5d9302d58b9;hb=9dd3c056922a1f370c0543c43adae040723bc454;hp=f564793c123dc2d9d747177fc371d9f3f17adb6a;hpb=f1439716b85c476a3357e3bfb0e4a2effdf3c27b;p=swftools.git diff --git a/src/swfcombine.c b/src/swfcombine.c index f564793..72d1147 100644 --- a/src/swfcombine.c +++ b/src/swfcombine.c @@ -687,7 +687,7 @@ TAG* write_master(TAG*tag, SWF*master, SWF*slave, int spriteid, int replaceddefi } if(tag_ok_for_slave(stag->id)) { tag = swf_InsertTag(tag, stag->id); - swf_SetBlock(tag, stag->data, stag->len); + write_changepos(tag, stag, config.movex, config.movey, config.scalex, config.scaley, 0); } stag = stag->next; } @@ -718,17 +718,19 @@ TAG* write_master(TAG*tag, SWF*master, SWF*slave, int spriteid, int replaceddefi swf_SetDefineID(tag, replaceddefine); } else { /* don't write this tag */ - msg(" replacing tag %d id %d with sprite", rtag->id - ,spriteid); + msg(" replacing tag %d ID %d with sprite", rtag->id ,spriteid); } if(flags&FLAGS_WRITESPRITE) { + msg(" writing sprite defines"); tag = write_sprite_defines(tag, slave); + msg(" writing sprite"); tag = write_sprite(tag, slave, spriteid, replaceddefine); } if(flags&FLAGS_WRITESLAVE) { + msg(" writing slave"); outputslave = 1; } } else { @@ -797,8 +799,9 @@ TAG* write_master(TAG*tag, SWF*master, SWF*slave, int spriteid, int replaceddefi while(stag && stag->id!=ST_END) { if(tag_ok_for_slave(stag->id)) { + msg(" [slave] write tag %02x (%d bytes in body), %.2f %.2f", rtag->id, rtag->len, config.movex /20.0, config.movey /20.0); tag = swf_InsertTag(tag, stag->id); - swf_SetBlock(tag, stag->data, stag->len); + write_changepos(tag, stag, config.movex, config.movey, config.scalex, config.scaley, 0); } stag = stag->next; } @@ -955,6 +958,15 @@ void normalcombine(SWF*master, char*slave_name, SWF*slave, SWF*newswf) char * name = swf_GetName(tag); int id = swf_GetPlaceID(tag); + { + SWFPLACEOBJECT obj; + swf_GetPlaceObject(tag, &obj); + swf_PlaceObjectFree(&obj); + if(obj.clipdepth) { + depthbitmap[obj.clipdepth] = 1; + } + } + if(name) msg(" tagid %02x places object %d named \"%s\"", tag->id, id, name); else @@ -1034,6 +1046,9 @@ void combine(SWF*master, char*slave_name, SWF*slave, SWF*newswf) slaveid = -1; slaveframe = -1; + if(!master->fileVersion && slave) + master->fileVersion = slave->fileVersion; + swf_FoldAll(master); swf_FoldAll(slave); @@ -1235,7 +1250,7 @@ int main(int argn, char *argv[]) memset(&slave, 0, sizeof(slave)); slave.firstTag = swf_InsertTag(0, ST_END); slave.frameRate = 0; - slave.fileVersion = 4; + slave.fileVersion = 0; slave.frameCount = 0; } @@ -1250,6 +1265,9 @@ int main(int argn, char *argv[]) } } + if(!newswf.fileVersion) + newswf.fileVersion = 4; + fi = open(outputname, O_BINARY|O_RDWR|O_TRUNC|O_CREAT, 0777); if(config.zlib) {