X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=src%2Fswfcombine.c;h=29996f902b22f406279360970d903a51fa14fffb;hb=d68c5b5c60449094852f867d4af3dfbc35c8a74a;hp=f190e9a593456b89c45e834a63cc8e3aba5eb62e;hpb=91f07304c9e9687652450f53938d76e1f60ddf76;p=swftools.git diff --git a/src/swfcombine.c b/src/swfcombine.c index f190e9a..29996f9 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,11 +10,14 @@ #include #include #include +#include "../lib/rfxswf.h" #include "../lib/args.h" +#include "../lib/log.h" #include "combine.h" #include "settings.h" #include "types.h" #include "flash.h" +#include "reloc.h" #include "../config.h" char * master_filename = 0; @@ -257,6 +260,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 +278,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 +289,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 +316,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 +323,12 @@ void makestackmaster(u8**masterdata, int*masterlength) pos += sizeof(head); *pos++ = fileversion; fixpos = (u32*)pos; - *(u32*)pos = 0x12345678; // to be overwritten + PUT32(pos, 0x12345678); // to be overwritten pos += 4; writeRECT(&pos, &box); - *(u16*)pos = 0x2000; // framerate + PUT16(pos, 0x2000) // framerate pos += 2; - *(u16*)pos = numslaves; + PUT16(pos, numslaves) // framerate pos += 2; for(t=0;t