X-Git-Url: http://git.asbjorn.biz/?p=swftools.git;a=blobdiff_plain;f=src%2Fswfcombine.c;h=2b189b922474ced538d5631f1792c567f1b3915a;hp=f190e9a593456b89c45e834a63cc8e3aba5eb62e;hb=7ddcc6604ef3a6004c8fefb59d2ecdedc440b2bc;hpb=47df0688e74d14cb1aaff3fca3ac51356d632dd2 diff --git a/src/swfcombine.c b/src/swfcombine.c index f190e9a..2b189b9 100644 --- a/src/swfcombine.c +++ b/src/swfcombine.c @@ -1,5 +1,5 @@ /* swfcombine.c - main routine for swfcombine(1), which is a tool for merging .swf-files. + main routine for swfcombine(1), a tool for merging .swf-files. Part of the swftools package. @@ -10,6 +10,7 @@ #include #include #include +#include "../lib/rfxswf.h" #include "../lib/args.h" #include "combine.h" #include "settings.h" @@ -257,6 +258,7 @@ void fi_dump(FILE*fi, void*_mem, int length) } } +/* todo: use rfxswf */ void makestackmaster(u8**masterdata, int*masterlength) { u8 head[] = {'F','W','S'}; @@ -274,6 +276,7 @@ void makestackmaster(u8**masterdata, int*masterlength) u8 data[256]; int ret; struct flash_header head; + struct reader_t r; strlength += strlen(slave_name[t]) + 9; if(!fi) { logf(" Couldn't open %s.", slave_filename[t]); @@ -284,8 +287,8 @@ void makestackmaster(u8**masterdata, int*masterlength) logf(" File %s is to small (%d bytes)", slave_filename[t], ret); exit(1); } - swf_init(data,256); - head = swf_read_header(); + swf_init(&r, data,256); + head = swf_read_header(&r); logf(" File %s has bounding box %d:%d:%d:%d\n", slave_filename[t], head.boundingBox.x1, head.boundingBox.y1, @@ -311,7 +314,6 @@ void makestackmaster(u8**masterdata, int*masterlength) } /* we don't have a master, so we create one ourselves. */ - /* (please notice the philosophical content) */ *masterlength = (numslaves + 1) * 32 + strlength; *masterdata = (u8*)malloc(*masterlength); pos = *masterdata; @@ -319,12 +321,12 @@ void makestackmaster(u8**masterdata, int*masterlength) pos += sizeof(head); *pos++ = fileversion; fixpos = (u32*)pos; - *(u32*)pos = 0x12345678; // to be overwritten + *(u32*)pos = SWAP32(0x12345678); // to be overwritten pos += 4; writeRECT(&pos, &box); - *(u16*)pos = 0x2000; // framerate + *(u16*)pos = SWAP16(0x2000); // framerate pos += 2; - *(u16*)pos = numslaves; + *(u16*)pos = SWAP16(numslaves); pos += 2; for(t=0;t