new function swf_write_header
[swftools.git] / src / swfcombine.c
index 77597b6..bbe589f 100644 (file)
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
-#include "args.h"
+#include "../lib/args.h"
 #include "combine.h"
 #include "settings.h"
 #include "types.h"
 #include "flash.h"
+#include "../config.h"
 
 char * master_filename = 0;
 char * master_name = 0;
@@ -81,7 +82,7 @@ int args_callback_option(char*name,char*val) {
     }
     else if (!strcmp(name, "V"))
     {  
-       printf("swfcombine - part of swftools 0.0.1\n");
+       printf("swfcombine - part of %s %s\n", PACKAGE, VERSION);
        exit(0);
     }
     else 
@@ -91,28 +92,21 @@ int args_callback_option(char*name,char*val) {
     }
 }
 
-struct options_t
-{
-    char*shortoption;
-    char*longoption;
-} options[] =
+struct options_t options[] =
 {{"o","output"},
  {"s","scale"},
  {"x","xpos"},
  {"y","ypos"},
  {"l","overlay"},
+ {"t","stack"},
  {"v","verbose"},
  {"V","version"},
  {"c","clip"},
+ {0,0}
 };
 
 int args_callback_longoption(char*name,char*val) {
-    int t;
-    for(t=0;t<sizeof(options)/sizeof(struct options_t);t++)
-        if(!strcmp(options[t].longoption, name))
-            return args_callback_option(options[t].shortoption,val);
-    fprintf(stderr, "Unknown option: --%s\n", name);
-    exit(1);
+    return args_long2shortoption(options, name, val);
 }
 
 int args_callback_command(char*name, char*val) {
@@ -155,16 +149,16 @@ int args_callback_command(char*name, char*val) {
 
 void args_callback_usage(char*name)
 {
-    printf("Usage: %s [-l] [-o outputfile] [name=]masterfile [-x xpos] [-y ypos] [-s scale] [name1=]slavefile1 .. [-x xpos] [-y ypos] [-s scale] [nameN=]slavefileN\n", name);
+    printf("Usage: %s [-l][-t] [-o outputfile] [[name=]masterfile] [-x xpos] [-y ypos] [-s scale] [name1=]slavefile1 .. [-x xpos] [-y ypos] [-s scale] [nameN=]slavefileN\n", name);
     printf("\n");
     printf("-o outputfile       explicitly specify output file. (otherwise, output.swf will be used)\n");
+    printf("-t                  (stack) place each slave into a seperate frame (no master movie)\n");
     printf("-l                  (overlay) Don't remove any master objects, only overlay new objects\n");
     printf("-c                  (clip) Clip the slave objects by the corresponding master objects\n");
     printf("-v                  (verbose) Use more than one -v for greater effect \n");
     printf("-x xpos             (move x) Adjust position of slave by xpos twips (1/20 pixel)\n");
     printf("-y ypos             (move y) Adjust position of slave by ypos twips (1/20 pixel)\n");
     printf("-s scale            (scale) Adjust size of slave by scale%\n");
-    printf("\n");
 }
 
 /* read a whole file in memory */
@@ -213,8 +207,6 @@ void makestackmaster(u8**masterdata, int*masterlength)
     int strlength = 0;
     int fileversion = 1;
 
-    logf("<error> stacking doesn't work yet. Prepare for problems.");
-
     /* scan all slaves for bounding box */
     for(t=0;t<numslaves;t++)
     {
@@ -322,6 +314,7 @@ int main(int argn, char *argv[])
     int t;
 
     config.overlay = 0; 
+    config.antistream = 0; 
     config.alloctest = 0;
     config.clip = 0;
     config.loglevel = 2;