From 664544cae79530caa45ccf382f620e9dd5e55996 Mon Sep 17 00:00:00 2001 From: kramm Date: Mon, 29 Mar 2004 17:51:13 +0000 Subject: [PATCH] added swf_Concatenate() function --- lib/modules/swftools.c | 44 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/lib/modules/swftools.c b/lib/modules/swftools.c index d6e93de..e46bd77 100644 --- a/lib/modules/swftools.c +++ b/lib/modules/swftools.c @@ -883,4 +883,46 @@ void swf_RelocateDepth(SWF*swf, char*bitmap) tag=tag->next; } } - + +TAG* swf_Concatenate (TAG*list1,TAG*list2) +{ + TAG*tag=0,*lasttag=0; + char bitmap[65536]; + char depthmap[65536]; + memset(bitmap, 0, sizeof(bitmap)); + memset(depthmap, 0, sizeof(depthmap)); + SWF swf1,swf2; + memset(&swf1, 0, sizeof(swf1)); + memset(&swf2, 0, sizeof(swf2)); + + swf1.firstTag = list1; + swf_FoldAll(&swf1); + swf2.firstTag = list2; + swf_FoldAll(&swf2); + + tag = list1; + while(tag) { + if(!swf_isDefiningTag(tag)) { + int id = swf_GetDefineID(tag); + bitmap[id] = 1; + } + if(tag->id == ST_PLACEOBJECT || + tag->id == ST_PLACEOBJECT2) { + int depth = swf_GetDepth(tag); + depthmap[depth] = 1; + } + if(tag->id == ST_REMOVEOBJECT || + tag->id == ST_REMOVEOBJECT2) { + int depth = swf_GetDepth(tag); + depthmap[depth] = 0; + } + tag = tag->next; + lasttag = tag; + } + swf_Relocate(&swf2, bitmap); + swf_RelocateDepth(&swf2, depthmap); + lasttag->next = swf2.firstTag; + swf2.firstTag->prev = lasttag; + + return swf1.firstTag; +} -- 1.7.10.4