return head;
}
+void swf_write_header(struct writer_t*w, struct flash_header*head)
+{
+ writer_writeu8(w, head->version);
+ writer_writeu32(w, head->length);
+
+ writer_writebits(w, 31, 5);
+ writer_writebits(w, head->boundingBox.x1, 31);
+ writer_writebits(w, head->boundingBox.x2, 31);
+ writer_writebits(w, head->boundingBox.y1, 31);
+ writer_writebits(w, head->boundingBox.y2, 31);
+ writer_resetbits(w);
+ writer_writeu16(w, head->rate);
+ writer_writeu16(w, head->count);
+}
+
struct RGB readRGB()
{
struct RGB rgb;
for(t=0;t<gradient.num;t++)
{
gradient.ratios[t] = readu8();
- if(shape>=3)
+ if(shape<3)
gradient.rgb[t] = readRGB();
else
gradient.rgba[t] = readRGBA();
*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)
{
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)
obj->matrix = readMATRIX();
}
if(obj->hascolortransform) {
- obj->cxform = readCXFORM();
+ obj->cxform = readCXFORM(0);
}
if(obj->hasratio) {
obj->ratio=readu16();