X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=lib%2Fmodules%2Fswftools.c;h=1f80dcecf5a38d39f8eb00d70da6c5175d935e64;hb=fd9d112727d70722bf2702eb14c2dd9cc2c554e1;hp=3618ad905306f83687100fc4870d761155b06295;hpb=4cc2227e383358d13c984a7cfa6e7a920450cf16;p=swftools.git diff --git a/lib/modules/swftools.c b/lib/modules/swftools.c index 3618ad9..1f80dce 100644 --- a/lib/modules/swftools.c +++ b/lib/modules/swftools.c @@ -116,6 +116,7 @@ U16 swf_GetDefineID(TAG * t) case ST_DEFINESPRITE: case ST_DEFINEMOVIE: case ST_DEFINEVIDEOSTREAM: + case ST_GLYPHNAMES: //pseudodefine case ST_VIDEOFRAME: //pseudodefine case ST_NAMECHARACTER: //pseudodefine id = swf_GetU16(t); @@ -143,8 +144,6 @@ SRECT swf_GetDefineBBox(TAG * t) case ST_DEFINESHAPE2: case ST_DEFINESHAPE3: case ST_DEFINEEDITTEXT: - case ST_DEFINEBUTTON: - case ST_DEFINEBUTTON2: case ST_DEFINETEXT: case ST_DEFINETEXT2: case ST_DEFINEVIDEOSTREAM: @@ -250,6 +249,7 @@ static int swf_pseudodefiningtagids[] = ST_NAMECHARACTER, ST_DOINITACTION, ST_VIDEOFRAME, + ST_GLYPHNAMES, -1 }; @@ -658,6 +658,7 @@ void enumerateUsedIDs(TAG * tag, int base, void (*callback)(TAG*, int, void*), v } break; } + case ST_GLYPHNAMES: case ST_DEFINEFONTINFO: case ST_DEFINEFONTINFO2: case ST_VIDEOFRAME: @@ -859,8 +860,8 @@ void swf_Relocate (SWF*swf, char*bitmap) void swf_RelocateDepth(SWF*swf, char*bitmap) { TAG*tag; - tag = swf->firstTag; int nr; + tag = swf->firstTag; for(nr=65535;nr>=0;nr--) { if(bitmap[nr] != 0) break; @@ -883,4 +884,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]; + SWF swf1,swf2; + memset(bitmap, 0, sizeof(bitmap)); + memset(depthmap, 0, sizeof(depthmap)); + 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; +}