added (long) GPL headers.
[swftools.git] / src / swfbbox.c
index 1c80cf6..d95e362 100644 (file)
@@ -3,9 +3,21 @@
 
    Part of the swftools package.
    
-   Copyright (c) 2001 Matthias Kramm <kramm@quiss.org>
-
-   This file is distributed under the GPL, see file COPYING for details */
+   Copyright (c) 2003 Matthias Kramm <kramm@quiss.org>
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
 
 #include "../config.h"
 #include <stdio.h>
@@ -69,7 +81,7 @@ void args_callback_usage(char*name)
 {    
     printf("Usage: %s [-at] file.swf\n", name);
     printf("\t-h , --help\t\t Print help and exit\n");
-    printf("\t-O , --optimize\t\t Print help and exit\n");
+    printf("\t-O , --optimize\t\t Recalculate bounding boxes\n");
     printf("\t-S , --swifty\t\t Print out transformed bounding boxes\n");
     printf("\t-o , --output\t\t Set output filename (for -O)\n");
     printf("\t-V , --version\t\t Print program version and exit\n");
@@ -354,8 +366,7 @@ int main (int argc,char ** argv)
     tag = swf.firstTag;
 
     if(swifty) {
-       printf("{\n");
-       printf("{frame %d}\n", frame++);
+       printf("{\n\t{frame %d}\n", frame++);
     }
 
     while (tag) {
@@ -374,7 +385,7 @@ int main (int argc,char ** argv)
        }
        if(swifty) {
            if (tag->id == ST_SHOWFRAME) {
-               printf("{frame %d}\n", frame++);
+               printf("}\n{\n\t{frame %d}\n", frame++);
            }
            if (tag->id == ST_PLACEOBJECT || tag->id == ST_PLACEOBJECT2) {
                if(hasid(tag)) {
@@ -402,7 +413,8 @@ int main (int argc,char ** argv)
                if(!name) {
                    sprintf(buf, "ID%d", id);name = buf;
                }
-               printf("{%s {%.2f %.2f %.2f %.2f %.2f %.2f %.2f %.2f}}\n", name, 
+               //printf("\t#%.4f %.4f %.4f %.4f | %.4f %.4f\n", m.sx/65536.0, m.r1/65536.0, m.r0/65536.0, m.sy/65536.0, m.tx/20.0, m.ty/20.0);
+               printf("\t{%s {%.2f %.2f %.2f %.2f %.2f %.2f %.2f %.2f}}\n", name, 
                        p1.x/20.0, p1.y/20.0, p2.x/20.0, p2.y/20.0,
                        p3.x/20.0, p3.y/20.0, p4.x/20.0, p4.y/20.0);
            }