X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=src%2Fas3compile.c;h=98ac30f6ddf325fd7a2e1704c4aeb09744fe16fe;hb=2773d91e9b8459c9f51070d78419cba75ba32bef;hp=5d20d314d7a82a0b247c080ce49dcb0bdbce3026;hpb=5a9b4530f6a84ce3666a94605270bddaf43c9ff2;p=swftools.git diff --git a/src/as3compile.c b/src/as3compile.c index 5d20d31..98ac30f 100644 --- a/src/as3compile.c +++ b/src/as3compile.c @@ -53,6 +53,7 @@ static struct options_t options[] = { {"X", "width"}, {"Y", "height"}, {"r", "rate"}, +{"M", "mainclass"}, {"l", "library"}, {"I", "include"}, {"N", "local-with-network"}, @@ -118,6 +119,10 @@ int args_callback_option(char*name,char*val) return 0; } else if(!strcmp(name, "D")) { + if(!strstr(val, "::")) { + fprintf(stderr, "Error: compile definition must contain \"::\"\n"); + exit(1); + } as3_set_define(val); return 1; } @@ -156,6 +161,7 @@ void args_callback_usage(char *name) printf("-X , --width Set target SWF width\n"); printf("-Y , --height Set target SWF width\n"); printf("-r , --rate Set target SWF framerate\n"); + printf("-M , --mainclass Set the name of the main class (extending flash.display.MovieClip or .Sprite)\n"); printf("-l , --library Include library file . can be an .abc or .swf file.\n"); printf("-I , --include Add additional include dir .\n"); printf("-N , --local-with-network Make output file \"local with networking\"\n"); @@ -222,7 +228,12 @@ int main (int argc,char ** argv) //as3_warning("output name not given, writing to %s", outputname); } - as3_parse_file(filename); + if(!strcmp(filename, ".")) { + as3_parse_directory("."); + } else { + as3_parse_file(filename); + } + void*code = as3_getcode(); SWF swf; @@ -242,7 +253,7 @@ int main (int argc,char ** argv) tag = swf_InsertTag(tag, ST_SYMBOLCLASS); swf_SetU16(tag, 1); swf_SetU16(tag, 0); - swf_SetString(tag, as3_getglobalclass()); + swf_SetString(tag, mainclass); } else { as3_warning("no global public MovieClip subclass"); }