use flashtype if flashversion>=8
[swftools.git] / src / swfc.c
index 745ec2e..34e731e 100644 (file)
@@ -681,7 +681,7 @@ static void s_endSWF()
        warning("Empty bounding box for movie");
     }
     
-    if(do_cgi)
+    if(do_cgi || !strcmp(filename, "-"))
        fi = fileno(stdout);
     else
        fi = open(filename, O_WRONLY|O_CREAT|O_TRUNC|O_BINARY, 0644);
@@ -979,6 +979,15 @@ void s_text(char*name, char*fontname, char*text, int size, RGBA color)
        return;
     }
     r = swf_SetDefineText(tag, font, &color, text, size);
+
+    if(stack[0].swf->fileVersion >= 8) {
+       tag = swf_InsertTag(tag, ST_CSMTEXTSETTINGS);
+       swf_SetU16(tag, id);
+       swf_SetU8(tag, /*grid*/(1<<3)|/*flashtype*/0x40);
+       swf_SetU32(tag, 0);//thickness
+       swf_SetU32(tag, 0);//sharpness
+       swf_SetU8(tag, 0);//reserved
+    }
    
     s_addcharacter(name, id, tag, r);
     incrementid();
@@ -1152,6 +1161,11 @@ void s_texture(char*name, char*object, int x, int y, float scalex, float scaley,
        fs->m.tx += p2.x;
        fs->m.ty += p2.y;
     }
+    if(bitmap) {
+       fs->m.sx *= 20;
+       fs->m.sy *= 20;
+    }
+
 
     if(dictionary_lookup(&textures, name))
        syntaxerror("texture %s defined twice", name);
@@ -1730,6 +1744,10 @@ void s_put(char*instance, char*character, parameters_t p)
     m = s_instancepos(i->character->size, &p);
    
     if(p.blendmode || p.filter) {
+       if(stack[0].swf->fileVersion < 8) {
+           if(p.blendmode) warning("blendmodes only supported for flash version>=8");
+           else            warning("filters only supported for flash version>=8");
+       }
        tag = swf_InsertTag(tag, ST_PLACEOBJECT3);
     } else {
        tag = swf_InsertTag(tag, ST_PLACEOBJECT2);