X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=src%2Fswfcombine.c;h=7181c5c4c8d7c862647dc408a3280efdd7a48764;hb=d37a4db40333c68f0b764e1aef6f784887429151;hp=44c251b198aed189a4c84008b9bdbcd1eebd271f;hpb=23c6c9b0eb8b5800d8fcb1a3147e8a09d1bdd31d;p=swftools.git diff --git a/src/swfcombine.c b/src/swfcombine.c index 44c251b..7181c5c 100644 --- a/src/swfcombine.c +++ b/src/swfcombine.c @@ -40,11 +40,14 @@ struct config_t char cat; char merge; char isframe; + char local_with_networking; + char local_with_filesystem; int loglevel; int sizex; char hassizex; int sizey; char hassizey; + int flashversion; int framerate; int movex; int movey; @@ -171,6 +174,16 @@ int args_callback_option(char*name,char*val) { config.scaley = atoi(val)/100.0; return 1; } + else if (!strcmp(name, "N")) + { + config.local_with_networking = 1; + return 0; + } + else if (!strcmp(name, "L")) + { + config.local_with_filesystem = 1; + return 0; + } else if (!strcmp(name, "t") || !strcmp(name, "T")) { if(master_filename) { @@ -199,6 +212,7 @@ static struct options_t options[] = { {"o", "output"}, {"t", "stack"}, {"T", "stack1"}, +{"F", "version"}, {"m", "merge"}, {"a", "cat"}, {"l", "overlay"}, @@ -212,6 +226,8 @@ static struct options_t options[] = { {"r", "rate"}, {"X", "width"}, {"Y", "height"}, +{"N", "local-with-network"}, +{"L", "local-with-filesystem"}, {"z", "zlib"}, {0,0} }; @@ -289,6 +305,8 @@ void args_callback_usage(char *name) printf("-r , --rate Set movie framerate to (frames/sec)\n"); printf("-X , --width Force movie bbox width to (default: use master width (not with -t))\n"); printf("-Y , --height Force movie bbox height to (default: use master height (not with -t))\n"); + printf("-N , --local-with-networking Make output file \"local-with-networking\"\n"); + printf("-L , --local-with-filesystem Make output file \"local-with-filesystem\"\n"); printf("-z , --zlib Enable Flash 6 (MX) Zlib Compression\n"); printf("\n"); } @@ -859,6 +877,8 @@ void adjustheader(SWF*swf) swf->movieSize.ymax = swf->movieSize.ymin + config.sizey; } + if(config.flashversion) + swf->fileVersion = config.flashversion; } void catcombine(SWF*master, char*slave_name, SWF*slave, SWF*newswf) @@ -871,6 +891,8 @@ void catcombine(SWF*master, char*slave_name, SWF*slave, SWF*newswf) msg(" Can't combine --cat and --frame"); exit(1); } + if(config.flashversion) + master->fileVersion = config.flashversion; tag = master->firstTag; while(tag) @@ -981,6 +1003,17 @@ void normalcombine(SWF*master, char*slave_name, SWF*slave, SWF*newswf) msg(" Slave file attached to object %d.", defineid); } } + } else if(tag->id == ST_SYMBOLCLASS) { + /* a symbolclass tag is like a define tag: it defines id 0000 */ + int num = swf_GetU16(tag); + int t; + for(t=0;tid == ST_PLACEOBJECT2) { char * name = swf_GetName(tag); int id = swf_GetPlaceID(tag); @@ -1035,6 +1068,7 @@ void normalcombine(SWF*master, char*slave_name, SWF*slave, SWF*newswf) } swf_Relocate (slave, masterbitmap); + if(config.merge) swf_RelocateDepth (slave, depthbitmap); jpeg_assert(slave, master); @@ -1301,6 +1335,11 @@ int main(int argn, char *argv[]) if(!newswf.fileVersion) newswf.fileVersion = 4; + if(config.local_with_filesystem) + newswf.fileAttributes &= ~FILEATTRIBUTE_USENETWORK; + if(config.local_with_networking) + newswf.fileAttributes |= FILEATTRIBUTE_USENETWORK; + fi = open(outputname, O_BINARY|O_RDWR|O_TRUNC|O_CREAT, 0777); if(config.zlib) {