From e39bfdb2351f876f09c34dbf96b673faf54e0094 Mon Sep 17 00:00:00 2001 From: kramm Date: Thu, 29 Nov 2001 18:23:55 +0000 Subject: [PATCH 1/1] * fixed gradient reading * readCXFORM now takes an "alpha" parameter. --- src/flash.c | 10 +++++----- src/flash.h | 3 +-- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/flash.c b/src/flash.c index 71c1410..f24b834 100644 --- a/src/flash.c +++ b/src/flash.c @@ -84,7 +84,7 @@ struct GRADIENT readGRADIENT(int shape) for(t=0;t=3) + if(shape<3) gradient.rgb[t] = readRGB(); else gradient.rgba[t] = readRGBA(); @@ -123,14 +123,14 @@ void writeRECT(u8**pos, struct RECT*r) *pos = writer_getpos(&w); } -struct CXFORM readCXFORM() +struct CXFORM readCXFORM(char alpha) { struct CXFORM c; int bits; c.hasadd=readbit(); c.hasmult=readbit(); bits=getbits(4); - c.alpha = 0; + c.alpha = alpha; if (c.hasmult) { @@ -316,7 +316,7 @@ void placeobject_init (struct PlaceObject*obj, struct swf_tag*tag) obj -> matrix = readMATRIX(); obj -> hascxform = (getinputpos() < &tag->data[tag->length]); if(obj -> hascxform) - obj -> cxform = readCXFORM(); + obj -> cxform = readCXFORM(0); } void placeobject_write (struct PlaceObject*obj, struct writer_t*w) @@ -369,7 +369,7 @@ void placeobject2_init (struct PlaceObject2*obj,struct swf_tag*tag) obj->matrix = readMATRIX(); } if(obj->hascolortransform) { - obj->cxform = readCXFORM(); + obj->cxform = readCXFORM(0); } if(obj->hasratio) { obj->ratio=readu16(); diff --git a/src/flash.h b/src/flash.h index 2d48cb7..f93d78b 100644 --- a/src/flash.h +++ b/src/flash.h @@ -115,7 +115,6 @@ struct RECT readRECT(); struct RGB readRGB(); struct MATRIX readMATRIX(); unsigned char* readSTRING(); -struct CXFORM readCXFORM(); struct CLIPACTIONS readCLIPACTIONS(); void writeRECT(u8**pos, struct RECT*r); @@ -145,7 +144,7 @@ struct RGB readRGB(); struct RGBA readRGBA(); struct GRADIENT readGRADIENT(int shape); struct RECT readRECT(); -struct CXFORM readCXFORM(); +struct CXFORM readCXFORM(char alpha); struct MATRIX readMATRIX(); unsigned char* readSTRING(); int swf_read_tag(struct swf_tag* swftag); -- 1.7.10.4