X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=lib%2Fmodules%2Fswftools.c;h=564825d72ae0bca6400aac3639b35b0a71b86fdc;hb=37f0c26881f33479b343f1a273b86bcd7e084373;hp=deb1a7e20ec9cba5479b8d2cce811c20d4f70b7f;hpb=30bec8eb9907643de6f1fbc7cd5e3eef16a31328;p=swftools.git diff --git a/lib/modules/swftools.c b/lib/modules/swftools.c index deb1a7e..564825d 100644 --- a/lib/modules/swftools.c +++ b/lib/modules/swftools.c @@ -291,6 +291,30 @@ char* swf_GetName(TAG * t) return name; } +/* used in enumerateUsedIDs */ +void swf_GetMorphGradient(TAG * tag, GRADIENT * gradient1, GRADIENT * gradient2) +{ + GRADIENT dummy1; + GRADIENT dummy2; + int t; + if(!gradient1) + gradient1 = &dummy1; + if(!gradient2) + gradient2 = &dummy2; + gradient1->num = + gradient2->num = swf_GetU8(tag); + for(t=0;tnum;t++) + { + int s=t; + if(s>=8) //FIXME + s=7; + gradient1->ratios[t] = swf_GetU8(tag); + swf_GetRGBA(tag, &gradient1->rgba[t]); + gradient2->ratios[t] = swf_GetU8(tag); + swf_GetRGBA(tag, &gradient2->rgba[t]); + } +} + #define DEBUG_ENUMERATE if(0) static void enumerateUsedIDs_styles(TAG * tag, void (*callback)(TAG*, int, void*), void*callback_data, int num, int morph) @@ -397,6 +421,16 @@ void enumerateUsedIDs(TAG * tag, int base, void (*callback)(TAG*, int, void*), v callback(tag, tag->pos + base, callback_data); //button id break; + case ST_EXPORTASSETS: { + int num = swf_GetU16(tag); + 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: @@ -541,7 +575,8 @@ void enumerateUsedIDs(TAG * tag, int base, void (*callback)(TAG*, int, void*), v callback(tag, tag->pos + base, callback_data); break; - case ST_DEFINEMORPHSHAPE: + //case ST_DEFINEMORPHSHAPE: /* disabled for now (doesn't work) */ + case ST_DEFINESHAPE3: // these thingies might have bitmap ids in their fillstyles num++; //fallthrough case ST_DEFINESHAPE2: @@ -567,7 +602,6 @@ void enumerateUsedIDs(TAG * tag, int base, void (*callback)(TAG*, int, void*), v DEBUG_ENUMERATE printf("-------\n"); while(--morph>=0) /* morph shapes define two shapes */ { - swf_ResetReadBits(tag); //? fillbits = swf_GetBits(tag, 4); linebits = swf_GetBits(tag, 4); DEBUG_ENUMERATE printf("%d %d\n", fillbits, linebits);