git.asbjorn.biz
/
swftools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fixed format warnings
[swftools.git]
/
lib
/
as3
/
main.c
diff --git
a/lib/as3/main.c
b/lib/as3/main.c
index
0727c12
..
a4d0e48
100644
(file)
--- a/
lib/as3/main.c
+++ b/
lib/as3/main.c
@@
-27,6
+27,7
@@
#include "../rfxswf.h"
#include "../os.h"
#include "files.h"
#include "../rfxswf.h"
#include "../os.h"
#include "files.h"
+#include "common.h"
#include "tokenizer.h"
#include "parser.tab.h"
#include "parser.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;
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];
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;
as3_add_include_dir(getcwd(buf, 512));
registry_init();
int t=0;
+ char*mainclass = 0;
for(t=1;t<argn-1;t++) {
if(!strcmp(argv[t], "-lex")) {
test_lexer(filename);
return 0;
}
for(t=1;t<argn-1;t++) {
if(!strcmp(argv[t], "-lex")) {
test_lexer(filename);
return 0;
}
+ if(!strcmp(argv[t], "-M")) {
+ mainclass = argv[++t];
+ }
if(!strcmp(argv[t], "-v")) {
as3_verbosity++;
}
if(!strcmp(argv[t], "-q")) {
as3_verbosity--;
}
if(!strcmp(argv[t], "-v")) {
as3_verbosity++;
}
if(!strcmp(argv[t], "-q")) {
as3_verbosity--;
}
+ if(!strcmp(argv[t], "-D")) {
+ char*c = argv[t+1];
+ if(!strstr(c, "::"))
+ printf("Error: compile definition must contain \"::\"\n");
+ as3_set_define(c);
+ }
+ if(!strcmp(argv[t], "-R")) {
+ as3_set_option("recurse","1");
+ }
if(!strcmp(argv[t], "-I")) {
as3_add_include_dir(argv[++t]);
}
if(!strcmp(argv[t], "-I")) {
as3_add_include_dir(argv[++t]);
}
@@
-107,14
+126,27
@@
int main(int argn, char*argv[])
swf.movieSize.xmin = swf.movieSize.ymin = 0;
swf.movieSize.xmax = 20*20;
swf.movieSize.ymax = 10*20;
swf.movieSize.xmin = swf.movieSize.ymin = 0;
swf.movieSize.xmax = 20*20;
swf.movieSize.ymax = 10*20;
- TAG*tag = swf.firstTag = swf_InsertTag(0, ST_DOABC);
+
+
+ TAG*tag = swf.firstTag = swf_InsertTag(0, ST_SETBACKGROUNDCOLOR);
+ swf_SetU8(tag, 0xff);
+ swf_SetU8(tag, 0xff);
+ swf_SetU8(tag, 0xff);
+
+ tag = as3_getassets(tag);
+
+ tag = swf_InsertTag(tag, ST_DOABC);
+ if(!swf.firstTag && tag) swf.firstTag = tag;
swf_WriteABC(tag, code);
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);
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");
}
} else {
printf("Warning: no global public MovieClip subclass\n");
}