static char * filename = 0;
static char * outputname = "output.swf";
static int verbose = 2;
+static int override_outputname = 0;
static struct options_t options[] =
{
}
else if(!strcmp(name, "o")) {
outputname = val;
+ override_outputname = 1;
return 1;
}
else if(!strcmp(name, "v")) {
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;
}
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)) {
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"))
SPOINT getPoint(SRECT r, char*name)
{
- int l;
+ int l=0;
if(!strcmp(name, "center")) {
SPOINT p;
p.x = (r.xmin + r.xmax)/2;
return p;
}
- l = (int)dictionary_lookup(&points, name);
+ if(points_initialized)
+ l = (int)dictionary_lookup(&points, name);
if(l==0) {
- syntaxerror("Couldn't find point \"%s\".", name);
+ syntaxerror("Invalid point: \"%s\".", name);
}
l--;
return *(SPOINT*)&mpoints.buffer[l];
{
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);
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=<plus>1"},
// "import" type stuff
{"shape", c_shape, "name filename"},