From 25e39f1bcfd11604dcb56791301248878b720d70 Mon Sep 17 00:00:00 2001 From: kramm Date: Mon, 1 May 2006 08:29:55 +0000 Subject: [PATCH] the flash player expects us to set *all* components to 0 if a color is fully transparent --- src/png2swf.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) 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; + } } } } -- 1.7.10.4