X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=lib%2Fmodules%2Fswfdump.c;h=dfc6241fdc39271023f506372b9b23f8fd30e945;hb=b6dc5af448066e3411d5e465853b1ff0dae54785;hp=af6cdfc9a8bdd277cb60871c5ccd90a33eddba3c;hpb=01ff77315b2769b1e9f7c66a7c514319d06ecf0e;p=swftools.git diff --git a/lib/modules/swfdump.c b/lib/modules/swfdump.c index af6cdfc..dfc6241 100644 --- a/lib/modules/swfdump.c +++ b/lib/modules/swfdump.c @@ -7,9 +7,19 @@ Copyright (c) 2001 Rainer Böhme - This file is distributed under the GPL, see file COPYING for details + 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 */ void swf_DumpHeader(FILE * f,SWF * swf) { if (!f) f = stderr; @@ -37,6 +47,17 @@ void swf_DumpTag(FILE * f,TAG * t) fprintf(f,"\n"); } +void swf_DumpSWF(FILE * f, SWF*swf) +{ + TAG* tag = swf->firstTag; + fprintf(f, "vvvvvvvvvvvvvvvvvvvvv\n"); + while(tag) { + printf("%8d %s\n", tag->len, swf_TagGetName(tag)); + tag = tag->next; + } + fprintf(f, "^^^^^^^^^^^^^^^^^^^^^\n"); +} + void swf_DumpFont(SWFFONT * font) { printf("ID: %d\n", font->id); @@ -59,6 +80,26 @@ void swf_DumpFont(SWFFONT * font) printf("language: %d\n", font->language); } +void swf_DumpShape(SHAPE2*shape2) +{ + SHAPELINE*l = shape2->lines; + while(l) { + if(l->type == moveTo) { + //printf("fill %d/%d line %d\n", l->fillstyle0, l->fillstyle1, l->linestyle); + printf("moveTo %.2f,%.2f\n", l->x/20.0, l->y/20.0); + } + if(l->type == lineTo) { + //printf("fill %d/%d line %d\n", l->fillstyle0, l->fillstyle1, l->linestyle); + printf("lineTo %.2f,%.2f\n", l->x/20.0, l->y/20.0); + } + if(l->type == splineTo) { + //printf("fill %d/%d line %d\n", l->fillstyle0, l->fillstyle1, l->linestyle); + printf("splineTo %.2f,%.2f %.2f,%.2f\n", l->sx/20.0, l->sy/20.0, l->x/20.0, l->y/20.0); + } + l = l->next; + } +} + char* swf_TagGetName(TAG*tag) { switch(tag->id)