check for freetype-config also in /opt/local/bin, /sw/bin.
[swftools.git] / src / swfdump.c
index 6256e49..49208ab 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");
@@ -561,8 +562,10 @@ void handlePlaceObject(TAG*tag, char*prefix)
 
     U16 id = swf_GetU16(tag);
     U16 depth = swf_GetU16(tag);
-    MATRIX matrix; swf_GetMatrix(tag, &matrix);
-    CXFORM cxform; swf_GetCXForm(tag, &cxform, 0);
+    MATRIX matrix; 
+    CXFORM cxform;
+    swf_GetMatrix(tag, &matrix);
+    swf_GetCXForm(tag, &cxform, 0);
 
     swf_SetU8(tag2, 14);
     swf_SetU16(tag2, depth);
@@ -599,13 +602,14 @@ char* linestyle2str(LINESTYLE*style)
 void handleShape(TAG*tag, char*prefix)
 {
     SHAPE2 shape;
+    SHAPELINE*line;
+    int t,max;
+
     tag->pos = 0;
     tag->readBit = 0;
     swf_ParseDefineShape(tag, &shape);
-    SHAPELINE*line;
 
-    int t;
-    int max = shape.numlinestyles > shape.numfillstyles?shape.numlinestyles:shape.numfillstyles;
+    max = shape.numlinestyles > shape.numfillstyles?shape.numlinestyles:shape.numfillstyles;
 
     if(max) printf("%s | fillstyles(%02d)        linestyles(%02d)\n", 
            prefix,
@@ -619,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]));
@@ -980,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)))
                        );