X-Git-Url: http://git.asbjorn.biz/?p=swftools.git;a=blobdiff_plain;f=lib%2Fas3%2Fmain.c;h=1ce83a67e446b4d473a59a7defcb5aef9eca100d;hp=0727c1214a379200ef1d835e2cfe3b7ede9976e6;hb=9ed9a87914fc9a590967d46de404e0f6290b7bb2;hpb=0fd17f47ee30d90181e51f30fc17a6c31646137e diff --git a/lib/as3/main.c b/lib/as3/main.c index 0727c12..1ce83a6 100644 --- a/lib/as3/main.c +++ b/lib/as3/main.c @@ -27,6 +27,7 @@ #include "../rfxswf.h" #include "../os.h" #include "files.h" +#include "common.h" #include "tokenizer.h" #include "parser.tab.h" #include "parser.h" @@ -51,6 +52,7 @@ void test_lexer(char*filename) } } +extern int a3_debug; int main(int argn, char*argv[]) { char*filename = 0; @@ -61,23 +63,40 @@ int main(int argn, char*argv[]) exit(1); } filename=argv[argn-1]; + +#ifdef BISONDEBUG + a3_debug = 1; //if bison was called with -t +#endif as3_add_include_dir(getcwd(buf, 512)); registry_init(); int t=0; + char*mainclass = 0; for(t=1;tnext) tag = tag->next; + + tag = swf_InsertTag(tag, ST_DOABC); + if(!swf.firstTag && tag) swf.firstTag = tag; swf_WriteABC(tag, code); - if(as3_getglobalclass()) { + if(!mainclass) + mainclass = as3_getglobalclass(); + + if(mainclass) { tag = swf_InsertTag(tag, ST_SYMBOLCLASS); swf_SetU16(tag, 1); swf_SetU16(tag, 0); - swf_SetString(tag, as3_getglobalclass()); + swf_SetString(tag, mainclass); } else { printf("Warning: no global public MovieClip subclass\n"); }