From 2e1a8d2cbd644b55251e41bb8b8d11e334a0782a Mon Sep 17 00:00:00 2001 From: kramm Date: Sun, 26 Oct 2003 15:14:11 +0000 Subject: [PATCH] added background color support. --- src/swfc.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/swfc.c b/src/swfc.c index cfda5e5..f57a98e 100644 --- a/src/swfc.c +++ b/src/swfc.c @@ -337,10 +337,9 @@ static MATRIX s_instancepos(instance_t*i, parameters_t*p) return m; } -void s_swf(char*name, SRECT r, int version, int fps, int compress) +void s_swf(char*name, SRECT r, int version, int fps, int compress, RGBA background) { SWF*swf = (SWF*)malloc(sizeof(SWF)); - RGBA rgb; if(stackpos) syntaxerror(".swf blocks can't be nested"); @@ -351,8 +350,7 @@ void s_swf(char*name, SRECT r, int version, int fps, int compress) swf->frameRate = fps; swf->firstTag = tag = swf_InsertTag(0, ST_SETBACKGROUNDCOLOR); swf->compressed = compress; - rgb.r = 0x00;rgb.g = 0x00;rgb.b = 0x00; - swf_SetRGB(tag,&rgb); + swf_SetRGB(tag,&background); if(stackpos==sizeof(stack)/sizeof(stack[0])) syntaxerror("too many levels of recursion"); @@ -1266,6 +1264,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; + RGBA color = parseColor(lu(args, "background")); if(!strcmp(name, "!default!") || override_outputname) name = outputname; @@ -1277,7 +1276,7 @@ static int c_swf(map_t*args) compress = 0; else syntaxerror("value \"%s\" not supported for the compress argument", compressstr); - s_swf(name, bbox, version, fps, compress); + s_swf(name, bbox, version, fps, compress, color); return 0; } int isRelative(char*str) @@ -1732,7 +1731,7 @@ static struct { command_func_t* func; char*arguments; } arguments[] = -{{"swf", c_swf, "bbox=autocrop version=5 fps=50 name=!default! @compress=default"}, +{{"swf", c_swf, "bbox=autocrop background=black version=5 fps=50 name=!default! @compress=default"}, {"frame", c_frame, "n=1"}, // "import" type stuff -- 1.7.10.4