X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=src%2Fswfc.c;h=064261e3e3a6e8564295f54d3a16fc1c0ad39479;hb=d2cdbc4265f341f190a4cde104e6256004304212;hp=9fd752ac6f1b12345773056cc00680d3b363aa3a;hpb=f6d4dc96fb50a920313da1dbdd92296aa406f7ad;p=swftools.git diff --git a/src/swfc.c b/src/swfc.c index 9fd752a..064261e 100644 --- a/src/swfc.c +++ b/src/swfc.c @@ -28,6 +28,7 @@ static char * filename = 0; static char * outputname = "output.swf"; static int verbose = 2; +static int override_outputname = 0; static struct options_t options[] = { @@ -45,6 +46,7 @@ int args_callback_option(char*name,char*val) } else if(!strcmp(name, "o")) { outputname = val; + override_outputname = 1; return 1; } else if(!strcmp(name, "v")) { @@ -854,7 +856,7 @@ void s_change(char*instance, parameters_t p2) p1 = i->parameters; allframes = currentframe - i->lastFrame - 1; - if(!allframes) { + if(allframes < 0) { warning(".change ignored. can only .put/.change an object once per frame."); return; } @@ -1041,7 +1043,7 @@ int parseColor2(char*str, RGBA*color) int r,g,b,a; int t; char*names[8] = {"black", "blue", "green", "cyan", - "red", "violet", "yellow", "white"}; + "red", "magenta", "yellow", "white"}; a=255; r=g=b=0; if(str[0]=='#' && (l==7 || l==9)) { @@ -1168,7 +1170,7 @@ static int c_swf(map_t*args) int version = parseInt(lu(args, "version")); int fps = (int)(parseFloat(lu(args, "fps"))*256); int compress = 0; - if(!strcmp(name, "!default!")) + if(!strcmp(name, "!default!") || override_outputname) name = outputname; if(!strcmp(compressstr, "default")) @@ -1477,9 +1479,11 @@ static int c_frame(map_t*args) { char*framestr = lu(args, "n"); int frame; - if(framestr[0]=='+') { + if(isRelative(framestr)) { frame = s_getframe(); - frame += parseInt(framestr+1); + if(getSign(framestr)<0) + syntaxerror("relative frame expressions must be positive"); + frame += parseInt(getOffset(framestr)); } else { frame = parseInt(framestr); @@ -1599,7 +1603,7 @@ static struct { char*arguments; } arguments[] = {{"swf", c_swf, "bbox=autocrop version=5 fps=50 name=!default! @compress=default"}, - {"frame", c_frame, "n=+1"}, + {"frame", c_frame, "n=1"}, // "import" type stuff {"shape", c_shape, "name filename"},