X-Git-Url: http://git.asbjorn.biz/?p=swftools.git;a=blobdiff_plain;f=src%2Fswfbbox.c;h=5fb1dbafd57fb9a400e1b396eabd203757ac6520;hp=fc6de0690cb43dcd5f698e72a1c2f275ee0ca8e9;hb=f7555c9f25b9008e1996e029f83ebeaaafd95321;hpb=4af601968e449891c5d89c180a95891b000f831d diff --git a/src/swfbbox.c b/src/swfbbox.c index fc6de06..5fb1dba 100644 --- a/src/swfbbox.c +++ b/src/swfbbox.c @@ -35,14 +35,14 @@ static int optimize = 0; static int swifty = 0; static int verbose = 0; -struct options_t options[] = -{ - {"V","version"}, - {"O","optimize"}, - {"o","output"}, - {"S","swifty"}, - {"v","verbose"}, - {0,0} +static struct options_t options[] = { +{"h", "help"}, +{"O", "optimize"}, +{"S", "swifty"}, +{"o", "output"}, +{"v", "verbose"}, +{"V", "version"}, +{0,0} }; int args_callback_option(char*name,char*val) @@ -78,15 +78,18 @@ int args_callback_longoption(char*name,char*val) { return args_long2shortoption(options, name, val); } -void args_callback_usage(char*name) -{ +void args_callback_usage(char *name) +{ + printf("\n"); printf("Usage: %s [-OS] file.swf\n", name); - printf("\t-h , --help\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 , --verbose\t\t Be more verbose\n"); - printf("\t-V , --version\t\t Print program version and exit\n"); + printf("\n"); + printf("-h , --help Print help and exit\n"); + printf("-O , --optimize Recalculate bounding boxes\n"); + printf("-S , --swifty Print out transformed bounding boxes\n"); + printf("-o , --output Set output filename to (for -O)\n"); + printf("-v , --verbose Be more verbose\n"); + printf("-V , --version Print program version and exit\n"); + printf("\n"); } int args_callback_command(char*name,char*val) { @@ -141,8 +144,7 @@ void parseFillStyleArray(TAG*tag, SHAPE2*shape) swf_ResetReadBits(tag); swf_GetMatrix(tag, &dest->m); swf_ResetReadBits(tag); - dest->gradient = malloc(sizeof(GRADIENT)); // TODO: free this again - swf_GetGradient(tag, dest->gradient, num>=3?1:0); + swf_GetGradient(tag, &dest->gradient, num>=3?1:0); } else if(type == 0x40 || type == 0x41) {