X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=src%2Fflash.c;h=289dcbb717c95d3de7318f7aedf80adf3a8cdaa3;hb=e1752ee77f9bc5529aa551fe89ded25d879d0119;hp=71c14104e0e1377d361d10747d764cb2b018a3db;hpb=1bc7637a7d6faa9d6ec7df0ad0d48625564ab542;p=swftools.git diff --git a/src/flash.c b/src/flash.c index 71c1410..289dcbb 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(); @@ -494,7 +494,28 @@ int spritetagids[] = int getidfromtag(struct swf_tag* tag) { - // todo: check for more than one id + int num = 1; + switch(tag->id) { + case TAGID_PLACEOBJECT2: + num++; + case TAGID_PLACEOBJECT: + reader_init (tag->data, tag->length); + if(num>=2) { + char b = readu8(); + if(!(b&2)) + return -1; + } + readu16(); + return readu16(); + break; + case TAGID_REMOVEOBJECT: + return *(u16*)tag->data; + break; + case TAGID_REMOVEOBJECT2: + return -1; + break; + } + return *(u16*)tag->data; }