X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=src%2Fswfcombine.c;h=403419df80d542e7546b498aec287f99066849ec;hb=435afb74a9aedfe10a49f0a181833705c9cbcf82;hp=f6257fe646744f9a315d54876d9eff253273fce6;hpb=1d20e19dd602b0af21ead7493ef254410fc3a8fe;p=swftools.git diff --git a/src/swfcombine.c b/src/swfcombine.c index f6257fe..403419d 100644 --- a/src/swfcombine.c +++ b/src/swfcombine.c @@ -497,7 +497,6 @@ TAG* write_sprite_defines(TAG*tag, SWF*sprite) void changedepth(TAG*tag, int add) { - /* fucking byteorders */ if(tag->id == ST_PLACEOBJECT) PUT16(&tag->data[2],GET16(&tag->data[2])+add); if(tag->id == ST_PLACEOBJECT2) @@ -506,6 +505,23 @@ void changedepth(TAG*tag, int add) PUT16(&tag->data[2],GET16(&tag->data[2])+add); if(tag->id == ST_REMOVEOBJECT2) PUT16(&tag->data[0],GET16(&tag->data[0])+add); + if(tag->id == ST_PLACEOBJECT2) { + SWFPLACEOBJECT obj; + U8 flags; + swf_SetTagPos(tag, 0); + flags = swf_GetU8(tag); + if(flags&2) swf_GetU16(tag); //id + if(flags&4) swf_GetMatrix(tag, 0); + if(flags&8) swf_GetCXForm(tag, 0,1); + if(flags&16) swf_GetU16(tag); //ratio + if(flags&64) { + swf_ResetReadBits(tag); + printf("%d->%d\n", GET16(&tag->data[tag->pos]), + GET16(&tag->data[tag->pos])+add); + PUT16(&tag->data[tag->pos],GET16(&tag->data[tag->pos])+add); + } + msg(" Depth relocation not fully working yet with clipdepths", tag->id); + } } void matrix_adjust(MATRIX*m, int movex, int movey, float scalex, float scaley, int scalepos) @@ -618,8 +634,9 @@ TAG* write_sprite(TAG*tag, SWF*sprite, int spriteid, int replaceddefine) rtag->id, rtag->len); tag = swf_InsertTag(tag, rtag->id); write_changepos(tag, rtag, config.movex, config.movey, config.scalex, config.scaley, 0); - - changedepth(tag, +2); + + if(config.clip || (config.overlay && !config.isframe)) + changedepth(tag, +2); if(tag->id == ST_SHOWFRAME) { @@ -957,7 +974,8 @@ void normalcombine(SWF*master, char*slave_name, SWF*slave, SWF*newswf) } swf_Relocate (slave, masterbitmap); - swf_RelocateDepth (slave, depthbitmap); + if(config.merge) + swf_RelocateDepth (slave, depthbitmap); jpeg_assert(slave, master); if (config.overlay)