From: kramm Date: Mon, 16 Jan 2006 17:01:47 +0000 (+0000) Subject: support for clipdepths in swf_RelocateDepth X-Git-Tag: release-0-8-0~254 X-Git-Url: http://git.asbjorn.biz/?p=swftools.git;a=commitdiff_plain;h=0389433248293338bb20bc0e2a2e62e38cbd0c1b support for clipdepths in swf_RelocateDepth --- diff --git a/lib/modules/swftools.c b/lib/modules/swftools.c index 3aadf8d..fbc6bb7 100644 --- a/lib/modules/swftools.c +++ b/lib/modules/swftools.c @@ -886,6 +886,22 @@ void swf_RelocateDepth(SWF*swf, char*bitmap) /* TODO * clip depths * sprites */ + 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); + } + int depth = swf_GetDepth(tag); if(depth>=0) { int newdepth = depth+nr;