// * readers should be object-oriented
static char* slavename;
+static int slaveid;
static char* tag_placeobject2_name (struct swf_tag* tag)
{
* Anyway we can't throw it out, so we just pass it
* through.
*/
+ writer_write(w, tag->fulldata, tag->fulllength);
break;
}
+ case TAGID_JPEGTABLES:
+ /* according to the flash specs, there may only
+ be one JPEGTABLES tag per swf. This is maybe
+ a big FIXME */
+ writer_write(w, tag->fulldata, tag->fulllength);
+ break;
case TAGID_EXPORTASSETS:
logf("<debug> deliberately ignoring EXPORTASSETS tag");
break;
startpos = (u8*)writer_getpos(w);
- if (spriteid<0)
- {
- logf("<warning> Didn't find anything named %s in file. No substitutions will occur.", slavename);
- spriteid = get_free_id();
- }
-
logf ("<notice> sprite id is %d", spriteid);
tmp = spriteid;
writer_write(w, &tmp, 2);
char master_flash = 0;
char slave_flash = 0;
slavename = _slavename;
+ if(slavename[0] == '#')
+ {
+ slaveid = atoi(&slavename[1]);
+ slavename = 0;
+ }
logf("<debug> move x (%d)", config.movex);
logf("<debug> move y (%d)", config.movey);
logf("<notice> the master file is flash (swf) format\n");
master_flash = 1;
}
+ else
+ logf("<notice> the master file is not flash (swf) format!\n");
+
if(slavedata[2] == 'S' &&
slavedata[1] == 'W' &&
slavedata[0] == 'F')
logf("<notice> the slave file is flash (swf) format\n");
slave_flash = 1;
}
+ else
+ logf("<notice> the slave file is not flash (swf) format!\n");
if(master_flash && slave_flash)
{
else
logf("<verbose> tagid %02x places object %d (no name)", tag, id);
- if (name && !strcmp(name,slavename)) {
+ if ((name && slavename && !strcmp(name,slavename)) ||
+ (!slavename && id==slaveid)) {
if(id>=0) {
spriteid = id;
logf("<notice> Slave file attached to object %d.", id);
}
while(master.tags[pos++].id != 0);
+ if (spriteid<0)
+ {
+ if(slavename) {
+ if(strcmp(slavename,"!!dummy!!"))
+ logf("<warning> Didn't find anything named %s in file. No substitutions will occur.", slavename);
+ }
+ else
+ logf("<warning> Didn't find id %d in file. No substitutions will occur.", slaveid);
+ spriteid = get_free_id();
+ }
+
swf_relocate (slavedata, slavelength, masterids);
read_swf(&slave, slavedata, slavelength);