added AREXT (.a on Unix, .lib on Windows).
[swftools.git] / src / swfdump.c
index 75ac80f..3940141 100644 (file)
@@ -64,6 +64,7 @@ static struct options_t options[] = {
 {"e", "html"},
 {"a", "action"},
 {"t", "text"},
+{"s", "shapes"},
 {"p", "placements"},
 {"X", "width"},
 {"Y", "height"},
@@ -71,7 +72,6 @@ static struct options_t options[] = {
 {"f", "frames"},
 {"d", "hex"},
 {"u", "used"},
-{"s", "shapes"},
 {0,0}
 };
 
@@ -151,6 +151,7 @@ void args_callback_usage(char *name)
     printf("-e , --html                    Print out html code for embedding the file\n");
     printf("-a , --action                  Disassemble action tags\n");
     printf("-t , --text                    Show text fields (like swfstrings).\n");
+    printf("-s , --shapes                  Show shape coordinates/styles\n");
     printf("-p , --placements              Show placement information\n");
     printf("-X , --width                   Prints out a string of the form \"-X width\".\n");
     printf("-Y , --height                  Prints out a string of the form \"-Y height\".\n");
@@ -622,7 +623,7 @@ void handleShape(TAG*tag, char*prefix)
        if(t < shape.numfillstyles) {
            printf(" | %-2d) %-18.18s", t+1, fillstyle2str(&shape.fillstyles[t]));
        } else {
-           printf("                    ");
+           printf("                         ");
        }
        if(t < shape.numlinestyles) {
            printf("%-2d) %s", t+1, linestyle2str(&shape.linestyles[t]));
@@ -654,11 +655,11 @@ void handleShape(TAG*tag, char*prefix)
     printf("%s |\n", prefix);
 }
     
-void fontcallback1(U16 id,U8 * name)
+void fontcallback1(void*self, U16 id,U8 * name)
 { fontnum++;
 }
 
-void fontcallback2(U16 id,U8 * name)
+void fontcallback2(void*self, U16 id,U8 * name)
 { 
   swf_FontExtract(&swf,id,&fonts[fontnum]);
   fontnum++;
@@ -868,10 +869,10 @@ int main (int argc,char ** argv)
    
     if(showtext) {
        fontnum = 0;
-       swf_FontEnumerate(&swf,&fontcallback1);
+       swf_FontEnumerate(&swf,&fontcallback1, 0);
        fonts = (SWFFONT**)malloc(fontnum*sizeof(SWFFONT*));
        fontnum = 0;
-       swf_FontEnumerate(&swf,&fontcallback2);
+       swf_FontEnumerate(&swf,&fontcallback2, 0);
     }
 
     while(tag) {
@@ -983,9 +984,9 @@ int main (int argc,char ** argv)
                }
            }
            if(nframe == frame)
-               printf(" %d (%s)", frame, timestring(frame*(256.0/(swf.frameRate+0.1))));
+               printf(" %d (%s)", frame+1, timestring(frame*(256.0/(swf.frameRate+0.1))));
            else
-               printf(" %d-%d (%s-%s)", frame, nframe,
+               printf(" %d-%d (%s-%s)", frame+1, nframe+1,
                        timestring(frame*(256.0/(swf.frameRate+0.1))),
                        timestring(nframe*(256.0/(swf.frameRate+0.1)))
                        );