printf("\n");
swf_FontExtract_DefineTextCallback(-1,0,tag,4, textcallback);
}
+
+void handleDefineBits(TAG*tag)
+{
+ U16 id;
+ U8 mode;
+ U16 width,height;
+ int bpp;
+ id = swf_GetU16(tag);
+ mode = swf_GetU8(tag);
+ width = swf_GetU16(tag);
+ height = swf_GetU16(tag);
+ printf(" image %dx%d",width,height);
+ if(mode == 3) printf(" (8 bpp)");
+ else if(mode == 4) printf(" (16 bpp)");
+ else if(mode == 5) printf(" (32 bpp)");
+ else printf(" (? bpp)");
+}
void handleEditText(TAG*tag)
{
fontnum++;
}
+void hexdumpTag(TAG*tag, char* prefix)
+{
+ int t;
+ printf(" %s-=> ",prefix);
+ for(t=0;t<tag->len;t++) {
+ printf("%02x ", tag->data[t]);
+ if((t && ((t&15)==15)) || (t==tag->len-1))
+ {
+ if(t==tag->len-1)
+ printf("\n");
+ else
+ printf("\n %s-=> ",prefix);
+ }
+ }
+}
+
void dumperror(const char* format, ...)
{
char buf[1024];
vsprintf(buf, format, arglist);
va_end(arglist);
- printf("==== Error: %s ====\n", buf);
+ if(!html && !xy)
+ printf("==== Error: %s ====\n", buf);
}
int main (int argc,char ** argv)
}
printf("<OBJECT CLASSID=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\"\n"
" WIDTH=\"%d\"\n"
- //" BGCOLOR=#ffffffff\n"
+ //" BGCOLOR=#ffffffff\n"?
" HEIGHT=\"%d\"\n"
+ //http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,23,0?
" CODEBASE=\"http://active.macromedia.com/flash5/cabs/swflash.cab#version=%s\">\n"
" <PARAM NAME=\"MOVIE\" VALUE=\"%s\">\n"
" <PARAM NAME=\"PLAY\" VALUE=\"true\">\n"
" <PARAM NAME=\"LOOP\" VALUE=\"true\">\n"
" <PARAM NAME=\"QUALITY\" VALUE=\"high\">\n"
- " <EMBED SRC=\"%s\" WIDTH=\"%d\" HEIGHT=\"%d\"\n" //bgcolor=#ffffff
+ " <EMBED SRC=\"%s\" WIDTH=\"%d\" HEIGHT=\"%d\"\n" //bgcolor=#ffffff?
" PLAY=\"true\" ALIGN=\"\" LOOP=\"true\" QUALITY=\"high\"\n"
" TYPE=\"application/x-shockwave-flash\"\n"
" PLUGINSPAGE=\"http://www.macromedia.com/go/getflashplayer\">\n"
else if(tag->id == ST_REMOVEOBJECT2) {
printf(" removes object from depth %04d", swf_GetDepth(tag));
}
+ else if(tag->id == ST_FREECHARACTER) {
+ printf(" frees object %04d", swf_GetPlaceID(tag));
+ }
else if(tag->id == ST_STARTSOUND) {
printf(" starts id %04d", swf_GetPlaceID(tag));
}
if(!issprite) {mainframe++; framelabel = 0;}
}
- if(tag->id == ST_DEFINEEDITTEXT) {
+ if(tag->id == ST_DEFINEBITSLOSSLESS ||
+ tag->id == ST_DEFINEBITSLOSSLESS2) {
+ handleDefineBits(tag);
+ printf("\n");
+ }
+ else if(tag->id == ST_DEFINEEDITTEXT) {
handleEditText(tag);
printf("\n");
}
swf_GetUsedIDs(tag, used);
printf("%s%suses IDs: ", indent, prefix);
for(t=0;t<num;t++) {
- tag->pos = used[t];
+ swf_SetTagPos(tag, used[t]);
printf("%d%s", swf_GetU16(tag), t<num-1?", ":"");
}
printf("\n");
}
if(tag->len && hex) {
- int t;
- printf(" %s-=> ",prefix);
- for(t=0;t<tag->len;t++) {
- printf("%02x ", tag->data[t]);
- if((t && ((t&15)==15)) || (t==tag->len-1))
- {
- if(t==tag->len-1)
- printf("\n");
- else
- printf("\n %s-=> ",prefix);
- }
- }
+ hexdumpTag(tag, prefix);
}
tag = tag->next;
fflush(stdout);