- flags = swf_GetU8(tag);
- memset(obj,0,sizeof(SWFPLACEOBJECT));
-
- swf_GetMatrix(0,&obj->matrix);
- swf_GetCXForm(0,&obj->cxform,1);
-
- obj->depth = swf_GetU16(tag);
- //flags&1: move
- if(flags&2) obj->id = swf_GetU16(tag);
- if(flags&4) swf_GetMatrix(tag, &obj->matrix);
- if(flags&8) swf_GetCXForm(tag, &obj->cxform,1);
- if(flags&16) obj->ratio = swf_GetU16(tag);
- /* if you modify the order of these operations, also
- modify it in ../src/swfcombine.c */
- if(flags&64)
- obj->clipdepth = swf_GetU16(tag); //clip
- if(flags&32) {
- int l,t;
- U8*data;
- swf_ResetReadBits(tag);
- l = strlen(&tag->data[tag->pos]);
- t = 0;
- data = malloc(l+1);
- obj->name = data;
- while((data[t++] = swf_GetU8(tag)));
- }
+ if(tag->id == ST_PLACEOBJECT) {
+ obj->id = swf_GetU16(tag);
+ obj->depth = swf_GetU16(tag);
+ swf_GetMatrix(tag, &obj->matrix);
+ swf_GetCXForm(tag, &obj->cxform, 0);
+ //obj->internal = PF_CHAR|PF_MATRIX|PF_CXFORM;
+ } else if(tag->id == ST_PLACEOBJECT2 || tag->id == ST_PLACEOBJECT3) {
+ U8 flags,flags2=0;
+ flags = swf_GetU8(tag);
+ if(tag->id == ST_PLACEOBJECT3)
+ flags2 = swf_GetU8(tag);
+ memset(obj,0,sizeof(SWFPLACEOBJECT));
+
+ swf_GetMatrix(0,&obj->matrix);
+ swf_GetCXForm(0,&obj->cxform,1);
+
+ obj->depth = swf_GetU16(tag);
+ //obj->internal = flags;
+ if(flags&PF_MOVE) obj->move = 1;
+ if(flags&PF_CHAR) obj->id = swf_GetU16(tag);
+ if(flags&PF_MATRIX) swf_GetMatrix(tag, &obj->matrix);
+ if(flags&PF_CXFORM) swf_GetCXForm(tag, &obj->cxform,1);
+ if(flags&PF_RATIO) obj->ratio = swf_GetU16(tag);
+ /* if you modify the order of these operations, also
+ modify it in ../src/swfcombine.c */
+ if(flags&PF_CLIPDEPTH)
+ obj->clipdepth = swf_GetU16(tag); //clip
+ if(flags&PF_NAME) {
+ int l,t;
+ U8*data;
+ swf_ResetReadBits(tag);
+ l = strlen((const char *)&tag->data[tag->pos]);
+ t = 0;
+ data = (U8*)rfx_alloc(l+1);
+ obj->name = data;
+ while((data[t++] = swf_GetU8(tag)));
+ }
+ if(flags2&PF2_BLENDMODE) {
+ obj->blendmode = swf_GetU8(tag);
+ }