X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=lib%2Fmodules%2Fswftools.c;h=b51203184f4adefb6506c8e85d8e0b0c33dc9e27;hb=d57bc01b36b45dc310937683d045924698155b17;hp=3aadf8d2c171d325a4ab3bca586b8af4e757c992;hpb=22e7dba47e27d130a2720ea9ca256867fa67ee21;p=swftools.git diff --git a/lib/modules/swftools.c b/lib/modules/swftools.c index 3aadf8d..b512031 100644 --- a/lib/modules/swftools.c +++ b/lib/modules/swftools.c @@ -25,8 +25,7 @@ #define S64 long long SFIXED RFXSWF_SP(SFIXED a1,SFIXED a2,SFIXED b1,SFIXED b2) -{ S64 a; - a = ((S64)a1*(S64)b1+(S64)a2*(S64)b2)>>16; +{ S64 a = ((S64)a1*(S64)b1+(S64)a2*(S64)b2)>>16; SFIXED result = (SFIXED)(a); if(a!=result) fprintf(stderr, "Warning: overflow in matrix multiplication"); @@ -883,10 +882,27 @@ void swf_RelocateDepth(SWF*swf, char*bitmap) while(tag) { + int depth; /* TODO * clip depths * sprites */ - int depth = swf_GetDepth(tag); + if(tag->id == ST_PLACEOBJECT2) { + SWFPLACEOBJECT obj; + swf_GetPlaceObject(tag, &obj); + if(obj.clipdepth) { + int newdepth = obj.clipdepth+nr; + if(newdepth>65535) { + fprintf(stderr, "Couldn't relocate depths: too large values\n"); + newdepth = 65535; + } + obj.clipdepth = newdepth; + swf_ResetTag(tag, ST_PLACEOBJECT2); + swf_SetPlaceObject(tag, &obj); + } + swf_PlaceObjectFree(&obj); + } + + depth = swf_GetDepth(tag); if(depth>=0) { int newdepth = depth+nr; if(newdepth>65535) {