From: kramm Date: Mon, 1 May 2006 08:29:55 +0000 (+0000) Subject: the flash player expects us to set *all* components to 0 if a color X-Git-Tag: release-0-8-0~202 X-Git-Url: http://git.asbjorn.biz/?p=swftools.git;a=commitdiff_plain;h=25e39f1bcfd11604dcb56791301248878b720d70 the flash player expects us to set *all* components to 0 if a color is fully transparent --- diff --git a/src/png2swf.c b/src/png2swf.c index 9980e5a..0d7e1a6 100644 --- a/src/png2swf.c +++ b/src/png2swf.c @@ -76,7 +76,7 @@ TAG *MovieStart(SWF * swf, float framerate, int dx, int dy) t = swf->firstTag = swf_InsertTag(NULL, ST_SETBACKGROUNDCOLOR); rgb.r = rgb.g = rgb.b = rgb.a = 0x00; - rgb.g = 0xff; //<--- handy for testing alpha conversion + //rgb.g = 0xff; //<--- handy for testing alpha conversion swf_SetRGB(t, &rgb); return t; @@ -667,8 +667,12 @@ TAG *MovieAddFrame(SWF * swf, TAG * t, char *sname, int id) if(hasalphacolor) { if(rgba[i].r == alphacolor[0] && rgba[i].g == alphacolor[1] && - rgba[i].b == alphacolor[2]) + rgba[i].b == alphacolor[2]) { + rgba[i].r = 0; + rgba[i].g = 0; + rgba[i].b = 0; rgba[i].a = 0; + } } } } else { @@ -681,8 +685,12 @@ TAG *MovieAddFrame(SWF * swf, TAG * t, char *sname, int id) rgba[i].b = i*mult; rgba[i].a = 255; if(hasalphacolor) { - if(rgba[i].r == alphacolor[0]) + if(rgba[i].r == alphacolor[0]) { + rgba[i].r = 0; + rgba[i].g = 0; + rgba[i].b = 0; rgba[i].a = 0; + } } } }