X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;ds=sidebyside;f=src%2Freloc.c;h=7cdf8e17f620f840d23f1bf39fe3de30f84b077a;hb=9fae7a57db14339ddf5cd1fdb486d452eae24d0a;hp=1582521c4cb08ba77da0647a5ac83b7d54e409b4;hpb=bc686910f5bbc06ee9f2c891172fd2ffb48ac445;p=swftools.git diff --git a/src/reloc.c b/src/reloc.c index 1582521..7cdf8e1 100644 --- a/src/reloc.c +++ b/src/reloc.c @@ -46,6 +46,37 @@ void map_ids_mem(u8*mem, int length) switch(newtag->id) { + case TAGID_DEFINEBUTTONCXFORM: { + int t; + maponeid(&newtag->data[0]); //button id + reader_init (newtag->data, newtag->length); + for(t=0;t<4;t++) { + int flags; + maponeid(&newtag->data[0]); + readu16(); //sound id + flags = readu8(); + if(flags&1) + readu32(); // in point + if(flags&2) + readu32(); // out points + if(flags&4) + readu16(); // loop count + if(flags&8) + { + int npoints = readu8(); + int s; + for(s=0;sdata[0]); //button id + break; case TAGID_PLACEOBJECT: maponeid(&newtag->data[0]); break; @@ -104,7 +135,8 @@ void map_ids_mem(u8*mem, int length) readu16(); //char readu16(); //layer readMATRIX(); - readCXFORM(); + if(num>1) + readCXFORM(); } // ... break; @@ -189,7 +221,7 @@ void map_ids_mem(u8*mem, int length) // printf("%d shape bounds: %d %d %d %d\n",newtag->id,r.x1,r.y1,r.x2,r.y2); resetbits(); count = readu8(); - if(count == 0xff && num>1) + if(count == 0xff && num>1) // defineshape2,3 only count = readu16(); // printf("%d fillstyles\n", count); for(t=0;t relocator: processing tag %02x", tag->id); map_ids(&file.tags[pos]); if(is_defining_tag(tag->id)) @@ -277,11 +311,11 @@ void swf_relocate (u8*data, int length, int*_bitmap) bitmap[newid] = 1; slaveids[id] = newid; - logf(" sprite id %d mapped to %d",id, newid); + logf(" relocator: id %d mapped to %d",id, newid); setidintag(tag, newid); - logf(" [sprite defs] write tag %02x (%d bytes in body)", + logf(" [reloc] write tag %02x (%d bytes in body)", tag->id, tag->length); } pos++;