X-Git-Url: http://git.asbjorn.biz/?p=swftools.git;a=blobdiff_plain;f=src%2Fswfcombine.c;h=7c675af9ba6a5d29260476fe0407ea82cb392d06;hp=103dfe0f8d8d0254f7a1935fc9ab5f35bc301c37;hb=aa4b3f6b8b77f87ea89f7d73c770cfb0232330b0;hpb=3bbf311f8f04b6ee366c4d3732150e669365cba5 diff --git a/src/swfcombine.c b/src/swfcombine.c index 103dfe0..7c675af 100644 --- a/src/swfcombine.c +++ b/src/swfcombine.c @@ -380,6 +380,7 @@ static char* slavename = 0; static int slaveid = -1; static int slaveframe = -1; static char masterbitmap[65536]; +static char depthbitmap[65536]; #define FLAGS_WRITEDEFINES 1 #define FLAGS_WRITENONDEFINES 2 @@ -891,14 +892,21 @@ void normalcombine(SWF*master, char*slave_name, SWF*slave, SWF*newswf) int frame = 0; char*framelabel; TAG * tag = master->firstTag; + + memset(depthbitmap, 0, sizeof(depthbitmap)); // set the idtab while(tag) { + int depth = swf_GetDepth(tag); + if(depth>=0) { + depthbitmap[depth] = 1; + } if(swf_isDefiningTag(tag)) { int defineid = swf_GetDefineID(tag); msg(" tagid %02x defines object %d", tag->id, defineid); masterbitmap[defineid] = 1; + if (!slavename && defineid==slaveid) { if(defineid>=0) { spriteid = defineid; @@ -946,6 +954,7 @@ void normalcombine(SWF*master, char*slave_name, SWF*slave, SWF*newswf) } swf_Relocate (slave, masterbitmap); + swf_RelocateDepth (slave, depthbitmap); jpeg_assert(slave, master); if (config.overlay)