X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=lib%2Fmodules%2Fswftools.c;h=840573a1993168723e1c618e5557b7c0b127e20b;hb=374001d59d71c2ac4d9e2503969e403393098710;hp=72d5607b62e2951daaef63b9f33e7f843e2fcec8;hpb=a36a0fe5a0f93dc010a3b65f064d870883f199e9;p=swftools.git diff --git a/lib/modules/swftools.c b/lib/modules/swftools.c index 72d5607..840573a 100644 --- a/lib/modules/swftools.c +++ b/lib/modules/swftools.c @@ -98,6 +98,7 @@ U16 swf_GetDefineID(TAG * t) { case ST_DEFINESHAPE: case ST_DEFINESHAPE2: case ST_DEFINESHAPE3: + case ST_DEFINESHAPE4: case ST_DEFINEMORPHSHAPE: case ST_DEFINEEDITTEXT: case ST_DEFINEBITS: @@ -105,14 +106,18 @@ U16 swf_GetDefineID(TAG * t) case ST_DEFINEBITSJPEG3: case ST_DEFINEBITSLOSSLESS: case ST_DEFINEBITSLOSSLESS2: + case ST_DEFINESCALINGGRID: //pseudodefine case ST_DEFINEBUTTON: case ST_DEFINEBUTTON2: case ST_DEFINEBUTTONCXFORM: //pseudodefine case ST_DEFINEBUTTONSOUND: //pseudodefine + case ST_CSMTEXTSETTINGS: //pseudodefine case ST_DEFINEFONT: case ST_DEFINEFONT2: + case ST_DEFINEFONT3: case ST_DEFINEFONTINFO: //pseudodefine case ST_DEFINEFONTINFO2: //pseudodefine + case ST_DEFINEFONTALIGNZONES: //pseudodefine case ST_DEFINETEXT: case ST_DEFINETEXT2: case ST_DEFINESOUND: @@ -198,6 +203,12 @@ U16 swf_GetPlaceID(TAG * t) U16 d = swf_GetU16(t); id = (flags&PF_CHAR)?swf_GetU16(t):id; } break; + case ST_PLACEOBJECT3: + { U8 flags = swf_GetU8(t); + U8 flags2 = swf_GetU8(t); + U16 d = swf_GetU16(t); + id = (flags&PF_CHAR)?swf_GetU16(t):id; + } break; } @@ -210,9 +221,11 @@ static int swf_definingtagids[] = {ST_DEFINESHAPE, ST_DEFINESHAPE2, ST_DEFINESHAPE3, + ST_DEFINESHAPE4, ST_DEFINEMORPHSHAPE, ST_DEFINEFONT, ST_DEFINEFONT2, + ST_DEFINEFONT3, ST_DEFINETEXT, ST_DEFINETEXT2, ST_DEFINEEDITTEXT, @@ -247,12 +260,16 @@ static int swf_spritetagids[] = -1 }; +/* tags which add content or information to a character with a given ID */ static int swf_pseudodefiningtagids[] = { ST_DEFINEFONTINFO, ST_DEFINEFONTINFO2, + ST_DEFINEFONTALIGNZONES, ST_DEFINEBUTTONCXFORM, ST_DEFINEBUTTONSOUND, + ST_DEFINESCALINGGRID, + ST_CSMTEXTSETTINGS, ST_NAMECHARACTER, ST_DOINITACTION, ST_VIDEOFRAME, @@ -319,6 +336,11 @@ int swf_GetDepth(TAG * t) { U8 flags = swf_GetU8(t); depth = swf_GetU16(t); } break; + case ST_PLACEOBJECT3: + { U8 flags = swf_GetU8(t); + U8 flags2 = swf_GetU8(t); + depth = swf_GetU16(t); + } break; case ST_SETTABINDEX: { depth = swf_GetU16(t); @@ -362,8 +384,11 @@ char* swf_GetName(TAG * t) case ST_FRAMELABEL: name = &t->data[swf_GetTagPos(t)]; break; + case ST_PLACEOBJECT3: case ST_PLACEOBJECT2: { U8 flags = swf_GetU8(t); + if(t->id == ST_PLACEOBJECT3) + swf_GetU8(t); swf_GetU16(t); //depth; if(flags&PF_CHAR) swf_GetU16(t); //id @@ -373,7 +398,7 @@ char* swf_GetName(TAG * t) swf_GetCXForm(t, &c, 1); if(flags&PF_RATIO) swf_GetU16(t); - if(flags&PF_CLIPACTION) + if(flags&PF_CLIPDEPTH) swf_GetU16(t); if(flags&PF_NAME) { swf_ResetReadBits(t); @@ -432,7 +457,7 @@ void enumerateUsedIDs_styles(TAG * tag, void (*callback)(TAG*, int, void*), void else {swf_GetRGB(tag, NULL);if(morph) swf_GetRGB(tag, NULL);} } - else if(type == 0x10 || type == 0x12) + else if(type == 0x10 || type == 0x12 || type == 0x13) { swf_ResetReadBits(tag); swf_GetMatrix(tag, NULL); @@ -444,7 +469,7 @@ void enumerateUsedIDs_styles(TAG * tag, void (*callback)(TAG*, int, void*), void else swf_GetGradient(tag, NULL, /*alpha*/ num>=3?1:0); } - else if(type == 0x40 || type == 0x41) + else if(type == 0x40 || type == 0x41 || type == 0x42 || type == 0x43) { swf_ResetReadBits(tag); // we made it. @@ -526,6 +551,20 @@ void enumerateUsedIDs(TAG * tag, int base, void (*callback)(TAG*, int, void*), v } } break; + case ST_IMPORTASSETS: + case ST_IMPORTASSETS2: { + swf_GetString(tag); //count + swf_GetU8(tag); //reserved + swf_GetU8(tag); //reserved + int num = swf_GetU16(tag); //url + int t; + for(t=0;tpos + base, callback_data); //button id + swf_GetU16(tag); //id + while(swf_GetU8(tag)); //name + } + } break; + case ST_FREECHARACTER: /* unusual tags, which all start with an ID */ case ST_NAMECHARACTER: case ST_GENERATORTEXT: @@ -540,6 +579,12 @@ void enumerateUsedIDs(TAG * tag, int base, void (*callback)(TAG*, int, void*), v break; callback(tag, 3 + base, callback_data); break; + case ST_PLACEOBJECT3: + // only if placeflaghascharacter + if(!(tag->data[0]&2)) + break; + callback(tag, 4 + base, callback_data); + break; case ST_REMOVEOBJECT: callback(tag, tag->pos + base, callback_data); break; @@ -665,7 +710,10 @@ void enumerateUsedIDs(TAG * tag, int base, void (*callback)(TAG*, int, void*), v } break; } + case ST_DEFINEFONTALIGNZONES: + case ST_DEFINESCALINGGRID: case ST_GLYPHNAMES: + case ST_CSMTEXTSETTINGS: case ST_DEFINEFONTINFO: case ST_DEFINEFONTINFO2: case ST_VIDEOFRAME: @@ -679,6 +727,8 @@ void enumerateUsedIDs(TAG * tag, int base, void (*callback)(TAG*, int, void*), v break; case ST_DEFINEMORPHSHAPE: + case ST_DEFINESHAPE4: + num++; case ST_DEFINESHAPE3: num++; //fallthrough case ST_DEFINESHAPE2: @@ -695,10 +745,18 @@ void enumerateUsedIDs(TAG * tag, int base, void (*callback)(TAG*, int, void*), v } id = swf_GetU16(tag); // id; - swf_GetRect(tag, NULL); // bounds + swf_GetRect(tag, NULL); // shape bounds if(morph) { swf_ResetReadBits(tag); - swf_GetRect(tag, NULL); // bounds2 + swf_GetRect(tag, NULL); // shape bounds2 + if(num==4) + swf_GetRect(tag, NULL); // edge bounds1 + } + if(num>=4) { + swf_GetRect(tag, NULL); // edge bounds + swf_GetU8(tag); // flags, &1: contains scaling stroke, &2: contains non-scaling stroke + } + if(morph) { swf_GetU32(tag); //offset to endedges } @@ -949,7 +1007,8 @@ U8 swf_isShapeTag(TAG*tag) { if(tag->id == ST_DEFINESHAPE || tag->id == ST_DEFINESHAPE2 || - tag->id == ST_DEFINESHAPE3) + tag->id == ST_DEFINESHAPE3 || + tag->id == ST_DEFINESHAPE4) return 1; return 0; } @@ -957,7 +1016,8 @@ U8 swf_isShapeTag(TAG*tag) U8 swf_isPlaceTag(TAG*tag) { if(tag->id == ST_PLACEOBJECT || - tag->id == ST_PLACEOBJECT2) + tag->id == ST_PLACEOBJECT2 || + tag->id == ST_PLACEOBJECT3) return 1; return 0; }