throw an error if more than one filename is specified
[swftools.git] / src / swfcombine.c
index 1204cc1..25698ee 100644 (file)
@@ -314,6 +314,7 @@ static void makestackmaster(SWF*swf)
     SRECT box;
     int fileversion = config.zlib?6:3;
     int frameRate = 256;
+    U32 fileAttributes = 0;
     RGBA rgb;
     rgb.r=rgb.b=rgb.g=0;
     memset(&box, 0, sizeof(box));
@@ -331,7 +332,9 @@ static void makestackmaster(SWF*swf)
        }
        close(fi);
        swf_RemoveJPEGTables(&head);
+        fileAttributes |= head.fileAttributes;
        removeCommonTags(&head);
+
        msg("<verbose> File %s has bounding box %d:%d:%d:%d\n",
                slave_filename[t], 
                head.movieSize.xmin, head.movieSize.ymin,
@@ -371,6 +374,7 @@ static void makestackmaster(SWF*swf)
     swf->fileVersion = fileversion;
     swf->movieSize = box;
     swf->frameRate = frameRate;
+    swf->fileAttributes = fileAttributes;
 
     swf->firstTag = swf_InsertTag(0, ST_SETBACKGROUNDCOLOR);
     tag = swf->firstTag;
@@ -1018,8 +1022,12 @@ void normalcombine(SWF*master, char*slave_name, SWF*slave, SWF*newswf)
 
     if (spriteid<0 && !config.isframe) {
        if(slavename) {
-           if(strcmp(slavename,"!!dummy!!"))
+           if(strcmp(slavename,"!!dummy!!")) {
                msg("<warning> Didn't find anything named %s in file. No substitutions will occur.", slavename);
+               if(!strcmp(slavename, "swf")) {
+                   msg("<warning> (If you were trying to combine rfxview with a document, try replacing 'swf' with 'viewport'.");
+               }
+           }
        }
        else
            msg("<warning> Didn't find id %d in file. No substitutions will occur.", slaveid);
@@ -1058,7 +1066,7 @@ void normalcombine(SWF*master, char*slave_name, SWF*slave, SWF*newswf)
                FLAGS_WRITEDEFINES|FLAGS_WRITENONDEFINES|   FLAGS_WRITESPRITE   );
     }
 
-    swf_DeleteTag(newswf, tag);
+    swf_DeleteTag(newswf, newswf->firstTag);
 }
 
 void combine(SWF*master, char*slave_name, SWF*slave, SWF*newswf)
@@ -1069,6 +1077,8 @@ void combine(SWF*master, char*slave_name, SWF*slave, SWF*newswf)
 
     if(!master->fileVersion && slave)
        master->fileVersion = slave->fileVersion;
+        
+    master->fileAttributes |= slave->fileAttributes;
 
     swf_FoldAll(master);
     swf_FoldAll(slave);